Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Bot ¶
type Bot struct { Name string `json:"name,omitempty"` UserChannelName string `json:"user_channel_name,omitempty"` TwitchIRCClient *twitch.Client `json:"-"` TwitchOAuthClient *helix.Client `json:"-"` TwitchConnectFailures int `json:"twitch_connect_failures,omitempty"` AccessCode string `json:"access_code,omitempty"` AccessToken string `json:"access_token,omitempty"` RefreshToken string `json:"refresh_token,omitempty"` Connected bool `json:"connected,omitempty"` ConnectAttempts int `json:"connect_attempts,omitempty"` UserTwitchID string `json:"user_twitch_id,omitempty"` TokenExpiry time.Time `json:"token_expiry,omitempty"` }
Bot represents twitch users connected via the botCallback route. These should post in users channels, Users should never post in channels
type BotToken ¶
BotToken is used to identify which user the bot should link to when using the botCallback route
type Channel ¶
type Channel struct { Name string `json:"name,omitempty"` IsMod bool `json:"is_mod,omitempty"` LastHost string `json:"last_host,omitempty"` LastRaid string `json:"last_raid,omitempty"` }
Channel holds channel information about a Twitch channel
type Command ¶
type Command struct { Input string `json:"input,omitempty"` Output string `json:"output,omitempty"` }
Command has in input such as `!so` which if it is detected in a Twitch channel message will trigger the Output to be sent by a Bot to the Twitch channel
type ConnectChannel ¶
ConnectChannel is used to tell Bots to connect to a specific channel
type Cookie ¶
type Cookie struct { TwitchID string `json:"twitch_id,omitempty"` Expiry time.Time `json:"expiry,omitempty"` }
Cookie is stored in the database and identified by a key stored in a http.cookie. This key can then be used to fetch a User via the TwitchID as an identifier
type State ¶
type State struct { Commands []Command `json:"commands,omitempty"` Variables []Variable `json:"variables,omitempty"` }
State represents variables we show in the frontend, part of the User struct
type Template ¶
Template holds template variables which we pass to html files that render the frontend
type User ¶
type User struct { TwitchID string `json:"twitch_id,omitempty"` Email string `json:"email,omitempty"` AccessCode string `json:"access_code,omitempty"` AccessToken string `json:"access_token,omitempty"` RefreshToken string `json:"refresh_token,omitempty"` TokenExpiry time.Time `json:"token_expiry,omitempty"` Scopes []string `json:"scopes,omitempty"` TokenType string `json:"token_type,omitempty"` Channel Channel `json:"channel,omitempty"` State State `json:"state,omitempty"` Connected bool `json:"connected,omitempty"` ConnectAttempts int `json:"connect_attempts,omitempty"` BotToken string `json:"bot_token,omitempty"` TwitchIRCClient *twitch.Client `json:"-"` TwitchOAuthClient *helix.Client `json:"-"` TwitchConnectFailures int `json:"twitch_connect_failures,omitempty"` }
User represents a Twitch user connected to our application
type Variable ¶
type Variable struct { Name string `json:"name,omitempty"` Value string `json:"value,omitempty"` Description string `json:"description,omitempty"` Expiry time.Time `json:"expiry,omitempty"` }
Variable can be used in commands, this might be things like the last user that raided or hosted a channel or the number of subscribers a channel has
type WebsocketMessage ¶
type WebsocketMessage struct { Key string `json:"key,omitempty"` Channel string `json:"channel,omitempty"` Command string `json:"command,omitempty"` Text string `json:"text,omitempty"` MsgParams map[string]string `json:"msg_params,omitempty"` PrivateMessage twitch.PrivateMessage `json:"private_message,omitempty"` State State `json:"state,omitempty"` AlertType string `json:"alert_type,omitempty"` BotName string `json:"bot_name,omitempty"` TwitchID string `json:"-"` }
WebsocketMessage is the struct for the data sent over websocket connections