* 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
* Document ExtBot.insert_callbakc_data
* fix duplicate object descriptions
Fixed by removing `:undoc-members:` in the affected classes.
Closes https://github.com/sphinx-doc/sphinx/issues/9294
* fix incorrect shortcut docstrings in user.py
* fix object type in forcereply.py
* fix discuss bot link in loginurl.py
* document that message is None for (my)_chat_member
in `effective_message`
* numerous persistence rendering fixes
* move docstring from property setter to property
* Revert "fix object type in forcereply.py"
This reverts commit 012663e0c3.
* Document comparison of jobs
* Update min python version to 3.6.8
* remove old note from chat.py + some return msg fixes
* fix colon placement
Co-authored-by: Harshil <ilovebhagwan@gmail.com>
Co-authored-by: Harshil <37377066+harshil21@users.noreply.github.com>
* 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>
* 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>
* 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>
* 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>
* [#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>
* Bump API Version to v5.2
* InputInvoiceMessageContent & simplify *Markup.__eq__ on the fly
* Updates to send_invoice
* InlineQuery updatees and new parameter for InlineQueryhandler
* VCScheduled - not integrated into Message yet
* Bump requirements-dev.txt versions
* Message.voice_chat_scheduled & new Filters.status_update.vcs
* Some doc updates
* Review
* All praise harshil, the god of finding typos :)
* Review
* More warnings
* Warn if number of workers < one
Signed-off-by: starry69 <starry369126@outlook.com>
* improve warning message
Signed-off-by: starry69 <starry369126@outlook.com>
* warn if converstation handler return unknown state
Signed-off-by: starry69 <starry369126@outlook.com>
* Show handler name and state aswell, in warning
Signed-off-by: starry69 <starry369126@outlook.com>
* minor nitpick
Signed-off-by: starry69 <starry369126@outlook.com>
* new filter and more tests!
* document forward filter better, fix a test.
* Minor formulation nitpicking
Co-authored-by: Hinrich Mahler <hinrich.mahler@freenet.de>
* Improve some badges for PTB-Raw
* doc fix for add_error_handler
* Some rendering
* Bump sphinx dependency
* Change signature annotation setting
* fix: chat_id can be string, message_id only int
* feat: add RTD link to documentation
* improving sender chat docstring (#2412)
* fix: improving sender chat docstring
also adding a note to a weird edge case
* fix: words being hard
* Add note on donations
* typo
* typo in User.get_profile_pictures docstrings
* Fix: meth, not attr for meth, not attr
* filters + inlinequery doc fix
* Bump versions, update RTD config file
* Try fix build
* Revert "fix: chat_id can be string, message_id only int"
This reverts commit ba04e5aa
* Add Starry & Harshil to credits
Co-authored-by: poolitzer <25934244+Poolitzer@users.noreply.github.com>
Co-authored-by: Harshil <ilovebhagwan@gmail.com>
* Improve some badges for PTB-Raw
* doc fix for add_error_handler
* Some rendering
* Doc fixes for filters.py
* render '@' as code
Co-authored-by: Harshil <ilovebhagwan@gmail.com>
* Change default handling, update signatures, get existing tests to pass.
* Try running tests on ubuntu 18.04
* Roll back
* Rework check_shortcut_call tests
* Further improve check_shortcut_call tests
* Start on defaults-checks for shortcuts, get it working for test_message
* Add check_shortcut_defaults to all other shortcut tests
* Some fine tuning
* Add defaults checking for bot methods
* Missing tests for TestCallbackQuery
* Test edit_message_media with defaults & some comments
* Fix cryptography requirement
* drop debug prints
* Remove debug prints
* Another try
* Try to fix coverage & logs
* Rearrange test order
* increase coverage
* Try to fix coverage reports
* address review
* Adapt tests like in #2386
* fix CI
* fix CI
* Make cryptography optional
* Try fixing CI
* Try some more
* Update pytest, mypy & pyupgrade, refactor test_meta, hope that things start to work
* Fix filterwarnings
* Mama mia! Here we go again!
* Add stupid debug prints
* A new hope
* Render-fixes for BP
* docs: fix simple typo, submition -> submission (#2260)
There is a small typo in tests/test_bot.py.
Should read `submission` rather than `submition`.
* Type on rawapibot.py docstring
* typo
* Typo: Filters.document(s)
* Typo fix
* Doc fix for messageentity (#2311)
* Add New Shortcuts to Chat (#2291)
* Add shortcuts
* Add a note
* Add run_async Parameter to ConversationHandler (#2292)
* Add run_async parameter
* Update docstring
* Update test to explicitly specify parameter
* Fix test job queue
* Add version added tag to docs
* Update docstring
Co-authored-by: Poolitzer <25934244+Poolitzer@users.noreply.github.com>
* Doc nitpicking
Co-authored-by: Poolitzer <25934244+Poolitzer@users.noreply.github.com>
Co-authored-by: Hinrich Mahler <hinrich.mahler@freenet.de>
* Fix rendering in messageentity
Co-authored-by: Bibo-Joshi <hinrich.mahler@freenet.de>
Co-authored-by: zeshuaro <joshuaystang@gmail.com>
Co-authored-by: Poolitzer <25934244+Poolitzer@users.noreply.github.com>
* fix: type hints for TelegramError
changed :class:`telegram.TelegramError` to :class:`telegram.error.TelegramError`
* fix: the error can be more then just a Telegram error
* Doc fix for inlinekeyboardbutton.py
added missing colon which broke rendering
* fix: remove context argument and doc remark
look at us already being in post 12
* use rtd badge
* filters doc fixes
* fix some rendering
* Doc & Rendering fixes for helpers.py
Co-authored-by: Tim Gates <tim.gates@iress.com>
Co-authored-by: Harshil <37377066+harshil21@users.noreply.github.com>
Co-authored-by: zeshuaro <joshuaystang@gmail.com>
Co-authored-by: Poolitzer <25934244+Poolitzer@users.noreply.github.com>
Co-authored-by: Harshil <ilovebhagwan@gmail.com>
* First POC
* Actually get it to work
* locals-less POC
* pre-commit
* Work on Message shortcuts, update some annotations in Bot methods
* Tippity Tappity, coding stuff
* CallbackQuery
* InlineQuery & Some other stuff
* Media Classes and PassportFile
* Fix tests
* PreCheckout- & ShippingQuery
* User
* Fix tests
* Chat
* Update rawapibot
* Update annotations for answer_inline_query
* Fix dscr for soccer ball values
* Update docs of BasePersistence regarding abc
* elaborate run_daily docs
* Make docstring of send_document.filename more precise
* increase bot API and add Discussion link
Co-authored-by: Poolitzer <25934244+Poolitzer@users.noreply.github.com>
* Check caption in Filters.regex
Added regex matching for message caption in Filters.regex.
* Moved caption check to Filters.caption_regex
* Added caption_regex tests
The same as for regex, with only the content of the message changed, that is now inside caption.
* Fixed pre-commit tests
Lines too long and an additional blank line
* Moved line break to comply
* Reformatted code with black
* Added docstrings
* Make pre-commit more strict
* Get pylint to read setup.cfg
* Make pylint & mypy happy aka ignore all the things
* use LogRecord.getMessage() in tests
* Make noam happy
* Update both pylint & mypy while we're at it
* Bring reqs-dev and makefile up to speed
* try making pre-commit happy
* fix jobqueue tests on the fly
* Move all constants to constants.py and documentation refactor.
* Move all constants to constants.py and documentation refactor.
* Overhaul constants
* Overhaul constants
* Minor docstring change
Co-authored-by: Hinrich Mahler <hinrich.mahler@freenet.de>
* Add string type hint
* fixed type hint in send_message()
* change type hint of send_chat_action to str
* make flaky happy
* fixed another type hint in edit_message_text
* Refactor handling of `default_quote`
* Make it a breaking change
* Pickle a bots defaults
* Temporarily enable tests for the v13 branch
* Temporarily enable tests for the v13 branch
* Refactor handling of kwargs in Bot methods (#1924)
* Unify kwargs handling in Bot methods
* Remove Request.get, make api_kwargs an explicit argument, move note to head of Bot class
* Fix test_official
* Update get_file methods
* Refactor JobQueue (#1981)
* First go on refactoring JobQueue
* Temporarily enable tests for the v13 branch
* Work on tests
* Temporarily enable tests for the v13 branch
* Increase coverage
* Remove JobQueue.tick()
* Address review
* Temporarily enable tests for the v13 branch
* Address review
* Dispatch errors
* Fix handling of job_kwargs
* Remove possibility to pass a Bot to JobQueue
* Refactor persistence of Bot instances (#1994)
* Refactor persistence of bots
* User BP.set_bot in Dispatcher
* Temporarily enable tests for the v13 branch
* Add documentation
* Add warning to Updater for passing both defaults and bot
* Address review
* Fix test
* Make most objects comparable
* ID attrs for PollAnswer
* fix test_game
* fix test_userprofilephotos
* update for API 4.7
* Warn on meaningless comparisons
* Update for API 4.8
* Address review
* Get started on docs, update Message._id_attrs
* Change PollOption & InputLocation
* Some more changes
* Even more changes
* First go on refactoring JobQueue
* Temporarily enable tests for the v13 branch
* Work on tests
* Temporarily enable tests for the v13 branch
* Increase coverage
* Remove JobQueue.tick()
* Address review
* Temporarily enable tests for the v13 branch
* Address review
* Dispatch errors
* Fix handling of job_kwargs
* Remove possibility to pass a Bot to JobQueue
* Unify kwargs handling in Bot methods
* Remove Request.get, make api_kwargs an explicit argument, move note to head of Bot class
* Fix test_official
* Update get_file methods
* Add notes on thumbs being ignored for small video files
* Fix some cross refs
* Add not to DictPersistence about it not actually writing to file
* Fix reply_to_message docs of Message
* Fix TypeError while unpickling TelegramError (and children)
* Add more extensive unit tests for errors pickling
* Move error pickling tests back to "test_error.py"
* Add test making sure that new errors are covered by tests
* Make meta test independent of sorting
Co-authored-by: Hinrich Mahler <hinrich.mahler@freenet.de>
* Fix start_webhook NotImplementedError on windows with python3.8
* Fine-tune and add tests.
* Minor fixes
* typos
* Make Codacy happy
Co-authored-by: n5y <41209360+n5y@users.noreply.github.com>
* Minor doc updates, following official API docs
* Fix spelling in Defaults docstrings
* Clarify Changelog of v12.7 about aware dates
* Fix typo in CHANGES.rst (#2024)
* Fix PicklePersistence.flush() with only bot_data (#2017)
* Update pylint in pre-commit to fix CI (#2018)
* Add Filters.via_bot (#2009)
* feat: via_bot filter
also fixing a small mistake in the empty parameter of the user filter and improve docs slightly
* fix: forgot to set via_bot to None
* fix: redoing subclassing to copy paste solution
* Cosmetic changes
Co-authored-by: Hinrich Mahler <hinrich.mahler@freenet.de>
* Update CHANGES.rst
Fixed Typo
Co-authored-by: Bibo-Joshi <hinrich.mahler@freenet.de>
Co-authored-by: Poolitzer <25934244+Poolitzer@users.noreply.github.com>
* Update downloads badge, add info on IRC Channel to Getting Help section
* Remove RegexHandler from ConversationHandlers Docs (#1973)
Replaced RegexHandler with MessageHandler, since the former is deprecated
* Fix Filters.via_bot docstrings
* Add notes on Markdown v1 being legacy mode
* Fixed typo in the Regex doc.. (#2036)
* Typo: Spelling
* Minor cleanup from #2043
* Document CommandHandler ignoring channel posts
* Doc fixes for a few telegram.ext classes
* Doc fixes for most `telegram` classes.
* pep-8
forgot the hard wrap is at 99 chars, not 100!
fixed a few spelling mistakes too.
* Address review and made rendering of booleans consistent
True, False, None are now rendered with ``bool`` wherever they weren't in telegram and telegram.ext classes.
* Few doc fixes for inline* classes
As usual, docs were cross-checked with official tg api docs.
* Doc fixes for telegram/files classes
As usual, docs were cross-checked with official tg api docs.
* Doc fixes for telegram.Game
Mostly just added hyperlinks. And fixed message length doc.
As usual, docs were cross-checked with official tg api docs.
* Very minor doc fix for passportfile.py and passportelementerrors.py
Didn't bother changing too much since this seems to be a custom implementation.
* Doc fixes for telegram.payments
As usual, cross-checked with official bot api docs.
* Address review 2
Few tiny other fixes too.
* Changed from ``True/False/None`` to :obj:`True/False/None` project-wide.
Few tiny other doc fixes too.
Co-authored-by: Robert Geislinger <mitachundkrach@gmail.com>
Co-authored-by: Poolitzer <25934244+Poolitzer@users.noreply.github.com>
Co-authored-by: GauthamramRavichandran <30320759+GauthamramRavichandran@users.noreply.github.com>
Co-authored-by: Mahesh19 <maheshvagicherla99438@gmail.com>
Co-authored-by: hoppingturtles <ilovebhagwan@gmail.com>
* feat: via_bot filter
also fixing a small mistake in the empty parameter of the user filter and improve docs slightly
* fix: forgot to set via_bot to None
* fix: redoing subclassing to copy paste solution
* Cosmetic changes
Co-authored-by: Hinrich Mahler <hinrich.mahler@freenet.de>
* Update notes on editing messages
* Update thumb and InputMedia* doc strings
* Fix attribute docstring for Updater.user_sig_handler
* Improve rendering for CCs attributes
* fix doc str for InputMedia*.media attribute
* Minor fix
* Make Filters.user attrs mutable
* Add test_filters_user_empty_args
* Add test_filters_user_empty_args
* fix locks
* Make codecov happy
* Make user_ids and usernames sets
* Correct doc string
* Address review
* Review Vol. II
* Apply suggestions from code review
Co-authored-by: Noam Meltzer <tsnoam@gmail.com>
* Review Vol III.
* propery setter is now only a wrapper to a private method + more cleanups
pylint complained on some extra stuff, so cleaned them as well
* Review Vol. IV
* Review Vol. V
* Apply changes to Filters.chat
Co-authored-by: Noam Meltzer <tsnoam@gmail.com>
* next_t property is added to Job class
Added new property to Job class - next_t, it will show the datetime when the job will be executed next time.
The property is updated during JobQueue._put method, right after job is added to queue.
Related to #1676
* Fixed newline and trailing whitespace
* Fixed PR issues, added test
1. Added setter for next_t - now JobQueue doesn't access protected Job._next_t.
2. Fixed Job class docstring.
3. Added test for next_t property.
4. Set next_t to None for run_once jobs that already ran.
* Fixed Flake8 issues
* Added next_t setter for datetime, added test
1. next_t setter now can accept datetime type.
2. added test for setting datetime to next_t and added some asserts that check tests results.
3. Also noticed Job.days setter raises ValueError when it's more appropriate to raise TypeError.
* Fixed test_warnings, added Number type to next_t setter
1. Changed type of error raised by interval setter from ValueError to TypeError..
2. Fixed test_warning after changing type of errors in Job.days and Job.interval.
3. Added Number type to next_t setter - now it can accept int too.
* Python 2 compatibility for test_job_next_t_property
Added _UTC and _UtcOffsetTimezone for python 2 compatibility
* Fixed PR issues
1. Replaced "datetime.replace tzinfo" with "datetime.astimezone"
2. Moved testing next_t setter to separate test.
3. Changed test_job_next_t_setter so it now uses non UTC timezone.
* Defining tzinfo from run_once, run_repeating
1. Added option to define Job.tzinfo from run_once (by when.tzinfo) and run_repeating (first.tzinfo)
2. Added test to check that tzinfo is always passed correctly.
* address review
Co-authored-by: Hinrich Mahler <hinrich.mahler@freenet.de>
* Bot.py doc fixes
All docs obtained from official Bot API docs
* made flake8 happy
* address review
Also improved consistency of `returns:` in docs
Co-authored-by: Hinrich Mahler <hinrich.mahler@freenet.de>
* Pure API changes
* Address review
* set Bot.commands on successfull call of set_my_commands
* Get started on tests
* More tests!
* More Coverage!
* Reset changes in utils.request
* Filters.dice, Filters.dice.text
* more coverage
* Address review
* Address review
* Test stop_poll with reply_markup
* Test stop_poll also without reply_markup
* Rephrase note on 'dice'
* Fix grammar in note on Filters.dice
* update api version readme
* address review
* doc fixes
* Update AUTHORS.rst
* More doc fixes
All docs were obtained from official Bot API docs.
* Shortened line length
Did this so it passes codacy check
* Revert id docstring changes
* typo
Co-authored-by: Hinrich Mahler <hinrich.mahler@freenet.de>
* First take on 4.6 support
* improved docs
* Minor doc formattings
* added poll and poll_answer to filters
* added tests, fixed mentioned issues
* added poll_answer + poll filter tests
* Update docs according to official API docs
* introducing pollhandler and pollanswerhandler
* First take on 4.6 support
* improved docs
* Minor doc formattings
* added poll and poll_answer to filters
* added tests, fixed mentioned issues
* added poll_answer + poll filter tests
* Update docs according to official API docs
* introducing pollhandler and pollanswerhandler
* correct_option_id validated with None
when trying to send a poll with correct option id 0 it was failing. Now None check is done so that even when 0 is passed it is assigned.
* improving example
* improving code
* adding poll filter example to the pollbot.py
* Update Readme
* simplify pollbot.py and add some comments
* add tests for Poll(Answer)Handler
* We just want Filters.poll, not Filters.update.poll
* Make test_official fail again
* Handle ME.language in M._parse_*
Co-authored-by: Hinrich Mahler <hinrich.mahler@freenet.de>
Co-authored-by: Sharun Kumar <715417+sharunkumar@users.noreply.github.com>
* Allow for nested MessageEntities in Message._parse_markdown/html, adjust tests
* remove testing relict
* Use MessageEntitys new equality check (#1465)
* Remove unused variable
* Update to custom_title feature and slow_mode_delay option
Changes:
- custom_title for ChatMember
- new method setChatAdministratorCustomTitle for Bot
- new slow_mode_delay for Chat
Update due to new API future `custom_title` from API 4.5 (https://core.telegram.org/bots/api#december-31-2019)
* Minor typo fix
* Comply with Flake8
* Add new MessageEntities and MarkdownV2
* Added file_unique_id attrs from API 4.5 and updated tests for it
* Fixed test and checked using flake8
* Fixed ChatPhoto documentation
* Fix Flake8
* Add setChatAdminCstmTitle to Bot
* Rename MDV2 methods
* Change files id attrs to unique id
* correct id_attrs for chat_photo
* Revert "temporarily skip tests failing b/c missing api 4.5 (#1738)"
This reverts commit 7cde6ca268.
* Fix text_markdown_v2 for monospace and text_links
* closing remarks from pieter
* Minor fix in escape_markdown, improve tests for it
* Fix offset bug in Message._parse_*
* Add test_chatphoto.py
* remove debug print from test_message.py
* try making codecov happy
* Update readme
* all hail codecov
* Improve Link handling for MarkdownV1 and adjust tests. Closes#1654
* Dont use beginning of pre-entity as language in _parse_markdown
* Remove debug print
* Dummy commit to try fix codecov
Co-authored-by: Hoi Dmytro <dmytro.hoi@gmail.com>
Co-authored-by: Dmytro Hoi <code@dmytrohoi.com>
Co-authored-by: poolitzer <25934244+poolitzer@users.noreply.github.com>
* Update docs according to official docs
* Add note to Updater according to #1772
* Add note on ChatPermissions
* Fix rendering for arg type of conversation_timeout
* added link property to bot
link property was available in User and Chat objects but not in Bot which was inconsistent.
* added 'link' property to Bot object
Bot will always have username so it does not require hasattr check
* add tests
Co-authored-by: Hinrich Mahler <hinrich.mahler@freenet.de>
* Make Filters.command only accept MessageEntitie commands
* Add option to filters.command to allow cmds anywhere in the message
* Make codecov happy, also retroactive for #1631