bot

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2021 License: GPL-3.0 Imports: 6 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 {
	TelegramBotClient *telebot.Bot
	// contains filtered or unexported fields
}

func NewBot

func NewBot(opt *Option) (*Bot, error)

func (*Bot) GetAllCronJobs

func (b *Bot) GetAllCronJobs() []CronJob

func (*Bot) GetAllMessageHandler

func (b *Bot) GetAllMessageHandler() map[interface{}][]CallbackHandler

func (*Bot) RegisterCronJob

func (b *Bot) RegisterCronJob(endpint interface{}, cronjob CronHandler, ticker *time.Ticker)

func (*Bot) RegisterMessageHandler

func (b *Bot) RegisterMessageHandler(endpint interface{}, handler CallbackHandler)

type CallbackHandler

type CallbackHandler func(*telebot.Bot, *telebot.Message, session.SessionManager)

type CronHandler

type CronHandler func(*telebot.Bot, session.SessionManager)

CronHandler - do cron jobs by passing Bot and the session about a communication

type CronJob

type CronJob struct {
	Handler CronHandler
	Ticker  *time.Ticker
}

type Option

type Option struct {
	BotAPIToken string
}

Jump to

Keyboard shortcuts

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