added /ping command

This commit is contained in:
Michael Mandl 2018-04-09 20:33:22 +02:00
parent b6d06beebf
commit 968f921398

View file

@ -15,6 +15,15 @@ int main(int argc, char **argv)
settings.wikiUser, settings.wikiPassword); settings.wikiUser, settings.wikiPassword);
tgbot::LongPollBot bot(settings.telegramToken); tgbot::LongPollBot bot(settings.telegramToken);
bot.callback(tgbot::utils::whenStarts, [](
const tgbot::types::Message message,
const tgbot::methods::Api &api,
const std::vector<std::string> args)
{
api.sendMessage(std::to_string(message.chat.id), "pong");
}, "/ping");
bot.callback([&wiki, &settings](const tgbot::types::Message message, bot.callback([&wiki, &settings](const tgbot::types::Message message,
const tgbot::methods::Api &api) const tgbot::methods::Api &api)
{ {