Documentation ¶
Index ¶
- type Bot
- type Command
- type Context
- type Handler
- type HandlerFunc
- type MessageContext
- func (ctx *MessageContext) AddReaction(emojiID string) error
- func (ctx *MessageContext) ChannelTyping() error
- func (ctx *MessageContext) EmbedReply(embed *discord.MessageEmbed) (m *discord.Message, err error)
- func (ctx *MessageContext) Next()
- func (ctx *MessageContext) RemoveReaction(emojiID string) error
- func (ctx *MessageContext) Reply(content string) (m *discord.Message, err error)
- type MessageHandler
- type MessageHandlerFunc
- type OptionsMap
- type Router
- func (r *Router) ClearCommands(s *discord.Session, guild string) (errors []error)
- func (r *Router) Count() (c int)
- func (r *Router) Get(name string) *Command
- func (r *Router) HandleInteraction(s *discord.Session, i *discord.InteractionCreate)
- func (r *Router) HandleMessage(s *discord.Session, m *discord.MessageCreate)
- func (r *Router) List() (list []*Command)
- func (r *Router) Register(cmd *Command)
- func (r *Router) Sync(s *discord.Session, guild string) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Command ¶ added in v0.4.1
type Command struct { Name string Description string DMPermission bool DefaultMemberPermissions int64 Options []*discord.ApplicationCommandOption Type discord.ApplicationCommandType Handler Handler Middlewares []Handler MessageHandler MessageHandler SubCommands *Router }
func (Command) ApplicationCommand ¶ added in v0.4.1
func (cmd Command) ApplicationCommand() *discord.ApplicationCommand
func (Command) ApplicationCommandOption ¶ added in v0.4.1
func (cmd Command) ApplicationCommandOption() *discord.ApplicationCommandOption
type Context ¶ added in v0.4.1
type Context struct { *discord.Session Caller *Command Interaction *discord.Interaction Options OptionsMap // contains filtered or unexported fields }
func NewContext ¶ added in v0.4.1
func NewContext(s *discord.Session, caller *Command, i *discord.Interaction, parent *discord.ApplicationCommandInteractionDataOption, handlers []Handler) *Context
type HandlerFunc ¶ added in v0.4.1
type HandlerFunc func(ctx *Context)
func (HandlerFunc) HandleCommand ¶ added in v0.4.1
func (f HandlerFunc) HandleCommand(ctx *Context)
type MessageContext ¶ added in v0.4.1
type MessageContext struct { *discord.Session Caller *Command Message *discord.Message // contains filtered or unexported fields }
func NewMessageContext ¶ added in v0.4.1
func NewMessageContext(s *discord.Session, caller *Command, m *discord.Message, handlers []MessageHandler) *MessageContext
func (*MessageContext) AddReaction ¶ added in v0.4.1
func (ctx *MessageContext) AddReaction(emojiID string) error
func (*MessageContext) ChannelTyping ¶ added in v0.4.1
func (ctx *MessageContext) ChannelTyping() error
func (*MessageContext) EmbedReply ¶ added in v0.4.1
func (ctx *MessageContext) EmbedReply(embed *discord.MessageEmbed) (m *discord.Message, err error)
func (*MessageContext) Next ¶ added in v0.4.1
func (ctx *MessageContext) Next()
func (*MessageContext) RemoveReaction ¶ added in v0.4.1
func (ctx *MessageContext) RemoveReaction(emojiID string) error
type MessageHandler ¶ added in v0.4.1
type MessageHandler interface {
HandleMessageCommand(ctx *MessageContext)
}
type MessageHandlerFunc ¶ added in v0.4.1
type MessageHandlerFunc func(ctx *MessageContext)
func (MessageHandlerFunc) HandleMessageCommand ¶ added in v0.4.1
func (f MessageHandlerFunc) HandleMessageCommand(ctx *MessageContext)
type OptionsMap ¶ added in v0.4.1
type OptionsMap = map[string]*discord.ApplicationCommandInteractionDataOption
type Router ¶ added in v0.2.0
type Router struct {
// contains filtered or unexported fields
}
func (*Router) ClearCommands ¶ added in v0.2.0
func (*Router) HandleInteraction ¶ added in v0.2.0
func (r *Router) HandleInteraction(s *discord.Session, i *discord.InteractionCreate)
func (*Router) HandleMessage ¶ added in v0.2.0
func (r *Router) HandleMessage(s *discord.Session, m *discord.MessageCreate)
Click to show internal directories.
Click to hide internal directories.