Conversation
…ryptionError (#2621) * move telegramdecryptionerror to error.py * Change error class name
* feat: add docs about docs * fix: improve looks * fix: make link work * fix: this looks better * Improved markdown, updated link * Less justifying Co-authored-by: Bibo-Joshi <22366557+Bibo-Joshi@users.noreply.github.com>
* Fix incomplete type annotations for CallbackContext Co-authored-by: Hinrich Mahler <22366557+Bibo-Joshi@users.noreply.github.com>
* Feat: Custom pytest marker Co-authored-by: Bibo-Joshi <22366557+Bibo-Joshi@users.noreply.github.com>
* Make basepersistence methods abstractmethod Signed-off-by: starry69 <starry369126@outlook.com> Co-authored-by: Hinrich Mahler <22366557+Bibo-Joshi@users.noreply.github.com>
Co-authored-by: Hinrich Mahler <22366557+Bibo-Joshi@users.noreply.github.com>
# Conflicts: # telegram/ext/conversationhandler.py # telegram/ext/dispatcher.py # telegram/ext/updater.py # tests/conftest.py # tests/test_dispatcher.py # tests/test_jobqueue.py # tests/test_persistence.py # tests/test_updater.py
# Conflicts: # telegram/ext/__init__.py # telegram/ext/dispatcher.py # telegram/utils/promise.py
# Conflicts: # telegram/ext/__init__.py # telegram/ext/callbackcontext.py # telegram/ext/conversationhandler.py # telegram/ext/dispatcher.py # telegram/ext/jobqueue.py # telegram/ext/updater.py # tests/conftest.py # tests/test_dispatcher.py # tests/test_jobqueue.py # tests/test_persistence.py # tests/test_updater.py
tsnoam
requested changes
Sep 17, 2021
Co-authored-by: Harshil <37377066+harshil21@users.noreply.github.com>
# Conflicts: # telegram/ext/jobqueue.py
Bibo-Joshi
commented
Sep 22, 2021
Co-authored-by: Harshil <37377066+harshil21@users.noreply.github.com>
# Conflicts: # examples/deeplinking.py # examples/inlinebot.py # telegram/ext/dispatcher.py # telegram/ext/updater.py # tests/conftest.py # tests/test_dispatcher.py # tests/test_updater.py
# Conflicts: # telegram/bot.py # telegram/ext/__init__.py # telegram/ext/callbackcontext.py # telegram/ext/conversationhandler.py # telegram/ext/dispatcher.py # telegram/ext/extbot.py # telegram/ext/jobqueue.py # telegram/ext/updater.py # tests/conftest.py # tests/test_bot.py # tests/test_dispatcher.py # tests/test_jobqueue.py # tests/test_persistence.py # tests/test_stack.py # tests/test_updater.py
4 tasks
# Conflicts: # examples/passportbot.py # examples/persistentconversationbot.py
tsnoam
approved these changes
Oct 8, 2021
Member
tsnoam
left a comment
There was a problem hiding this comment.
Left 2 minor comments.
PR approved. Merge at will.
| """ | ||
| return self._set_request(request) | ||
|
|
||
| def private_key(self: BuilderType, private_key: bytes, password: bytes = None) -> BuilderType: |
Member
There was a problem hiding this comment.
I think that a really nice touch would be to have private_key accept either bytes (the key itself) or Path|str and then we'll open the file and read the file for the user.
Anyway, lets merge this PR already, and if you like the idea about the private_key, lets do it in another PR.
# Conflicts: # telegram/ext/updater.py
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2556
Notes:
ExtBotBuilderclass. Currently only therequestargument ofExtBotwould profit from with. Then again, the init ofExtBotmay become more complicated in the future if we add more features. If we want to add a corresponding class, we need to think about if we still want to allow for manual instantiation ofExtBotor not …Updatercan be used withoutDispatcher. IMO this emphasizes that both have different tasks and for advanced users it may be helpful to outsource the fetching of updates while doing the processing manually.Dispatcher/Updater.exception_eventproperly documented attributes and they are no longer protected. Whileexception_eventwas probably initially meant as means for private communication betweenUpdaterandDispatcherI do feel like it could be useful to have it more publically available for advaced, custom setups.DefaultContextType = CallbackContext[ExtBot, Dict, Dict, Dict]. This made sence for the type hinting in the builders, but it seemed clever to me to make this also publically available to allow users to improve their type hints.DefaultContextTypeis the correct annotation if you're not using a customContextTypesobject. The import ofDefaultContextTypecan be fine tuned in the context of Clear up imports policy #2468builder.bot(bot)would fail because you already set a token. I quickly gave up on this because it became too excessive. Instead type hinting "only" coversjob_queue,bot,persistence,context_typesincludingbot/chat/user_data. This essentially makes sure that one can get proper type hints for all the attributes of thecontextargument. E.g. now it tells you ifcontext.botistg.BotorExtBotand also ifcontext.job_queueisNoneset_dispatcher/updater_classdon't have proper type hints, i.e. you won't know ifupdaterorupdater/context.dispatcherare instances of subclasses. IISC that's near impossible to get right and users that are so advanced that they want custom subclasses, should be able to handle that …TODO:
Updare/Dispatcher.builder() -> Updater/DispatcherBuilder()and use those in the examplestest_dispatcher/test_less_than_one_worker_warningChecklist for PRs
.. versionadded:: version,.. versionchanged:: versionor.. deprecated:: versionto the docstrings for user facing changes (for methods/class descriptions, arguments and attributes)