summaryrefslogtreecommitdiff
path: root/samples/inline-keyboard
diff options
context:
space:
mode:
Diffstat (limited to 'samples/inline-keyboard')
-rw-r--r--samples/inline-keyboard/src/main.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/samples/inline-keyboard/src/main.cpp b/samples/inline-keyboard/src/main.cpp
index 0976989..70cf7c7 100644
--- a/samples/inline-keyboard/src/main.cpp
+++ b/samples/inline-keyboard/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());
@@ -41,13 +39,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();
}