Documentation ¶
Overview ¶
Package bot implements a DRY-bot framework, implementing a common base for writing various types of Twitch bots.
Index ¶
- type Bot
- func (b *Bot) AddTarget(id, login string, conf map[string]string)
- func (t Bot) Connected(c *conpool.Con)
- func (t Bot) Disconnected(c *conpool.Con, err error)
- func (b *Bot) ETag() string
- func (b *Bot) ExternalSay(login string, frags []string, cmd bool, bp string) bool
- func (b *Bot) ExternalSayID(id string, frags []string, cmd bool, bp string) bool
- func (b *Bot) IDFromLogin(login string) string
- func (b *Bot) LoginFromID(id string) string
- func (b *Bot) Message(con *conpool.Con, msg *ircon.Message)
- func (b *Bot) RemoveTarget(id, login string) error
- func (b *Bot) Run(targets []Target) context.Context
- func (b *Bot) Say(login, msg string)
- func (t Bot) SendInContext(login, rawmsg string) bool
- func (b *Bot) SendRaw(raw string)
- func (b *Bot) SetLive(id string, live bool)
- func (b *Bot) SetTargetConfig(id, login string, conf map[string]string) (string, error)
- func (b *Bot) Stream(ctx context.Context, login string, wr webservice.WebWriter) error
- func (b *Bot) TargetConfig(login string) map[string]string
- func (b *Bot) Targets() (string, []Target)
- type RawInputLogger
- type RawMessageHook
- type ServiceImpl
- type Target
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bot ¶
type Bot struct { RunningID int64 ConfigCounter int64 RawInputLogger RawInputLogger RawMessageHook RawMessageHook WS *webservice.Server ConfigPropagation func(id, login string, conf map[string]string) (string, error) PartFeedback interface { Parted(login string) error } ChannelManager chanmgr.Executor Commander *commander.Commander Output *output.Output // contains filtered or unexported fields }
func (*Bot) ExternalSay ¶
func (*Bot) ExternalSayID ¶
func (*Bot) Run ¶
Run starts the bot threads and returns a context that will be closed when the bot should stop running.
func (*Bot) SetTargetConfig ¶
func (*Bot) Stream ¶
type ServiceImpl ¶
type ServiceImpl interface { IDFromLogin(login string) string SendRaw(raw string) ExternalSay(login string, frags []string, command bool, bp string) bool ExternalSayID(id string, frags []string, command bool, bp string) bool RemoveTarget(id, login string) error SetTargetConfig(id, login string, config map[string]string) (string, error) TargetConfig(login string) map[string]string Targets() (string, []Target) Stream(ctx context.Context, login string, wr webservice.WebWriter) error }
Directories ¶
Path | Synopsis |
---|---|
Package ctxrl implements context-based rate limiting.
|
Package ctxrl implements context-based rate limiting. |
examples
|
|
Package globalrl implements global rate limiting for the Twitch Message Interface.
|
Package globalrl implements global rate limiting for the Twitch Message Interface. |
internal
|
|
signal
Package signal contains helpers for common signalling operations.
|
Package signal contains helpers for common signalling operations. |
Package pubsub implements highlevel Twitch PubSub helpers.
|
Package pubsub implements highlevel Twitch PubSub helpers. |
unstable
|
|
admincmd
Package admincmd implements standard administrative commands for managing channels and channel configuration.
|
Package admincmd implements standard administrative commands for managing channels and channel configuration. |
argparse
Package argparse implements lidl argument parsing.
|
Package argparse implements lidl argument parsing. |
cmdqueue
Package cmdqueue implements a command queueing and execution management system.
|
Package cmdqueue implements a command queueing and execution management system. |
cmdservice
Package cmdservice implements hosting of command-sets which can be called by clients via an HTTP-based API.
|
Package cmdservice implements hosting of command-sets which can be called by clients via an HTTP-based API. |
cmdtable
Package cmdtable implements tools to look up chat commands in a table.
|
Package cmdtable implements tools to look up chat commands in a table. |
conpool
Package conpool implements connection pooling based on assigning a context (typically, a channel) to a specific connection.
|
Package conpool implements connection pooling based on assigning a context (typically, a channel) to a specific connection. |
ipc
Package ipc describes an IPC request/response protocol for communicating chat commands and chat response messages.
|
Package ipc describes an IPC request/response protocol for communicating chat commands and chat response messages. |
joinmgr
Package joinmgr implements channel JOIN management in an environment with connection pooling and a global rate-limit in JOIN commands.
|
Package joinmgr implements channel JOIN management in an environment with connection pooling and a global rate-limit in JOIN commands. |
log
Package log implements a convenient wrapper for zerolog.
|
Package log implements a convenient wrapper for zerolog. |
paramhelper
Package paramhelper helps parse input as pseudo-YAML, which allows for flexible handling of e.g.
|
Package paramhelper helps parse input as pseudo-YAML, which allows for flexible handling of e.g. |
webservice
Package webservice implements an API server that works with HTTP requests in JSON and form-request format.
|
Package webservice implements an API server that works with HTTP requests in JSON and form-request format. |
Click to show internal directories.
Click to hide internal directories.