Documentation
¶
Index ¶
- Constants
- type Bot
- func (b *Bot) AddCommand(cmd *discordgo.ApplicationCommand, guildIds ...string)
- func (b *Bot) AddHandler(name string, handler any)
- func (b *Bot) AddIntent(intent discordgo.Intent)
- func (b *Bot) AddPlugin(plugin Plugin, guildIds ...string) error
- func (b *Bot) Id() string
- func (b *Bot) ReloadPlugin(name string)
- func (b *Bot) RemoveCommand(cmdId string, guildIds ...string)
- func (b *Bot) RemoveHandler(name string)
- func (b *Bot) RemovePlugin(plugin Plugin, guildIds ...string)
- func (b *Bot) Restart() error
- func (b *Bot) Start() error
- func (b *Bot) Stop() error
- type BotState
- type Config
- type Plugin
- type PluginManager
Constants ¶
View Source
const Version = "v0.0.1"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bot ¶
func (*Bot) AddCommand ¶
func (b *Bot) AddCommand(cmd *discordgo.ApplicationCommand, guildIds ...string)
AddCommand registers an ApplicationCommand to the specified guild Ids (global if empty). The supplied command will be compared against currently registered commands to prevent re-registering the same exact command.
func (*Bot) AddHandler ¶
func (*Bot) ReloadPlugin ¶
func (*Bot) RemoveCommand ¶
func (*Bot) RemoveHandler ¶
func (*Bot) RemovePlugin ¶
type Plugin ¶
type Plugin interface { Name() string Description() string Handlers() map[string]any Commands() map[string]*discordgo.ApplicationCommand Intents() []discordgo.Intent }
Plugin is the baseline interface for extending bot behavior.
type PluginManager ¶
type PluginManager struct {
// contains filtered or unexported fields
}
func (PluginManager) Commands ¶
func (p PluginManager) Commands() map[string]*discordgo.ApplicationCommand
func (PluginManager) Description ¶
func (p PluginManager) Description() string
func (PluginManager) Handlers ¶
func (p PluginManager) Handlers() map[string]any
func (PluginManager) Intents ¶
func (p PluginManager) Intents() []discordgo.Intent
func (PluginManager) Name ¶
func (p PluginManager) Name() string
Click to show internal directories.
Click to hide internal directories.