Documentation
¶
Index ¶
- func RegisterModuleFactory(f ModuleFactory, name string) error
- type AdminWebProvider
- type Bot
- func (b *Bot) AddCommand(name string, help string, handler func(*CommandContext, []string) error, ...) error
- func (b *Bot) AddModule(modType string) error
- func (b *Bot) AddModuleByName(modType string, name string) error
- func (b *Bot) AddTemplateFunc(name string, f interface{}) error
- func (b *Bot) Connect() error
- func (b *Bot) Irc() *twitch.Client
- func (b *Bot) IsAdminRequest(r *http.Request) bool
- func (b *Bot) RemoveCommand(name string) error
- type CmdEngine
- type CommandContext
- type Config
- type Duration
- type Module
- type ModuleFactory
- type PublicWebProvider
- type RPCServiceProvider
- type Time
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterModuleFactory ¶
func RegisterModuleFactory(f ModuleFactory, name string) error
Types ¶
type AdminWebProvider ¶
AdminWebProvider is implemented by modules that serve admin web pages.
type Bot ¶
type Bot struct { Config *Config // contains filtered or unexported fields }
Bot is the main object that represents the bot.
func (*Bot) AddCommand ¶
func (b *Bot) AddCommand(name string, help string, handler func(*CommandContext, []string) error, userLevel int) error
AddCommand adds a bot command.
func (*Bot) AddTemplateFunc ¶
func (*Bot) RemoveCommand ¶
RemoveCommand removes a bot command.
type CommandContext ¶
type CommandContext struct { Bot *Bot Channel string User *twitch.User Message *twitch.Message UserLevel int API *twitchapi.Connection IRC *twitch.Client }
CommandContext is passed to commands that are executed.
type Config ¶
type Config struct { BotUsername string `json:"bot_username"` Channel string `json:"channel"` APIOAuth string `json:"api_oauth"` IRCOAuth string `json:"irc_oauth"` IRCAddress string `json:"irc_addr"` APIURLBase string `json:"api_url_base"` AdminUser string `json:"admin_user"` ClientID string `json:"client_id"` HTTPAddr string `json:"http_addr"` HTTPSAddr string `json:"https_addr"` HTTPRedirectBase string `json:"http_redirect_base"` KeyFile string `json:"key_file"` CertFile string `json:"cert_file"` DBPath string `json:"db_path"` }
Config is the bot's configuration
func LoadConfig ¶
type ModuleFactory ¶
ModuleFactory functions create modules.
type PublicWebProvider ¶
PublicWebProvider is implemented by modules that serve public web pages.
type RPCServiceProvider ¶
type RPCServiceProvider interface {
GetRPCService() interface{}
}
RPCServiceProvider is implemented my modules that handle rpc requests.
Click to show internal directories.
Click to hide internal directories.