ingest: add wire format for incoming messages

This commit is contained in:
2025-04-06 08:57:04 -04:00
parent 8d6dbcb970
commit 844ad98142
9 changed files with 320 additions and 0 deletions

24
ingest/message.go Normal file
View File

@@ -0,0 +1,24 @@
package ingest
// Twitch is the shape required of Twitch EventSub chat message events.
// Fields that Kaiyan does not need are dropped for efficiency.
type Twitch struct {
// Broadcaster is the broadcaster user ID.
Broadcaster string `json:"broadcaster_user_id"`
// Chatter is the user ID of the user who sent the message.
Chatter string `json:"chatter_user_id"`
// ID is the message ID.
ID string `json:"message_id"`
// Message is the message content.
Message TwitchContent `json:"message"`
// SourceBroadcaster is the user ID of the broadcaster whose chat was the
// one to which this message was sent originally, in the case of shared chat.
// If it is not a shared chat message, then this is the empty string.
SourceBroadcaster NullableString `json:"source_broadcaster_user_id"`
}
// TwitchContent is the content of a Twitch message event.
// Fields that Kaiyan does not need are dropped for efficiency.
type TwitchContent struct {
Text string `json:"text"`
}