bot

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2019 License: Unlicense Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bot

type Bot struct {
	Api              *tgbotapi.BotAPI
	CallbacksHandler map[string]Handler
	CommandsHandlers map[string]Handler
	Logger           *zap.Logger
}

func GetNew

func GetNew(apiToken string, debug bool, logger *zap.Logger) (*Bot, error)

func (*Bot) AddCallbackHandler

func (bot *Bot) AddCallbackHandler(command string, handler Handler)

func (*Bot) AddCommandHandler

func (bot *Bot) AddCommandHandler(command string, handler Handler)

func (*Bot) ProcessCallbackQuery

func (bot *Bot) ProcessCallbackQuery(u *tgbotapi.Update)

func (*Bot) ProcessCommand

func (bot *Bot) ProcessCommand(u *tgbotapi.Update)

func (*Bot) Run

func (bot *Bot) Run(offset, timeout int) error

type Handler

type Handler func(update *tgbotapi.Update, bot *Bot, params ...interface{}) tgbotapi.Chattable

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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