Skip to content

Commit 69f3852

Browse files
committed
Enabled or disable bot debug by telegram command. It will be library feature.
1 parent de41459 commit 69f3852

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/UniversalTelegramBot.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,14 @@ int UniversalTelegramBot::getUpdates(long offset) {
331331
messages[newMessageIndex].from_name = from_name;
332332

333333
newMessageIndex++;
334+
335+
if (text == "/debug_bot_on") {
336+
_debug = true;
337+
UniversalTelegramBot::sendMessage(chat_id, "Debug mode of Bot ENABLED");
338+
} else if (text == "/debug_bot_off") {
339+
_debug = false;
340+
UniversalTelegramBot::sendMessage(chat_id, "Debug mode of Bot DISABLED");
341+
}
334342
}
335343
}
336344
return newMessageIndex;

0 commit comments

Comments
 (0)