Title: [FEATURE] Interruption behaviour of Conversations · Issue #1640 · python-telegram-bot/python-telegram-bot · GitHub
Open Graph Title: [FEATURE] Interruption behaviour of Conversations · Issue #1640 · python-telegram-bot/python-telegram-bot
X Title: [FEATURE] Interruption behaviour of Conversations · Issue #1640 · python-telegram-bot/python-telegram-bot
Description: Issue I am facing Hi, I have faced a problem where I have a few conversations and a few commands: dp.add_handler( ConversationHandler( entry_points=[CommandHandler('command1', command1)], states={ STATE1: [MessageHandler(Filters.text, do...
Open Graph Description: Issue I am facing Hi, I have faced a problem where I have a few conversations and a few commands: dp.add_handler( ConversationHandler( entry_points=[CommandHandler('command1', command1)], states={ ...
X Description: Issue I am facing Hi, I have faced a problem where I have a few conversations and a few commands: dp.add_handler( ConversationHandler( entry_points=[CommandHandler('command1', command1)], s...
Opengraph URL: https://github.com/python-telegram-bot/python-telegram-bot/issues/1640
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[FEATURE] Interruption behaviour of Conversations","articleBody":"\r\n### Issue I am facing\r\nHi, I have faced a problem where I have a few conversations and a few commands:\r\n\r\n```python\r\n\r\n dp.add_handler(\r\n ConversationHandler(\r\n entry_points=[CommandHandler('command1', command1)],\r\n states={\r\n STATE1: [MessageHandler(Filters.text, do_something1)],\r\n },\r\n fallbacks=[AnyHandler(do_something1_fallback)],\r\n allow_reentry=True,\r\n )\r\n )\r\n dp.add_handler(CommandHandler('command2', command2))\r\n dp.add_handler(\r\n ConversationHandler(\r\n entry_points=[CommandHandler('command3, command3)],\r\n states={\r\n STATE2: [MessageHandler(Filters.video, do_something3)],\r\n },\r\n fallbacks=[AnyHandler(do_something3_fallback)],\r\n allow_reentry=True,\r\n )\r\n )\r\n dp.add_handler(AnyHandler(global_fallback))\r\n```\r\n\r\nNow when my bot handles conversation for `command3`, I can easy to interrupt the conversation by entering command2 or command3. But interruption doesn't reset state of conversation for command3.\r\nFor example:\r\n```\r\nU: /command3\r\nB: Send video\r\nU: (sends a text)\r\nB: Send video, please\r\nU: /command1\r\nB: Send text\r\nU: (sends a text)\r\nB: Thanks, I saved it\r\nU: BLABLA\r\nB: Send video, please.\r\n\r\n```\r\n\r\nThe last sentence is not obvious, why I need a video (do_something3_fallback) when I finished the conversation in the middle of full conversational? More generaly I expect to see the result of `global_fallback`.\r\n\r\nMy idea to add a parameter `isolated` to conversational that doesn't allow interruption by any command and when such conversational started than dispatcher can only view handlers of started conversation.\r\n\r\nI know that I can implement it by nesting Conversational Handlers, but then my code looks very ugly and messy.","author":{"url":"https://github.com/hyzyla","@type":"Person","name":"hyzyla"},"datePublished":"2019-11-24T09:30:43Z","url":"https://github.com/python-telegram-bot/python-telegram-bot/issues/1640"}
| 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:5ab947f6-4f3d-bac8-de3a-ca5a838a16ca |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9262:1DF74B:BE56:F1DA:6B027D9A |
| html-safe-nonce | 69d49791e19c0cfed029a03a9ed9af7e9e21d8d94c781b120e0cbd2498fb568b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MjYyOjFERjc0QjpCRTU2OkYxREE6NkIwMjdEOUEiLCJ2aXNpdG9yX2lkIjoiMjI1NzA5MjEzNDMxMjI0NjY4MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 3bf8c40121ca0b28fa6edadc68c8386fd054eb86ba06c78dbe08bcd60979a338 |
| hovercard-subject-tag | issue:527671883 |
| 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/1640/issue_layout |
| twitter:image | https://opengraph.githubassets.com/8c569b266c69ddca924a3aecf8776e18088f1a1d351f93419321cbdb9ce708ba/python-telegram-bot/python-telegram-bot/issues/1640 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/8c569b266c69ddca924a3aecf8776e18088f1a1d351f93419321cbdb9ce708ba/python-telegram-bot/python-telegram-bot/issues/1640 |
| og:image:alt | Issue I am facing Hi, I have faced a problem where I have a few conversations and a few commands: dp.add_handler( ConversationHandler( entry_points=[CommandHandler('command1', command1)], states={ ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | hyzyla |
| 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