Difference between revisions of "Mod:Chat"
From Roll20 Wiki
(Created page with "===Chat Events and Functions=== '''chat:message''' Triggered whenever a new chat message is received. Note that if the message is of type "rollresult", you will need to call...") |
Revision as of 02:55, 23 April 2013
Chat Events and Functions
chat:message
Triggered whenever a new chat message is received. Note that if the message is of type "rollresult", you will need to call JSON.parse()
on the content of the message to get an object which contains information on the roll results. If the message is of type "api", then it hasn't been shown to anyone, and the player who sent the chat message is probably expecting an API script to do something as a result of the message.
Callback parameter:
{ who: "Riley D.", //The person who sent the message. Can be any string. type: "general", //One of "general", "rollresult", "emote", "whisper", "desc", "api" content: "The chat message", //The chat message, if it's a rollresult this will be a JSON string of data about the roll target: "-Abc123", //For whispers, the target of the whisper }