From 2234450b81e3451a3e14686e80e13e66cf6d2a4a Mon Sep 17 00:00:00 2001 From: Oleg Morozenkov Date: Thu, 26 Jul 2018 00:03:15 +0300 Subject: Test on old ubuntu --- samples/photo/src/main.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'samples/photo') diff --git a/samples/photo/src/main.cpp b/samples/photo/src/main.cpp index 03ca437..cca31f0 100644 --- a/samples/photo/src/main.cpp +++ b/samples/photo/src/main.cpp @@ -8,8 +8,6 @@ using namespace std; using namespace TgBot; -bool sigintGot = false; - int main() { string token(getenv("TOKEN")); printf("Token: %s\n", token.c_str()); @@ -27,13 +25,15 @@ int main() { signal(SIGINT, [](int s) { printf("SIGINT got\n"); - sigintGot = true; + exit(0); }); + try { printf("Bot username: %s\n", bot.getApi().getMe()->username.c_str()); + bot.getApi().deleteWebhook(); TgLongPoll longPoll(bot); - while (!sigintGot) { + while (true) { printf("Long poll started\n"); longPoll.start(); } -- cgit v1.2.3