cmdhelp

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2023 License: MIT Imports: 2 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HelpProvider

type HelpProvider interface {
	Help(ctx ken.SubCommandContext) (emb *discordgo.MessageEmbed, err error)
}

HelpProvider defines a command which provides help content.

type Middleware

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

Middleware implements ken.MiddlewareBefore. It checks if a command implements HelpProvider on execution and attaches a help sub command handler. When the help sub command was called, a message is responded containing the embed returned by the Help implementation.

func New

func New(subCommandName ...string) *Middleware

New returns a new instance of Middleware.

You can also pass a custom name for the help sub command. This defaults to "help" otherwise.

func (*Middleware) Before

func (m *Middleware) Before(ctx *ken.Ctx) (next bool, err error)

Jump to

Keyboard shortcuts

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