Documentation ¶
Overview ¶
Package command provides implementations for the command abstractions found in package plugin.
Index ¶
- type ExampleArgs
- type LocalizedExampleArgs
- type LocalizedMeta
- func (m LocalizedMeta) GetAliases() []string
- func (m LocalizedMeta) GetArgParser() plugin.ArgParser
- func (m LocalizedMeta) GetArgs() plugin.ArgConfig
- func (m LocalizedMeta) GetBotPermissions() discord.Permissions
- func (m LocalizedMeta) GetChannelTypes() plugin.ChannelTypes
- func (m LocalizedMeta) GetExampleArgs(l *i18n.Localizer) plugin.ExampleArgs
- func (m LocalizedMeta) GetLongDescription(l *i18n.Localizer) string
- func (m LocalizedMeta) GetName() string
- func (m LocalizedMeta) GetShortDescription(l *i18n.Localizer) string
- func (m LocalizedMeta) GetThrottler() plugin.Throttler
- func (m LocalizedMeta) IsHidden() bool
- func (m LocalizedMeta) IsRestricted(s *state.State, ctx *plugin.Context) error
- type Meta
- func (m Meta) GetAliases() []string
- func (m Meta) GetArgParser() plugin.ArgParser
- func (m Meta) GetArgs() plugin.ArgConfig
- func (m Meta) GetBotPermissions() discord.Permissions
- func (m Meta) GetChannelTypes() plugin.ChannelTypes
- func (m Meta) GetExampleArgs(*i18n.Localizer) plugin.ExampleArgs
- func (m Meta) GetLongDescription(*i18n.Localizer) string
- func (m Meta) GetName() string
- func (m Meta) GetShortDescription(*i18n.Localizer) string
- func (m Meta) GetThrottler() plugin.Throttler
- func (m Meta) IsHidden() bool
- func (m Meta) IsRestricted(s *state.State, ctx *plugin.Context) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ExampleArgs ¶
type ExampleArgs = plugin.ExampleArgs
type LocalizedExampleArgs ¶
type LocalizedExampleArgs []struct { // Flags is a map of example flags. Flags map[string]*i18n.Config // Args contains the example arguments. Args []*i18n.Config }
func (LocalizedExampleArgs) BaseType ¶
func (lexamples LocalizedExampleArgs) BaseType(l *i18n.Localizer) plugin.ExampleArgs
type LocalizedMeta ¶
type LocalizedMeta struct { // Name is the name of the command. // It may not contain whitespace or dots. Name string // Aliases are the optional aliases of the command. // They may not contain whitespace or dots. Aliases []string // ShortDescription is an optional short description of the command. ShortDescription *i18n.Config // LongDescription is an optional long description of the command. LongDescription *i18n.Config // Args is the argument configuration of the command. // If this is left empty, the command won't accept any arguments. Args plugin.ArgConfig // ArgParser is the optional custom ArgParser of the command. ArgParser plugin.ArgParser // ExampleArgs contains the optional example arguments of the command. ExampleArgs exampleArgsGetter // Hidden specifies whether this command should be hidden from the help // message. Hidden bool // ChannelTypes are the plugin.ChannelTypes the command may be executed in. // // If this is not set, AllChannels. ChannelTypes plugin.ChannelTypes // BotPermissions are the permissions the bot needs to execute this // command. BotPermissions discord.Permissions // Restrictions contains the optional restrictions of the command. Restrictions plugin.RestrictionFunc // Throttler is the optional plugin.Throttler of the command. Throttler plugin.Throttler }
LocalizedMeta is the localized implementation of the plugin.CommandMeta interface.
func (LocalizedMeta) GetAliases ¶
func (m LocalizedMeta) GetAliases() []string
func (LocalizedMeta) GetArgParser ¶
func (m LocalizedMeta) GetArgParser() plugin.ArgParser
func (LocalizedMeta) GetArgs ¶
func (m LocalizedMeta) GetArgs() plugin.ArgConfig
func (LocalizedMeta) GetBotPermissions ¶
func (m LocalizedMeta) GetBotPermissions() discord.Permissions
func (LocalizedMeta) GetChannelTypes ¶
func (m LocalizedMeta) GetChannelTypes() plugin.ChannelTypes
func (LocalizedMeta) GetExampleArgs ¶
func (m LocalizedMeta) GetExampleArgs(l *i18n.Localizer) plugin.ExampleArgs
func (LocalizedMeta) GetLongDescription ¶
func (m LocalizedMeta) GetLongDescription(l *i18n.Localizer) string
func (LocalizedMeta) GetName ¶
func (m LocalizedMeta) GetName() string
func (LocalizedMeta) GetShortDescription ¶
func (m LocalizedMeta) GetShortDescription(l *i18n.Localizer) string
func (LocalizedMeta) GetThrottler ¶
func (m LocalizedMeta) GetThrottler() plugin.Throttler
func (LocalizedMeta) IsHidden ¶
func (m LocalizedMeta) IsHidden() bool
func (LocalizedMeta) IsRestricted ¶
type Meta ¶
type Meta struct { // Name is the name of the command. // It may not contain whitespace or dots. Name string // Aliases are the optional aliases of the command. // They may not contain whitespace or dots. Aliases []string // ShortDescription is an optional short description of the command. ShortDescription string // LongDescription is an optional long description of the command. LongDescription string // Args is the argument configuration of the command. // If this is left empty, the command won't accept any arguments. Args plugin.ArgConfig // ArgParser is the optional custom ArgParser of the command. ArgParser plugin.ArgParser // ExampleArgs contains the optional example arguments of the command. ExampleArgs plugin.ExampleArgs // Hidden specifies whether this command should be hidden from the help // message. Hidden bool // ChannelTypes are the plugin.ChannelTypes the command may be executed in. // // If this is not set, AllChannels will be used. ChannelTypes plugin.ChannelTypes // BotPermissions are the permissions the bot needs to execute this // command. BotPermissions discord.Permissions // Restrictions contains the optional restrictions of the command. Restrictions plugin.RestrictionFunc // Throttler is the optional plugin.Throttler of the command. Throttler plugin.Throttler }
Meta is the static, unlocalized, implementation of the plugin.CommandMeta interface.
func (Meta) GetAliases ¶
func (Meta) GetArgParser ¶
func (Meta) GetBotPermissions ¶
func (m Meta) GetBotPermissions() discord.Permissions
func (Meta) GetChannelTypes ¶
func (m Meta) GetChannelTypes() plugin.ChannelTypes
func (Meta) GetExampleArgs ¶
func (m Meta) GetExampleArgs(*i18n.Localizer) plugin.ExampleArgs
func (Meta) GetThrottler ¶
Click to show internal directories.
Click to hide internal directories.