instant_message

From SmartBots Developers Docs
Bot PlaygroundEvents
Revision as of 12:30, 1 July 2016 by Gg (Talk | contribs)

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

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

Bot.on("instant_message", 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 instant_message
speaker_type The sender of the message. Can be AVATAR or OBJECT
speaker_name The name of the sender
speaker_uuid The UUID of the sender
message The text of the message

Example

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

console.log("Bot is listening, IM something");