Every message is just a JSON object; Each pay load must have 2 fields @
which is command name; !id
which is a unique message id. In the examples described all placeholders are described with enclosing angle brackets <<...>>
. Following placeholders are fixed:
<<id>>
:{String}
is unique message ID; is always supposed to be incrementing id<<ts>>
:{Number}
unix timestamp<<nick>>
:{String}
Nick name of user<<group_id>>
:{String}
Name of group<<payload>>
:{String}
message payload from server
Everything server wants to send is wrapped under SERVER meta command. This might include status messages, meta payloads (channel user list, banned users etc.)
{"@":"SERVER","!id":<<id>>,"utc_timestamp":0,"msg":"<<payload>>"}
<<nick>>
:{String}
Nick name user is trying to set
{"@":"set-nick","to":"SERVER","msg":"<<nick>>"}
{"@":"nick-set","!id":<<id>>,"utc_timestamp":0,"oldNick":"<<nick>>","newNick":"<<nick>>"}
{"@":"join-group","to":"SERVER","msg":"<<group_id>>"}
{"@":"leave-group","to":"SERVER","msg":"<<group_id>>"}
{"@":"group-join","!id":<<id>>,"utc_timestamp":<<ts>>,"to":"<<group_id>>","from":"<<nick>>"}
{"@":"group-leave","!id":<<id>>,"utc_timestamp":<<ts>>,"to":"<<group_id>>","from":"<<nick>>"}
{"@":"ping","!id":<<id>>,"utc_timestamp":0,"t":<<ts>>}
{"@":"pong","t":<<ts>>}
{"@":"send-msg","to":"<<group_id|'@'+nick>>","msg":"<<payload>>"}
{"@":"group-message","!id":<<id>>,"utc_timestamp":<<ts>>,"to":"<<group_id|'@'+nick>>","from":"<<nick>>","msg":"<<payload>>"}