Documentation
¶
Index ¶
- Variables
- func Error(s *discordgo.Session, i *discordgo.InteractionCreate, errorMsg string)
- func ErrorUpdate(s *discordgo.Session, i *discordgo.InteractionCreate, errorMsg string)
- func SimpleMessage(s *discordgo.Session, i *discordgo.InteractionCreate, msg string)
- func SimpleUpdateMessage(s *discordgo.Session, i *discordgo.InteractionCreate, msg string)
- type AppCmdOptions
- type CommandBuilder
- type DiscordBinding
- type DiscordCommad
- func (dc *DiscordCommad) AddMiddleware(middleware MiddlewareFunc) CommandBuilder
- func (dc *DiscordCommad) AddPermission(permission discordgo.ApplicationCommandPermissions) CommandBuilder
- func (dc *DiscordCommad) AddSubcommand(cmd DiscordCommad) CommandBuilder
- func (dc *DiscordCommad) Build() DiscordCommad
- func (dc *DiscordCommad) SetApplicationCmd(cmd discordgo.ApplicationCommand) CommandBuilder
- func (dc *DiscordCommad) SetHandler(handler Handler) CommandBuilder
- func (dc *DiscordCommad) SetOptions(opts DiscordCommandOptions) CommandBuilder
- type DiscordCommandOptions
- type Handler
- type HandlerFunc
- type MiddlewareFunc
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrCommandAlreadyExist = errors.New("command already exist") ErrCommandDoesNotExist = errors.New("command doesn't exist") )
Functions ¶
func ErrorUpdate ¶
func ErrorUpdate(s *discordgo.Session, i *discordgo.InteractionCreate, errorMsg string)
func SimpleMessage ¶
func SimpleMessage(s *discordgo.Session, i *discordgo.InteractionCreate, msg string)
func SimpleUpdateMessage ¶
func SimpleUpdateMessage(s *discordgo.Session, i *discordgo.InteractionCreate, msg string)
Types ¶
type AppCmdOptions ¶
type AppCmdOptions []*discordgo.ApplicationCommandInteractionDataOption
type CommandBuilder ¶
type CommandBuilder interface { SetHandler(Handler) CommandBuilder SetApplicationCmd(cmd discordgo.ApplicationCommand) CommandBuilder AddMiddleware(MiddlewareFunc) CommandBuilder AddPermission(permission discordgo.ApplicationCommandPermissions) CommandBuilder SetOptions(opts DiscordCommandOptions) CommandBuilder AddSubcommand(cmd DiscordCommad) CommandBuilder Build() DiscordCommad }
func NewCommand ¶
func NewCommand() CommandBuilder
type DiscordBinding ¶
type DiscordBinding struct {
// contains filtered or unexported fields
}
func NewBinding ¶
func NewBinding(guild string, token string) (*DiscordBinding, error)
func (*DiscordBinding) AddCommand ¶
func (b *DiscordBinding) AddCommand(cmd DiscordCommad) error
func (*DiscordBinding) DeleteAllCommands ¶
func (b *DiscordBinding) DeleteAllCommands() error
type DiscordCommad ¶
type DiscordCommad struct {
// contains filtered or unexported fields
}
func (*DiscordCommad) AddMiddleware ¶
func (dc *DiscordCommad) AddMiddleware(middleware MiddlewareFunc) CommandBuilder
func (*DiscordCommad) AddPermission ¶
func (dc *DiscordCommad) AddPermission(permission discordgo.ApplicationCommandPermissions) CommandBuilder
func (*DiscordCommad) AddSubcommand ¶
func (dc *DiscordCommad) AddSubcommand(cmd DiscordCommad) CommandBuilder
func (*DiscordCommad) Build ¶
func (dc *DiscordCommad) Build() DiscordCommad
func (*DiscordCommad) SetApplicationCmd ¶
func (dc *DiscordCommad) SetApplicationCmd(cmd discordgo.ApplicationCommand) CommandBuilder
func (*DiscordCommad) SetHandler ¶
func (dc *DiscordCommad) SetHandler(handler Handler) CommandBuilder
func (*DiscordCommad) SetOptions ¶
func (dc *DiscordCommad) SetOptions(opts DiscordCommandOptions) CommandBuilder
type DiscordCommandOptions ¶
type DiscordCommandOptions struct {
KeepExistingPermissions bool
}
type Handler ¶
type Handler interface {
Respond(s *discordgo.Session, i *discordgo.InteractionCreate, opts AppCmdOptions)
}
func AckMiddleware ¶
type HandlerFunc ¶
type HandlerFunc func(s *discordgo.Session, i *discordgo.InteractionCreate, opts AppCmdOptions)
func (HandlerFunc) Respond ¶
func (f HandlerFunc) Respond(s *discordgo.Session, i *discordgo.InteractionCreate, opts AppCmdOptions)
type MiddlewareFunc ¶
func (MiddlewareFunc) Middleware ¶
func (mw MiddlewareFunc) Middleware(handler Handler) Handler
Click to show internal directories.
Click to hide internal directories.