Documentation
¶
Overview ¶
Package lolicon implements Tenchou Fansub's Lolicon bot.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterPlugin ¶
func RegisterPlugin(plugin Plugin)
RegisterPlugin registers a plugin.
This function panics if a plugin with the same id was already registered.
Types ¶
type HelpProvider ¶
type HelpProvider interface { Plugin // Help must return a map describing every supported command. // // A map key is the trigger for a command (without any prefix), // and its value is the description for that trigger. Help() map[string]string }
HelpProvider is a plugin that provides information for the "help" command.
type Message ¶
type Message struct { Date time.Time `json:"date"` Content string `json:"content"` ChannelId string `json:"channel_id"` UserId string `json:"user_id"` Command string `json:"command"` Trailing string `json:"trailing"` IsAdmin bool `json:"is_admin"` Raw *RawMessageData `json:"raw"` }
Message is a message from Discord.
type MessageHandler ¶
MessageHandler is a plugin that can handle messages.
type Plugin ¶
type Plugin interface { Id() PluginId // Setup is called when the plugin is loaded. Setup(storage storage.Driver) (err error) // Open is called when the connection to Discord has been // successfully established. Open(s *discordgo.Session) (err error) // Close is called after the connection to Discord has been closed. Close() (err error) }
Plugin is a plugin.
type RawMessageData ¶
type RawMessageData struct { Session *discordgo.Session `json:"-"` Event *discordgo.MessageCreate `json:"event"` }
RawMessageData contains the raw message received from Discord.
Directories
¶
Path | Synopsis |
---|---|
cmd
|
|
plugins
|
|
Package storage defines interfaces for persisting data in storage engines.
|
Package storage defines interfaces for persisting data in storage engines. |
jsonstorage
Package jsonstorage implements the storage.Driver interface for persisting information in JSON files.
|
Package jsonstorage implements the storage.Driver interface for persisting information in JSON files. |
Click to show internal directories.
Click to hide internal directories.