-
|
Consider the code below import asyncio
from os import environ
from telegram.ext import ApplicationBuilder
TELEGRAM_BOT_TOKEN = environ['TELEGRAM_BOT_TOKEN']
async def main():
await asyncio.sleep(1)
app = ApplicationBuilder().token(TELEGRAM_BOT_TOKEN).build()
app.run_polling()
if __name__ == '__main__':
asyncio.run(main())The library throws an error How would I achieve the correct behavior? |
Beta Was this translation helpful? Give feedback.
Answered by
antsif-a
Aug 10, 2025
Replies: 1 comment
-
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
antsif-a
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Found solution: https://github.com/python-telegram-bot/python-telegram-bot/wiki/Frequently-requested-design-patterns#running-ptb-alongside-other-asyncio-frameworks