command

package
v0.0.0-...-f712e64 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActionCommand

type ActionCommand interface {
	CommandAction(update *telegramApi.Update, bot *telegramApi.BotAPI) error
	GetCommandName() string
}

ActionCommand this is an interface for having the special methods of the commands

func GetEnabledCommands

func GetEnabledCommands() []ActionCommand

GetEnabledCommands method responsible for returning all enabled commands

type Command

type Command struct {
	Name        string
	Description string
}

Command basic structure to create a command

func (Command) GetCommandName

func (c Command) GetCommandName() string

GetCommandName method responsible for returning the command name

type HelpCommand

type HelpCommand struct {
	Command
}

HelpCommand this is the help command

func (HelpCommand) CommandAction

func (c HelpCommand) CommandAction(update *telegramApi.Update, bot *telegramApi.BotAPI) error

CommandAction method responsible for showing the help message

type StartCommand

type StartCommand struct {
	Command
}

StartCommand this is the initial command

func (StartCommand) CommandAction

func (c StartCommand) CommandAction(update *telegramApi.Update, bot *telegramApi.BotAPI) error

CommandAction method responsible for showing a welcome message

Jump to

Keyboard shortcuts

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