Documentation
¶
Index ¶
- func FillContextReply[K Event](cb *ContextBuilder, event K, ctx context.Context) (context.Context, error)
- func FillPlayerContext(cb *ContextBuilder, userID snowflake.ID, ctx context.Context) (context.Context, error)
- func GetContext(ctx context.Context, app interfaces.App, userID snowflake.ID, ...) (context.Context, error)
- func WithContext[K Event](app interfaces.App, handler func(e *K) error, opts ...ContextOption) func(e *K) error
- func WithContextD[D any, K Event](app interfaces.App, handler func(d D, e *K) error, opts ...ContextOption) func(d D, e *K) error
- func WithPlayer() func(a *ContextBuilder)
- func WithPlayerCards() func(a *ContextBuilder)
- func WithPlayerGithubStars() func(a *ContextBuilder)
- func WithPlayerLootBoxes() func(a *ContextBuilder)
- func WithPlayerSelectedCard() func(a *ContextBuilder)
- type Command
- type CommandOption
- type ContextBuilder
- type ContextKey
- type ContextOption
- type Event
- type Menu
- type MenuOption
- type MenuStore
- type RegisterFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FillContextReply ¶
func FillPlayerContext ¶
func GetContext ¶
func GetContext(ctx context.Context, app interfaces.App, userID snowflake.ID, opts ...ContextOption) (context.Context, error)
func WithContext ¶
func WithContext[K Event](app interfaces.App, handler func(e *K) error, opts ...ContextOption) func(e *K) error
func WithContextD ¶
func WithContextD[D any, K Event](app interfaces.App, handler func(d D, e *K) error, opts ...ContextOption) func(d D, e *K) error
func WithPlayer ¶
func WithPlayer() func(a *ContextBuilder)
func WithPlayerCards ¶
func WithPlayerCards() func(a *ContextBuilder)
func WithPlayerGithubStars ¶
func WithPlayerGithubStars() func(a *ContextBuilder)
func WithPlayerLootBoxes ¶
func WithPlayerLootBoxes() func(a *ContextBuilder)
func WithPlayerSelectedCard ¶
func WithPlayerSelectedCard() func(a *ContextBuilder)
Types ¶
type Command ¶
type Command struct { Name string Description string bot.Client *handler.Mux // contains filtered or unexported fields }
func NewCommand ¶
func NewCommand(opts ...CommandOption) *Command
type CommandOption ¶
type CommandOption func(a *Command)
func WithApp ¶
func WithApp(app interfaces.App) CommandOption
func WithCommandName ¶
func WithCommandName(name string) CommandOption
func WithDescription ¶
func WithDescription(desc string) CommandOption
func WithRegisterFunc ¶
func WithRegisterFunc(r RegisterFunc) CommandOption
func WithSlashCommand ¶
func WithSlashCommand(r discord.SlashCommandCreate) CommandOption
type ContextBuilder ¶
type ContextBuilder struct {
// contains filtered or unexported fields
}
type ContextKey ¶
type ContextKey string
var ( PlayerKey ContextKey = "player" ErrorKey ContextKey )
type ContextOption ¶
type ContextOption func(a *ContextBuilder)
type Event ¶
type Event interface { User() discord.User CreateMessage(messageCreate discord.MessageCreate, opts ...rest.RequestOpt) error handler.CommandEvent | handler.AutocompleteEvent | handler.ComponentEvent | handler.InteractionEvent | handler.ModalEvent }
type Menu ¶
type Menu struct { Name string Emoji discord.Emoji Commands []*Command // contains filtered or unexported fields }
func (*Menu) RegisterCommands ¶
func (m *Menu) RegisterCommands() ([]discord.ApplicationCommandCreate, error)
type MenuOption ¶
type MenuOption func(a *Menu)
func WithCommands ¶
func WithCommands(cmds ...*Command) MenuOption
func WithEmoji ¶
func WithEmoji(emoji discord.Emoji) MenuOption
func WithMenuName ¶
func WithMenuName(name string) MenuOption
type MenuStore ¶
type MenuStore struct { Menus []*Menu Commands []*Command // contains filtered or unexported fields }
func NewMenuStore ¶
func NewMenuStore(app interfaces.App) *MenuStore
func (*MenuStore) NewMenu ¶
func (ms *MenuStore) NewMenu(opts ...MenuOption) *Menu
func (*MenuStore) RegisterCommands ¶
func (ms *MenuStore) RegisterCommands() ([]discord.ApplicationCommandCreate, error)
type RegisterFunc ¶
Click to show internal directories.
Click to hide internal directories.