command

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2020 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command struct {
	// Name of the command without the leading slash.
	Name string

	// Short description of the command
	ShortLine string

	// Hidden enables commands to be hidden from the /help output, such as
	// Telegram's built-in commands and easter eggs.
	Hidden bool

	// Run runs the command.
	Run func(context.Context, *bot.Bot, *telegram.Message)
}

A Command is an implementation of a bot command.

func Lookup

func Lookup(cmdname string) *Command

Lookup looks-up name from registered commands and returns corresponding Command if any.

Jump to

Keyboard shortcuts

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