Replies: 3 comments 6 replies
-
@Olegt0rr help |
Beta Was this translation helpful? Give feedback.
6 replies
-
Don't use threads for this. |
Beta Was this translation helpful? Give feedback.
0 replies
-
I know its quite late but i fixed it like this: import asyncio
async def start_raid_bot():
dp_bot1 = Dispatcher()
dp_bot1.include_router(raid_router)
await dp_bot1.start_polling(bot1)
async def start_trend_bot():
dp_bot2 = Dispatcher()
dp_bot2.include_router(router_trend_bot)
await dp_bot2.start_polling(bot2)
async def main():
asyncio.create_task(confirm_payment_and_inform_user())
task_bot1 = asyncio.create_task(start_raid_bot())
task_bot2 = asyncio.create_task(start_trend_bot())
await task_bot1
await task_bot2
if __name__ == "__main__":
asyncio.run(main()) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
bot = Bot(token='token1',parse_mode = 'HTML')
dp = Dispatcher(bot,storage = MemoryStorage())
bot1 = Bot(token='token2',parse_mode = 'HTML')
dp1 = Dispatcher(bot1,storage = MemoryStorage())
I have two bots, tell me how to run them in parallel
Beta Was this translation helpful? Give feedback.
All reactions