Skip to content
This repository has been archived by the owner on Apr 24, 2024. It is now read-only.

Commit

Permalink
Refactor: enable concurrent updates in bot.py
Browse files Browse the repository at this point in the history
This commit refactors code by adding the `concurrent_updates` argument to the `ApplicationBuilder` method. This enables concurrent updates so that long-running tasks don't block the event loop.
  • Loading branch information
ciuzaak committed Apr 22, 2023
1 parent 6cc141b commit 1c908b7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,8 @@ async def post_init(application: Application):
boot_time = datetime.datetime.now()

print(f'[+] bot started at {boot_time}, calling loop!')
application = ApplicationBuilder().token(token).post_init(post_init).build()
application = ApplicationBuilder().token(token).post_init(
post_init).concurrent_updates(True).build()

handler_list = [
CommandHandler('id', send_id),
Expand Down

0 comments on commit 1c908b7

Please sign in to comment.