UPDATE: the data value for the message type shoud be
with an optional reply value which is an id for the message you want to reply to
As for the structure of an incoming chat/donation message, here's an example one
Code: Select all
{
"data":{
"auth": 50,
"author": 'janLuna',
"author_color": 'B00B69',
"author_id": 954,
"author_level": 50,
"donate_value": "",
"id": 19923,
"message": 'oh',
"reply": 0,
"time": 1674259423516
},
"type": 'chat'
}
type is always chat, even for donations
explanations for each field in the data object are:
auth - message author's permission level, 0 for normal users, 50 for mods, 100 for admins (matt)
author - the author's username
author_color - a hex string of the author color
author_id - seems to be an ID number to identify the author regardless of username
author_level - the same as auth
donate_value - amount of money donated, as a string, representing i believe dollars (matt why), empty string if it's not a donation
id - ID number representing the message, this is what is used for replies
message - the text of the message, with encoded HTML entities (so stuff like & and > for & and > respectively)
reply - ID of the message it's replying to, 0 if there is no reply
time - unix timestamp for when the message was sent
Incoming join/part messages are way simpler:
Code: Select all
{"data":{"name":"username"}, "type":"join"}
Code: Select all
{"data":{"name":"username"}, "type":"part"}