Title: [Feature] Improve handling of local mode & docs regarding file handling · Issue #3114 · python-telegram-bot/python-telegram-bot · GitHub
Open Graph Title: [Feature] Improve handling of local mode & docs regarding file handling · Issue #3114 · python-telegram-bot/python-telegram-bot
X Title: [Feature] Improve handling of local mode & docs regarding file handling · Issue #3114 · python-telegram-bot/python-telegram-bot
Description: I suggest to add a flag local_api_server/local_mode/similar naming to the Bot class which can be used to tell ptb that the bot is running against a bot api server in --local mode. Currently the benefit of that would be that we could acce...
Open Graph Description: I suggest to add a flag local_api_server/local_mode/similar naming to the Bot class which can be used to tell ptb that the bot is running against a bot api server in --local mode. Currently the ben...
X Description: I suggest to add a flag local_api_server/local_mode/similar naming to the Bot class which can be used to tell ptb that the bot is running against a bot api server in --local mode. Currently the ben...
Opengraph URL: https://github.com/python-telegram-bot/python-telegram-bot/issues/3114
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Feature] Improve handling of local mode & docs regarding file handling","articleBody":"I suggest to add a flag `local_api_server`/`local_mode`/similar naming to the `Bot` class which can be used to tell ptb that the bot is running against a bot api server in `--local` mode. Currently the benefit of that would be that we could accept file paths in all cases. In local mode, we pass the URI, otherwise we load the contents in binary mode.\r\nIf the local mode has more benefits in the future, we could leveral this setting.\r\n\r\nWhat do the other team members think about this?\r\n\r\nAdditionally, we should unify the documentation on how files are handled.\r\nSome of the classes/methods that accept file input have a note like [here](https://python-telegram-bot.readthedocs.io/en/stable/telegram.bot.html#telegram.Bot.send_document), but others don't. Also that note is outdated, as it doesn't explain when a `pathlib.Path` can be passed. It should also mention that we don't support `open(file, 'r')` but only `open(file, 'rb')`. We should either have a unified note that we add everywhere or move this [snippets section](https://github.com/python-telegram-bot/python-telegram-bot/wiki/Code-snippets#working-with-files-and-media) to a standalone page, extend it a bit and point to it from the docs.\r\nI'm slightly in favor of the latter.\r\n\r\nTo avoid repitition of `Note: …` strings in the docs, we can `.. include::` them - see sphinx-doc/sphinx/issues/9939","author":{"url":"https://github.com/Bibo-Joshi","@type":"Person","name":"Bibo-Joshi"},"datePublished":"2022-06-22T15:51:33Z","url":"https://github.com/python-telegram-bot/python-telegram-bot/issues/3114"}
| 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:808a238a-1eb0-4f03-05da-333b1618bae8 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8882:D5B7F:D8B342:11C6395:6B0279CF |
| html-safe-nonce | 827995db0e896a17020bab0f35304d69c966b1747da32cad7582459d1357ae9b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4ODgyOkQ1QjdGOkQ4QjM0MjoxMUM2Mzk1OjZCMDI3OUNGIiwidmlzaXRvcl9pZCI6IjIyNjYwMzAwNTU3NDQ1MDIyMjMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 30056034aabdaeb9fba3348a5c3535bd99f5cf6b6c8db117e695216bbce6e169 |
| hovercard-subject-tag | issue:1280418465 |
| 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/3114/issue_layout |
| twitter:image | https://opengraph.githubassets.com/f5a38464e14bae24b486da6955c79c10bc19b7a5bce484b5dc17a1462e992ba9/python-telegram-bot/python-telegram-bot/issues/3114 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/f5a38464e14bae24b486da6955c79c10bc19b7a5bce484b5dc17a1462e992ba9/python-telegram-bot/python-telegram-bot/issues/3114 |
| og:image:alt | I suggest to add a flag local_api_server/local_mode/similar naming to the Bot class which can be used to tell ptb that the bot is running against a bot api server in --local mode. Currently the ben... |
| 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