Title: [BUG] Subscription: Doesn't work for `'from'` & Other Improvements · Issue #2709 · python-telegram-bot/python-telegram-bot · GitHub
Open Graph Title: [BUG] Subscription: Doesn't work for `'from'` & Other Improvements · Issue #2709 · python-telegram-bot/python-telegram-bot
X Title: [BUG] Subscription: Doesn't work for `'from'` & Other Improvements · Issue #2709 · python-telegram-bot/python-telegram-bot
Description: Steps to Reproduce get an instance of Message run message['from'], message['from_user'] and message['false_key'] the first gives None, the second gives the user, the 3rd gives None Expected behaviour both message['from'] and message['fro...
Open Graph Description: Steps to Reproduce get an instance of Message run message['from'], message['from_user'] and message['false_key'] the first gives None, the second gives the user, the 3rd gives None Expected behavio...
X Description: Steps to Reproduce get an instance of Message run message['from'], message['from_user'] and message['false_key'] the first gives None, the second gives the user, the 3rd giv...
Opengraph URL: https://github.com/python-telegram-bot/python-telegram-bot/issues/2709
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[BUG] Subscription: Doesn't work for `'from'` & Other Improvements","articleBody":"### Steps to Reproduce\n\n1. get an instance of `Message`\r\n2. run `message['from']`, `message['from_user']` and `message['false_key']`\r\n3. the first gives `None`, the second gives the user, the 3rd gives `None`\r\n\n\n### Expected behaviour\n\n1. both `message['from']` and `message['from_user']` return the user\r\n2. `message['false_key']` raises `KeyError`. This behavior was apparently lost in #2345 for some reason\n\n### Actual behaviour\n\n1. `message['from']` gives `None`\r\n2. `message['from_user']` return the user\r\n3. `message['false_key']` returns `None`\n\n### Operating System\n\nAny\n\n### Version of Python, python-telegram-bot & dependencies\n\n```shell\nbranches master and v14\n```\n\n\n### Relevant log output\n\n_No response_\n\n### Additional Context\n\n* This is easy to fix by adapting `TelegramObject.__getitem__` to raise `KeyError` when the attribute is not found and introducing a special case where `obj['from']` looks up `'from_user'`.\r\n\r\n* In addition, `Message` overrides `__getitem__`, but this is actually not necessary. This should be removed.\r\n* A PR for this should be based on v14. see #2681","author":{"url":"https://github.com/Bibo-Joshi","@type":"Person","name":"Bibo-Joshi"},"datePublished":"2021-10-07T15:02:39Z","url":"https://github.com/python-telegram-bot/python-telegram-bot/issues/2709"}
| 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:8c702510-2343-ec46-83a3-e8d2a11c4f3e |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CF6C:E0ADF:28300F0:327A3F3:6B027811 |
| html-safe-nonce | c9a4ce78ea66eb2326e377a371d3065fd09fcf23f806bc50b30051237b6cea62 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDRjZDOkUwQURGOjI4MzAwRjA6MzI3QTNGMzo2QjAyNzgxMSIsInZpc2l0b3JfaWQiOiI3NTY0NjM1Njg0NDUyMDcxNDQxIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | f2527dd4bda0520fe97bb3313b5ecd94719b7ca4f30517f1165a916ff5315f15 |
| hovercard-subject-tag | issue:1020150025 |
| 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/2709/issue_layout |
| twitter:image | https://opengraph.githubassets.com/98c83eb23474755d7316b8ad937de39ce0f92491b1ea0357c0826303f392269d/python-telegram-bot/python-telegram-bot/issues/2709 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/98c83eb23474755d7316b8ad937de39ce0f92491b1ea0357c0826303f392269d/python-telegram-bot/python-telegram-bot/issues/2709 |
| og:image:alt | Steps to Reproduce get an instance of Message run message['from'], message['from_user'] and message['false_key'] the first gives None, the second gives the user, the 3rd gives None Expected behavio... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Bibo-Joshi |
| 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