Bibo-Joshi
5e24765bbc
Escape Backslashes in escape_markdown
( #3055 )
2022-05-21 16:54:11 +02:00
Bibo-Joshi
2175af6abc
Apply isort
and Update pre-commit.ci Configuration ( #3049 )
2022-05-19 15:10:08 +02:00
Bibo-Joshi
ca4e4c6280
Drop Support for ujson
( #3037 )
2022-05-19 12:47:53 +02:00
Bibo-Joshi
d2cabcaa74
Adjust pre-commit
Settings for isort
( #3043 )
2022-05-18 17:23:00 +02:00
tal66
076955d04d
Make PTB Specific Keyword-Only Arguments for PTB Specific in Bot methods ( #3035 )
...
* Introduce keyword-only arguments in Bot methods
* partial code review fix
* tests, code rev changes
* flake8
* tests, code rev, more shortcut methods
* One more iteration on `check_shortcut_signature`
* Update tests/conftest.py
Co-authored-by: Harshil <37377066+harshil21@users.noreply.github.com>
Co-authored-by: Hinrich Mahler <22366557+Bibo-Joshi@users.noreply.github.com>
Co-authored-by: Harshil <37377066+harshil21@users.noreply.github.com>
2022-05-18 17:18:44 +02:00
Bibo-Joshi
c1041655f6
Adjust Equality Comparisons to Fit Bot API 6.0 ( #3033 )
2022-05-18 07:48:20 +02:00
Bibo-Joshi
5e924014de
Add Tuple Based Version Info and Rename telegram.bot_api_version
to telegram.__bot_api_version__
( #3030 )
2022-05-14 15:50:12 +02:00
Aditya Yadav
1f7efe4519
Rename Job.context
to Job.data
( #3028 )
2022-05-12 19:26:03 +02:00
Bibo-Joshi
e47d18c9ec
Remove Client-Side Parameter Validation ( #3024 )
2022-05-12 19:20:24 +02:00
Bibo-Joshi
65bbea780a
Rename Handler
to BaseHandler
( #3019 )
2022-05-12 18:18:40 +02:00
Harshil
be8f4f7aad
Don't Pass Default Values of Optional Parameters to Telegram ( #2978 )
2022-05-09 19:30:46 +02:00
Bibo-Joshi
d917404de1
Adjust Tests to Changed API Behavior ( #3002 )
2022-05-07 21:47:50 +02:00
Hinrich Mahler
95d6272d20
Bump version to v20.0a0
2022-05-06 19:03:54 +02:00
Bibo-Joshi
950d9a0751
Extend Code Formatting With Black ( #2972 )
2022-05-06 18:22:35 +02:00
Bibo-Joshi
62cbd11f14
Adapt Tests to Changed Bot.get_file
Behavior ( #2995 )
2022-05-06 18:22:34 +02:00
Harshil
335772568f
Update and Expand Tests & pre-commit Settings and Improve Code Quality ( #2925 )
...
Co-authored-by: Hinrich Mahler <22366557+Bibo-Joshi@users.noreply.github.com>
2022-05-06 18:22:34 +02:00
Harshil
e10f9164fe
API 6.0 ( #2956 )
...
Co-authored-by: Hinrich Mahler <22366557+Bibo-Joshi@users.noreply.github.com>
2022-05-06 18:22:34 +02:00
Bibo-Joshi
823d030c2c
Use enums for dynamic types & rename two attributes in ChatMember ( #2817 )
2022-05-06 18:21:36 +02:00
Bibo-Joshi
36888a7c47
Fix a Bug in ChatMemberUpdated.difference
( #2947 )
2022-05-06 18:21:36 +02:00
Poolitzer
97281da351
Add Convenience Shortcuts ChatPermissions.{all, no}_permissions
( #2948 )
2022-05-06 18:20:58 +02:00
Harshil
7c113f5c75
Expand and Adjust filters.{Document, Sticker}
( #2922 )
...
Co-authored-by: Hinrich Mahler <22366557+Bibo-Joshi@users.noreply.github.com>
2022-05-06 18:19:15 +02:00
Bibo-Joshi
42eaa67fd5
Switch to asyncio
( #2731 )
...
Co-authored-by: tsnoam <tsnoam@gmail.com>
Co-authored-by: Harshil <37377066+harshil21@users.noreply.github.com>
Co-authored-by: Poolitzer <25934244+Poolitzer@users.noreply.github.com>
2022-05-06 18:19:15 +02:00
Harshil
a743726b08
Persistence of Bots
: Refactor Automatic Replacement and Integration with TelegramObject
( #2893 )
2022-05-06 18:19:15 +02:00
Harshil
835434c12f
Return Plain Dicts from BasePersistence.get_*_data ( #2873 )
2022-05-06 18:19:15 +02:00
murugu-21
778eadbe7c
Replace git.io Links ( #2872 )
...
Co-authored-by: Harshil <37377066+harshil21@users.noreply.github.com>
Co-authored-by: Bibo-Joshi <22366557+Bibo-Joshi@users.noreply.github.com>
2022-05-06 18:19:15 +02:00
DonalDuck004
9c9b133ed2
Add Dispatcher.migrate_chat_data ( #2848 )
...
Co-authored-by: Bibo-Joshi <22366557+Bibo-Joshi@users.noreply.github.com>
Co-authored-by: Harshil <37377066+harshil21@users.noreply.github.com>
2022-05-06 18:19:14 +02:00
Harshil
8560af9c4f
Remove telegram.ReplyMarkup ( #2870 )
2022-05-06 18:19:14 +02:00
Harshil
0ccd7d40ac
Add Method drop_chat/user_data to Dispatcher and Persistence ( #2852 )
2022-05-06 18:19:14 +02:00
Harshil
e442782d8f
Fix failing animation tests ( #2865 )
2022-05-06 18:19:14 +02:00
Harshil
f4147fb583
Improve Code Quality & Test Suite ( #2843 )
2022-05-06 18:19:14 +02:00
Harshil
9354db7c19
Defaults.protect_content ( #2840 )
2022-05-06 18:19:14 +02:00
Bibo-Joshi
0a6cc7f722
Documentation Fixes & Improvements ( #2822 )
...
Co-authored-by: Harshil <37377066+harshil21@users.noreply.github.com>
2022-05-06 18:19:14 +02:00
Bibo-Joshi
6382361161
Improve Job.__getattr__ ( #2832 )
2022-05-06 18:19:14 +02:00
Harshil
5891db2f6b
Add Dispatcher.add_handlers ( #2823 )
...
Co-authored-by: Bibo-Joshi <22366557+Bibo-Joshi@users.noreply.github.com>
2022-05-06 18:19:14 +02:00
Bibo-Joshi
9a8c76fc2b
Improve Error Messages in CommandHandler.__init__ ( #2837 )
2022-05-06 18:19:14 +02:00
Harshil
89d5310504
Use __all__ Consistently ( #2805 )
2022-05-06 18:19:13 +02:00
Bibo-Joshi
de85eec674
Convenience Functionality for ChatInviteLinks ( #2782 )
2022-05-06 18:19:13 +02:00
Harshil
9b56be44b4
Update pre-commit Settings & Improve a Test ( #2796 )
2022-05-06 18:19:13 +02:00
Simon Damberg
28c8c155ce
Improve Subscription of TelegramObject ( #2719 )
...
Co-authored-by: Hinrich Mahler <22366557+Bibo-Joshi@users.noreply.github.com>
Co-authored-by: Harshil <37377066+harshil21@users.noreply.github.com>
2022-05-06 18:19:13 +02:00
Bibo-Joshi
55e8c38e50
Improve Code Quality ( #2783 )
2022-05-06 18:19:13 +02:00
Harshil
145d04230b
Overhaul of Filters ( #2759 )
2022-05-06 18:19:13 +02:00
Poolitzer
b852a6866d
Refactor Warnings in ConversationHandler ( #2755 , #2784 )
2022-05-06 18:19:13 +02:00
Harshil
42df3f471d
Update Exceptions for Immutable Attributes ( #2749 )
2022-05-06 18:19:13 +02:00
Zisis Pavloudis
6f9e733f58
Introduce TelegramObject.set/get_bot ( #2712 )
2022-05-06 18:19:13 +02:00
Bibo-Joshi
0e60d56f53
Introduce Enums for telegram.constants ( #2708 )
2022-05-06 18:19:13 +02:00
eldbud
7e51901d51
Refactor MRO of InputMedia* and Some File-Like Classes ( #2717 )
2022-05-06 18:19:13 +02:00
eldbud
59014bee64
Make Tests Agnostic of the CWD ( #2727 )
2022-05-06 18:19:12 +02:00
Bibo-Joshi
0cb8d50aea
Accept File Paths for Updater/DispatcherBuilder.private_key ( #2724 )
2022-05-06 18:19:12 +02:00
Kenneth Cheo
5275c45199
Mark Internal Modules As Private ( #2687 )
...
Co-authored-by: Hinrich Mahler <22366557+Bibo-Joshi@users.noreply.github.com>
2022-05-06 18:19:12 +02:00
Bibo-Joshi
7afce46d9f
Introduce Builder Pattern for Updater and Dispatcher ( #2646 )
2022-05-06 18:19:12 +02:00
Philipp
99581abe05
Add Filters.update.edited ( #2705 )
2022-05-06 18:19:11 +02:00
eldbud
1edfa1504c
Handle Filepaths via the Pathlib Module ( #2688 )
2022-05-06 18:19:11 +02:00
Harshil
267d4e8191
Improve Signature Inspection for Bot Methods ( #2686 )
2022-05-06 18:19:11 +02:00
Bibo-Joshi
90b82eed99
Pass Failing Jobs to Error Handlers ( #2692 )
2022-05-06 18:19:11 +02:00
Bibo-Joshi
f0efb14e6d
Move Defaults to telegram.ext ( #2648 )
2022-05-06 18:19:11 +02:00
Bibo-Joshi
ce94651490
Make InlineQuery.answer Raise ValueError ( #2675 )
2022-05-06 18:19:11 +02:00
Bibo-Joshi
c440c255a7
Clear Up Import Policy ( #2671 )
...
Co-authored-by: Harshil <37377066+harshil21@users.noreply.github.com>
2022-05-06 18:19:11 +02:00
Harshil
f6497093ce
Warnings Overhaul ( #2662 )
2022-05-06 18:19:11 +02:00
Bibo-Joshi
7528503794
Refine Dispatcher.dispatch_error ( #2660 )
...
Co-authored-by: Harshil <37377066+harshil21@users.noreply.github.com>
2022-05-06 18:19:11 +02:00
Harshil
afcff83ebc
Add User Friendly Type Check For Init Of {Inline, Reply}KeyboardMarkup ( #2657 )
2022-05-06 18:19:10 +02:00
Bibo-Joshi
8f0031e9c8
Remove Deprecated Functionality ( #2644 , #2740 , #2745 )
2022-05-06 18:19:10 +02:00
Harshil
5c500fb6fd
Fix Signatures and Improve test_official ( #2643 )
2022-05-06 18:19:10 +02:00
Poolitzer
641f931f19
Drop Non-CallbackContext API ( #2617 )
2022-05-06 18:19:10 +02:00
Ankit Raibole
4d493aff16
Remove day_is_strict argument of JobQueue.run_monthly ( #2634 )
...
Co-authored-by: Hinrich Mahler <22366557+Bibo-Joshi@users.noreply.github.com>
2022-05-06 18:19:10 +02:00
Harshil
b4ea5557ac
Remove __dict__
from __slots__
and drop Python 3.6 ( #2619 , #2636 )
2022-05-06 18:19:10 +02:00
Bibo-Joshi
be441d56f9
Refactor Initialization of Persistence Classes ( #2604 )
2022-05-06 18:19:09 +02:00
Stɑrry Shivɑm
633b7e7762
Make BasePersistence Methods Abstract ( #2624 )
...
Signed-off-by: starry69 <starry369126@outlook.com>
Co-authored-by: Hinrich Mahler <22366557+Bibo-Joshi@users.noreply.github.com>
2022-05-06 18:19:09 +02:00
Harshil
4a329aa4da
Move and Rename TelegramDecryptionError to telegram.error.PassportDecryptionError ( #2621 )
2022-05-06 18:19:09 +02:00
Harshil
a35ecf4065
API 5.7 ( #2881 )
2022-02-02 21:05:46 +01:00
Harshil
e6d9f3d057
Update Copyright to 2022 ( #2836 )
2022-01-03 08:15:18 +01:00
Harshil
98bf378c6e
API 5.6 ( #2835 )
2022-01-03 08:13:33 +01:00
Bibo-Joshi
cb95868c4a
Api 5.5 ( #2809 )
...
Co-authored-by: poolitzer <github@poolitzer.eu>
Co-authored-by: Harshil <37377066+harshil21@users.noreply.github.com>
2021-12-11 15:21:56 +01:00
Bibo-Joshi
e4dc80f41d
API 5.4 ( #2767 )
...
Co-authored-by: poolitzer <25934244+Poolitzer@users.noreply.github.com>
2021-11-08 19:02:20 +01:00
Yan
c3e3bb77e5
Fix camelCase Functions in ExtBot ( #2659 )
...
Co-authored-by: Bibo-Joshi <22366557+Bibo-Joshi@users.noreply.github.com>
2021-09-15 17:07:11 +02:00
DonalDuck004
a25c76e6a3
Fix Empty Captions not Being Passed by Bot.copy_message ( #2651 )
2021-09-09 07:50:04 +02:00
Mehdi
0c5085022c
Fix Setting Thumbs When Uploading A Single File ( #2583 )
...
* Update request.py
If the media has a thumb, we also need to attach it to the data.
* Add test
* Editing syntax
* Debug test
* update request.py
* Update test_inputmedia.py
* Update test_inputmedia.py
* Update test_inputmedia.py
Fix test.
* Update AUTHORS.rst
Adding my name!
* Update AUTHORS.rst
2021-08-11 08:34:47 +02:00
Bibo-Joshi
1fdaaac809
Fix Bug in BasePersistence.insert/replace_bot for Objects with __dict__ not in __slots__ ( #2603 )
...
* More special cases with slots
* Fix failing tests
2021-07-24 17:17:25 +02:00
Bibo-Joshi
ed147813ab
API 5.3 ( #2572 )
...
* BotCommandScopes
* pre-commit
* typo
Co-authored-by: Harshil <37377066+harshil21@users.noreply.github.com>
* rename kickChatMember & getChatMembersCount method
Signed-off-by: starry69 <starry369126@outlook.com>
* add `language_code` and `scope` to `get/set_my_commands`
and add `delete_my_commands()`
* add `input_field_placeholder` to replykeyboardmarkup.py and forcereply.py
also improved/fixed docs along the way
* showcase `input_field_placeholder` in conversationbot.py
* review 1
'i will not go away' has gone away 😢
* deprecate `Bot.commands` and make sure its only used for default scope
* review 2 (use constants for scope)
* Review
Signed-off-by: starry69 <starry369126@outlook.com>
* doc updates
* New ChatMember classes
Signed-off-by: starry69 <starry369126@outlook.com>
* Address review
Signed-off-by: starry69 <starry369126@outlook.com>
* add versionadded tags again
Signed-off-by: starry69 <starry369126@outlook.com>
* Improve tests & add a deprecation note to ChatMember
* test_official
* Documentation tweaks
* Bump bot api version number
* but bot
* Rename chat shortcuts
Signed-off-by: starry69 <starry369126@outlook.com>
* deepsource
Signed-off-by: starry69 <starry369126@outlook.com>
* add missing slot in botcommandscope & missing slot tests
Co-authored-by: Harshil <37377066+harshil21@users.noreply.github.com>
Co-authored-by: starry69 <starry369126@outlook.com>
Co-authored-by: Harshil <ilovebhagwan@gmail.com>
2021-07-01 17:45:19 +02:00
Harshil
9aec8deec6
Stabilize CI ( #2575 )
...
* attempt 'surely this one' on fixing test_idle and test_depr_warnings
* remove unused filterwarnings
2021-06-26 22:19:59 +02:00
zeroone2numeral2
105f1ccdb5
Better Exception-Handling for BasePersistence.replace/insert_bot ( #2564 )
...
* Catch exceptions raised while copying __dict__/__slots__ in BasePersistence.replace/insert_bot()
Also updated the docstrings to reflect the changes in behavior with unexpected errors
* Tests: added to CustomClass immutable object that would trigger a setattr() exception
* Tests: added new uuid_ property to own CustomClass methods
* Updated AUTHORS.rst
* Revert "Tests: added new uuid_ property to own CustomClass methods"
This reverts commit 9e67463cf7
.
* Revert "Tests: added to CustomClass immutable object that would trigger a setattr() exception"
This reverts commit 1c258304
* Removed unneeded Exception cast to string
f-string will perform the string-ification on their own
* Removed another unneeded Exception cast to string
* Added test to parse unparsable objects in __dict__ or __slots__
* Applied black and pylint style suggestions
All lint tests passed
* Fix typo
Co-authored-by: Harshil <37377066+harshil21@users.noreply.github.com>
Co-authored-by: Bibo-Joshi <hinrich.mahler@freenet.de>
Co-authored-by: Harshil <37377066+harshil21@users.noreply.github.com>
2021-06-20 22:14:05 +02:00
Bibo-Joshi
52ce03929b
Fix Bug in BasePersistence.insert/replace_bot for Objects with __dict__ in their slots ( #2561 )
...
* Handle objects with __dict__ in __slots__
* Rework
2021-06-13 15:07:40 +02:00
Bibo-Joshi
ac4768155f
Remove Incorrect Warning About Defaults and ExtBot ( #2553 )
...
* Don't throw warning when passing defaults to ExtBot
* Review
2021-06-10 12:03:44 +02:00
Bibo-Joshi
8531a7a40c
Arbitrary callback_data ( #1844 )
2021-06-06 11:48:48 +02:00
Bibo-Joshi
fce7cc903c
Add ContextTypes & BasePersistence.refresh_user/chat/bot_data ( #2262 )
2021-06-06 10:37:53 +02:00
GauthamramRavichandran
5da1dd7ce9
Add max_connections Parameter to Updater.start_webhook ( #2547 )
...
* Include max_connections args
* Update docs & add test
Co-authored-by: Hinrich Mahler <hinrich.mahler@freenet.de>
2021-06-06 09:27:45 +02:00
Stɑrry Shivɑm
46cdeb495a
Fix for Promise.done_callback ( #2544 )
...
* Don't call done_cb on exceptions
Signed-off-by: starry69 <starry369126@outlook.com>
* improve docs
Co-authored-by: Bibo-Joshi <hinrich.mahler@freenet.de>
* revert black
Co-authored-by: Bibo-Joshi <hinrich.mahler@freenet.de>
2021-06-05 17:08:45 +02:00
Bibo-Joshi
653691fafb
Improve Slot Tests ( #2541 )
2021-05-30 20:30:26 +02:00
Harshil
92ff6a8e2b
Add __slots__ ( #2345 )
...
Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
Co-authored-by: Hinrich Mahler <hinrich.mahler@freenet.de>
2021-05-29 16:18:16 +02:00
Bibo-Joshi
cc43aef64b
Fix Test Failing Due To Telegram Updates ( #2537 )
...
* Update TestPhoto
* try to fix test_idle again...
* fix test_send_game due to photo size changes...
Co-authored-by: Harshil <ilovebhagwan@gmail.com>
2021-05-28 22:24:43 +02:00
Bibo-Joshi
e2c6d60721
Improve Code Quality ( #2536 )
...
* Start fixing stuff
* More docstrings
* stabilize test_idle
Co-authored-by: Harshil <ilovebhagwan@gmail.com>
2021-05-27 20:34:58 +02:00
Bibo-Joshi
8bf88c3231
Supplement Codacy with DeepSource ( #2454 )
...
* Add deepsource config
* Update Badges
* Update Badges some more
* Stupid change to trigger analysis of all files
* Try to get ignore right
* Update badges again
* Get started on fixing issues
* Fix some more issues
* Remove more plank lines
* Docs for de_json/list & to_dict/json
* Some improvements from deepcode.ai
* Some more improvements
* Some more improvements
* More docstrnigs & let's run DS on the tests just for fun
* Autofix issues in 10 files
Resolved issues in the following files via DeepSource Autofix:
1. tests/conftest.py
2. tests/test_bot.py
3. tests/test_commandhandler.py
4. tests/test_conversationhandler.py
5. tests/test_dispatcher.py
6. tests/test_filters.py
7. tests/test_inputmedia.py
8. tests/test_messagehandler.py
9. tests/test_official.py
10. tests/test_persistence.py
* Some more improvements for tests, but that shall be enough
* Some more docstrings for functions
* Some minor stuff, try to fix tests
* Update DS config
* Still more docs
* Doc fixes
* More fixes
* Fix: indent docstring
* Some fixes
* Revert "Stupid change to trigger analysis of all files"
This reverts commit dd46c260
* Review
Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
Co-authored-by: Poolitzer <25934244+Poolitzer@users.noreply.github.com>
2021-05-27 09:38:17 +02:00
Poolitzer
1572c61063
Increase Test Coverage of CallbackQueryHandler ( #2520 )
...
* Test: let's see
* Test: let's see, now in the correct place
* Fix: Explicitly return None in else clause
also documented this behaviour clearly in the docstring
* add link in doc
Co-authored-by: Bibo-Joshi <hinrich.mahler@freenet.de>
* Fix: remove unnecessary else statement
Co-authored-by: Bibo-Joshi <hinrich.mahler@freenet.de>
2021-05-27 09:37:37 +02:00
Harshil
5ff3b76e18
Stabilize CI ( #2522 )
...
* asking the test what is wrong with them
* fix botscore_not_modified tests for good
* xfail game tests due to race conditions
* address review (add a comment)
* fix xfail marker
* address review
* simplify expression
2021-05-19 13:33:41 +02:00
Poolitzer
cd69f69b28
Add Filters.attachment ( #2528 )
...
* feat: attachment filter
* fix: add versionadded statement
* Fix: small doc string changes
Co-authored-by: Bibo-Joshi <hinrich.mahler@freenet.de>
Co-authored-by: Bibo-Joshi <hinrich.mahler@freenet.de>
2021-05-19 10:39:10 +02:00
Poolitzer
8b0d2e5f75
Add pattern Argument to ChosenInlineResultHandler ( #2517 )
...
* Feat: add pattern arg to ChosenInlineResultHandler
* Fix: remove unnecessary if clause
the attribute must be present, since it's not optional.
* Fix: wrong type documentation
Co-authored-by: Bibo-Joshi <hinrich.mahler@freenet.de>
* Fix: Addressing code review
small documentation fixes, and moving one test.
* Fix: link to matches
Co-authored-by: Bibo-Joshi <hinrich.mahler@freenet.de>
* Fix: also link here
Co-authored-by: Bibo-Joshi <hinrich.mahler@freenet.de>
2021-05-19 10:32:11 +02:00
Nikolai Krivenko
7d0fb85c8c
Fix send_phone_number_to_provider argument for Bot.send_invoice ( #2527 )
...
* [#2526 ] set data['send_phone_number_to_provider'] from corresponding variable
* [#2526 ] Add myself to AUTHORS.rst
* Add unit test
Co-authored-by: Hinrich Mahler <hinrich.mahler@freenet.de>
2021-05-16 20:56:28 +02:00
Bibo-Joshi
08ba7c7793
Handle Classes as Input for BasePersistence.replace/insert_bot ( #2523 )
...
* Ignore classes on replace/insert_bot
* Review
2021-05-16 20:02:35 +02:00
Bibo-Joshi
9737b1d3c7
Bump Tornado Version and Remove Workaround from #2067 ( #2494 )
2021-05-05 20:59:06 +02:00
Harshil
b20265819b
Stabilize CI ( #2480 )
...
* mark some occasionally failing tests as flaky
* fix test which was failing locally for some reason
* Don't fail tests if they've exceeded the timeout
* This reverts commit 1d0f982e95
.
* remove flaky on two tests as per review
* the end of timeout failures, hopefully.
* first run successful. Fixing pre-commit to trigger 2nd run.
2021-04-30 10:43:52 +02:00
Bibo-Joshi
3938a57542
Convenience Utilities & Example for Handling ChatMemberUpdated ( #2490 )
...
* ChatMemberUpdate.difference
* constants for update types
* Add an example for ChatMemberHandler
* Update examples/chatmemberbot.py
* Review
* Review
2021-04-30 10:14:41 +02:00