Commit graph

110 commits

Author SHA1 Message Date
Oleg A
24e933bdde
Fix: default parent for __setitem__ (#806)
* fix: self is default parent

* chore: mv bot fixture

* chore: add update_chat test

* fix: string CHAT_PHOTO data
2022-02-08 02:30:41 +02:00
Oleg A
b39672f9b6
[2.x] Don't save error as a file (#813)
* fix: don't save error as file

Raise an aiohttp.ClientResponseError if the response status is 400 or higher

#799

* fix tests

Co-authored-by: darksidecat <58224121+darksidecat@users.noreply.github.com>
2022-02-08 02:29:53 +02:00
Cyril Margorin
d646e19852
Fix fsmcontextproxy update (#755)
* Create test case for invalid 'FSMContextProxy.update()' function

* Fix invalid 'FSMContextProxy.update()' function

* Verify that written data has been stored and read back correctly
2021-12-01 02:43:12 +02:00
Alex Root Junior
720a5451b7 Fixed fixture 2021-11-07 01:47:04 +02:00
Alex Root Junior
b190bbba19
Dev 2.x api 5.4 (#741)
* Added support of Bot API 5.4

* Bump version

* Added aliases for ChatJoinRequest object

* Create aiohttp session inside async function

* Try to fix compatibility with aiohttp 3.8

* Fixed compatibility with Python 3.10
2021-11-07 01:39:51 +02:00
darksidecat
b98ec3efad
add Bot.download_file aliases ability to save files to a directory and automatically create directories (#694)
* add destination_dir and make_dirs parameters to bot download aliases

* add the ability to save files to a directory with path completion based on file_path,
* add an option to automatically create directories in the file path

* Downloadable mixin uses directory creation parameter in bot methods
2021-11-07 01:28:12 +02:00
Oleg A
100848b889
chore: reuse json util #712 (#713) 2021-10-06 00:59:43 +03:00
darksidecat
358ecc7821
Fix #665, add separate parametrs for saving to directory and file (#677)
* close #665

* add backward compatibility

* improve doc, codestyle

* warning text update

* use tmpdir fixture in tests
2021-09-06 00:05:52 +03:00
Oleg A
3ee28281c4
RedisStorage major fixes + tests updates (#676)
* fix: redis async close

* fix: redis adapter async close

* fix: aioredis pytest update

* fix: tests remove unused old_storage mark

* fix: tests remove redundant linebreak

* fix: tests remove redundant s.redis call
2021-09-05 23:46:50 +03:00
Ramzan Bekbulatov
580fa2e499
Allow empty and zero parts in CallbackData (#646)
* enh: allow empty parts in CallbackData

* enh: allow zero parts in CallbackData

* new: tests for CallbackData
2021-08-01 00:05:21 +03:00
Ramzan Bekbulatov
f6f2972a11
Add to ChatMemberOwner new default fields (#645)
* new: add field type ConstField

* new: add const fields for ChatMemberOwner

* new: better typings for get_chat_administrators

* new: add tests for chat owner fields

* fix: Type typing for class

* enh: alias is_chat_owner for is_chat_creator
2021-07-31 21:47:37 +03:00
Oleg A
f18e4491c2
Telegram API 5.3 (#610)
* docs: api version update

* feat: personalized commands

* feat: custom placeholders

* refactor: ChatMember split

* fix: old names for ChatMemberStatus

* refactor: renamed kickChatMember to banChatMember

* style: align params

* refactor: renamed getChatMembersCount to getChatMemberCount (#614)

* feat: resolve ChatMember

* refactor: renamed BotCommandScopeTypes (similar to code style)

* refactor: resolve is a static method

* Construct BotCommandScope from type

* Make BotCommandScope classmethod instead of method

* Use classmethod for ChatMember resolve method

Co-authored-by: Hoi Dmytro <dmytro.hoi@gmail.com>
Co-authored-by: Alex Root Junior <jroot.junior@gmail.com>
2021-07-04 23:52:55 +03:00
Andrey Tikhonov
0b1c22b7b0
Сleanup storage (#587)
* remove key from storage, when not needed

* fix redis1 delete

* fix new line

* check reset

* fix redis store close check
2021-06-13 01:22:47 +03:00
Oleg A
08f0635afe
Deep linking util fix (#569)
* fix: deep linking util fixed and refactored

* fix: wrong payload split

* feat: check payload length
2021-04-28 01:24:34 +03:00
Oleg A
ee12911f24
pytest update; yield_fixture deprecation fix; event_loop removed (#479) 2021-01-10 20:53:59 +02:00
Alex Root Junior
b170bbc5f6 Fix tests 2020-11-08 17:57:02 +02:00
Oleg A
2b060d9ad4
Bot API 5.0 (#454)
* increased Telegram Bot API version

* AIOG-T-64 added logOut method

* AIOG-T-64 added logOut method test

* AIOG-T-64 logOut type annotation fix

* AIOG-T-65 added close (close_bot) method

* AIOG-T-65 old `close` method deprecation warn

* AIOG-T-65 `close_bot` test added

* AIOG-T-67 added ip_address param to set_webhook, updated docs

* updated deprecation text

Co-authored-by: Martin Winks <mpa@snejugal.ru>

* AIOG-T-69 param `drop_pending_updates` added in methods `setWebhook` and `deleteWebhook`

* AIOG-T-71 new `ChatLocation` class

* AIOG-T-70 updated `Chat` class: bio, linked chats, location

* AIOG-T-68 field `ip_address` added to class `WebhookInfo`

* AIOG-T-72 param `only_if_banned` added to `unbanChatMember` method

* AIOG-T-72 updated Chat.unban shortcut

* AIOG-T-73 field `file_name` added to `Audio` and `Video` classes

* AIOG-T-74 param `disable_content_type_detection` added in `sendDocument` method and `InputMediaDocument` class

* AIOG-T-75 Added the ability to pin messages in private chats (docs update)

* AIOG-T-76 Added the parameter message_id to the method unpinChatMessage to allow unpinning of the specific pinned message

* AIOG-T-77 Added the method unpinAllChatMessages, which can be used to unpin all pinned messages in a chat.

* AIOG-T-78 updated send_media_group description; added media qty check

* AIOG-T-80 field `live_period` added to `Location` class

* AIOG-T-81 Added support for live location heading

* AIOG-T-82 added the field proximity_alert_distance to the classes Location, InlineQueryResultLocation, InputLocationMessageContent; fixed heading in InputLocationMessageContent

* AIOG-T-82 added parameter proximity_alert_distance to the methods sendLocation and editMessageLiveLocation

* AIOG-T-83 Added the type ProximityAlertTriggered

* AIOG-T-83 Added field proximity_alert_triggered to the class Message

* AIOG-T-84 Added the field horizontal_accuracy to the classes Location, InlineQueryResultLocation, InputLocationMessageContent

* AIOG-T-84 Added the parameter horizontal_accuracy to the methods sendLocation and editMessageLiveLocation.

* Added live_period to InputLocationMessageContent (missed?)

* AIOG-T-85 Added the field sender_chat to the class Message

* AIOG-T-86 Added `is_anonymous` field to `chatMember` class

* AIOG-T-87 Added the parameter is_anonymous to the method promoteChatMember

* AIOG-T-89 Added the method `copyMessage`

* AIOG-T-90 Poll docs update

* AIOG-T-91 ability to manually specify text entities

* AIOG-T-92 Google Places as a venue API provider

* AIOG-T-93 Added the field allow_sending_without_reply to the methods

* AIOG-T-94 football and slot machine dice

* removed Optional

Co-authored-by: Ramzan Bekbulatov <bekbulatov.ramzan@ya.ru>

* Apply suggestions from code review

removed Optional

Co-authored-by: Ramzan Bekbulatov <bekbulatov.ramzan@ya.ru>

* Don't use deprecated Bot.close method from dispatcher (Replaced by session.close)

* Fix copyMessage method, update alias (with deprecation)
Fix imports

* AIOG-T-79: Easy way to use custom API server

* Update docs

* Bump requirements

* Rollback email

* AIOG-T-93 allow_sending_without_reply to send_message shortcuts

* AIOG-T-93 added allow_sending_without_reply to send_photo shortcuts

* AIOG-T-93 added allow_sending_without_reply to send_video shortcuts

* Union[type, None] -> Optional[type] refactoring

* AIOG-T-93 added allow_sending_without_reply to send_animation shortcuts

* added type hint to reply field

* AIOG-T-93 added allow_sending_without_reply to send_audio shortcuts

* AIOG-T-93 added allow_sending_without_reply to send_document shortcuts

* AIOG-T-93 added allow_sending_without_reply to send_sticker shortcuts

* AIOG-T-93 added allow_sending_without_reply to send_video_note shortcuts

* AIOG-T-93 added allow_sending_without_reply to send_voice shortcuts

* AIOG-T-93 added allow_sending_without_reply to send_location shortcuts

* AIOG-T-93 added allow_sending_without_reply to send_venue shortcuts

* AIOG-T-93 added allow_sending_without_reply to send_contact shortcuts

* AIOG-T-93 added allow_sending_without_reply to send_poll shortcuts

* AIOG-T-93 added allow_sending_without_reply to send_dice shortcuts

* AIOG-T-93 added allow_sending_without_reply to send_media_group shortcuts

* AIOG-T-92 added google_place_ to send_venue shortcuts

* AIOG-T-91 added entities to send_message shortcuts

* AIOG-T-91 added caption_entities to send_photo shortcuts

* AIOG-T-91 added caption_entities to send_video shortcuts

* AIOG-T-91 added caption_entities to send_animation shortcuts

* AIOG-T-91 added caption_entities to send_audio shortcuts

* AIOG-T-91 added caption_entities to send_document shortcuts

* AIOG-T-91 added caption_entities to send_voice shortcuts

* AIOG-T-91 added explanation_parse_mode to send_poll shortcuts

* AIOG-T-91 added entities to edit_message_text shortcuts

* AIOG-T-91 added caption_entities to edit_message_caption shortcuts

* fixed types.MessageEntity -> MessageEntity in docs

Co-authored-by: Martin Winks <mpa@snejugal.ru>
Co-authored-by: Ramzan Bekbulatov <bekbulatov.ramzan@ya.ru>
Co-authored-by: Alex Root Junior <jroot.junior@gmail.com>
2020-11-08 17:51:39 +02:00
Martin Winks
a529619d79
hotfix(updates): CHOSEN_INLINE_RESULT is a correct API-term (#415)
* hotfix(updates): CHOSEN_INLINE_RESULT is a correct API-term

* feat(utils): deprecated descriptor

deprecate CHOSEN_INLINE_QUERY and always return CHOSEN_INLINE_RESULT instead of incorrect value

* fix(tests): remove example from test

* fix(utils): use stacklevel=3

level on which descriptor is being called
2020-09-10 22:34:20 +03:00
unintended
17eb8a56d0
Fix #413 parse entities positioning (#414)
* fix entity positioning in parse_entities() #413
* add tests and small fixes
2020-09-04 18:08:15 +03:00
Martin Winks
00cff4acf5
fix(handlerObj): fix parameter-spec solving (#408) 2020-08-22 00:07:03 +03:00
Egor
f904292751
fix: bug IDFilter checking message from channel (#376)
* fix: bug IDFilter checking message from channel

* chore: add mark.asyncio for tests which were ignored previously
2020-07-05 03:08:38 +03:00
Egor
5586e5110d
fix: remove aiomongo completely (#380) 2020-07-05 03:00:00 +03:00
Egor
d179789ea7
feat: mongo motor (#368)
* initial commit

* replacement by motor

* Delete settings.json

* fix: split to several files

* feat: add test for deleted file

Co-authored-by: morz <morzik45@gmail.com>
Co-authored-by: morzik45 <46727779+morzik45@users.noreply.github.com>
2020-06-29 21:56:35 +03:00
unintended
f9c367548f
Fix markdown escaping issues (#363)
* #360 - Fix: escape '=' sign in markdown

* fix more escaping issues

* Rename test suite

Co-authored-by: Alex Root Junior <jroot.junior@gmail.com>
2020-06-27 16:17:38 +03:00
Denis Belavin
1389ca5874
#320 - Fix: Class InputMediaAudio contains some fields from other class. (#354)
Co-authored-by: Belavin Denis <belavin.d.andreevich@yandex.ru>
2020-06-10 23:08:44 +03:00
Egor
a8dfe86358
feat: ForwardedMessage filter (#355)
* feat: ForwardedMessage filter
* fix: add tests
* fix: attr name
2020-06-10 23:07:55 +03:00
Egor
70767111c4
fix: add support init fields from parent object in KeyboardButton (#344)
* fix: add support init fields from parent object in KeyboardButton

* fix: add tests
2020-05-31 17:49:33 +03:00
Alex Root Junior
cb0a898487
Merge pull request #319 from Senpos/fix-idfilter-aiogram-v2
Fix behavior when a single string is passed as ID
2020-05-24 21:08:04 +03:00
Senpos
6b1c7d3b36 Add tests for extract_chat_ids 2020-05-17 17:17:41 +03:00
mpa
6508235d16 fix(BaseBot): remove __del__ method from BaseBot
implement "lazy" session property getter and new get_new_session for BaseBot
2020-05-10 01:13:00 +04:00
Oleg A
cd75d3c468 #296 Added test for getting bot's user_id 2020-04-07 09:43:11 +03:00
Oleg A
6cc769ce4f #289 Added setStickerSetThumb test 2020-04-05 19:13:33 +03:00
Oleg A
29d767bd78 #289 added getMyCommands test 2020-04-05 17:26:53 +03:00
Oleg A
505d6bf75b normalized FakeTelegram passed data 2020-04-05 17:26:18 +03:00
Oleg A
a5f9373381 refactored message_dict to message_data in FakeTelegram 2020-04-05 17:02:43 +03:00
Oleg A
38a2309c32 #289 added setMyCommands test 2020-04-05 16:48:34 +03:00
Oleg A
0f245bbf56 #289 added sendDice test and dataset 2020-04-05 16:14:26 +03:00
Oleg A
13462abe47 test_bot minor refactoring 2020-04-05 15:52:01 +03:00
Bachynin Ivan
5a9a4c888e add simple tests for RedisStorage2 2020-02-12 20:28:45 +02:00
Alex Root Junior
a8ec717d32 Fix tests 2020-01-05 20:22:16 +02:00
Alex Root Junior
528e27b86e
Merge pull request #241 from aiogram/#238-deeplinking
#238 Deep linking feature
2019-12-03 17:25:19 +02:00
Oleg A
5489e4cc18 #238 Added /start Pattern test cases 2019-11-30 00:21:38 +03:00
Oleg A
c23c7a2025 #238 Improved deep_link test cases 2019-11-30 00:19:08 +03:00
Oleg A
746eead0da #238 Fixed deep_link = None case 2019-11-29 23:46:38 +03:00
Oleg A
41191721f6 #238 Added CommandStart filter tests 2019-11-29 23:25:46 +03:00
Oleg A
1305a06b24 #238 Removed prints and fixed example 2019-11-24 01:08:06 +03:00
Oleg A
a42252b5c6 #238 Added deep linking feature 2019-11-24 00:40:11 +03:00
Oleg A
4523a1cab3 #239 added token type validation 2019-11-23 12:45:47 +03:00
Oleg A
89b0754b33 #239 added test cases for check_token 2019-11-23 12:02:30 +03:00
Suren Khorenyan
68a9df9222 Create OrderedHelper 2019-10-09 20:03:48 +03:00