From 8720e79422cdefb6a7f91206116e295141e86afb Mon Sep 17 00:00:00 2001 From: shoopea Date: Mon, 22 Jun 2020 11:02:04 +0200 Subject: [PATCH] test --- bot.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/bot.go b/bot.go index 3500be7..ed506a2 100644 --- a/bot.go +++ b/bot.go @@ -8,6 +8,9 @@ import ( func BotHandlers(b *tb.Bot) { + b.Handle("/pause", botPause) + b.Handle("/unpause", botUnpause) + b.Handle(tb.OnPhoto, botPhoto) b.Handle(tb.OnChannelPost, botChannelPost) b.Handle(tb.OnQuery, botQuery) @@ -17,6 +20,16 @@ func BotHandlers(b *tb.Bot) { b.Start() } +func botPause(m *tb.Message) { + forcePaused = true + return +} + +func botUnpause(m *tb.Message) { + forcePaused = false + return +} + func PrintText(m *tb.Message) { logInfoDebug("[%d] %s(%d) | %s(%d) : %s\n", m.ID, m.Chat.Title, m.Chat.ID, m.Sender.Username, m.Sender.ID, m.Text) return