Documentation ¶
Index ¶
- func PermissionCheck(ctx context.Context, c *components.Components, g *ent.Guild, client bot.Client, ...) bool
- func RolePermissionCheck(g *ent.Guild, guildID snowflake.ID, client bot.Client, roleIds []snowflake.ID, ...) bool
- type AutocompleteHandler
- type Command
- func (gc *Command) AutocompleteHandler() func(event *events.AutocompleteInteractionCreate) error
- func (gc *Command) CommandHandler() func(event *events.ApplicationCommandInteractionCreate) error
- func (gc *Command) ComponentHandler() func(event *events.ComponentInteractionCreate) error
- func (gc *Command) Create() []discord.ApplicationCommandCreate
- func (gc *Command) IsPrivate() bool
- func (gc *Command) ModalHandler() func(event *events.ModalSubmitInteractionCreate) error
- func (gc *Command) Name() string
- func (gc *Command) OnEvent() func(event bot.Event) error
- func (gc *Command) Scheduler() []components.Scheduler
- func (gc *Command) SetComponent(c *components.Components) *Command
- type CommandHandler
- type ComponentHandler
- type EventHandler
- type ModalHandler
- type PAutocompleteHandler
- type PCommandHandler
- type PComponentHandler
- type Permission
- type PermissionAutocompleteHandler
- type PermissionCommandHandler
- type PermissionComponentHandler
- type PermissionDefaultString
- type PermissionHandler
- type PermissionString
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PermissionCheck ¶
func PermissionCheck(ctx context.Context, c *components.Components, g *ent.Guild, client bot.Client, m discord.ResolvedMember, guildID snowflake.ID, perms []Permission) bool
func RolePermissionCheck ¶
Types ¶
type AutocompleteHandler ¶
type AutocompleteHandler EventHandler[*events.AutocompleteInteractionCreate]
func (AutocompleteHandler) DiscordPermission ¶
func (c AutocompleteHandler) DiscordPermission() discord.Permissions
func (AutocompleteHandler) Handler ¶
func (c AutocompleteHandler) Handler() EventHandler[*events.AutocompleteInteractionCreate]
func (AutocompleteHandler) Permissions ¶
func (c AutocompleteHandler) Permissions() []Permission
type Command ¶
type Command struct { Namespace string Private bool CommandCreate []discord.ApplicationCommandCreate // /command/subcommand_group/subcommand CommandHandlers map[string]PermissionCommandHandler ComponentHandlers map[string]PermissionComponentHandler ModalHandlers map[string]ModalHandler AutocompleteHandlers map[string]PermissionAutocompleteHandler EventHandler EventHandler[bot.Event] Schedulers []components.Scheduler // contains filtered or unexported fields }
func (*Command) AutocompleteHandler ¶
func (gc *Command) AutocompleteHandler() func(event *events.AutocompleteInteractionCreate) error
func (*Command) CommandHandler ¶
func (gc *Command) CommandHandler() func(event *events.ApplicationCommandInteractionCreate) error
func (*Command) ComponentHandler ¶
func (gc *Command) ComponentHandler() func(event *events.ComponentInteractionCreate) error
func (*Command) Create ¶
func (gc *Command) Create() []discord.ApplicationCommandCreate
func (*Command) ModalHandler ¶
func (gc *Command) ModalHandler() func(event *events.ModalSubmitInteractionCreate) error
func (*Command) Scheduler ¶
func (gc *Command) Scheduler() []components.Scheduler
func (*Command) SetComponent ¶
func (gc *Command) SetComponent(c *components.Components) *Command
type CommandHandler ¶
type CommandHandler EventHandler[*events.ApplicationCommandInteractionCreate]
func (CommandHandler) DiscordPermission ¶
func (c CommandHandler) DiscordPermission() discord.Permissions
func (CommandHandler) Handler ¶
func (c CommandHandler) Handler() EventHandler[*events.ApplicationCommandInteractionCreate]
func (CommandHandler) Permissions ¶
func (c CommandHandler) Permissions() []Permission
type ComponentHandler ¶
type ComponentHandler EventHandler[*events.ComponentInteractionCreate]
func (ComponentHandler) DiscordPermission ¶
func (c ComponentHandler) DiscordPermission() discord.Permissions
func (ComponentHandler) Handler ¶
func (c ComponentHandler) Handler() EventHandler[*events.ComponentInteractionCreate]
func (ComponentHandler) Permissions ¶
func (c ComponentHandler) Permissions() []Permission
type EventHandler ¶
type EventHandler[E bot.Event] func(c *components.Components, event E) errors.Error
type ModalHandler ¶
type ModalHandler func(c *components.Components, event *events.ModalSubmitInteractionCreate) errors.Error
type PAutocompleteHandler ¶
type PAutocompleteHandler struct { AutocompleteHandler EventHandler[*events.AutocompleteInteractionCreate] Permission []Permission DiscordPerm discord.Permissions }
func (PAutocompleteHandler) DiscordPermission ¶
func (c PAutocompleteHandler) DiscordPermission() discord.Permissions
func (PAutocompleteHandler) Handler ¶
func (c PAutocompleteHandler) Handler() EventHandler[*events.AutocompleteInteractionCreate]
func (PAutocompleteHandler) Permissions ¶
func (c PAutocompleteHandler) Permissions() []Permission
type PCommandHandler ¶
type PCommandHandler struct { CommandHandler EventHandler[*events.ApplicationCommandInteractionCreate] Permission []Permission DiscordPerm discord.Permissions }
func (PCommandHandler) DiscordPermission ¶
func (c PCommandHandler) DiscordPermission() discord.Permissions
func (PCommandHandler) Handler ¶
func (c PCommandHandler) Handler() EventHandler[*events.ApplicationCommandInteractionCreate]
func (PCommandHandler) Permissions ¶
func (c PCommandHandler) Permissions() []Permission
type PComponentHandler ¶
type PComponentHandler struct { ComponentHandler EventHandler[*events.ComponentInteractionCreate] Permission []Permission DiscordPerm discord.Permissions }
func (PComponentHandler) DiscordPermission ¶
func (c PComponentHandler) DiscordPermission() discord.Permissions
func (PComponentHandler) Handler ¶
func (c PComponentHandler) Handler() EventHandler[*events.ComponentInteractionCreate]
func (PComponentHandler) Permissions ¶
func (c PComponentHandler) Permissions() []Permission
type Permission ¶
type PermissionAutocompleteHandler ¶
type PermissionAutocompleteHandler PermissionHandler[*events.AutocompleteInteractionCreate]
type PermissionCommandHandler ¶
type PermissionCommandHandler PermissionHandler[*events.ApplicationCommandInteractionCreate]
type PermissionComponentHandler ¶
type PermissionComponentHandler PermissionHandler[*events.ComponentInteractionCreate]
type PermissionDefaultString ¶
type PermissionDefaultString string
func (PermissionDefaultString) Default ¶
func (p PermissionDefaultString) Default() bool
func (PermissionDefaultString) PermString ¶
func (p PermissionDefaultString) PermString() string
type PermissionHandler ¶
type PermissionHandler[E bot.Event] interface { Handler() EventHandler[E] Permissions() []Permission DiscordPermission() discord.Permissions }
type PermissionString ¶
type PermissionString string
func (PermissionString) Default ¶
func (p PermissionString) Default() bool
func (PermissionString) PermString ¶
func (p PermissionString) PermString() string
Click to show internal directories.
Click to hide internal directories.