Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrUsage = errors.New("Wrong command usage")
Functions ¶
This section is empty.
Types ¶
type BaseTrigger ¶
type BaseTrigger struct {
IRC IRCClient
}
BaseTrigger is just an implementation of Trigger to reduce some boilerplate code
func (*BaseTrigger) OnEvent ¶ added in v0.7.2
func (btrigger *BaseTrigger) OnEvent(msg interface{})
func (*BaseTrigger) SetIRC ¶ added in v0.7.2
func (btrigger *BaseTrigger) SetIRC(irc IRCClient)
type Command ¶
type Command interface { Info() CommandInfo Execute(nick string, args []string) (reply string, err error) }
Command is like a pure function just inputs and outputs
type CommandInfo ¶
CommandInfo contains information of a command
type Config ¶
type Config struct { Nick string `toml:"nick"` Name string `toml:"name"` User string `toml:"user"` Server string `toml:"server"` Port int `toml:"port"` Channel string `toml:"channel"` Retry bool `toml:"retry"` SASLUser string `toml:"sasl_user"` SASLPass string `toml:"sasl_pass"` DBPath string `toml:"dbpath"` WebHookAddr string `toml:"webhook_addr"` Secret string `toml:"secret"` Commands []string `toml:"commands"` Points []int `toml:"points"` Cooldowns []Duration `toml:"cooldowns"` }
type Duration ¶ added in v0.6.0
func (*Duration) UnmarshalText ¶ added in v0.6.0
Click to show internal directories.
Click to hide internal directories.