group_im

From SmartBots Developers Docs
Bot PlaygroundEvents
Revision as of 13:01, 11 October 2022 by Gg (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Fires when bot receives a group chat message.

Bot.on("group_im", function(event) { ... });

Reference

This event comes with the following event object:

Variable Required Description
event object properties:
name The name of the event in this case group_im
group_name The same of the group
group_uuid The UUUID of the group
speaker_name The name of the sender
speaker_uuid The UUID of the sender
message The text of the message

Example

Bot.on("group_im", function(event) {
  console.log(event.group_name + ": " + event.speaker_name +" says: \n" + event.message);
});

console.log("Bot is listening to group chat.");