diff options
author | Rosyid Haryadi <rosyid_haryadi@protonmail.com> | 2024-09-25 19:50:54 +0700 |
---|---|---|
committer | Rosyid Haryadi <rosyid_haryadi@protonmail.com> | 2024-09-25 19:50:54 +0700 |
commit | 03ffdd456aba172541e359a0642e924ffb94d795 (patch) | |
tree | 9e8c01bbf8e2376155162d35c207fd2b7c84ea6d /main.py | |
parent | 899d75d5165b7156dfece893523a7131232a195a (diff) |
isbusymain
Diffstat (limited to 'main.py')
-rw-r--r-- | main.py | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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() |