bot

package
v0.1.18 Latest Latest
Warning

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

Go to latest
Published: May 9, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Commands map[string][]CmdHandler = make(map[string][]CmdHandler)

Functions

func AddCmd

func AddCmd(name string, command ...CmdHandler)

func Run

func Run(token string)

Run starts the bot

Types

type CmdHandler added in v0.1.10

type CmdHandler func(ctx *Context) bool

return false to prevent the next handler from being called

type Context added in v0.1.8

type Context struct {
	Bot    *tgbotapi.BotAPI
	Update *tgbotapi.Update
	Args   []string
}

func (*Context) Call added in v0.1.8

func (ctx *Context) Call(name string)

Call calls another command with the same context

func (*Context) Send added in v0.1.8

func (ctx *Context) Send(text string)

Send sends a message to the user

Jump to

Keyboard shortcuts

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