* 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>
* 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
* 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>
* 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
* added parse_mode parameter in Updater and in Bot class to set a default parse mode for bot
* DefaultValue
* Add default parse_mode everywhere
* Renome to default_parse_mode
* Test def parse_mode for send_*, edit_message_*
* Remove duplicate code in Input* classes
* Improve handling of def_p_m for Bot methods
* Remove unneeded deletion of kwargs
* Make @log preserve signature, add bots with defaults to tests
* Fix Codacy
* Fix Travis Error
* Add default_disable_notification
* Add default_disable_web_page_preview
* Add default_disable_timeout
* add default_disable_web_page_preview for InputTextMessageContent
* add default_quote
* Try fixing test_pin_and_unpin
* Just run 3.5 tests for paranoia
* add tests for Defaults
* Revert "Just run 3.5 tests for paranoia"
This reverts commit 1baa91a3a1.
* Tidy up parameters, move Defaults to ext
* Stage new files, because im an idiot
* remove debug prints
* change equality checks for DEFAULT_NONE
* Some last changes
* fix S&R error so that tests actually run
Co-authored-by: Ak4zh <agwl.akash@gmail.com>
Co-authored-by: Eldinnie <Eldinnie@users.noreply.github.com>
* fix download without path arguments
* fix download without path arguments
* solved downloading a file without file_path or custom_path
* if no file_path, download as file_id
* Add test case
* Elaborate doc string
Co-authored-by: Bibo-Joshi <hinrich.mahler@freenet.de>
* Update AUTHORS.rst
* Update AUTHORS.rst
* Add bot_data to CallbackContext as global memory
* Minor fixes in docstrings
* Incorp. req. changes, Flake8 Fixes
* Persist before stop
* Fix CI errors
* Implement #1342 for bot_data
* Add check pickle_persistence_only_bot similar to #1462
* Fix test_persistence
* Try dispatching error before logging it
* Fix test
Co-authored-by: Eldinnie <Eldinnie@users.noreply.github.com>
* add private /c links to message.links object
* fixing ids for basic groups
* fixing ids for non basic chats and the test
* Improve tests for Message.link
* Simplify id_to_link
* Stop testing with ujson
* Fix timing issue with test_delete_message
* ignore pip deprecation warning. hopefully it will fix windows+py2.7
* telegram replies to deleteing old messages are not consistent
* Add test workflow
* Attempt github grouping
* Improve bot info fetching
- Add support for b64+json encoded github secret with all the vars
- Add bot_name and bot_username since it's needed for a proper get_me test
* Improve test workflow a lot
- Add coverage
- Install ujson
- test_official only run on in single job
- Pass bot info to pytest
* Improve github grouping by having shorter titles
* Run pytest with coverage
* Improve coverage report
* Proper exitcode behaviour for pytest
* Proper test official handling
* Proper error handling
* Skip jobqueue tests on windows
* run coverage tests even if nocoverage ones fail
* Skip messagequeue tests on windows
* Clean up to satisfy flake8
* Run meta tests
- Improved usage of fixtures
- Replaced fixtures for directly callable factories where
multiple mock objects were needed in the same test function
- Extracted fixtures where possible (in place of literals or
global constants)
- Moved some fixtures to ``conftest.py`` to be used by other
modules
- Made a common base class for both ``TestCommandHandler`` and
``TestPrefixHandler``, extracting common methods, patterns and
signatures
- The extracted patterns in test methods have been named with
leading ``_test``
- Extracted other repeatedly used test utilities into functions
(e.g. ``is_match``) and methods (e.g. ``make_default_handler``)