Documentation
¶
Index ¶
- type Bot
- func (b *Bot) AddCommand(command *disgord.CreateApplicationCommand, options *BotCommandOptions, ...)
- func (b *Bot) LinkIDToHandler(ID string, comp BotComponent)
- func (b *Bot) LinkIDsToHandlers(compMap map[string]BotComponent)
- func (b *Bot) NewComponentHandler(handler InteractionHandler) string
- func (b *Bot) NewComponentHandlerFromOptions(options BotComponentOptions, handler InteractionHandler) string
- func (b *Bot) Run() error
- type BotCommand
- type BotCommandOptions
- type BotComponent
- type BotComponentOptions
- type BotConfig
- type InteractionHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bot ¶
type Bot struct {
Client *disgord.Client
Config BotConfig
Commands []*disgord.CreateApplicationCommand
CommandHandlers map[string]BotCommand
ActiveComponentHandlers map[string]BotComponent
}
func NewBotWithConfig ¶ added in v1.0.0
func NewBotWithDefault ¶ added in v1.0.0
func NewBotWithDefault() Bot
func (*Bot) AddCommand ¶
func (b *Bot) AddCommand(command *disgord.CreateApplicationCommand, options *BotCommandOptions, handler InteractionHandler)
func (*Bot) LinkIDToHandler ¶ added in v1.0.0
func (b *Bot) LinkIDToHandler(ID string, comp BotComponent)
func (*Bot) LinkIDsToHandlers ¶ added in v1.0.0
func (b *Bot) LinkIDsToHandlers(compMap map[string]BotComponent)
func (*Bot) NewComponentHandler ¶
func (b *Bot) NewComponentHandler(handler InteractionHandler) string
func (*Bot) NewComponentHandlerFromOptions ¶ added in v1.0.0
func (b *Bot) NewComponentHandlerFromOptions(options BotComponentOptions, handler InteractionHandler) string
type BotCommand ¶ added in v1.0.0
type BotCommand struct {
Handler InteractionHandler
Options BotCommandOptions
}
type BotCommandOptions ¶ added in v1.0.0
type BotCommandOptions struct {
// Only people who have this perm or above can use command
RequiredPermission disgord.PermissionBit
// Sent when you don't have perms
PermissionErrorMessage disgord.CreateInteractionResponse
// When any error occurs when running command
GeneralErrorMessage disgord.CreateInteractionResponse
}
type BotComponent ¶ added in v1.0.0
type BotComponent struct {
Handler InteractionHandler
Options BotComponentOptions
}
type BotComponentOptions ¶ added in v1.0.0
type BotComponentOptions struct {
// Applies to any error message when clicking a button
GeneralErrorMessage disgord.CreateInteractionResponse
// Only one user can click the button
UserLockedTo disgord.Snowflake
// Sent when somebody that isn't userlockedto clicks the button
OutsideInteractionErrorMessage disgord.CreateInteractionResponse
// Choose if the button will only respond to one click (won't disable)
OneClickOnly bool
}
type BotConfig ¶ added in v1.0.0
type BotConfig struct {
DefaultPermissionErrorMessage disgord.CreateInteractionResponse
DefaultGeneralErrorMessage disgord.CreateInteractionResponse
DefaultOutsideInteractionErrorMessage disgord.CreateInteractionResponse
}
type InteractionHandler ¶ added in v1.0.0
type InteractionHandler func(session disgord.Session, interaction *disgord.InteractionCreate) error
Click to show internal directories.
Click to hide internal directories.