Title: [QUESTION] Async env · Issue #3230 · python-telegram-bot/python-telegram-bot · GitHub
Open Graph Title: [QUESTION] Async env · Issue #3230 · python-telegram-bot/python-telegram-bot
X Title: [QUESTION] Async env · Issue #3230 · python-telegram-bot/python-telegram-bot
Description: Issue I am facing This thing starts async bot in a sync environment. def main() -> None: application = Application.builder().token("TOKEN").build() application.run_polling() if __name__ == "__main__": main() But is there a way to start a...
Open Graph Description: Issue I am facing This thing starts async bot in a sync environment. def main() -> None: application = Application.builder().token("TOKEN").build() application.run_polling() if __name__ == "__main_...
X Description: Issue I am facing This thing starts async bot in a sync environment. def main() -> None: application = Application.builder().token("TOKEN").build() application.run_polling() if __name_...
Opengraph URL: https://github.com/python-telegram-bot/python-telegram-bot/issues/3230
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[QUESTION] Async env","articleBody":"### Issue I am facing\n\nThis thing starts async bot in a sync environment.\r\n```python\r\ndef main() -> None:\r\n application = Application.builder().token(\"TOKEN\").build()\r\n application.run_polling()\r\n\r\nif __name__ == \"__main__\":\r\n main()\r\n```\r\nBut is there a way to start async bot in async environment?\r\nSomething like that??\r\n```python\r\nasync def main() -> None:\r\n application = Application.builder().token(\"TOKEN\").build()\r\n await application.run_polling()\r\n\r\nif __name__ == \"__main__\":\r\n asyncio.run(main())\r\n```\n\n### Traceback to the issue\n\n_No response_\n\n### Related part of your code\n\n_No response_\n\n### Operating System\n\nLinux\n\n### Version of Python, python-telegram-bot & dependencies\n\n```shell\npython-telegram-bot 20.0a4\r\nBot API 6.2\r\nPython 3.7.6 (default, May 7 2022, 13:31:42) [GCC 11.2.0]\n```\n","author":{"url":"https://github.com/searayeah","@type":"Person","name":"searayeah"},"datePublished":"2022-09-10T13:06:19Z","url":"https://github.com/python-telegram-bot/python-telegram-bot/issues/3230"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:68c63042-da57-eca0-38cc-02dafd09efcd |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A776:1148D3:4A59D06:5E88ADA:6B025F06 |
| html-safe-nonce | 052e7e7a7136f04c3e85499433eae63a2f3970f539a1277f304db941effefb69 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNzc2OjExNDhEMzo0QTU5RDA2OjVFODhBREE6NkIwMjVGMDYiLCJ2aXNpdG9yX2lkIjoiNDI3MDU4NjU0NjU3MjM4NjA1NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 924bd022e86eced9562e9247e42d4d183a6e6736ab17acf460aeeba0db8d19b0 |
| hovercard-subject-tag | issue:1368617093 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python-telegram-bot/python-telegram-bot/3230/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a3c80faf39e6c127a9c4a50372abc0a271070a345c3095c01406d3e0f9fb44e8/python-telegram-bot/python-telegram-bot/issues/3230 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a3c80faf39e6c127a9c4a50372abc0a271070a345c3095c01406d3e0f9fb44e8/python-telegram-bot/python-telegram-bot/issues/3230 |
| og:image:alt | Issue I am facing This thing starts async bot in a sync environment. def main() -> None: application = Application.builder().token("TOKEN").build() application.run_polling() if __name__ == "__main_... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | searayeah |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| go-import | github.com/python-telegram-bot/python-telegram-bot git https://github.com/python-telegram-bot/python-telegram-bot.git |
| octolytics-dimension-user_id | 16178365 |
| octolytics-dimension-user_login | python-telegram-bot |
| octolytics-dimension-repository_id | 38696925 |
| octolytics-dimension-repository_nwo | python-telegram-bot/python-telegram-bot |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 38696925 |
| octolytics-dimension-repository_network_root_nwo | python-telegram-bot/python-telegram-bot |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width