Search code examples
google-hangoutsgoogle-chat

Create to auto-reply to every message in a space


I need create google chat bot (or find already existing bot) which would respond with a reply every time when a user creates a new thread in the space?

As I found in the bot api, it looks like it only responds to the following 3 events (https://developers.google.com/chat/api/guides/message-formats/events#event_types):

  • bot entering the space
  • bot leaving the space
  • message directed to the bot

It doesn't look like a bot can be configured to respond only to every new thread that is started in the space.


Solution

  • Your list of possible event types is incomplete, the full list is at https://developers.google.com/chat/api/reference/rest/v1/EventType.

    That said, messages not directed to the bot do not generate an event, so the bot does not see them, as you correctly noted. There is a feature request opened for the functionality at https://issuetracker.google.com/issues/75245758.

    See Q: How to find messages in google spaces using chat.api for an experimental REST API that allows to search and filter all messages in a Google Chat Space.