Documentation ¶
Index ¶
- func FormatSearchResult(start int, result *cypress.Result, resultPerPage int) string
- func TimerDeleteMessage(n int, f func()) *time.Timer
- type BotCmdWorker
- func (botcmdworker *BotCmdWorker) AddCache(messageID int, chatID int64, clause *cypress.SearchClause)
- func (botcmdworker *BotCmdWorker) DelCache(messageID int, chatID int64)
- func (botcmdworker *BotCmdWorker) GetFromCache(messageID int, chatID int64) *cypress.SearchClause
- func (botcmdworker *BotCmdWorker) RegTimer(messageID int, chatID int64, timer *time.Timer)
- func (botcmdworker *BotCmdWorker) ResetTimer(messageID int, chatID int64, n int)
- func (botcmdworker *BotCmdWorker) TGBotButtonQuery(tgservice *service.Telegram, conf *TGBotCommandConf, cypressapi *cypress.API, ...)
- func (botcmdworker *BotCmdWorker) TGBotCommand(tgservice *service.Telegram, conf *TGBotCommandConf, cypressapi *cypress.API, ...)
- func (botcmdworker *BotCmdWorker) UnregTimer(messageID int, chatID int64)
- type TGBotCommandConf
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatSearchResult ¶
FormatSearchResult format the search result and build the message text for telegram reply
func TimerDeleteMessage ¶
TimerDeleteMessage will call the function f after n seconds
Types ¶
type BotCmdWorker ¶
type BotCmdWorker struct { //BotToken string QueryCache map[string]*cypress.SearchClause TimerCache map[string]*time.Timer }
BotCmd worker struct
func NewBotCmdWorker ¶
func NewBotCmdWorker() *BotCmdWorker
func (*BotCmdWorker) AddCache ¶
func (botcmdworker *BotCmdWorker) AddCache(messageID int, chatID int64, clause *cypress.SearchClause)
func (*BotCmdWorker) DelCache ¶
func (botcmdworker *BotCmdWorker) DelCache(messageID int, chatID int64)
func (*BotCmdWorker) GetFromCache ¶
func (botcmdworker *BotCmdWorker) GetFromCache(messageID int, chatID int64) *cypress.SearchClause
func (*BotCmdWorker) RegTimer ¶
func (botcmdworker *BotCmdWorker) RegTimer(messageID int, chatID int64, timer *time.Timer)
func (*BotCmdWorker) ResetTimer ¶
func (botcmdworker *BotCmdWorker) ResetTimer(messageID int, chatID int64, n int)
func (*BotCmdWorker) TGBotButtonQuery ¶
func (botcmdworker *BotCmdWorker) TGBotButtonQuery(tgservice *service.Telegram, conf *TGBotCommandConf, cypressapi *cypress.API, query *tgbotapi.CallbackQuery)
TGBotCommand telegram bot command processor
func (*BotCmdWorker) TGBotCommand ¶
func (botcmdworker *BotCmdWorker) TGBotCommand(tgservice *service.Telegram, conf *TGBotCommandConf, cypressapi *cypress.API, message *tgbotapi.Message)
TGBotCommand telegram bot command processor
func (*BotCmdWorker) UnregTimer ¶
func (botcmdworker *BotCmdWorker) UnregTimer(messageID int, chatID int64)
type TGBotCommandConf ¶
Click to show internal directories.
Click to hide internal directories.