help

package
v0.0.0-...-bf34452 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MsgDefaultHelp is what is shown when ?help is entered with no arguments.
	MsgDefaultHelp = "Type `?help` for this message, `?list` to list all commands, or `?help <command>` to get help for a particular command."
)
View Source
const (
	// MsgHelpHelp prints the results of ?help help
	MsgHelpHelp = "Get help for help."
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Executor

type Executor struct {
	// contains filtered or unexported fields
}

Executor prints help text for help commands.

func NewExecutor

func NewExecutor(featureRegistry *feature.Registry) *Executor

NewExecutor works as advertised.

func (*Executor) Execute

func (e *Executor) Execute(s api.DiscordSession, channel model.Snowflake, command *model.Command)

Execute replies over the given channel with a help message.

func (*Executor) GetType

func (e *Executor) GetType() int

GetType returns the type.

func (*Executor) PublicOnly

func (e *Executor) PublicOnly() bool

PublicOnly returns whether the executor should be intercepted in a private channel.

type Feature

type Feature struct {
	// contains filtered or unexported fields
}

Feature is a Feature that prints a help prompt for the user.

func NewFeature

func NewFeature(featureRegistry *feature.Registry) *Feature

NewFeature returns a new Feature.

func (*Feature) CommandInterceptors

func (f *Feature) CommandInterceptors() []feature.CommandInterceptor

CommandInterceptors returns nothing.

func (*Feature) Executors

func (f *Feature) Executors() []feature.Executor

Executors gets the executors.

func (*Feature) FallbackParser

func (f *Feature) FallbackParser() feature.Parser

FallbackParser returns nil.

func (*Feature) OnInitialLoad

func (f *Feature) OnInitialLoad(s api.DiscordSession) error

OnInitialLoad does nothing.

func (*Feature) Parsers

func (f *Feature) Parsers() []feature.Parser

Parsers returns the parsers.

type Parser

type Parser struct {
	// contains filtered or unexported fields
}

Parser parses ?help commands.

func NewParser

func NewParser(featureRegistry *feature.Registry) *Parser

NewParser works as advertised.

func (*Parser) GetName

func (p *Parser) GetName() string

GetName returns the named type.

func (*Parser) HelpText

func (p *Parser) HelpText(command string) (string, error)

HelpText returns the help text.

func (*Parser) Parse

func (p *Parser) Parse(splitContent []string, m *discordgo.MessageCreate) (*model.Command, error)

Parse parses the given help command.

Jump to

Keyboard shortcuts

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