go-twitch/api/chat/models.go

135 lines
5.2 KiB
Go
Raw Normal View History

2024-02-28 10:30:20 -05:00
package chat
type EmoteImages struct {
// A URL to the small version (28px x 28px) of the emote.
URL1x string `json:"url_1x"`
// A URL to the medium version (56px x 56px) of the emote.
URL2x string `json:"url_2x"`
// A URL to the large version (112px x 112px) of the emote.
URL4x string `json:"url_4x"`
}
type EmoteFormat string
const (
EmoteFormatStatic EmoteFormat = "static"
EmoteFormatAnimated EmoteFormat = "animated"
)
type EmoteScale string
const (
// 1.0 — A small version (28px x 28px) is available.
EmoteScale1 EmoteScale = "1.0"
// 2.0 — A medium version (56px x 56px) is available.
EmoteScale2 EmoteScale = "2x"
// 3.0 — A large version (112px x 112px) is available.
EmoteScale4 EmoteScale = "4x"
)
type EmoteThemeMode string
const (
EmoteThemeModeDark EmoteThemeMode = "dark"
EmoteThemeModeLight EmoteThemeMode = "light"
)
type Badge struct {
// An ID that identifies this set of chat badges. For example, Bits or Subscriber.
SetID string `json:"set_id"`
// The list of chat badges in this set.
Versions []BadgeVersion `json:"versions"`
}
type BadgeVersion struct {
// An ID that identifies this version of the badge. The ID can be any value.
// For example, for Bits, the ID is the Bits tier level, but for World of Warcraft, it could be Alliance or Horde.
ID string `json:"id"`
// A URL to the small version (18px x 18px) of the badge.
ImageURL1x string `json:"image_url_1x"`
// A URL to the medium version (36px x 36px) of the badge.
ImageURL2x string `json:"image_url_2x"`
// A URL to the large version (72px x 72px) of the badge.
ImageURL4x string `json:"image_url_4x"`
// The title of the badge.
Title string `json:"title"`
// The description of the badge.
Description string `json:"description"`
// The action to take when clicking on the badge. Set to null if no action is specified.
ClickAction *string `json:"click_action"`
// The URL to navigate to when clicking on the badge. Set to null if no URL is specified.
ClickURL *string `json:"click_url"`
}
type Settings struct {
// The ID of the broadcaster specified in the request.
BroadcasterID string `json:"broadcaster_id"`
// A Boolean value that determines whether chat messages must contain only emotes. Is true if chat messages may contain only emotes; otherwise, false.
EmoteMode bool `json:"emote_mode"`
// A Boolean value that determines whether the broadcaster restricts the chat room to followers only.
//
// Is true if the broadcaster restricts the chat room to followers only; otherwise, false.
//
// See the follower_mode_duration field for how long users must follow the broadcaster before being able to participate in the chat room.
FollowerMode bool `json:"follower_mode"`
// The length of time, in minutes, that users must follow the broadcaster before being able to participate in the chat room.
// Is null if follower_mode is false.
FollowerModeDuration *int `json:"follower_mode_duration"`
// The moderators ID.
// The response includes this field only if the request specifies a user access token that includes the moderator:read:chat_settings scope.
ModeratorID *string `json:"moderator_id"`
// A Boolean value that determines whether the broadcaster adds a short delay before chat messages appear in the chat room.
// This gives chat moderators and bots a chance to remove them before viewers can see the message.
// See the non_moderator_chat_delay_duration field for the length of the delay.
// Is true if the broadcaster applies a delay; otherwise, false.
//
// The response includes this field only if the request specifies a user access token that includes the moderator:read:chat_settings
// scope and the user in the moderator_id query parameter is one of the broadcasters moderators.
NonModeratorChatDelay *bool `json:"non_moderator_chat_delay"`
// The amount of time, in seconds, that messages are delayed before appearing in chat. Is null if non_moderator_chat_delay is false.
//
// The response includes this field only if the request specifies a user access token that includes the moderator:read:chat_settings
// scope and the user in the moderator_id query parameter is one of the broadcasters moderators.
NonModeratorChatDelayDuration *int `json:"non_moderator_chat_delay_duration"`
// A Boolean value that determines whether the broadcaster limits how often users in the chat room are allowed to send messages.
//
// Is true if the broadcaster applies a delay; otherwise, false.
//
// See the slow_mode_wait_time field for the delay.
SlowMode bool `json:"slow_mode"`
// The amount of time, in seconds, that users must wait between sending messages.
//
// Is null if slow_mode is false.
SlowModeWaitTime *int `json:"slow_mode_wait_time"`
// A Boolean value that determines whether only users that subscribe to the broadcasters channel may talk in the chat room.
//
// Is true if the broadcaster restricts the chat room to subscribers only; otherwise, false.
SubscriberMode bool `json:"subscriber_mode"`
// A Boolean value that determines whether the broadcaster requires users to post only unique messages in the chat room.
//
// Is true if the broadcaster requires unique messages only; otherwise, false.
UniqueChatMode bool `json:"unique_chat_mode"`
}