command

package
v0.0.0-...-4e18fe8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 9, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package command provides implementations for the command abstractions found in package plugin.

Index

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

func (m LocalizedMeta) IsRestricted(s *state.State, ctx *plugin.Context) error

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 (m Meta) GetAliases() []string

func (Meta) GetArgParser

func (m Meta) GetArgParser() plugin.ArgParser

func (Meta) GetArgs

func (m Meta) GetArgs() plugin.ArgConfig

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) GetLongDescription

func (m Meta) GetLongDescription(*i18n.Localizer) string

func (Meta) GetName

func (m Meta) GetName() string

func (Meta) GetShortDescription

func (m Meta) GetShortDescription(*i18n.Localizer) string

func (Meta) GetThrottler

func (m Meta) GetThrottler() plugin.Throttler

func (Meta) IsHidden

func (m Meta) IsHidden() bool

func (Meta) IsRestricted

func (m Meta) IsRestricted(s *state.State, ctx *plugin.Context) error

Directories

Path Synopsis
Package help provides the default help command.
Package help provides the default help command.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL