Documentation ¶
Index ¶
- Constants
- type AccessLevelType
- type Bot
- func (b *Bot) Connect() error
- func (b *Bot) IsActive(user string) bool
- func (b *Bot) IsBanned(user string) bool
- func (b *Bot) LoadModules() error
- func (b *Bot) ResetActivity()
- func (b *Bot) SetBanList(banned []string)
- func (b *Bot) SetupLoyalty(loyalty *loyalty.Manager)
- func (b *Bot) WriteMessage(message string)
- type BotAlertsConfig
- type BotAlertsModule
- type BotCommand
- type BotCommandHandler
- type BotConfig
- type BotCustomCommand
- type BotTimer
- type BotTimerModule
- type BotTimersConfig
- type Client
- type Config
Constants ¶
View Source
const AverageMessageWindow = 5
View Source
const BotAlertsKey = "twitch/bot-modules/alerts/config"
View Source
const BotConfigKey = "twitch/bot-config"
View Source
const BotCounterPrefix = "twitch/bot-counters/"
View Source
const BotTimersKey = "twitch/bot-modules/timers/config"
View Source
const ChatEventKey = "twitch/ev/chat-message"
View Source
const ChatHistoryKey = "twitch/chat-history"
View Source
const ConfigKey = "twitch/config"
View Source
const CustomCommandsKey = "twitch/bot-custom-commands"
View Source
const WriteMessageRPC = "twitch/@send-chat-message"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccessLevelType ¶
type AccessLevelType string
const ( ALTEveryone AccessLevelType = "everyone" ALTSubscribers AccessLevelType = "subscriber" ALTVIP AccessLevelType = "vip" ALTModerators AccessLevelType = "moderators" ALTStreamer AccessLevelType = "streamer" )
type Bot ¶
type Bot struct { Client *irc.Client // Module specific vars Loyalty *loyalty.Manager Timers *BotTimerModule Alerts *BotAlertsModule // contains filtered or unexported fields }
func (*Bot) LoadModules ¶ added in v1.5.2
func (*Bot) ResetActivity ¶
func (b *Bot) ResetActivity()
func (*Bot) SetBanList ¶
func (*Bot) SetupLoyalty ¶
func (*Bot) WriteMessage ¶ added in v1.5.2
type BotAlertsConfig ¶ added in v1.7.0
type BotAlertsConfig struct { Follow struct { Enabled bool `json:"enabled"` Messages []string `json:"messages"` } `json:"follow"` Subscription struct { Enabled bool `json:"enabled"` Messages []string `json:"messages"` Variations []struct { MinStreak *int `json:"min_streak,omitempty"` IsGifted *bool `json:"is_gifted,omitempty"` Messages []string `json:"messages"` } `json:"variations"` } `json:"subscription"` GiftSub struct { Enabled bool `json:"enabled"` Messages []string `json:"messages"` Variations []struct { MinCumulative *int `json:"min_cumulative,omitempty"` IsAnonymous *bool `json:"is_anonymous,omitempty"` Messages []string `json:"messages"` } `json:"variations"` } `json:"gift_sub"` Raid struct { Enabled bool `json:"enabled"` Messages []string `json:"messages"` Variations []struct { MinViewers *int `json:"min_viewers,omitempty"` Messages []string `json:"messages"` } `json:"variations"` } `json:"raid"` Cheer struct { Enabled bool `json:"enabled"` Messages []string `json:"messages"` Variations []struct { MinAmount *int `json:"min_amount,omitempty"` Messages []string `json:"messages"` } `json:"variations"` } `json:"cheer"` }
type BotAlertsModule ¶ added in v1.7.0
type BotAlertsModule struct { Config BotAlertsConfig // contains filtered or unexported fields }
func SetupAlerts ¶ added in v1.7.0
func SetupAlerts(bot *Bot) *BotAlertsModule
type BotCommand ¶
type BotCommand struct { Description string Usage string AccessLevel AccessLevelType Handler BotCommandHandler Enabled bool }
type BotCommandHandler ¶
type BotCommandHandler func(bot *Bot, message irc.PrivateMessage)
type BotCustomCommand ¶ added in v1.5.0
type BotCustomCommand struct { Description string `json:"description"` AccessLevel AccessLevelType `json:"access_level"` Response string `json:"response"` Enabled bool `json:"enabled"` }
type BotTimer ¶ added in v1.5.2
type BotTimer struct { Enabled bool `json:"enabled"` // Whether the timer is enabled Name string `json:"name"` // Timer name (must be unique) MinimumChatActivity int `json:"minimum_chat_activity"` // Minimum chat messages in the last 5 minutes MinimumDelay int `json:"minimum_delay"` // In seconds Messages []string `json:"messages"` // Messages to write (randomly chosen) }
type BotTimerModule ¶ added in v1.5.2
type BotTimerModule struct { Config BotTimersConfig // contains filtered or unexported fields }
func SetupTimers ¶ added in v1.5.2
func SetupTimers(bot *Bot) *BotTimerModule
func (*BotTimerModule) OnMessage ¶ added in v1.5.2
func (m *BotTimerModule) OnMessage(message irc.PrivateMessage)
type BotTimersConfig ¶ added in v1.5.2
Click to show internal directories.
Click to hide internal directories.