bot

package
v0.0.0-...-c6be4de Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2021 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Done = "Done"
)

Variables

This section is empty.

Functions

func RegisterHandlers

func RegisterHandlers(b *telebot.Bot, db db.Base, hh []Handler)

func Unique

func Unique(h Handler) string

Types

type Action

type Action interface {
	Do(b *telebot.Bot, r Request) error
}

Actions to: send message send callback response edit message and it's buttons.

type Bot

type Bot interface {
	// Do Action or error
	Action(action Action)
	Err(err error) bool
	Base() db.Base
}

func DefaultBot

func DefaultBot(b *telebot.Bot, db db.Base) Bot

type Button

type Button interface {
	Text() string
	Data() string
	Handler
	Scanner
}

type Command

type Command interface {
	Description() string
	Handler
}

type Handler

type Handler interface {
	Do(Bot)
}

type Message

type Message struct {
	Text     string
	DeleteRM bool // Deletes request message from chat history
	Buttons  []Button
}

func (Message) Do

func (m Message) Do(b *telebot.Bot, r Request) error

type Request

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

type Response

type Response struct {
	Text        string
	EditMessage *Message
}

func (Response) Do

func (r Response) Do(b *telebot.Bot, request Request) error

type Scanner

type Scanner interface {
	Scan(data string) Handler
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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