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 (b *Bot) Connected(c *conpool.Con)
- func (b *Bot) Disconnected(c *conpool.Con, err error)
- func (b *Bot) LoginFromID(id string) string
- func (b *Bot) Message(con *conpool.Con, msg *ircon.Message)
- func (b *Bot) RemoveTarget(id, login string)
- func (b *Bot) RemoveTargetLogin(login string) error
- func (b *Bot) Run(targets []Target) context.Context
- func (b *Bot) Say(login, msg string)
- func (b *Bot) SetLive(id string, live bool)
- func (b *Bot) Table() *cmdtable.Table
- type Commander
- func (c Commander) Config()
- func (c *Commander) Configure(login string, conf map[string]string)
- func (c Commander) Message()
- func (c *Commander) Remove(login string)
- func (c *Commander) RunningConf(login string) chanconf
- func (c *Commander) SetLive(id, login string, live bool)
- func (c *Commander) SyncHighRL(login string, highrl bool)
- func (c *Commander) SyncSlowMode(login string, slow int)
- type RawInputLogger
- type RawMessageHook
- type RoomState
- type TMI
- type Target
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bot ¶
type Bot struct { 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 CPool *conpool.Pool Commander *Commander // contains filtered or unexported fields }
func (*Bot) Message ¶
Message handles messages received on a specific connection, which may happen concurrently across multiple connections.
func (*Bot) Run ¶
Run starts the bot threads and returns a context that will be closed when the bot should stop running.
func (*Bot) Say ¶
Say publishes a message to the given channel.
type Commander ¶
type RoomState ¶
type RoomState interface { Joined(room string) Parted(room string) // <ID from room state> SlowMode(room string, secs int) HighRL(room string, yesno bool) }
Provides:
type TMI ¶
type TMI struct { }
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package ctxrl implements context-based rate limiting.
|
Package ctxrl implements context-based rate limiting. |
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 highlivel Twitch PubSub helpers.
|
Package pubsub implements highlivel 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. |
cmdclient
Package cmdclient implements execution of commands using a remote service.
|
Package cmdclient implements execution of commands using a remote service. |
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 messages in a table.
|
Package cmdtable implements tools to look up messages 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. |
partyline
Package partyline implements Redis-based communication of command-sets for command-set hosts and their clients.
|
Package partyline implements Redis-based communication of command-sets for command-set hosts and their clients. |
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.