stream.mattkc.com custom clients, bridges and hacking.

Any discussion of software that doesn't fit into any category goes here.
Post Reply
User avatar
janLuna
Posts: 3
Joined: Mon Jan 16, 2023 10:10 pm

stream.mattkc.com custom clients, bridges and hacking.

Post by janLuna »

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!
Last edited by janLuna on Mon Jan 23, 2023 6:23 am, edited 1 time in total.
User avatar
y2k4
Posts: 6
Joined: Tue Dec 27, 2022 10:53 pm

Re: stream.mattkc.com custom clients and bridges.

Post by y2k4 »

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):

Code: Select all

{"type":"hello","data":{"last_message":-1},"auth":"google","token":"[Google OAuth Token]"}

{"type":"status","data":{},"auth":"google","token":"[Google OAuth Token]"}
To send message:

Code: Select all

{"type":"message","data":"[MESSAGE HERE]","auth":"google","token":"[Google OAuth Token]"}
User avatar
janLuna
Posts: 3
Joined: Mon Jan 16, 2023 10:10 pm

Re: stream.mattkc.com custom clients and bridges.

Post by janLuna »

UPDATE: the data value for the message type shoud be

Code: Select all

{"text":"message text"}
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"}
User avatar
janLuna
Posts: 3
Joined: Mon Jan 16, 2023 10:10 pm

Re: stream.mattkc.com custom clients and bridges.

Post by janLuna »

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
User avatar
voxalice
Posts: 1
Joined: Tue Jan 17, 2023 3:56 am

Re: stream.mattkc.com custom clients and bridges.

Post by voxalice »

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
Post Reply