group_im

From SmartBots Developers Docs
Bot PlaygroundEvents
Revision as of 20:03, 3 July 2016 by Phil (Talk | contribs) (Created page with "{{DISPLAYTITLE:group_im}} <onlyinclude>Fires when bot receives a group chat message.</onlyinclude> <syntaxhighlight lang="javascript"> Bot.on("group_im", function(event) { .....")

(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.");