From 03ffdd456aba172541e359a0642e924ffb94d795 Mon Sep 17 00:00:00 2001 From: Rosyid Haryadi Date: Wed, 25 Sep 2024 19:50:54 +0700 Subject: isbusy --- main.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'main.py') diff --git a/main.py b/main.py index 6753a42..345e885 100644 --- a/main.py +++ b/main.py @@ -46,6 +46,7 @@ def sendLog(msg): def handleCommand(messages): + bot.isBusy = True for msg in messages: msg = msg.lower() if msg == 'update': @@ -82,6 +83,7 @@ def handleCommand(messages): msgSend += f'\nDB = {res[0]} rows' bot.sendMessage(msgSend) connn.close() + bot.isBusy = False @repeat(every().day.at("09:00")) @@ -104,7 +106,7 @@ if __name__ == '__main__': logger.info("DB FILE NOT FOUND. CREATING...") initDb() while True: - if not bot.isProcessingPolling and bot.hasNewMessages: + if not bot.isBusy and bot.hasNewMessages: handleCommand(bot.getNewMessages()) else: bot.pollUpdate() -- cgit v1.2.3-70-g09d2