Bigger and better rewrite.

This commit is contained in:
Matt Burchett 2020-05-17 01:31:17 -05:00
parent dc7febd2ad
commit d6ed947bb9

View File

@ -46,8 +46,8 @@ func (tb *Bot) Handler() {
tb.Bot.HandleMessage("/admin chatID", tb.chatID) tb.Bot.HandleMessage("/admin chatID", tb.chatID)
// Help // Help
tb.Bot.HandleMessage("/help", "USAGE:\n\n/movie <Movie Name> or /m <Movie Name>\n/show <TV Show Name> or /s <TV Show Name>\n\nEXAMPLES:\n\n/s The Walking Dead\n/m Avatar") tb.Bot.HandleMessage("/help$", tb.helpHandler)
tb.Bot.HandleMessage("/h", "USAGE:\n\n/movie <Movie Name> or /m <Movie Name>\n/show <TV Show Name> or /s <TV Show Name>\n\nEXAMPLES:\n\n/s The Walking Dead\n/m Avatar") tb.Bot.HandleMessage("/h$", tb.helpHandler)
// Callback Handler // Callback Handler
tb.Bot.HandleCallback(tb.callbackHandler) tb.Bot.HandleCallback(tb.callbackHandler)
@ -67,3 +67,7 @@ func (tb *Bot) callbackHandler(cq *tbot.CallbackQuery) {
tb.Client.EditMessageText(tb.CallbackChatID, tb.CallbackMessageID, "Callback received.") tb.Client.EditMessageText(tb.CallbackChatID, tb.CallbackMessageID, "Callback received.")
tb.Client.SendMessage(tb.CallbackChatID, cq.Data) tb.Client.SendMessage(tb.CallbackChatID, cq.Data)
} }
func (tb *Bot) helpHandler(m *tbot.Message) {
tb.Client.SendMessage(m.Chat.ID, "USAGE:\n\n/movie <Movie Name> or /m <Movie Name>\n/show <TV Show Name> or /s <TV Show Name>\n\nEXAMPLES:\n\n/s The Walking Dead\n/m Avatar")
}