Commit graph

33 commits

Author SHA1 Message Date
Luca Bellanti
7b116be344
Localize Received datetime Objects According to Defaults.tzinfo (#3632) 2023-04-18 16:16:23 +02:00
Harshil
9997a9f47e
Empower ruff (#3594) 2023-03-25 19:18:04 +01:00
Bibo-Joshi
22d0dd1301
Tidy Up Tests Directory (#3553) 2023-02-22 20:19:46 +01:00
Harshil
963edbf191
Refactor and Overhaul the Test Suite (#3426) 2023-02-11 10:45:17 +01:00
Poolitzer
23a685335b
API 6.5 (#3530)
Co-authored-by: Harshil <37377066+harshil21@users.noreply.github.com>
2023-02-08 11:47:21 +01:00
Bibo-Joshi
51ad4d76d0
Update Copyright to 2023 (#3459) 2023-01-01 21:31:29 +01:00
Harshil
caacafa090
API 6.3 (#3346)
Co-authored-by: Poolitzer <25934244+Poolitzer@users.noreply.github.com>
Co-authored-by: Hinrich Mahler <22366557+Bibo-Joshi@users.noreply.github.com>
Co-authored-by: Dmitry Kolomatskiy <58207913+lemontree210@users.noreply.github.com>
Co-authored-by: Clot <69784758+clot27@users.noreply.github.com>
2022-11-22 10:43:50 +01:00
Harshil
e54c6a04de
Handle Lists and Tuples and Datetimes Directly in TelegramObject.to_dict (#3353) 2022-11-13 21:28:41 +01:00
Bibo-Joshi
1c20ff3fb9
Introduce TelegramObject.api_kwargs (#3233) 2022-10-07 11:51:53 +02:00
Bibo-Joshi
950d9a0751 Extend Code Formatting With Black (#2972) 2022-05-06 18:22:35 +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
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
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
5c500fb6fd Fix Signatures and Improve test_official (#2643) 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
Harshil
e6d9f3d057
Update Copyright to 2022 (#2836) 2022-01-03 08:15:18 +01: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
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
Poolitzer
ac02bce109
API 5.1 (#2424)
* Feat: New invite links

* Fix: doc strings

Co-authored-by: Bibo-Joshi <hinrich.mahler@freenet.de>

* new dice, new admin privilege, revoke_messages, update and fix some docs

* add missing param to shortcut

* Add ChatMemberUpdated

* Add voicechat related objects

Signed-off-by: starry69 <starry369126@outlook.com>

* add versionadd tags

Signed-off-by: starry69 <starry369126@outlook.com>

* Fix filter tests

* Update tg.Update

* ChatMemberHandler

* Add versioning directives

* add can_manage_voice_chats attr and fix docs

Signed-off-by: starry69 <starry369126@outlook.com>

* fix chat shortcut

Signed-off-by: starry69 <starry369126@outlook.com>

* address review

* MADTC

* Chat.message_auto_delete_time

* Some doc fixes

* address review

Signed-off-by: starry69 <starry369126@outlook.com>

* welp

Signed-off-by: starry69 <starry369126@outlook.com>

* Add voicechat related filters

Signed-off-by: starry69 <starry369126@outlook.com>

* Fix: Addressing review

change place of version adding, added obj:True as doc string, changing how member limit is initiated

* feat: adding chat shortcuts for invite links

* fix: changing equality of chatinviteobjects

* Non-test comments

* Some test fixes

* A bit more tests

* Bump API version in both readmes

* Increase coverage

* Add Bot API Version in telegram.constants (#2429)

* add bot api version in constants

Signed-off-by: starry69 <starry369126@outlook.com>

* addressing review

Signed-off-by: starry69 <starry369126@outlook.com>

* add versioning directive

Co-authored-by: Bibo-Joshi <hinrich.mahler@freenet.de>

* pre-commit & coverage

Co-authored-by: Bibo-Joshi <hinrich.mahler@freenet.de>
Co-authored-by: Harshil <ilovebhagwan@gmail.com>
Co-authored-by: starry69 <starry369126@outlook.com>
2021-03-14 16:41:35 +01:00
starry69
91e0271e4c Update copyright headers
Signed-off-by: starry69 <starry369126@outlook.com>
2021-01-03 10:40:24 +05:30
Bibo-Joshi
ae9ce60b55
API 5.0 (#2181)
Co-authored-by: poolitzer <25934244+Poolitzer@users.noreply.github.com>
Co-authored-by: Harshil <37377066+harshil21@users.noreply.github.com>
2020-11-29 16:20:46 +01:00
Bibo-Joshi
264b2c9c72
Switch Code Formatting to Black (#2122)
* Swtich code formatting to Black

* Update docs

* Fix tests

* TRy fixing pre-commit
2020-10-09 17:22:07 +02:00
Nils K
8406889179
Remove Python 2 Support (#1715)
* Remove usages of python-future lib

* Remove python2 datetime.timezone replacement

* Remove python2 workaround in InputFile.__init__

* Remove import of str necessary for python2

* Remove urllib2 import necessary for python2

* Remove a mention of python 2 in doc

* Remove python 2 from travis config file

* Remove python 2 from appveyor config

* Remove python2 from debian build rules

* Remove unnecessarry aliasing of time.perf_counter

* Remove python 2 from github workflow

* Remove mention of python 2 in descriptions/readme

* Remove version check for queue import

* Remove version checks in tests

* Adjust docs to correctly mention supported version

* Fix indentation

* Remove unused 'sys' imports

* Fix indentation

* Remove references to mq.curtime in tests

* Replace super calls by argumentsless version

* Remove future dependency

* Fix error in de_json declaration

* Use python3 metaclass syntax

* Use implicit inheriting from object

* Remove accidentally committed .vscode folder

* Use nameless f-string and raw string

* Fix regex string literal syntax

* Remove old style classes

* Run pyupgrade

* Fix leftover from automatic merge

* Fix lint errors

* Update telegram/files/sticker.py

Co-authored-by: Bibo-Joshi <hinrich.mahler@freenet.de>
2020-06-15 18:20:51 +02:00
Bibo-Joshi
8d2c7af1f3
API 4.5 (#1508)
* 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>
2020-03-28 16:37:26 +01:00
Noam Meltzer
43bfebb150
Update copyright date to 2020 (#1746) 2020-02-02 23:08:54 +02:00
Paolo Lammens
4e717a172b Fix UTC/local inconsistencies for naive datetimes (#1506) 2019-11-15 22:51:22 +02:00
Bibo-Joshi
965ad17af8 API 4.4 (#1464) 2019-09-06 22:41:43 +03:00
Jacob Bom
2ca7ff82ef Update headers to 2018 (#962)
Also add two missing headers.
[ci skip]
2018-01-04 17:16:06 +02:00
Jeff
b6a0853896 Add Bot API 3.3 (#806)
* Bot API 3.3

* simpler helper methods (accept only custom names now)
attempt to fix circular import (not sure if its the correct way tho)
added helper methods into User object

* fix User objects in tests to contain is_bot required value

* fix User objects in tests to contain is_bot required value

* delete extra line that caused flake8 error

* fix swapped arguments
2017-09-01 08:40:05 +02:00
Jacob Bom
5d7c6ad541 Switch to pytest + required fixes to code (#788)
Required fixes:
 - CallbackQuery is now comparable.
 - Message.effective_attachment, Message.photo,
   Message.new_chat_members, Message.new_chat_photo &
   Game.text_entitties semantic fixes - when they are not defined,
   return an empty list.
 - Docstring fix to Update class.
2017-08-12 00:58:41 +03:00
Noam Meltzer
9a2d5e0410 Update copyright notice to include 2017 - missing files from another PR 2017-05-15 00:37:40 +03:00
Jacob Bom
da01601ff9 Add equality rich comparision operators to telegram objects (#604)
fixes #587
2017-05-15 00:29:31 +03:00