Documentation ¶
Index ¶
- Variables
- func AddBotParser(name string, parser BotParser) error
- func ParseBots(cfg *Config) error
- func RunAll(createModsFor func(Bot) []Module) error
- func RunBot(bot Bot) error
- func SetField(obj interface{}, name string, value interface{}) error
- func Token() string
- type Actions
- type Admin
- type Author
- type BaseConnection
- type Bot
- type BotParser
- type Config
- type Connection
- type Message
- type MessageFormatter
- type Messenger
- type Modable
- type Module
- type ModuleManager
- type NullMessenger
- type Stream
Constants ¶
This section is empty.
Variables ¶
View Source
var Bots map[string]Bot
View Source
var DefaultConfig string
Functions ¶
func AddBotParser ¶
Types ¶
type Actions ¶
type Actions interface { Messenger MessageFormatter Admin }
type BaseConnection ¶ added in v0.5.0
type BaseConnection struct { NAME string `toml:"name"` Type string Admins []string Mods map[string]any }
BaseConnection is a base template for Connections to use.
func (*BaseConnection) Name ¶ added in v0.5.0
func (c *BaseConnection) Name() string
func (*BaseConnection) SetName ¶ added in v0.5.0
func (c *BaseConnection) SetName(name string)
type Bot ¶
type Bot interface { Connection Admin Modable Messenger MessageFormatter }
type Connection ¶
type Message ¶
type MessageFormatter ¶
type ModuleManager ¶
type ModuleManager struct {
// contains filtered or unexported fields
}
func NewModManager ¶
func NewModManager(mods []Module, actions Actions) (*ModuleManager, error)
func (*ModuleManager) Run ¶
func (manager *ModuleManager) Run(stream Stream) error
func (*ModuleManager) Stop ¶
func (manager *ModuleManager) Stop()
type NullMessenger ¶
type NullMessenger struct{}
func (*NullMessenger) Send ¶
func (messenger *NullMessenger) Send(msg Message) error
Directories ¶
Path | Synopsis |
---|---|
cmd
|
|
connections
|
|
Package log is meant to be used by modules to log any important information or errors to be reviewed by the bot owner.
|
Package log is meant to be used by modules to log any important information or errors to be reviewed by the bot owner. |
sed
Package sed is a toy implementation of sed for making _real_ corrections only, no silly seds.
|
Package sed is a toy implementation of sed for making _real_ corrections only, no silly seds. |
Click to show internal directories.
Click to hide internal directories.