Character Vault
Any Concept / Any System
Compendium
Your System Come To Life
Roll20 for Android
Streamlined for your Tablet
Roll20 for iPad
Streamlined for your Tablet

Personal tools

Difference between revisions of "API:Chat"

From Roll20 Wiki

Jump to: navigation, search
(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
}