summaryrefslogtreecommitdiff
path: root/samples/echobot-curl-client
diff options
context:
space:
mode:
authorOleg Morozenkov <m@oleg.rocks>2018-07-26 00:03:15 +0300
committerOleg Morozenkov <m@oleg.rocks>2018-07-26 00:03:15 +0300
commit2234450b81e3451a3e14686e80e13e66cf6d2a4a (patch)
tree1eeda88af36566425621c34092df9e63b5749037 /samples/echobot-curl-client
parent399eb75d2af1e641fd80b25d1729ef250a66314a (diff)
Test on old ubuntu
Diffstat (limited to 'samples/echobot-curl-client')
-rw-r--r--samples/echobot-curl-client/src/main.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/samples/echobot-curl-client/src/main.cpp b/samples/echobot-curl-client/src/main.cpp
index 1f376a5..630dad8 100644
--- a/samples/echobot-curl-client/src/main.cpp
+++ b/samples/echobot-curl-client/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());
@@ -30,13 +28,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();
}