Commit graph

72 commits

Author SHA1 Message Date
Юрий
a852b95596
add protect content global default (#917) 2022-08-13 23:44:59 +03: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
samuelfirst
301a43e26b Set default disable_web_page_preview 2022-01-02 19:49:54 +03: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
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
c99b165668
fix(bot,dispatcher): do not use _MainThread event loop (#397)
* fix(bot,dispatcher): do not use _MainThread event loop on ::Bot, ::Dispatcher initializations

* fix: use more generic get approach

* docs: comments

* chore(task): asyncio.create_task comes with py3.7

* fix(dispatcher): todo
2020-09-13 22:42:21 +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
8cd781048a #296 Get bot's user_id without get_me 2020-04-07 09:36:16 +03:00
Alex Root Junior
8f07b1248e More safe bot deleter 2020-04-05 18:22:52 +03:00
Alex Root Junior
c19e2a0d42
Merge pull request #248 from a6a3uh/fix_socks_login
Latest version of aiohttp_socks changed interface
2020-01-01 16:41:25 +02:00
Alex Root Junior
9115a44be6 Backport of text decoration utils from 3.0 2020-01-01 16:39:31 +02:00
Ali Tlisov
c0353b802d fixed socks proxy usage 2019-12-29 18:49:46 +03:00
Alex Root Junior
bd90c726b5 Fix Bot.__del__ for cases when event loop is closed 2019-10-14 14:53:12 +03:00
Alex Root Junior
e56be672a3 Safe close aiohttp session when delete bot instance 2019-09-01 14:46:51 +03:00
Suren Khorenyan
7863f052d9 Refactor aiogram/utils/auth_widget.py
+ fix check auth widget token in BaseBot, fix tests
2019-08-16 22:36:11 +03:00
Alex Root Junior
403d93d490
Merge pull request #130 from gabbhack/different_bot_tokens
Different bot tokens
2019-06-09 21:30:28 +03:00
0623forbidden
71466c4960 Add get_url method for Downloadable 2019-05-24 17:54:48 +07:00
Nikita
9ef3a630d1 Update base.py 2019-05-12 11:35:45 +05:00
Nikita
49157af59b Update base.py 2019-05-03 16:09:55 +05:00
Nikita
5580cdaa06 Update base.py 2019-05-03 16:08:23 +05:00
Nikita
3025d981be Implements opportunity to create temporary instance of bot with different tokens 2019-05-03 15:45:08 +05:00
Alex RootJunior
beca19b5e2 Implements opportunity to change request timeouts 2019-04-17 23:24:23 +03:00
Alex RootJunior
599e87ec13 Bump polls to latest API version (Naming and location) 2019-04-15 23:38:17 +03:00
Oleg A
7c0ada5897 Replaced 'ssl_context' kwarg with 'ssl' cause: DeprecationWarning: ssl_context is deprecated, use ssl=context instead 2019-02-25 15:43:18 +03:00
Dmitry Sobolev
e73533d487 DNS over socks proxy 2019-01-25 13:16:52 +05:00
Alex Root Junior
e0a832f5ba Remove BaseBot._data = {} 2018-10-21 20:58:48 +03:00
Alex Root Junior
39c333251f Rewrite contextvar usage. Implemented ContextInstanceMixin and DataMixin 2018-10-20 15:55:57 +03:00
t0rr
734623ae71 #65 bug fix with no proxy_auth 2018-08-17 12:18:22 +03:00
Alex Root Junior
5466f0c342 Set requests timeout 2018-08-14 00:13:37 +03:00
Alex Root Junior
e31e08a072 Proxy & proxy_auth is not needed when used aiohttp_socks 2018-08-13 23:28:49 +03:00
Alex Root Junior
d5290647c5 Remove Connectors mechanism and use aiohttp_socks instead of aiosocksy for Socks4/Socks5 proxies 2018-08-13 23:25:17 +03:00
Alex Root Junior
4d7555b1c3 Rewrite file uploading mechanism. Allow to send thumbs (Bot API 4.0). 2018-08-13 22:42:10 +03:00
Alex Root Junior
cd4fee5eaa Implement connectors mechanism. 2018-07-08 18:40:54 +03:00
Alex Root Junior
7df5337cb4 Unused import 2018-05-02 13:52:12 +03:00
Alex Root Junior
2a5dc531d2 Disable connections limit. 2018-05-02 13:49:31 +03:00
Alex Root Junior
80d2b24d7e Remove deprecated temp session. 2018-04-23 00:02:13 +03:00
Alex Root Junior
a941a00abc Deprecate temp sessions. 2018-04-22 21:32:32 +03:00
Alex Root Junior
9e97cd6727 destroy_temp_session is awaitable 2018-04-19 03:32:38 +03:00
Alex Root Junior
f047bb6db3 Implemented support of Socks5 Proxy 2018-04-19 03:28:34 +03:00
Alex Root Junior
d2c5896b5c Oops. Remove duplicated argument. 2018-04-07 23:28:55 +03:00
Alex Root Junior
f0552ad6f5 Fix aiohttp ClientConnectorSSLError: SSL certificate verify failed #33 2018-04-07 01:52:26 +03:00
Alex Root Junior
ce0d9aa3c6 Temporary fix "Coroutine 'BaseBot.close' was never awaited" 2018-04-05 23:11:09 +03:00
Alex Root Junior
7cab32b1cc Fix Fatal Python error: PyImport_GetModuleDict: no module dictionary! 2018-02-23 13:56:35 +02:00
Alex Root Junior
4f2cb40aea Implemented auth widget object and auth data validator. 2018-02-22 01:56:44 +02:00
Suren Khorenyan
70fb332fd3 Minor refactoring:
- removed remaining assertions
- quotes replaced with double quotes in f-strings
2018-02-12 22:06:05 +03:00
Alex Root Junior
9571608f7e Small changes in annotations. 2018-01-27 03:34:53 +02:00
Alex Root Junior
44e61fc6ad Set default parse mode. 2018-01-18 17:36:24 +02:00
Alex Root Junior
16a61b092f More graceful stopping of long polling. 2018-01-06 14:31:59 +02:00
Alex Root Junior
629dd400eb Remove auto retry requests on RetryAfter error. 2017-12-10 04:00:46 +02:00