Difference between revisions of "Bot Playground/Events"

From SmartBots Developers Docs
Jump to: navigation, search
Line 10: Line 10:
 
</syntaxhighlight>
 
</syntaxhighlight>
  
== Commands reference ==
+
== Events reference ==
  
 
{{API_Table_start|Command|Description}}
 
{{API_Table_start|Command|Description}}
  
 
{{API_Group|Messaging}}
 
{{API_Group|Messaging}}
{{API_Entry|HTTP Bot Command|im}}
+
{{API_Entry|HTTP Bot Command|instant_message}}
  
 
{{API_Table_end}}
 
{{API_Table_end}}

Revision as of 14:07, 28 June 2016

Event is a callback function which is invoked when something happens with your bot or surrounding world.

Callbacks are set using a special on() function:

Bot.on("instant_message", function(data) {
  console.log("bot got a message:", data);
});

Events reference

Command Description

Messaging

instant_message Fires when bot receives a message from another avatar or in-world object.