ingest: add wire format for incoming messages
This commit is contained in:
24
ingest/message.go
Normal file
24
ingest/message.go
Normal 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"`
|
||||
}
|
Reference in New Issue
Block a user