I made this thread for everyone to share anything they make for the stream chat!
I've personally made a client and IRC bridge but I've yet to put them on GitHub, will post update here when i do!
stream.mattkc.com custom clients, bridges and hacking.
stream.mattkc.com custom clients, bridges and hacking.
Last edited by janLuna on Mon Jan 23, 2023 6:23 am, edited 1 time in total.
Re: stream.mattkc.com custom clients and bridges.
Did some testing and here is what I found:
Web Socket URL: wss://server.mattkc.com:2002
Connect handshake process (new line indicates new message to send to web socket):
To send message:
Web Socket URL: wss://server.mattkc.com:2002
Connect handshake process (new line indicates new message to send to web socket):
Code: Select all
{"type":"hello","data":{"last_message":-1},"auth":"google","token":"[Google OAuth Token]"}
{"type":"status","data":{},"auth":"google","token":"[Google OAuth Token]"}
Code: Select all
{"type":"message","data":"[MESSAGE HERE]","auth":"google","token":"[Google OAuth Token]"}
Re: stream.mattkc.com custom clients and bridges.
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
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
{"text":"message text"}
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'
}
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"}
Re: stream.mattkc.com custom clients and bridges.
UPDATE: i uploaded the IRC bridge, IRCkc, to GitHub, so you can now run your own instances, mostly important for other ChatKC instances whenever Matt actually makes it open source
Re: stream.mattkc.com custom clients and bridges.
Not sure if this fits here, but I made a small userscript that adds timestamps to the stream website.
https://github.com/Voxalice/misc-usersc ... ps.user.js
https://github.com/Voxalice/misc-usersc ... ps.user.js