From 968f92139801f2fb17fdbe55bb3897fb9e5f489f Mon Sep 17 00:00:00 2001 From: Michael Mandl Date: Mon, 9 Apr 2018 20:33:22 +0200 Subject: [PATCH] added /ping command --- BeezleBot/BeezleBot.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/BeezleBot/BeezleBot.cpp b/BeezleBot/BeezleBot.cpp index c8d86ab..a6c5671 100644 --- a/BeezleBot/BeezleBot.cpp +++ b/BeezleBot/BeezleBot.cpp @@ -15,6 +15,15 @@ int main(int argc, char **argv) settings.wikiUser, settings.wikiPassword); tgbot::LongPollBot bot(settings.telegramToken); + + bot.callback(tgbot::utils::whenStarts, []( + const tgbot::types::Message message, + const tgbot::methods::Api &api, + const std::vector args) + { + api.sendMessage(std::to_string(message.chat.id), "pong"); + }, "/ping"); + bot.callback([&wiki, &settings](const tgbot::types::Message message, const tgbot::methods::Api &api) {