From 915c84c74209374523871550e12fc56eb8ff24ac Mon Sep 17 00:00:00 2001 From: Alex Root Junior Date: Sun, 24 Jan 2021 20:54:38 +0200 Subject: [PATCH] Update API --- Makefile | 2 +- aiogram/client/bot.py | 294 +++++++++--------- aiogram/client/session/aiohttp.py | 2 +- aiogram/dispatcher/event/telegram.py | 6 +- aiogram/methods/add_sticker_to_set.py | 4 +- aiogram/methods/answer_callback_query.py | 7 +- aiogram/methods/answer_inline_query.py | 5 +- aiogram/methods/answer_pre_checkout_query.py | 6 +- aiogram/methods/answer_shipping_query.py | 2 +- aiogram/methods/close.py | 2 +- aiogram/methods/copy_message.py | 4 +- aiogram/methods/create_new_sticker_set.py | 8 +- aiogram/methods/delete_chat_photo.py | 2 +- aiogram/methods/delete_chat_sticker_set.py | 2 +- aiogram/methods/delete_message.py | 2 +- aiogram/methods/delete_sticker_from_set.py | 2 +- aiogram/methods/delete_webhook.py | 4 +- aiogram/methods/edit_message_caption.py | 2 +- aiogram/methods/edit_message_live_location.py | 2 +- aiogram/methods/edit_message_media.py | 3 +- aiogram/methods/edit_message_reply_markup.py | 2 +- aiogram/methods/edit_message_text.py | 2 +- aiogram/methods/export_chat_invite_link.py | 3 +- aiogram/methods/forward_message.py | 2 +- aiogram/methods/get_chat.py | 2 +- aiogram/methods/get_chat_administrators.py | 2 +- aiogram/methods/get_chat_member.py | 2 +- aiogram/methods/get_file.py | 2 +- aiogram/methods/get_game_high_scores.py | 5 +- aiogram/methods/get_me.py | 2 +- aiogram/methods/get_my_commands.py | 2 +- aiogram/methods/get_sticker_set.py | 2 +- aiogram/methods/get_updates.py | 13 +- aiogram/methods/get_user_profile_photos.py | 2 +- aiogram/methods/get_webhook_info.py | 2 +- aiogram/methods/kick_chat_member.py | 2 +- aiogram/methods/leave_chat.py | 2 +- aiogram/methods/log_out.py | 2 +- aiogram/methods/pin_chat_message.py | 4 +- aiogram/methods/promote_chat_member.py | 4 +- aiogram/methods/restrict_chat_member.py | 2 +- aiogram/methods/send_animation.py | 8 +- aiogram/methods/send_audio.py | 10 +- aiogram/methods/send_chat_action.py | 5 +- aiogram/methods/send_contact.py | 4 +- aiogram/methods/send_dice.py | 6 +- aiogram/methods/send_document.py | 8 +- aiogram/methods/send_game.py | 4 +- aiogram/methods/send_invoice.py | 18 +- aiogram/methods/send_location.py | 4 +- aiogram/methods/send_media_group.py | 2 +- aiogram/methods/send_message.py | 4 +- aiogram/methods/send_photo.py | 6 +- aiogram/methods/send_poll.py | 12 +- aiogram/methods/send_sticker.py | 6 +- aiogram/methods/send_venue.py | 6 +- aiogram/methods/send_video.py | 10 +- aiogram/methods/send_video_note.py | 8 +- aiogram/methods/send_voice.py | 6 +- .../set_chat_administrator_custom_title.py | 2 +- aiogram/methods/set_chat_description.py | 2 +- aiogram/methods/set_chat_permissions.py | 2 +- aiogram/methods/set_chat_photo.py | 2 +- aiogram/methods/set_chat_sticker_set.py | 2 +- aiogram/methods/set_chat_title.py | 2 +- aiogram/methods/set_game_score.py | 2 +- aiogram/methods/set_my_commands.py | 2 +- aiogram/methods/set_passport_data_errors.py | 2 +- .../methods/set_sticker_position_in_set.py | 2 +- aiogram/methods/set_sticker_set_thumb.py | 4 +- aiogram/methods/set_webhook.py | 17 +- aiogram/methods/stop_message_live_location.py | 2 +- aiogram/methods/stop_poll.py | 2 +- aiogram/methods/unban_chat_member.py | 2 +- aiogram/methods/unpin_all_chat_messages.py | 2 +- aiogram/methods/unpin_chat_message.py | 2 +- aiogram/methods/upload_sticker_file.py | 4 +- aiogram/types/animation.py | 11 +- aiogram/types/audio.py | 15 +- aiogram/types/base.py | 4 +- aiogram/types/bot_command.py | 3 +- aiogram/types/callback_game.py | 2 +- aiogram/types/callback_query.py | 27 +- aiogram/types/chat.py | 43 +-- aiogram/types/chat_member.py | 48 ++- aiogram/types/chat_permissions.py | 20 +- aiogram/types/chat_photo.py | 12 +- aiogram/types/chosen_inline_result.py | 12 +- aiogram/types/contact.py | 6 +- aiogram/types/dice.py | 3 +- aiogram/types/document.py | 13 +- aiogram/types/encrypted_credentials.py | 10 +- aiogram/types/encrypted_passport_element.py | 39 +-- aiogram/types/file.py | 15 +- aiogram/types/force_reply.py | 28 +- aiogram/types/game.py | 11 +- aiogram/types/game_high_score.py | 3 +- aiogram/types/inline_keyboard_button.py | 22 +- aiogram/types/inline_keyboard_markup.py | 8 +- aiogram/types/inline_query.py | 9 +- aiogram/types/inline_query_result.py | 44 +-- aiogram/types/inline_query_result_article.py | 16 +- aiogram/types/inline_query_result_audio.py | 24 +- .../types/inline_query_result_cached_audio.py | 20 +- .../inline_query_result_cached_document.py | 22 +- .../types/inline_query_result_cached_gif.py | 19 +- .../inline_query_result_cached_mpeg4_gif.py | 20 +- .../types/inline_query_result_cached_photo.py | 21 +- .../inline_query_result_cached_sticker.py | 13 +- .../types/inline_query_result_cached_video.py | 19 +- .../types/inline_query_result_cached_voice.py | 21 +- aiogram/types/inline_query_result_contact.py | 23 +- aiogram/types/inline_query_result_document.py | 29 +- aiogram/types/inline_query_result_game.py | 9 +- aiogram/types/inline_query_result_gif.py | 28 +- aiogram/types/inline_query_result_location.py | 29 +- .../types/inline_query_result_mpeg4_gif.py | 29 +- aiogram/types/inline_query_result_photo.py | 27 +- aiogram/types/inline_query_result_venue.py | 27 +- aiogram/types/inline_query_result_video.py | 30 +- aiogram/types/inline_query_result_voice.py | 24 +- .../types/input_contact_message_content.py | 6 +- aiogram/types/input_file.py | 3 +- .../types/input_location_message_content.py | 12 +- aiogram/types/input_media.py | 11 +- aiogram/types/input_media_animation.py | 28 +- aiogram/types/input_media_audio.py | 27 +- aiogram/types/input_media_document.py | 24 +- aiogram/types/input_media_photo.py | 14 +- aiogram/types/input_media_video.py | 29 +- aiogram/types/input_message_content.py | 12 +- aiogram/types/input_text_message_content.py | 9 +- aiogram/types/input_venue_message_content.py | 11 +- aiogram/types/invoice.py | 7 +- aiogram/types/keyboard_button.py | 23 +- aiogram/types/keyboard_button_poll_type.py | 7 +- aiogram/types/labeled_price.py | 5 +- aiogram/types/location.py | 10 +- aiogram/types/login_url.py | 24 +- aiogram/types/mask_position.py | 9 +- aiogram/types/message.py | 166 ++++------ aiogram/types/message_entity.py | 16 +- aiogram/types/order_info.py | 8 +- aiogram/types/passport_data.py | 3 +- aiogram/types/passport_element_error.py | 22 +- .../passport_element_error_data_field.py | 8 +- aiogram/types/passport_element_error_file.py | 8 +- aiogram/types/passport_element_error_files.py | 8 +- .../passport_element_error_front_side.py | 8 +- .../passport_element_error_reverse_side.py | 8 +- .../types/passport_element_error_selfie.py | 8 +- ...passport_element_error_translation_file.py | 9 +- ...assport_element_error_translation_files.py | 9 +- .../passport_element_error_unspecified.py | 5 +- aiogram/types/passport_file.py | 6 +- aiogram/types/photo_size.py | 7 +- aiogram/types/poll.py | 15 +- aiogram/types/poll_answer.py | 3 +- aiogram/types/pre_checkout_query.py | 17 +- aiogram/types/proximity_alert_triggered.py | 3 +- aiogram/types/reply_keyboard_markup.py | 18 +- aiogram/types/reply_keyboard_remove.py | 15 +- aiogram/types/response_parameters.py | 8 +- aiogram/types/shipping_query.py | 4 +- aiogram/types/sticker.py | 15 +- aiogram/types/sticker_set.py | 6 +- aiogram/types/successful_payment.py | 11 +- aiogram/types/update.py | 37 +-- aiogram/types/user.py | 12 +- aiogram/types/venue.py | 9 +- aiogram/types/video.py | 11 +- aiogram/types/video_note.py | 9 +- aiogram/types/voice.py | 7 +- aiogram/types/webhook_info.py | 12 +- aiogram/utils/helper.py | 5 +- docs2/api/methods/add_sticker_to_set.rst | 12 +- docs2/api/methods/answer_callback_query.rst | 14 +- docs2/api/methods/answer_inline_query.rst | 14 +- .../api/methods/answer_pre_checkout_query.rst | 12 +- docs2/api/methods/answer_shipping_query.rst | 12 +- docs2/api/methods/close.rst | 51 +++ docs2/api/methods/copy_message.rst | 51 +++ docs2/api/methods/create_new_sticker_set.rst | 12 +- docs2/api/methods/delete_chat_photo.rst | 12 +- docs2/api/methods/delete_chat_sticker_set.rst | 12 +- docs2/api/methods/delete_message.rst | 28 +- docs2/api/methods/delete_sticker_from_set.rst | 12 +- docs2/api/methods/delete_webhook.rst | 12 +- docs2/api/methods/edit_message_caption.rst | 12 +- .../methods/edit_message_live_location.rst | 12 +- docs2/api/methods/edit_message_media.rst | 12 +- .../api/methods/edit_message_reply_markup.rst | 12 +- docs2/api/methods/edit_message_text.rst | 12 +- docs2/api/methods/export_chat_invite_link.rst | 14 +- docs2/api/methods/forward_message.rst | 12 +- docs2/api/methods/get_chat.rst | 10 +- docs2/api/methods/get_chat_administrators.rst | 10 +- docs2/api/methods/get_chat_member.rst | 10 +- docs2/api/methods/get_chat_members_count.rst | 10 +- docs2/api/methods/get_file.rst | 12 +- docs2/api/methods/get_game_high_scores.rst | 12 +- docs2/api/methods/get_me.rst | 10 +- docs2/api/methods/get_my_commands.rst | 10 +- docs2/api/methods/get_sticker_set.rst | 10 +- docs2/api/methods/get_updates.rst | 16 +- docs2/api/methods/get_user_profile_photos.rst | 10 +- docs2/api/methods/get_webhook_info.rst | 10 +- docs2/api/methods/index.rst | 11 +- docs2/api/methods/kick_chat_member.rst | 12 +- docs2/api/methods/leave_chat.rst | 12 +- docs2/api/methods/log_out.rst | 51 +++ docs2/api/methods/pin_chat_message.rst | 12 +- docs2/api/methods/promote_chat_member.rst | 12 +- docs2/api/methods/restrict_chat_member.rst | 12 +- docs2/api/methods/send_animation.rst | 12 +- docs2/api/methods/send_audio.rst | 14 +- docs2/api/methods/send_chat_action.rst | 16 +- docs2/api/methods/send_contact.rst | 12 +- docs2/api/methods/send_dice.rst | 12 +- docs2/api/methods/send_document.rst | 12 +- docs2/api/methods/send_game.rst | 12 +- docs2/api/methods/send_invoice.rst | 12 +- docs2/api/methods/send_location.rst | 12 +- docs2/api/methods/send_media_group.rst | 12 +- docs2/api/methods/send_message.rst | 12 +- docs2/api/methods/send_photo.rst | 12 +- docs2/api/methods/send_poll.rst | 12 +- docs2/api/methods/send_sticker.rst | 12 +- docs2/api/methods/send_venue.rst | 12 +- docs2/api/methods/send_video.rst | 12 +- docs2/api/methods/send_video_note.rst | 12 +- docs2/api/methods/send_voice.rst | 12 +- .../set_chat_administrator_custom_title.rst | 12 +- docs2/api/methods/set_chat_description.rst | 12 +- docs2/api/methods/set_chat_permissions.rst | 12 +- docs2/api/methods/set_chat_photo.rst | 10 +- docs2/api/methods/set_chat_sticker_set.rst | 12 +- docs2/api/methods/set_chat_title.rst | 12 +- docs2/api/methods/set_game_score.rst | 12 +- docs2/api/methods/set_my_commands.rst | 12 +- .../api/methods/set_passport_data_errors.rst | 14 +- .../methods/set_sticker_position_in_set.rst | 12 +- docs2/api/methods/set_sticker_set_thumb.rst | 12 +- docs2/api/methods/set_webhook.rst | 24 +- .../methods/stop_message_live_location.rst | 12 +- docs2/api/methods/stop_poll.rst | 12 +- docs2/api/methods/unban_chat_member.rst | 12 +- docs2/api/methods/unpin_all_chat_messages.rst | 51 +++ docs2/api/methods/unpin_chat_message.rst | 12 +- docs2/api/methods/upload_sticker_file.rst | 10 +- docs2/api/types/animation.rst | 2 - docs2/api/types/audio.rst | 2 - docs2/api/types/bot_command.rst | 2 - docs2/api/types/callback_game.rst | 2 - docs2/api/types/callback_query.rst | 4 - docs2/api/types/chat.rst | 2 - docs2/api/types/chat_location.rst | 9 + docs2/api/types/chat_member.rst | 2 - docs2/api/types/chat_permissions.rst | 2 - docs2/api/types/chat_photo.rst | 2 - docs2/api/types/chosen_inline_result.rst | 4 - docs2/api/types/contact.rst | 2 - docs2/api/types/dice.rst | 2 - docs2/api/types/document.rst | 2 - docs2/api/types/encrypted_credentials.rst | 2 - .../api/types/encrypted_passport_element.rst | 2 - docs2/api/types/file.rst | 4 - docs2/api/types/force_reply.rst | 12 - docs2/api/types/game.rst | 2 - docs2/api/types/game_high_score.rst | 6 - docs2/api/types/index.rst | 11 +- docs2/api/types/inline_keyboard_button.rst | 2 - docs2/api/types/inline_keyboard_markup.rst | 4 - docs2/api/types/inline_query.rst | 2 - docs2/api/types/inline_query_result.rst | 42 --- .../api/types/inline_query_result_article.rst | 2 - docs2/api/types/inline_query_result_audio.rst | 4 - .../inline_query_result_cached_audio.rst | 4 - .../inline_query_result_cached_document.rst | 4 - .../types/inline_query_result_cached_gif.rst | 2 - .../inline_query_result_cached_mpeg4_gif.rst | 2 - .../inline_query_result_cached_photo.rst | 2 - .../inline_query_result_cached_sticker.rst | 4 - .../inline_query_result_cached_video.rst | 2 - .../inline_query_result_cached_voice.rst | 4 - .../api/types/inline_query_result_contact.rst | 4 - .../types/inline_query_result_document.rst | 4 - docs2/api/types/inline_query_result_game.rst | 4 - docs2/api/types/inline_query_result_gif.rst | 2 - .../types/inline_query_result_location.rst | 4 - .../types/inline_query_result_mpeg4_gif.rst | 2 - docs2/api/types/inline_query_result_photo.rst | 2 - docs2/api/types/inline_query_result_venue.rst | 4 - docs2/api/types/inline_query_result_video.rst | 4 - docs2/api/types/inline_query_result_voice.rst | 4 - .../types/input_contact_message_content.rst | 2 - docs2/api/types/input_file.rst | 26 +- .../types/input_location_message_content.rst | 2 - docs2/api/types/input_media.rst | 12 - docs2/api/types/input_media_animation.rst | 2 - docs2/api/types/input_media_audio.rst | 2 - docs2/api/types/input_media_document.rst | 2 - docs2/api/types/input_media_photo.rst | 2 - docs2/api/types/input_media_video.rst | 2 - docs2/api/types/input_message_content.rst | 10 - .../api/types/input_text_message_content.rst | 2 - .../api/types/input_venue_message_content.rst | 2 - docs2/api/types/invoice.rst | 2 - docs2/api/types/keyboard_button.rst | 6 - docs2/api/types/keyboard_button_poll_type.rst | 2 - docs2/api/types/labeled_price.rst | 2 - docs2/api/types/location.rst | 2 - docs2/api/types/login_url.rst | 6 - docs2/api/types/mask_position.rst | 2 - docs2/api/types/message.rst | 2 - docs2/api/types/message_entity.rst | 2 - docs2/api/types/message_id.rst | 9 + docs2/api/types/order_info.rst | 2 - docs2/api/types/passport_data.rst | 2 - docs2/api/types/passport_element_error.rst | 20 -- .../passport_element_error_data_field.rst | 2 - .../api/types/passport_element_error_file.rst | 2 - .../types/passport_element_error_files.rst | 2 - .../passport_element_error_front_side.rst | 2 - .../passport_element_error_reverse_side.rst | 2 - .../types/passport_element_error_selfie.rst | 2 - ...assport_element_error_translation_file.rst | 2 - ...ssport_element_error_translation_files.rst | 2 - .../passport_element_error_unspecified.rst | 2 - docs2/api/types/passport_file.rst | 2 - docs2/api/types/photo_size.rst | 2 - docs2/api/types/poll.rst | 2 - docs2/api/types/poll_answer.rst | 2 - docs2/api/types/poll_option.rst | 2 - docs2/api/types/pre_checkout_query.rst | 2 - docs2/api/types/proximity_alert_triggered.rst | 9 + docs2/api/types/reply_keyboard_markup.rst | 2 - docs2/api/types/reply_keyboard_remove.rst | 2 - docs2/api/types/response_parameters.rst | 2 - docs2/api/types/shipping_address.rst | 2 - docs2/api/types/shipping_option.rst | 2 - docs2/api/types/shipping_query.rst | 2 - docs2/api/types/sticker.rst | 2 - docs2/api/types/sticker_set.rst | 2 - docs2/api/types/successful_payment.rst | 2 - docs2/api/types/update.rst | 4 - docs2/api/types/user.rst | 2 - docs2/api/types/user_profile_photos.rst | 2 - docs2/api/types/venue.rst | 2 - docs2/api/types/video.rst | 2 - docs2/api/types/video_note.rst | 2 - docs2/api/types/voice.rst | 2 - docs2/api/types/webhook_info.rst | 2 - docs2/api/upload_file.rst | 10 +- tests/deprecated.py | 4 +- tests/test_api/test_client/test_bot.py | 3 +- .../test_session/test_aiohttp_session.py | 7 +- .../test_session/test_base_session.py | 5 +- .../test_methods/test_set_my_commands.py | 4 +- tests/test_api/test_types/test_message.py | 7 +- tests/test_dispatcher/test_dispatcher.py | 3 +- .../test_dispatcher/test_event/test_event.py | 6 +- .../test_dispatcher/test_filters/test_base.py | 3 +- 363 files changed, 1510 insertions(+), 2262 deletions(-) create mode 100644 docs2/api/methods/close.rst create mode 100644 docs2/api/methods/copy_message.rst create mode 100644 docs2/api/methods/log_out.rst create mode 100644 docs2/api/methods/unpin_all_chat_messages.rst create mode 100644 docs2/api/types/chat_location.rst create mode 100644 docs2/api/types/message_id.rst create mode 100644 docs2/api/types/proximity_alert_triggered.rst diff --git a/Makefile b/Makefile index 6a2f442a..ca31515a 100644 --- a/Makefile +++ b/Makefile @@ -70,7 +70,7 @@ clean: .PHONY: isort isort: - $(py) isort -rc aiogram tests + $(py) isort aiogram tests .PHONY: black black: diff --git a/aiogram/client/bot.py b/aiogram/client/bot.py index a22213f6..b55e9aa5 100644 --- a/aiogram/client/bot.py +++ b/aiogram/client/bot.py @@ -330,19 +330,20 @@ class Bot(ContextInstanceMixin["Bot"]): request_timeout: Optional[int] = None, ) -> List[Update]: """ - Use this method to receive incoming updates using long polling (`wiki `_). An Array of `Update `_ objects is returned. - **Notes** + Use this method to receive incoming updates using long polling (`wiki `_). An Array of :class:`aiogram.types.update.Update` objects is returned. - **1.** This method will not work if an outgoing webhook is set up. + **Notes** - **2.** In order to avoid getting duplicate updates, recalculate *offset* after each server response. + **1.** This method will not work if an outgoing webhook is set up. + + **2.** In order to avoid getting duplicate updates, recalculate *offset* after each server response. Source: https://core.telegram.org/bots/api#getupdates - :param offset: Identifier of the first update to be returned. Must be greater by one than the highest among the identifiers of previously received updates. By default, updates starting with the earliest unconfirmed update are returned. An update is considered confirmed as soon as `getUpdates `_ is called with an *offset* higher than its *update_id*. The negative offset can be specified to retrieve updates starting from *-offset* update from the end of the updates queue. All previous updates will forgotten. + :param offset: Identifier of the first update to be returned. Must be greater by one than the highest among the identifiers of previously received updates. By default, updates starting with the earliest unconfirmed update are returned. An update is considered confirmed as soon as :class:`aiogram.methods.get_updates.GetUpdates` is called with an *offset* higher than its *update_id*. The negative offset can be specified to retrieve updates starting from *-offset* update from the end of the updates queue. All previous updates will forgotten. :param limit: Limits the number of updates to be retrieved. Values between 1-100 are accepted. Defaults to 100. :param timeout: Timeout in seconds for long polling. Defaults to 0, i.e. usual short polling. Should be positive, short polling should be used for testing purposes only. - :param allowed_updates: A JSON-serialized list of the update types you want your bot to receive. For example, specify [“message”, “edited_channel_post”, “callback_query”] to only receive updates of these types. See `Update `_ for a complete list of available update types. Specify an empty list to receive all updates regardless of type (default). If not specified, the previous setting will be used. + :param allowed_updates: A JSON-serialized list of the update types you want your bot to receive. For example, specify ['message', 'edited_channel_post', 'callback_query'] to only receive updates of these types. See :class:`aiogram.types.update.Update` for a complete list of available update types. Specify an empty list to receive all updates regardless of type (default). If not specified, the previous setting will be used. :param request_timeout: Request timeout :return: An Array of Update objects is returned. """ @@ -365,16 +366,17 @@ class Bot(ContextInstanceMixin["Bot"]): request_timeout: Optional[int] = None, ) -> bool: """ - Use this method to specify a url and receive incoming updates via an outgoing webhook. Whenever there is an update for the bot, we will send an HTTPS POST request to the specified url, containing a JSON-serialized `Update `_. In case of an unsuccessful request, we will give up after a reasonable amount of attempts. Returns *True* on success. + Use this method to specify a url and receive incoming updates via an outgoing webhook. Whenever there is an update for the bot, we will send an HTTPS POST request to the specified url, containing a JSON-serialized :class:`aiogram.types.update.Update`. In case of an unsuccessful request, we will give up after a reasonable amount of attempts. Returns :code:`True` on success. If you'd like to make sure that the Webhook request comes from Telegram, we recommend using a secret path in the URL, e.g. :code:`https://www.example.com/`. Since nobody else knows your bot's token, you can be pretty sure it's us. - **Notes** - **1.** You will not be able to receive updates using `getUpdates `_ for as long as an outgoing webhook is set up. + **Notes** - **2.** To use a self-signed certificate, you need to upload your `public key certificate `_ using *certificate* parameter. Please upload as InputFile, sending a String will not work. + **1.** You will not be able to receive updates using :class:`aiogram.methods.get_updates.GetUpdates` for as long as an outgoing webhook is set up. - **3.** Ports currently supported *for Webhooks*: **443, 80, 88, 8443**. - **NEW!** If you're having any trouble setting up webhooks, please check out this `amazing guide to Webhooks `_. + **2.** To use a self-signed certificate, you need to upload your `public key certificate `_ using *certificate* parameter. Please upload as InputFile, sending a String will not work. + + **3.** Ports currently supported *for Webhooks*: **443, 80, 88, 8443**. + **NEW!** If you're having any trouble setting up webhooks, please check out this `amazing guide to Webhooks `_. Source: https://core.telegram.org/bots/api#setwebhook @@ -382,8 +384,8 @@ class Bot(ContextInstanceMixin["Bot"]): :param certificate: Upload your public key certificate so that the root certificate in use can be checked. See our `self-signed guide `_ for details. :param ip_address: The fixed IP address which will be used to send webhook requests instead of the IP address resolved through DNS :param max_connections: Maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery, 1-100. Defaults to *40*. Use lower values to limit the load on your bot's server, and higher values to increase your bot's throughput. - :param allowed_updates: A JSON-serialized list of the update types you want your bot to receive. For example, specify [“message”, “edited_channel_post”, “callback_query”] to only receive updates of these types. See `Update `_ for a complete list of available update types. Specify an empty list to receive all updates regardless of type (default). If not specified, the previous setting will be used. - :param drop_pending_updates: Pass *True* to drop all pending updates + :param allowed_updates: A JSON-serialized list of the update types you want your bot to receive. For example, specify ['message', 'edited_channel_post', 'callback_query'] to only receive updates of these types. See :class:`aiogram.types.update.Update` for a complete list of available update types. Specify an empty list to receive all updates regardless of type (default). If not specified, the previous setting will be used. + :param drop_pending_updates: Pass :code:`True` to drop all pending updates :param request_timeout: Request timeout :return: Returns True on success. """ @@ -403,11 +405,11 @@ class Bot(ContextInstanceMixin["Bot"]): request_timeout: Optional[int] = None, ) -> bool: """ - Use this method to remove webhook integration if you decide to switch back to `getUpdates `_. Returns *True* on success. + Use this method to remove webhook integration if you decide to switch back to :class:`aiogram.methods.get_updates.GetUpdates`. Returns :code:`True` on success. Source: https://core.telegram.org/bots/api#deletewebhook - :param drop_pending_updates: Pass *True* to drop all pending updates + :param drop_pending_updates: Pass :code:`True` to drop all pending updates :param request_timeout: Request timeout :return: Returns True on success. """ @@ -421,7 +423,7 @@ class Bot(ContextInstanceMixin["Bot"]): request_timeout: Optional[int] = None, ) -> WebhookInfo: """ - Use this method to get current webhook status. Requires no parameters. On success, returns a `WebhookInfo `_ object. If the bot is using `getUpdates `_, will return an object with the *url* field empty. + Use this method to get current webhook status. Requires no parameters. On success, returns a :class:`aiogram.types.webhook_info.WebhookInfo` object. If the bot is using :class:`aiogram.methods.get_updates.GetUpdates`, will return an object with the *url* field empty. Source: https://core.telegram.org/bots/api#getwebhookinfo @@ -442,7 +444,7 @@ class Bot(ContextInstanceMixin["Bot"]): request_timeout: Optional[int] = None, ) -> User: """ - A simple method for testing your bot's auth token. Requires no parameters. Returns basic information about the bot in form of a `User `_ object. + A simple method for testing your bot's auth token. Requires no parameters. Returns basic information about the bot in form of a :class:`aiogram.types.user.User` object. Source: https://core.telegram.org/bots/api#getme @@ -457,7 +459,7 @@ class Bot(ContextInstanceMixin["Bot"]): request_timeout: Optional[int] = None, ) -> bool: """ - Use this method to log out from the cloud Bot API server before launching the bot locally. You **must** log out the bot before running it locally, otherwise there is no guarantee that the bot will receive updates. After a successful call, you can immediately log in on a local server, but will not be able to log in back to the cloud Bot API server for 10 minutes. Returns *True* on success. Requires no parameters. + Use this method to log out from the cloud Bot API server before launching the bot locally. You **must** log out the bot before running it locally, otherwise there is no guarantee that the bot will receive updates. After a successful call, you can immediately log in on a local server, but will not be able to log in back to the cloud Bot API server for 10 minutes. Returns :code:`True` on success. Requires no parameters. Source: https://core.telegram.org/bots/api#logout @@ -472,7 +474,7 @@ class Bot(ContextInstanceMixin["Bot"]): request_timeout: Optional[int] = None, ) -> bool: """ - Use this method to close the bot instance before moving it from one local server to another. You need to delete the webhook before calling this method to ensure that the bot isn't launched again after server restart. The method will return error 429 in the first 10 minutes after the bot is launched. Returns *True* on success. Requires no parameters. + Use this method to close the bot instance before moving it from one local server to another. You need to delete the webhook before calling this method to ensure that the bot isn't launched again after server restart. The method will return error 429 in the first 10 minutes after the bot is launched. Returns :code:`True` on success. Requires no parameters. Source: https://core.telegram.org/bots/api#close @@ -499,7 +501,7 @@ class Bot(ContextInstanceMixin["Bot"]): request_timeout: Optional[int] = None, ) -> Message: """ - Use this method to send text messages. On success, the sent `Message `_ is returned. + Use this method to send text messages. On success, the sent :class:`aiogram.types.message.Message` is returned. Source: https://core.telegram.org/bots/api#sendmessage @@ -510,7 +512,7 @@ class Bot(ContextInstanceMixin["Bot"]): :param disable_web_page_preview: Disables link previews for links in this message :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param reply_to_message_id: If the message is a reply, ID of the original message - :param allow_sending_without_reply: Pass *True*, if the message should be sent even if the specified replied-to message is not found + :param allow_sending_without_reply: Pass :code:`True`, if the message should be sent even if the specified replied-to message is not found :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user. :param request_timeout: Request timeout :return: On success, the sent Message is returned. @@ -537,7 +539,7 @@ class Bot(ContextInstanceMixin["Bot"]): request_timeout: Optional[int] = None, ) -> Message: """ - Use this method to forward messages of any kind. On success, the sent `Message `_ is returned. + Use this method to forward messages of any kind. On success, the sent :class:`aiogram.types.message.Message` is returned. Source: https://core.telegram.org/bots/api#forwardmessage @@ -573,7 +575,7 @@ class Bot(ContextInstanceMixin["Bot"]): request_timeout: Optional[int] = None, ) -> MessageId: """ - Use this method to copy messages of any kind. The method is analogous to the method `forwardMessages `_, but the copied message doesn't have a link to the original message. Returns the `MessageId `_ of the sent message on success. + Use this method to copy messages of any kind. The method is analogous to the method :class:`aiogram.methods.forward_messages.ForwardMessages`, but the copied message doesn't have a link to the original message. Returns the :class:`aiogram.types.message_id.MessageId` of the sent message on success. Source: https://core.telegram.org/bots/api#copymessage @@ -585,7 +587,7 @@ class Bot(ContextInstanceMixin["Bot"]): :param caption_entities: List of special entities that appear in the new caption, which can be specified instead of *parse_mode* :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param reply_to_message_id: If the message is a reply, ID of the original message - :param allow_sending_without_reply: Pass *True*, if the message should be sent even if the specified replied-to message is not found + :param allow_sending_without_reply: Pass :code:`True`, if the message should be sent even if the specified replied-to message is not found :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user. :param request_timeout: Request timeout :return: Returns the MessageId of the sent message on success. @@ -620,18 +622,18 @@ class Bot(ContextInstanceMixin["Bot"]): request_timeout: Optional[int] = None, ) -> Message: """ - Use this method to send photos. On success, the sent `Message `_ is returned. + Use this method to send photos. On success, the sent :class:`aiogram.types.message.Message` is returned. Source: https://core.telegram.org/bots/api#sendphoto :param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`) - :param photo: Photo to send. Pass a file_id as String to send a photo that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a photo from the Internet, or upload a new photo using multipart/form-data. The photo must be at most 10 MB in size. The photo's width and height must not exceed 10000 in total. Width and height ratio must be at most 20. `More info on Sending Files » `_ + :param photo: Photo to send. Pass a file_id as String to send a photo that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a photo from the Internet, or upload a new photo using multipart/form-data. The photo must be at most 10 MB in size. The photo's width and height must not exceed 10000 in total. Width and height ratio must be at most 20. :ref:`More info on Sending Files » ` :param caption: Photo caption (may also be used when resending photos by *file_id*), 0-1024 characters after entities parsing :param parse_mode: Mode for parsing entities in the photo caption. See `formatting options `_ for more details. :param caption_entities: List of special entities that appear in the caption, which can be specified instead of *parse_mode* :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param reply_to_message_id: If the message is a reply, ID of the original message - :param allow_sending_without_reply: Pass *True*, if the message should be sent even if the specified replied-to message is not found + :param allow_sending_without_reply: Pass :code:`True`, if the message should be sent even if the specified replied-to message is not found :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user. :param request_timeout: Request timeout :return: On success, the sent Message is returned. @@ -669,23 +671,23 @@ class Bot(ContextInstanceMixin["Bot"]): request_timeout: Optional[int] = None, ) -> Message: """ - Use this method to send audio files, if you want Telegram clients to display them in the music player. Your audio must be in the .MP3 or .M4A format. On success, the sent `Message `_ is returned. Bots can currently send audio files of up to 50 MB in size, this limit may be changed in the future. - For sending voice messages, use the `sendVoice `_ method instead. + Use this method to send audio files, if you want Telegram clients to display them in the music player. Your audio must be in the .MP3 or .M4A format. On success, the sent :class:`aiogram.types.message.Message` is returned. Bots can currently send audio files of up to 50 MB in size, this limit may be changed in the future. + For sending voice messages, use the :class:`aiogram.methods.send_voice.SendVoice` method instead. Source: https://core.telegram.org/bots/api#sendaudio :param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`) - :param audio: Audio file to send. Pass a file_id as String to send an audio file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an audio file from the Internet, or upload a new one using multipart/form-data. `More info on Sending Files » `_ + :param audio: Audio file to send. Pass a file_id as String to send an audio file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an audio file from the Internet, or upload a new one using multipart/form-data. :ref:`More info on Sending Files » ` :param caption: Audio caption, 0-1024 characters after entities parsing :param parse_mode: Mode for parsing entities in the audio caption. See `formatting options `_ for more details. :param caption_entities: List of special entities that appear in the caption, which can be specified instead of *parse_mode* :param duration: Duration of the audio in seconds :param performer: Performer :param title: Track name - :param thumb: Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://” if the thumbnail was uploaded using multipart/form-data under . `More info on Sending Files » `_ + :param thumb: Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://' if the thumbnail was uploaded using multipart/form-data under . :ref:`More info on Sending Files » ` :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param reply_to_message_id: If the message is a reply, ID of the original message - :param allow_sending_without_reply: Pass *True*, if the message should be sent even if the specified replied-to message is not found + :param allow_sending_without_reply: Pass :code:`True`, if the message should be sent even if the specified replied-to message is not found :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user. :param request_timeout: Request timeout :return: On success, the sent Message is returned. @@ -725,20 +727,20 @@ class Bot(ContextInstanceMixin["Bot"]): request_timeout: Optional[int] = None, ) -> Message: """ - Use this method to send general files. On success, the sent `Message `_ is returned. Bots can currently send files of any type of up to 50 MB in size, this limit may be changed in the future. + Use this method to send general files. On success, the sent :class:`aiogram.types.message.Message` is returned. Bots can currently send files of any type of up to 50 MB in size, this limit may be changed in the future. Source: https://core.telegram.org/bots/api#senddocument :param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`) - :param document: File to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. `More info on Sending Files » `_ - :param thumb: Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://” if the thumbnail was uploaded using multipart/form-data under . `More info on Sending Files » `_ + :param document: File to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. :ref:`More info on Sending Files » ` + :param thumb: Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://' if the thumbnail was uploaded using multipart/form-data under . :ref:`More info on Sending Files » ` :param caption: Document caption (may also be used when resending documents by *file_id*), 0-1024 characters after entities parsing :param parse_mode: Mode for parsing entities in the document caption. See `formatting options `_ for more details. :param caption_entities: List of special entities that appear in the caption, which can be specified instead of *parse_mode* :param disable_content_type_detection: Disables automatic server-side content type detection for files uploaded using multipart/form-data :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param reply_to_message_id: If the message is a reply, ID of the original message - :param allow_sending_without_reply: Pass *True*, if the message should be sent even if the specified replied-to message is not found + :param allow_sending_without_reply: Pass :code:`True`, if the message should be sent even if the specified replied-to message is not found :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user. :param request_timeout: Request timeout :return: On success, the sent Message is returned. @@ -779,23 +781,23 @@ class Bot(ContextInstanceMixin["Bot"]): request_timeout: Optional[int] = None, ) -> Message: """ - Use this method to send video files, Telegram clients support mp4 videos (other formats may be sent as `Document `_). On success, the sent `Message `_ is returned. Bots can currently send video files of up to 50 MB in size, this limit may be changed in the future. + Use this method to send video files, Telegram clients support mp4 videos (other formats may be sent as :class:`aiogram.types.document.Document`). On success, the sent :class:`aiogram.types.message.Message` is returned. Bots can currently send video files of up to 50 MB in size, this limit may be changed in the future. Source: https://core.telegram.org/bots/api#sendvideo :param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`) - :param video: Video to send. Pass a file_id as String to send a video that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a video from the Internet, or upload a new video using multipart/form-data. `More info on Sending Files » `_ + :param video: Video to send. Pass a file_id as String to send a video that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a video from the Internet, or upload a new video using multipart/form-data. :ref:`More info on Sending Files » ` :param duration: Duration of sent video in seconds :param width: Video width :param height: Video height - :param thumb: Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://” if the thumbnail was uploaded using multipart/form-data under . `More info on Sending Files » `_ + :param thumb: Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://' if the thumbnail was uploaded using multipart/form-data under . :ref:`More info on Sending Files » ` :param caption: Video caption (may also be used when resending videos by *file_id*), 0-1024 characters after entities parsing :param parse_mode: Mode for parsing entities in the video caption. See `formatting options `_ for more details. :param caption_entities: List of special entities that appear in the caption, which can be specified instead of *parse_mode* - :param supports_streaming: Pass *True*, if the uploaded video is suitable for streaming + :param supports_streaming: Pass :code:`True`, if the uploaded video is suitable for streaming :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param reply_to_message_id: If the message is a reply, ID of the original message - :param allow_sending_without_reply: Pass *True*, if the message should be sent even if the specified replied-to message is not found + :param allow_sending_without_reply: Pass :code:`True`, if the message should be sent even if the specified replied-to message is not found :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user. :param request_timeout: Request timeout :return: On success, the sent Message is returned. @@ -838,22 +840,22 @@ class Bot(ContextInstanceMixin["Bot"]): request_timeout: Optional[int] = None, ) -> Message: """ - Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without sound). On success, the sent `Message `_ is returned. Bots can currently send animation files of up to 50 MB in size, this limit may be changed in the future. + Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without sound). On success, the sent :class:`aiogram.types.message.Message` is returned. Bots can currently send animation files of up to 50 MB in size, this limit may be changed in the future. Source: https://core.telegram.org/bots/api#sendanimation :param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`) - :param animation: Animation to send. Pass a file_id as String to send an animation that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an animation from the Internet, or upload a new animation using multipart/form-data. `More info on Sending Files » `_ + :param animation: Animation to send. Pass a file_id as String to send an animation that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an animation from the Internet, or upload a new animation using multipart/form-data. :ref:`More info on Sending Files » ` :param duration: Duration of sent animation in seconds :param width: Animation width :param height: Animation height - :param thumb: Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://” if the thumbnail was uploaded using multipart/form-data under . `More info on Sending Files » `_ + :param thumb: Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://' if the thumbnail was uploaded using multipart/form-data under . :ref:`More info on Sending Files » ` :param caption: Animation caption (may also be used when resending animation by *file_id*), 0-1024 characters after entities parsing :param parse_mode: Mode for parsing entities in the animation caption. See `formatting options `_ for more details. :param caption_entities: List of special entities that appear in the caption, which can be specified instead of *parse_mode* :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param reply_to_message_id: If the message is a reply, ID of the original message - :param allow_sending_without_reply: Pass *True*, if the message should be sent even if the specified replied-to message is not found + :param allow_sending_without_reply: Pass :code:`True`, if the message should be sent even if the specified replied-to message is not found :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user. :param request_timeout: Request timeout :return: On success, the sent Message is returned. @@ -892,19 +894,19 @@ class Bot(ContextInstanceMixin["Bot"]): request_timeout: Optional[int] = None, ) -> Message: """ - Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .OGG file encoded with OPUS (other formats may be sent as `Audio `_ or `Document `_). On success, the sent `Message `_ is returned. Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future. + Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .OGG file encoded with OPUS (other formats may be sent as :class:`aiogram.types.audio.Audio` or :class:`aiogram.types.document.Document`). On success, the sent :class:`aiogram.types.message.Message` is returned. Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future. Source: https://core.telegram.org/bots/api#sendvoice :param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`) - :param voice: Audio file to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. `More info on Sending Files » `_ + :param voice: Audio file to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. :ref:`More info on Sending Files » ` :param caption: Voice message caption, 0-1024 characters after entities parsing :param parse_mode: Mode for parsing entities in the voice message caption. See `formatting options `_ for more details. :param caption_entities: List of special entities that appear in the caption, which can be specified instead of *parse_mode* :param duration: Duration of the voice message in seconds :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param reply_to_message_id: If the message is a reply, ID of the original message - :param allow_sending_without_reply: Pass *True*, if the message should be sent even if the specified replied-to message is not found + :param allow_sending_without_reply: Pass :code:`True`, if the message should be sent even if the specified replied-to message is not found :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user. :param request_timeout: Request timeout :return: On success, the sent Message is returned. @@ -939,18 +941,18 @@ class Bot(ContextInstanceMixin["Bot"]): request_timeout: Optional[int] = None, ) -> Message: """ - As of `v.4.0 `_, Telegram clients support rounded square mp4 videos of up to 1 minute long. Use this method to send video messages. On success, the sent `Message `_ is returned. + As of `v.4.0 `_, Telegram clients support rounded square mp4 videos of up to 1 minute long. Use this method to send video messages. On success, the sent :class:`aiogram.types.message.Message` is returned. Source: https://core.telegram.org/bots/api#sendvideonote :param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`) - :param video_note: Video note to send. Pass a file_id as String to send a video note that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. `More info on Sending Files » `_. Sending video notes by a URL is currently unsupported + :param video_note: Video note to send. Pass a file_id as String to send a video note that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. :ref:`More info on Sending Files » `. Sending video notes by a URL is currently unsupported :param duration: Duration of sent video in seconds :param length: Video width and height, i.e. diameter of the video message - :param thumb: Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://” if the thumbnail was uploaded using multipart/form-data under . `More info on Sending Files » `_ + :param thumb: Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://' if the thumbnail was uploaded using multipart/form-data under . :ref:`More info on Sending Files » ` :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param reply_to_message_id: If the message is a reply, ID of the original message - :param allow_sending_without_reply: Pass *True*, if the message should be sent even if the specified replied-to message is not found + :param allow_sending_without_reply: Pass :code:`True`, if the message should be sent even if the specified replied-to message is not found :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user. :param request_timeout: Request timeout :return: On success, the sent Message is returned. @@ -986,7 +988,7 @@ class Bot(ContextInstanceMixin["Bot"]): :param media: A JSON-serialized array describing messages to be sent, must include 2-10 items :param disable_notification: Sends messages `silently `_. Users will receive a notification with no sound. :param reply_to_message_id: If the messages are a reply, ID of the original message - :param allow_sending_without_reply: Pass *True*, if the message should be sent even if the specified replied-to message is not found + :param allow_sending_without_reply: Pass :code:`True`, if the message should be sent even if the specified replied-to message is not found :param request_timeout: Request timeout :return: On success, an array of Messages that were sent is returned. """ @@ -1017,7 +1019,7 @@ class Bot(ContextInstanceMixin["Bot"]): request_timeout: Optional[int] = None, ) -> Message: """ - Use this method to send point on the map. On success, the sent `Message `_ is returned. + Use this method to send point on the map. On success, the sent :class:`aiogram.types.message.Message` is returned. Source: https://core.telegram.org/bots/api#sendlocation @@ -1030,7 +1032,7 @@ class Bot(ContextInstanceMixin["Bot"]): :param proximity_alert_radius: For live locations, a maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified. :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param reply_to_message_id: If the message is a reply, ID of the original message - :param allow_sending_without_reply: Pass *True*, if the message should be sent even if the specified replied-to message is not found + :param allow_sending_without_reply: Pass :code:`True`, if the message should be sent even if the specified replied-to message is not found :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user. :param request_timeout: Request timeout :return: On success, the sent Message is returned. @@ -1064,7 +1066,7 @@ class Bot(ContextInstanceMixin["Bot"]): request_timeout: Optional[int] = None, ) -> Union[Message, bool]: """ - Use this method to edit live location messages. A location can be edited until its *live_period* expires or editing is explicitly disabled by a call to `stopMessageLiveLocation `_. On success, if the edited message is not an inline message, the edited `Message `_ is returned, otherwise *True* is returned. + Use this method to edit live location messages. A location can be edited until its *live_period* expires or editing is explicitly disabled by a call to :class:`aiogram.methods.stop_message_live_location.StopMessageLiveLocation`. On success, if the edited message is not an inline message, the edited :class:`aiogram.types.message.Message` is returned, otherwise :code:`True` is returned. Source: https://core.telegram.org/bots/api#editmessagelivelocation @@ -1103,7 +1105,7 @@ class Bot(ContextInstanceMixin["Bot"]): request_timeout: Optional[int] = None, ) -> Union[Message, bool]: """ - Use this method to stop updating a live location message before *live_period* expires. On success, if the message was sent by the bot, the sent `Message `_ is returned, otherwise *True* is returned. + Use this method to stop updating a live location message before *live_period* expires. On success, if the message was sent by the bot, the sent :class:`aiogram.types.message.Message` is returned, otherwise :code:`True` is returned. Source: https://core.telegram.org/bots/api#stopmessagelivelocation @@ -1143,7 +1145,7 @@ class Bot(ContextInstanceMixin["Bot"]): request_timeout: Optional[int] = None, ) -> Message: """ - Use this method to send information about a venue. On success, the sent `Message `_ is returned. + Use this method to send information about a venue. On success, the sent :class:`aiogram.types.message.Message` is returned. Source: https://core.telegram.org/bots/api#sendvenue @@ -1153,12 +1155,12 @@ class Bot(ContextInstanceMixin["Bot"]): :param title: Name of the venue :param address: Address of the venue :param foursquare_id: Foursquare identifier of the venue - :param foursquare_type: Foursquare type of the venue, if known. (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.) + :param foursquare_type: Foursquare type of the venue, if known. (For example, 'arts_entertainment/default', 'arts_entertainment/aquarium' or 'food/icecream'.) :param google_place_id: Google Places identifier of the venue :param google_place_type: Google Places type of the venue. (See `supported types `_.) :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param reply_to_message_id: If the message is a reply, ID of the original message - :param allow_sending_without_reply: Pass *True*, if the message should be sent even if the specified replied-to message is not found + :param allow_sending_without_reply: Pass :code:`True`, if the message should be sent even if the specified replied-to message is not found :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user. :param request_timeout: Request timeout :return: On success, the sent Message is returned. @@ -1196,7 +1198,7 @@ class Bot(ContextInstanceMixin["Bot"]): request_timeout: Optional[int] = None, ) -> Message: """ - Use this method to send phone contacts. On success, the sent `Message `_ is returned. + Use this method to send phone contacts. On success, the sent :class:`aiogram.types.message.Message` is returned. Source: https://core.telegram.org/bots/api#sendcontact @@ -1207,7 +1209,7 @@ class Bot(ContextInstanceMixin["Bot"]): :param vcard: Additional data about the contact in the form of a `vCard `_, 0-2048 bytes :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param reply_to_message_id: If the message is a reply, ID of the original message - :param allow_sending_without_reply: Pass *True*, if the message should be sent even if the specified replied-to message is not found + :param allow_sending_without_reply: Pass :code:`True`, if the message should be sent even if the specified replied-to message is not found :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove keyboard or to force a reply from the user. :param request_timeout: Request timeout :return: On success, the sent Message is returned. @@ -1249,15 +1251,15 @@ class Bot(ContextInstanceMixin["Bot"]): request_timeout: Optional[int] = None, ) -> Message: """ - Use this method to send a native poll. On success, the sent `Message `_ is returned. + Use this method to send a native poll. On success, the sent :class:`aiogram.types.message.Message` is returned. Source: https://core.telegram.org/bots/api#sendpoll :param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`) :param question: Poll question, 1-300 characters :param options: A JSON-serialized list of answer options, 2-10 strings 1-100 characters each - :param is_anonymous: True, if the poll needs to be anonymous, defaults to *True* - :param type: Poll type, “quiz” or “regular”, defaults to “regular” + :param is_anonymous: True, if the poll needs to be anonymous, defaults to :code:`True` + :param type: Poll type, 'quiz' or 'regular', defaults to 'regular' :param allows_multiple_answers: True, if the poll allows multiple answers, ignored for polls in quiz mode, defaults to *False* :param correct_option_id: 0-based identifier of the correct answer option, required for polls in quiz mode :param explanation: Text that is shown when a user chooses an incorrect answer or taps on the lamp icon in a quiz-style poll, 0-200 characters with at most 2 line feeds after entities parsing @@ -1265,10 +1267,10 @@ class Bot(ContextInstanceMixin["Bot"]): :param explanation_entities: List of special entities that appear in the poll explanation, which can be specified instead of *parse_mode* :param open_period: Amount of time in seconds the poll will be active after creation, 5-600. Can't be used together with *close_date*. :param close_date: Point in time (Unix timestamp) when the poll will be automatically closed. Must be at least 5 and no more than 600 seconds in the future. Can't be used together with *open_period*. - :param is_closed: Pass *True*, if the poll needs to be immediately closed. This can be useful for poll preview. + :param is_closed: Pass :code:`True`, if the poll needs to be immediately closed. This can be useful for poll preview. :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param reply_to_message_id: If the message is a reply, ID of the original message - :param allow_sending_without_reply: Pass *True*, if the message should be sent even if the specified replied-to message is not found + :param allow_sending_without_reply: Pass :code:`True`, if the message should be sent even if the specified replied-to message is not found :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user. :param request_timeout: Request timeout :return: On success, the sent Message is returned. @@ -1307,15 +1309,15 @@ class Bot(ContextInstanceMixin["Bot"]): request_timeout: Optional[int] = None, ) -> Message: """ - Use this method to send an animated emoji that will display a random value. On success, the sent `Message `_ is returned. + Use this method to send an animated emoji that will display a random value. On success, the sent :class:`aiogram.types.message.Message` is returned. Source: https://core.telegram.org/bots/api#senddice :param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`) - :param emoji: Emoji on which the dice throw animation is based. Currently, must be one of “”, “”, “”, “”, or “”. Dice can have values 1-6 for “” and “”, values 1-5 for “” and “”, and values 1-64 for “”. Defaults to “” + :param emoji: Emoji on which the dice throw animation is based. Currently, must be one of '', '', '', '', or ''. Dice can have values 1-6 for '' and '', values 1-5 for '' and '', and values 1-64 for ''. Defaults to '' :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param reply_to_message_id: If the message is a reply, ID of the original message - :param allow_sending_without_reply: Pass *True*, if the message should be sent even if the specified replied-to message is not found + :param allow_sending_without_reply: Pass :code:`True`, if the message should be sent even if the specified replied-to message is not found :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user. :param request_timeout: Request timeout :return: On success, the sent Message is returned. @@ -1337,8 +1339,9 @@ class Bot(ContextInstanceMixin["Bot"]): request_timeout: Optional[int] = None, ) -> bool: """ - Use this method when you need to tell the user that something is happening on the bot's side. The status is set for 5 seconds or less (when a message arrives from your bot, Telegram clients clear its typing status). Returns *True* on success. - Example: The `ImageBot `_ needs some time to process a request and upload the image. Instead of sending a text message along the lines of “Retrieving image, please wait…”, the bot may use `sendChatAction `_ with *action* = *upload_photo*. The user will see a “sending photo” status for the bot. + Use this method when you need to tell the user that something is happening on the bot's side. The status is set for 5 seconds or less (when a message arrives from your bot, Telegram clients clear its typing status). Returns :code:`True` on success. + + Example: The `ImageBot `_ needs some time to process a request and upload the image. Instead of sending a text message along the lines of 'Retrieving image, please wait…', the bot may use :class:`aiogram.methods.send_chat_action.SendChatAction` with *action* = *upload_photo*. The user will see a 'sending photo' status for the bot. We only recommend using this method when a response from the bot will take a **noticeable** amount of time to arrive. @@ -1363,7 +1366,7 @@ class Bot(ContextInstanceMixin["Bot"]): request_timeout: Optional[int] = None, ) -> UserProfilePhotos: """ - Use this method to get a list of profile pictures for a user. Returns a `UserProfilePhotos `_ object. + Use this method to get a list of profile pictures for a user. Returns a :class:`aiogram.types.user_profile_photos.UserProfilePhotos` object. Source: https://core.telegram.org/bots/api#getuserprofilephotos @@ -1386,7 +1389,7 @@ class Bot(ContextInstanceMixin["Bot"]): request_timeout: Optional[int] = None, ) -> File: """ - Use this method to get basic info about a file and prepare it for downloading. For the moment, bots can download files of up to 20MB in size. On success, a `File `_ object is returned. The file can then be downloaded via the link :code:`https://api.telegram.org/file/bot/`, where :code:`` is taken from the response. It is guaranteed that the link will be valid for at least 1 hour. When the link expires, a new one can be requested by calling `getFile `_ again. + Use this method to get basic info about a file and prepare it for downloading. For the moment, bots can download files of up to 20MB in size. On success, a :class:`aiogram.types.file.File` object is returned. The file can then be downloaded via the link :code:`https://api.telegram.org/file/bot/`, where :code:`` is taken from the response. It is guaranteed that the link will be valid for at least 1 hour. When the link expires, a new one can be requested by calling :class:`aiogram.methods.get_file.GetFile` again. **Note:** This function may not preserve the original file name and MIME type. You should save the file's MIME type and name (if available) when the File object is received. Source: https://core.telegram.org/bots/api#getfile @@ -1408,7 +1411,7 @@ class Bot(ContextInstanceMixin["Bot"]): request_timeout: Optional[int] = None, ) -> bool: """ - Use this method to kick a user from a group, a supergroup or a channel. In the case of supergroups and channels, the user will not be able to return to the chat on their own using invite links, etc., unless `unbanned `_ first. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Returns *True* on success. + Use this method to kick a user from a group, a supergroup or a channel. In the case of supergroups and channels, the user will not be able to return to the chat on their own using invite links, etc., unless `unbanned `_ first. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Returns :code:`True` on success. Source: https://core.telegram.org/bots/api#kickchatmember @@ -1434,7 +1437,7 @@ class Bot(ContextInstanceMixin["Bot"]): request_timeout: Optional[int] = None, ) -> bool: """ - Use this method to unban a previously kicked user in a supergroup or channel. The user will **not** return to the group or channel automatically, but will be able to join via link, etc. The bot must be an administrator for this to work. By default, this method guarantees that after the call the user is not a member of the chat, but will be able to join it. So if the user is a member of the chat they will also be **removed** from the chat. If you don't want this, use the parameter *only_if_banned*. Returns *True* on success. + Use this method to unban a previously kicked user in a supergroup or channel. The user will **not** return to the group or channel automatically, but will be able to join via link, etc. The bot must be an administrator for this to work. By default, this method guarantees that after the call the user is not a member of the chat, but will be able to join it. So if the user is a member of the chat they will also be **removed** from the chat. If you don't want this, use the parameter *only_if_banned*. Returns :code:`True` on success. Source: https://core.telegram.org/bots/api#unbanchatmember @@ -1461,7 +1464,7 @@ class Bot(ContextInstanceMixin["Bot"]): request_timeout: Optional[int] = None, ) -> bool: """ - Use this method to restrict a user in a supergroup. The bot must be an administrator in the supergroup for this to work and must have the appropriate admin rights. Pass *True* for all permissions to lift restrictions from a user. Returns *True* on success. + Use this method to restrict a user in a supergroup. The bot must be an administrator in the supergroup for this to work and must have the appropriate admin rights. Pass :code:`True` for all permissions to lift restrictions from a user. Returns :code:`True` on success. Source: https://core.telegram.org/bots/api#restrictchatmember @@ -1496,13 +1499,13 @@ class Bot(ContextInstanceMixin["Bot"]): request_timeout: Optional[int] = None, ) -> bool: """ - Use this method to promote or demote a user in a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Pass *False* for all boolean parameters to demote a user. Returns *True* on success. + Use this method to promote or demote a user in a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Pass *False* for all boolean parameters to demote a user. Returns :code:`True` on success. Source: https://core.telegram.org/bots/api#promotechatmember :param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`) :param user_id: Unique identifier of the target user - :param is_anonymous: Pass *True*, if the administrator's presence in the chat is hidden + :param is_anonymous: Pass :code:`True`, if the administrator's presence in the chat is hidden :param can_change_info: Pass True, if the administrator can change chat title, photo and other settings :param can_post_messages: Pass True, if the administrator can create channel posts, channels only :param can_edit_messages: Pass True, if the administrator can edit messages of other users and can pin messages, channels only @@ -1537,7 +1540,7 @@ class Bot(ContextInstanceMixin["Bot"]): request_timeout: Optional[int] = None, ) -> bool: """ - Use this method to set a custom title for an administrator in a supergroup promoted by the bot. Returns *True* on success. + Use this method to set a custom title for an administrator in a supergroup promoted by the bot. Returns :code:`True` on success. Source: https://core.telegram.org/bots/api#setchatadministratorcustomtitle @@ -1561,7 +1564,7 @@ class Bot(ContextInstanceMixin["Bot"]): request_timeout: Optional[int] = None, ) -> bool: """ - Use this method to set default chat permissions for all members. The bot must be an administrator in the group or a supergroup for this to work and must have the *can_restrict_members* admin rights. Returns *True* on success. + Use this method to set default chat permissions for all members. The bot must be an administrator in the group or a supergroup for this to work and must have the *can_restrict_members* admin rights. Returns :code:`True` on success. Source: https://core.telegram.org/bots/api#setchatpermissions @@ -1583,7 +1586,8 @@ class Bot(ContextInstanceMixin["Bot"]): ) -> str: """ Use this method to generate a new invite link for a chat; any previously generated link is revoked. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Returns the new invite link as *String* on success. - Note: Each administrator in a chat generates their own invite links. Bots can't use invite links generated by other administrators. If you want your bot to work with invite links, it will need to generate its own link using `exportChatInviteLink `_ — after this the link will become available to the bot via the `getChat `_ method. If your bot needs to generate a new invite link replacing its previous one, use `exportChatInviteLink `_ again. + + Note: Each administrator in a chat generates their own invite links. Bots can't use invite links generated by other administrators. If you want your bot to work with invite links, it will need to generate its own link using :class:`aiogram.methods.export_chat_invite_link.ExportChatInviteLink` — after this the link will become available to the bot via the :class:`aiogram.methods.get_chat.GetChat` method. If your bot needs to generate a new invite link replacing its previous one, use :class:`aiogram.methods.export_chat_invite_link.ExportChatInviteLink` again. Source: https://core.telegram.org/bots/api#exportchatinvitelink @@ -1603,7 +1607,7 @@ class Bot(ContextInstanceMixin["Bot"]): request_timeout: Optional[int] = None, ) -> bool: """ - Use this method to set a new profile photo for the chat. Photos can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Returns *True* on success. + Use this method to set a new profile photo for the chat. Photos can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Returns :code:`True` on success. Source: https://core.telegram.org/bots/api#setchatphoto @@ -1624,7 +1628,7 @@ class Bot(ContextInstanceMixin["Bot"]): request_timeout: Optional[int] = None, ) -> bool: """ - Use this method to delete a chat photo. Photos can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Returns *True* on success. + Use this method to delete a chat photo. Photos can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Returns :code:`True` on success. Source: https://core.telegram.org/bots/api#deletechatphoto @@ -1644,7 +1648,7 @@ class Bot(ContextInstanceMixin["Bot"]): request_timeout: Optional[int] = None, ) -> bool: """ - Use this method to change the title of a chat. Titles can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Returns *True* on success. + Use this method to change the title of a chat. Titles can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Returns :code:`True` on success. Source: https://core.telegram.org/bots/api#setchattitle @@ -1666,7 +1670,7 @@ class Bot(ContextInstanceMixin["Bot"]): request_timeout: Optional[int] = None, ) -> bool: """ - Use this method to change the description of a group, a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Returns *True* on success. + Use this method to change the description of a group, a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Returns :code:`True` on success. Source: https://core.telegram.org/bots/api#setchatdescription @@ -1689,13 +1693,13 @@ class Bot(ContextInstanceMixin["Bot"]): request_timeout: Optional[int] = None, ) -> bool: """ - Use this method to add a message to the list of pinned messages in a chat. If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' admin right in a supergroup or 'can_edit_messages' admin right in a channel. Returns *True* on success. + Use this method to add a message to the list of pinned messages in a chat. If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' admin right in a supergroup or 'can_edit_messages' admin right in a channel. Returns :code:`True` on success. Source: https://core.telegram.org/bots/api#pinchatmessage :param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`) :param message_id: Identifier of a message to pin - :param disable_notification: Pass *True*, if it is not necessary to send a notification to all chat members about the new pinned message. Notifications are always disabled in channels and private chats. + :param disable_notification: Pass :code:`True`, if it is not necessary to send a notification to all chat members about the new pinned message. Notifications are always disabled in channels and private chats. :param request_timeout: Request timeout :return: Returns True on success. """ @@ -1713,7 +1717,7 @@ class Bot(ContextInstanceMixin["Bot"]): request_timeout: Optional[int] = None, ) -> bool: """ - Use this method to remove a message from the list of pinned messages in a chat. If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' admin right in a supergroup or 'can_edit_messages' admin right in a channel. Returns *True* on success. + Use this method to remove a message from the list of pinned messages in a chat. If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' admin right in a supergroup or 'can_edit_messages' admin right in a channel. Returns :code:`True` on success. Source: https://core.telegram.org/bots/api#unpinchatmessage @@ -1734,7 +1738,7 @@ class Bot(ContextInstanceMixin["Bot"]): request_timeout: Optional[int] = None, ) -> bool: """ - Use this method to clear the list of pinned messages in a chat. If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' admin right in a supergroup or 'can_edit_messages' admin right in a channel. Returns *True* on success. + Use this method to clear the list of pinned messages in a chat. If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' admin right in a supergroup or 'can_edit_messages' admin right in a channel. Returns :code:`True` on success. Source: https://core.telegram.org/bots/api#unpinallchatmessages @@ -1753,7 +1757,7 @@ class Bot(ContextInstanceMixin["Bot"]): request_timeout: Optional[int] = None, ) -> bool: """ - Use this method for your bot to leave a group, supergroup or channel. Returns *True* on success. + Use this method for your bot to leave a group, supergroup or channel. Returns :code:`True` on success. Source: https://core.telegram.org/bots/api#leavechat @@ -1772,7 +1776,7 @@ class Bot(ContextInstanceMixin["Bot"]): request_timeout: Optional[int] = None, ) -> Chat: """ - Use this method to get up to date information about the chat (current name of the user for one-on-one conversations, current username of a user, group or channel, etc.). Returns a `Chat `_ object on success. + Use this method to get up to date information about the chat (current name of the user for one-on-one conversations, current username of a user, group or channel, etc.). Returns a :class:`aiogram.types.chat.Chat` object on success. Source: https://core.telegram.org/bots/api#getchat @@ -1791,7 +1795,7 @@ class Bot(ContextInstanceMixin["Bot"]): request_timeout: Optional[int] = None, ) -> List[ChatMember]: """ - Use this method to get a list of administrators in a chat. On success, returns an Array of `ChatMember `_ objects that contains information about all chat administrators except other bots. If the chat is a group or a supergroup and no administrators were appointed, only the creator will be returned. + Use this method to get a list of administrators in a chat. On success, returns an Array of :class:`aiogram.types.chat_member.ChatMember` objects that contains information about all chat administrators except other bots. If the chat is a group or a supergroup and no administrators were appointed, only the creator will be returned. Source: https://core.telegram.org/bots/api#getchatadministrators @@ -1833,7 +1837,7 @@ class Bot(ContextInstanceMixin["Bot"]): request_timeout: Optional[int] = None, ) -> ChatMember: """ - Use this method to get information about a member of a chat. Returns a `ChatMember `_ object on success. + Use this method to get information about a member of a chat. Returns a :class:`aiogram.types.chat_member.ChatMember` object on success. Source: https://core.telegram.org/bots/api#getchatmember @@ -1855,7 +1859,7 @@ class Bot(ContextInstanceMixin["Bot"]): request_timeout: Optional[int] = None, ) -> bool: """ - Use this method to set a new group sticker set for a supergroup. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Use the field *can_set_sticker_set* optionally returned in `getChat `_ requests to check if the bot can use this method. Returns *True* on success. + Use this method to set a new group sticker set for a supergroup. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Use the field *can_set_sticker_set* optionally returned in :class:`aiogram.methods.get_chat.GetChat` requests to check if the bot can use this method. Returns :code:`True` on success. Source: https://core.telegram.org/bots/api#setchatstickerset @@ -1877,7 +1881,7 @@ class Bot(ContextInstanceMixin["Bot"]): request_timeout: Optional[int] = None, ) -> bool: """ - Use this method to delete a group sticker set from a supergroup. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Use the field *can_set_sticker_set* optionally returned in `getChat `_ requests to check if the bot can use this method. Returns *True* on success. + Use this method to delete a group sticker set from a supergroup. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Use the field *can_set_sticker_set* optionally returned in :class:`aiogram.methods.get_chat.GetChat` requests to check if the bot can use this method. Returns :code:`True` on success. Source: https://core.telegram.org/bots/api#deletechatstickerset @@ -1901,15 +1905,16 @@ class Bot(ContextInstanceMixin["Bot"]): request_timeout: Optional[int] = None, ) -> bool: """ - Use this method to send answers to callback queries sent from `inline keyboards `_. The answer will be displayed to the user as a notification at the top of the chat screen or as an alert. On success, *True* is returned. - Alternatively, the user can be redirected to the specified Game URL. For this option to work, you must first create a game for your bot via `@Botfather `_ and accept the terms. Otherwise, you may use links like :code:`t.me/your_bot?start=XXXX` that open your bot with a parameter. + Use this method to send answers to callback queries sent from `inline keyboards `_. The answer will be displayed to the user as a notification at the top of the chat screen or as an alert. On success, :code:`True` is returned. + + Alternatively, the user can be redirected to the specified Game URL. For this option to work, you must first create a game for your bot via `@Botfather `_ and accept the terms. Otherwise, you may use links like :code:`t.me/your_bot?start=XXXX` that open your bot with a parameter. Source: https://core.telegram.org/bots/api#answercallbackquery :param callback_query_id: Unique identifier for the query to be answered :param text: Text of the notification. If not specified, nothing will be shown to the user, 0-200 characters :param show_alert: If *true*, an alert will be shown by the client instead of a notification at the top of the chat screen. Defaults to *false*. - :param url: URL that will be opened by the user's client. If you have created a `Game `_ and accepted the conditions via `@Botfather `_, specify the URL that opens your game — note that this will only work if the query comes from a `https://core.telegram.org/bots/api#inlinekeyboardbutton `_*callback_game* button. + :param url: URL that will be opened by the user's client. If you have created a :class:`aiogram.types.game.Game` and accepted the conditions via `@Botfather `_, specify the URL that opens your game — note that this will only work if the query comes from a `https://core.telegram.org/bots/api#inlinekeyboardbutton `_ *callback_game* button. :param cache_time: The maximum amount of time in seconds that the result of the callback query may be cached client-side. Telegram apps will support caching starting in version 3.14. Defaults to 0. :param request_timeout: Request timeout :return: On success, True is returned. @@ -1929,7 +1934,7 @@ class Bot(ContextInstanceMixin["Bot"]): request_timeout: Optional[int] = None, ) -> bool: """ - Use this method to change the list of the bot's commands. Returns *True* on success. + Use this method to change the list of the bot's commands. Returns :code:`True` on success. Source: https://core.telegram.org/bots/api#setmycommands @@ -1947,7 +1952,7 @@ class Bot(ContextInstanceMixin["Bot"]): request_timeout: Optional[int] = None, ) -> List[BotCommand]: """ - Use this method to get the current list of the bot's commands. Requires no parameters. Returns Array of `BotCommand `_ on success. + Use this method to get the current list of the bot's commands. Requires no parameters. Returns Array of :class:`aiogram.types.bot_command.BotCommand` on success. Source: https://core.telegram.org/bots/api#getmycommands @@ -1975,7 +1980,7 @@ class Bot(ContextInstanceMixin["Bot"]): request_timeout: Optional[int] = None, ) -> Union[Message, bool]: """ - Use this method to edit text and `game `_ messages. On success, if the edited message is not an inline message, the edited `Message `_ is returned, otherwise *True* is returned. + Use this method to edit text and `game `_ messages. On success, if the edited message is not an inline message, the edited :class:`aiogram.types.message.Message` is returned, otherwise :code:`True` is returned. Source: https://core.telegram.org/bots/api#editmessagetext @@ -2015,7 +2020,7 @@ class Bot(ContextInstanceMixin["Bot"]): request_timeout: Optional[int] = None, ) -> Union[Message, bool]: """ - Use this method to edit captions of messages. On success, if the edited message is not an inline message, the edited `Message `_ is returned, otherwise *True* is returned. + Use this method to edit captions of messages. On success, if the edited message is not an inline message, the edited :class:`aiogram.types.message.Message` is returned, otherwise :code:`True` is returned. Source: https://core.telegram.org/bots/api#editmessagecaption @@ -2051,7 +2056,7 @@ class Bot(ContextInstanceMixin["Bot"]): request_timeout: Optional[int] = None, ) -> Union[Message, bool]: """ - Use this method to edit animation, audio, document, photo, or video messages. If a message is part of a message album, then it can be edited only to an audio for audio albums, only to a document for document albums and to a photo or a video otherwise. When an inline message is edited, a new file can't be uploaded. Use a previously uploaded file via its file_id or specify a URL. On success, if the edited message was sent by the bot, the edited `Message `_ is returned, otherwise *True* is returned. + Use this method to edit animation, audio, document, photo, or video messages. If a message is part of a message album, then it can be edited only to an audio for audio albums, only to a document for document albums and to a photo or a video otherwise. When an inline message is edited, a new file can't be uploaded. Use a previously uploaded file via its file_id or specify a URL. On success, if the edited message was sent by the bot, the edited :class:`aiogram.types.message.Message` is returned, otherwise :code:`True` is returned. Source: https://core.telegram.org/bots/api#editmessagemedia @@ -2082,7 +2087,7 @@ class Bot(ContextInstanceMixin["Bot"]): request_timeout: Optional[int] = None, ) -> Union[Message, bool]: """ - Use this method to edit only the reply markup of messages. On success, if the edited message is not an inline message, the edited `Message `_ is returned, otherwise *True* is returned. + Use this method to edit only the reply markup of messages. On success, if the edited message is not an inline message, the edited :class:`aiogram.types.message.Message` is returned, otherwise :code:`True` is returned. Source: https://core.telegram.org/bots/api#editmessagereplymarkup @@ -2110,7 +2115,7 @@ class Bot(ContextInstanceMixin["Bot"]): request_timeout: Optional[int] = None, ) -> Poll: """ - Use this method to stop a poll which was sent by the bot. On success, the stopped `Poll `_ with the final results is returned. + Use this method to stop a poll which was sent by the bot. On success, the stopped :class:`aiogram.types.poll.Poll` with the final results is returned. Source: https://core.telegram.org/bots/api#stoppoll @@ -2150,7 +2155,7 @@ class Bot(ContextInstanceMixin["Bot"]): - If the bot has *can_delete_messages* permission in a supergroup or a channel, it can delete any message there. - Returns *True* on success. + Returns :code:`True` on success. Source: https://core.telegram.org/bots/api#deletemessage @@ -2183,15 +2188,15 @@ class Bot(ContextInstanceMixin["Bot"]): request_timeout: Optional[int] = None, ) -> Message: """ - Use this method to send static .WEBP or `animated `_ .TGS stickers. On success, the sent `Message `_ is returned. + Use this method to send static .WEBP or `animated `_ .TGS stickers. On success, the sent :class:`aiogram.types.message.Message` is returned. Source: https://core.telegram.org/bots/api#sendsticker :param chat_id: Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`) - :param sticker: Sticker to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a .WEBP file from the Internet, or upload a new one using multipart/form-data. `More info on Sending Files » `_ + :param sticker: Sticker to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a .WEBP file from the Internet, or upload a new one using multipart/form-data. :ref:`More info on Sending Files » ` :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param reply_to_message_id: If the message is a reply, ID of the original message - :param allow_sending_without_reply: Pass *True*, if the message should be sent even if the specified replied-to message is not found + :param allow_sending_without_reply: Pass :code:`True`, if the message should be sent even if the specified replied-to message is not found :param reply_markup: Additional interface options. A JSON-serialized object for an `inline keyboard `_, `custom reply keyboard `_, instructions to remove reply keyboard or to force a reply from the user. :param request_timeout: Request timeout :return: On success, the sent Message is returned. @@ -2212,7 +2217,7 @@ class Bot(ContextInstanceMixin["Bot"]): request_timeout: Optional[int] = None, ) -> StickerSet: """ - Use this method to get a sticker set. On success, a `StickerSet `_ object is returned. + Use this method to get a sticker set. On success, a :class:`aiogram.types.sticker_set.StickerSet` object is returned. Source: https://core.telegram.org/bots/api#getstickerset @@ -2232,12 +2237,12 @@ class Bot(ContextInstanceMixin["Bot"]): request_timeout: Optional[int] = None, ) -> File: """ - Use this method to upload a .PNG file with a sticker for later use in *createNewStickerSet* and *addStickerToSet* methods (can be used multiple times). Returns the uploaded `File `_ on success. + Use this method to upload a .PNG file with a sticker for later use in *createNewStickerSet* and *addStickerToSet* methods (can be used multiple times). Returns the uploaded :class:`aiogram.types.file.File` on success. Source: https://core.telegram.org/bots/api#uploadstickerfile :param user_id: User identifier of sticker file owner - :param png_sticker: **PNG** image with the sticker, must be up to 512 kilobytes in size, dimensions must not exceed 512px, and either width or height must be exactly 512px. `More info on Sending Files » `_ + :param png_sticker: **PNG** image with the sticker, must be up to 512 kilobytes in size, dimensions must not exceed 512px, and either width or height must be exactly 512px. :ref:`More info on Sending Files » ` :param request_timeout: Request timeout :return: Returns the uploaded File on success. """ @@ -2260,17 +2265,17 @@ class Bot(ContextInstanceMixin["Bot"]): request_timeout: Optional[int] = None, ) -> bool: """ - Use this method to create a new sticker set owned by a user. The bot will be able to edit the sticker set thus created. You **must** use exactly one of the fields *png_sticker* or *tgs_sticker*. Returns *True* on success. + Use this method to create a new sticker set owned by a user. The bot will be able to edit the sticker set thus created. You **must** use exactly one of the fields *png_sticker* or *tgs_sticker*. Returns :code:`True` on success. Source: https://core.telegram.org/bots/api#createnewstickerset :param user_id: User identifier of created sticker set owner - :param name: Short name of sticker set, to be used in :code:`t.me/addstickers/` URLs (e.g., *animals*). Can contain only english letters, digits and underscores. Must begin with a letter, can't contain consecutive underscores and must end in *“_by_”*. ** is case insensitive. 1-64 characters. + :param name: Short name of sticker set, to be used in :code:`t.me/addstickers/` URLs (e.g., *animals*). Can contain only english letters, digits and underscores. Must begin with a letter, can't contain consecutive underscores and must end in *'_by_'*. ** is case insensitive. 1-64 characters. :param title: Sticker set title, 1-64 characters :param emojis: One or more emoji corresponding to the sticker - :param png_sticker: **PNG** image with the sticker, must be up to 512 kilobytes in size, dimensions must not exceed 512px, and either width or height must be exactly 512px. Pass a *file_id* as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. `More info on Sending Files » `_ + :param png_sticker: **PNG** image with the sticker, must be up to 512 kilobytes in size, dimensions must not exceed 512px, and either width or height must be exactly 512px. Pass a *file_id* as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. :ref:`More info on Sending Files » ` :param tgs_sticker: **TGS** animation with the sticker, uploaded using multipart/form-data. See `https://core.telegram.org/animated_stickers#technical-requirements `_`https://core.telegram.org/animated_stickers#technical-requirements `_ for technical requirements - :param contains_masks: Pass *True*, if a set of mask stickers should be created + :param contains_masks: Pass :code:`True`, if a set of mask stickers should be created :param mask_position: A JSON-serialized object for position where the mask should be placed on faces :param request_timeout: Request timeout :return: Returns True on success. @@ -2298,14 +2303,14 @@ class Bot(ContextInstanceMixin["Bot"]): request_timeout: Optional[int] = None, ) -> bool: """ - Use this method to add a new sticker to a set created by the bot. You **must** use exactly one of the fields *png_sticker* or *tgs_sticker*. Animated stickers can be added to animated sticker sets and only to them. Animated sticker sets can have up to 50 stickers. Static sticker sets can have up to 120 stickers. Returns *True* on success. + Use this method to add a new sticker to a set created by the bot. You **must** use exactly one of the fields *png_sticker* or *tgs_sticker*. Animated stickers can be added to animated sticker sets and only to them. Animated sticker sets can have up to 50 stickers. Static sticker sets can have up to 120 stickers. Returns :code:`True` on success. Source: https://core.telegram.org/bots/api#addstickertoset :param user_id: User identifier of sticker set owner :param name: Sticker set name :param emojis: One or more emoji corresponding to the sticker - :param png_sticker: **PNG** image with the sticker, must be up to 512 kilobytes in size, dimensions must not exceed 512px, and either width or height must be exactly 512px. Pass a *file_id* as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. `More info on Sending Files » `_ + :param png_sticker: **PNG** image with the sticker, must be up to 512 kilobytes in size, dimensions must not exceed 512px, and either width or height must be exactly 512px. Pass a *file_id* as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. :ref:`More info on Sending Files » ` :param tgs_sticker: **TGS** animation with the sticker, uploaded using multipart/form-data. See `https://core.telegram.org/animated_stickers#technical-requirements `_`https://core.telegram.org/animated_stickers#technical-requirements `_ for technical requirements :param mask_position: A JSON-serialized object for position where the mask should be placed on faces :param request_timeout: Request timeout @@ -2328,7 +2333,7 @@ class Bot(ContextInstanceMixin["Bot"]): request_timeout: Optional[int] = None, ) -> bool: """ - Use this method to move a sticker in a set created by the bot to a specific position. Returns *True* on success. + Use this method to move a sticker in a set created by the bot to a specific position. Returns :code:`True` on success. Source: https://core.telegram.org/bots/api#setstickerpositioninset @@ -2349,7 +2354,7 @@ class Bot(ContextInstanceMixin["Bot"]): request_timeout: Optional[int] = None, ) -> bool: """ - Use this method to delete a sticker from a set created by the bot. Returns *True* on success. + Use this method to delete a sticker from a set created by the bot. Returns :code:`True` on success. Source: https://core.telegram.org/bots/api#deletestickerfromset @@ -2370,13 +2375,13 @@ class Bot(ContextInstanceMixin["Bot"]): request_timeout: Optional[int] = None, ) -> bool: """ - Use this method to set the thumbnail of a sticker set. Animated thumbnails can be set for animated sticker sets only. Returns *True* on success. + Use this method to set the thumbnail of a sticker set. Animated thumbnails can be set for animated sticker sets only. Returns :code:`True` on success. Source: https://core.telegram.org/bots/api#setstickersetthumb :param name: Sticker set name :param user_id: User identifier of the sticker set owner - :param thumb: A **PNG** image with the thumbnail, must be up to 128 kilobytes in size and have width and height exactly 100px, or a **TGS** animation with the thumbnail up to 32 kilobytes in size; see `https://core.telegram.org/animated_stickers#technical-requirements `_`https://core.telegram.org/animated_stickers#technical-requirements `_ for animated sticker technical requirements. Pass a *file_id* as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. `More info on Sending Files » `_. Animated sticker set thumbnail can't be uploaded via HTTP URL. + :param thumb: A **PNG** image with the thumbnail, must be up to 128 kilobytes in size and have width and height exactly 100px, or a **TGS** animation with the thumbnail up to 32 kilobytes in size; see `https://core.telegram.org/animated_stickers#technical-requirements `_`https://core.telegram.org/animated_stickers#technical-requirements `_ for animated sticker technical requirements. Pass a *file_id* as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. :ref:`More info on Sending Files » `. Animated sticker set thumbnail can't be uploaded via HTTP URL. :param request_timeout: Request timeout :return: Returns True on success. """ @@ -2404,7 +2409,7 @@ class Bot(ContextInstanceMixin["Bot"]): request_timeout: Optional[int] = None, ) -> bool: """ - Use this method to send answers to an inline query. On success, *True* is returned. + Use this method to send answers to an inline query. On success, :code:`True` is returned. No more than **50** results per query are allowed. @@ -2413,7 +2418,7 @@ class Bot(ContextInstanceMixin["Bot"]): :param inline_query_id: Unique identifier for the answered query :param results: A JSON-serialized array of results for the inline query :param cache_time: The maximum amount of time in seconds that the result of the inline query may be cached on the server. Defaults to 300. - :param is_personal: Pass *True*, if results may be cached on the server side only for the user that sent the query. By default, results may be returned to any user who sends the same query + :param is_personal: Pass :code:`True`, if results may be cached on the server side only for the user that sent the query. By default, results may be returned to any user who sends the same query :param next_offset: Pass the offset that a client should send in the next query with the same text to receive more results. Pass an empty string if there are no more results or if you don't support pagination. Offset length can't exceed 64 bytes. :param switch_pm_text: If passed, clients will display a button with specified text that switches the user to a private chat with the bot and sends the bot a start message with the parameter *switch_pm_parameter* :param switch_pm_parameter: `Deep-linking `_ parameter for the /start message sent to the bot when user presses the switch button. 1-64 characters, only :code:`A-Z`, :code:`a-z`, :code:`0-9`, :code:`_` and :code:`-` are allowed. @@ -2465,7 +2470,7 @@ class Bot(ContextInstanceMixin["Bot"]): request_timeout: Optional[int] = None, ) -> Message: """ - Use this method to send invoices. On success, the sent `Message `_ is returned. + Use this method to send invoices. On success, the sent :class:`aiogram.types.message.Message` is returned. Source: https://core.telegram.org/bots/api#sendinvoice @@ -2482,16 +2487,16 @@ class Bot(ContextInstanceMixin["Bot"]): :param photo_size: Photo size :param photo_width: Photo width :param photo_height: Photo height - :param need_name: Pass *True*, if you require the user's full name to complete the order - :param need_phone_number: Pass *True*, if you require the user's phone number to complete the order - :param need_email: Pass *True*, if you require the user's email address to complete the order - :param need_shipping_address: Pass *True*, if you require the user's shipping address to complete the order - :param send_phone_number_to_provider: Pass *True*, if user's phone number should be sent to provider - :param send_email_to_provider: Pass *True*, if user's email address should be sent to provider - :param is_flexible: Pass *True*, if the final price depends on the shipping method + :param need_name: Pass :code:`True`, if you require the user's full name to complete the order + :param need_phone_number: Pass :code:`True`, if you require the user's phone number to complete the order + :param need_email: Pass :code:`True`, if you require the user's email address to complete the order + :param need_shipping_address: Pass :code:`True`, if you require the user's shipping address to complete the order + :param send_phone_number_to_provider: Pass :code:`True`, if user's phone number should be sent to provider + :param send_email_to_provider: Pass :code:`True`, if user's email address should be sent to provider + :param is_flexible: Pass :code:`True`, if the final price depends on the shipping method :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param reply_to_message_id: If the message is a reply, ID of the original message - :param allow_sending_without_reply: Pass *True*, if the message should be sent even if the specified replied-to message is not found + :param allow_sending_without_reply: Pass :code:`True`, if the message should be sent even if the specified replied-to message is not found :param reply_markup: A JSON-serialized object for an `inline keyboard `_. If empty, one 'Pay :code:`total price`' button will be shown. If not empty, the first button must be a Pay button. :param request_timeout: Request timeout :return: On success, the sent Message is returned. @@ -2533,7 +2538,7 @@ class Bot(ContextInstanceMixin["Bot"]): request_timeout: Optional[int] = None, ) -> bool: """ - If you sent an invoice requesting a shipping address and the parameter *is_flexible* was specified, the Bot API will send an `Update `_ with a *shipping_query* field to the bot. Use this method to reply to shipping queries. On success, True is returned. + If you sent an invoice requesting a shipping address and the parameter *is_flexible* was specified, the Bot API will send an :class:`aiogram.types.update.Update` with a *shipping_query* field to the bot. Use this method to reply to shipping queries. On success, True is returned. Source: https://core.telegram.org/bots/api#answershippingquery @@ -2560,12 +2565,12 @@ class Bot(ContextInstanceMixin["Bot"]): request_timeout: Optional[int] = None, ) -> bool: """ - Once the user has confirmed their payment and shipping details, the Bot API sends the final confirmation in the form of an `Update `_ with the field *pre_checkout_query*. Use this method to respond to such pre-checkout queries. On success, True is returned. **Note:** The Bot API must receive an answer within 10 seconds after the pre-checkout query was sent. + Once the user has confirmed their payment and shipping details, the Bot API sends the final confirmation in the form of an :class:`aiogram.types.update.Update` with the field *pre_checkout_query*. Use this method to respond to such pre-checkout queries. On success, True is returned. **Note:** The Bot API must receive an answer within 10 seconds after the pre-checkout query was sent. Source: https://core.telegram.org/bots/api#answerprecheckoutquery :param pre_checkout_query_id: Unique identifier for the query to be answered - :param ok: Specify *True* if everything is alright (goods are available, etc.) and the bot is ready to proceed with the order. Use *False* if there are any problems. + :param ok: Specify :code:`True` if everything is alright (goods are available, etc.) and the bot is ready to proceed with the order. Use *False* if there are any problems. :param error_message: Required if *ok* is *False*. Error message in human readable form that explains the reason for failure to proceed with the checkout (e.g. "Sorry, somebody just bought the last of our amazing black T-shirts while you were busy filling out your payment details. Please choose a different color or garment!"). Telegram will display this message to the user. :param request_timeout: Request timeout :return: On success, True is returned. @@ -2589,7 +2594,7 @@ class Bot(ContextInstanceMixin["Bot"]): request_timeout: Optional[int] = None, ) -> bool: """ - Informs a user that some of the Telegram Passport elements they provided contains errors. The user will not be able to re-submit their Passport to you until the errors are fixed (the contents of the field for which you returned the error must change). Returns *True* on success. + Informs a user that some of the Telegram Passport elements they provided contains errors. The user will not be able to re-submit their Passport to you until the errors are fixed (the contents of the field for which you returned the error must change). Returns :code:`True` on success. Use this if the data submitted by the user doesn't satisfy the standards your service requires for any reason. For example, if a birthday date seems invalid, a submitted document is blurry, a scan shows evidence of tampering, etc. Supply some details in the error message to make sure the user knows how to correct the issues. Source: https://core.telegram.org/bots/api#setpassportdataerrors @@ -2623,7 +2628,7 @@ class Bot(ContextInstanceMixin["Bot"]): request_timeout: Optional[int] = None, ) -> Message: """ - Use this method to send a game. On success, the sent `Message `_ is returned. + Use this method to send a game. On success, the sent :class:`aiogram.types.message.Message` is returned. Source: https://core.telegram.org/bots/api#sendgame @@ -2631,7 +2636,7 @@ class Bot(ContextInstanceMixin["Bot"]): :param game_short_name: Short name of the game, serves as the unique identifier for the game. Set up your games via `Botfather `_. :param disable_notification: Sends the message `silently `_. Users will receive a notification with no sound. :param reply_to_message_id: If the message is a reply, ID of the original message - :param allow_sending_without_reply: Pass *True*, if the message should be sent even if the specified replied-to message is not found + :param allow_sending_without_reply: Pass :code:`True`, if the message should be sent even if the specified replied-to message is not found :param reply_markup: A JSON-serialized object for an `inline keyboard `_. If empty, one 'Play game_title' button will be shown. If not empty, the first button must launch the game. :param request_timeout: Request timeout :return: On success, the sent Message is returned. @@ -2658,7 +2663,7 @@ class Bot(ContextInstanceMixin["Bot"]): request_timeout: Optional[int] = None, ) -> Union[Message, bool]: """ - Use this method to set the score of the specified user in a game. On success, if the message was sent by the bot, returns the edited `Message `_, otherwise returns *True*. Returns an error, if the new score is not greater than the user's current score in the chat and *force* is *False*. + Use this method to set the score of the specified user in a game. On success, if the message was sent by the bot, returns the edited :class:`aiogram.types.message.Message`, otherwise returns :code:`True`. Returns an error, if the new score is not greater than the user's current score in the chat and *force* is *False*. Source: https://core.telegram.org/bots/api#setgamescore @@ -2694,8 +2699,9 @@ class Bot(ContextInstanceMixin["Bot"]): request_timeout: Optional[int] = None, ) -> List[GameHighScore]: """ - Use this method to get data for high score tables. Will return the score of the specified user and several of their neighbors in a game. On success, returns an *Array* of `GameHighScore `_ objects. - This method will currently return scores for the target user, plus two of their closest neighbors on each side. Will also return the top three users if the user and his neighbors are not among them. Please note that this behavior is subject to change. + Use this method to get data for high score tables. Will return the score of the specified user and several of their neighbors in a game. On success, returns an *Array* of :class:`aiogram.types.game_high_score.GameHighScore` objects. + + This method will currently return scores for the target user, plus two of their closest neighbors on each side. Will also return the top three users if the user and his neighbors are not among them. Please note that this behavior is subject to change. Source: https://core.telegram.org/bots/api#getgamehighscores diff --git a/aiogram/client/session/aiohttp.py b/aiogram/client/session/aiohttp.py index 96e88bac..7b83ad9a 100644 --- a/aiogram/client/session/aiohttp.py +++ b/aiogram/client/session/aiohttp.py @@ -56,7 +56,7 @@ def _retrieve_basic(basic: _ProxyBasic) -> Dict[str, Any]: def _prepare_connector(chain_or_plain: _ProxyType) -> Tuple[Type["TCPConnector"], Dict[str, Any]]: - from aiohttp_socks import ProxyInfo, ProxyConnector, ChainProxyConnector # type: ignore + from aiohttp_socks import ChainProxyConnector, ProxyConnector, ProxyInfo # type: ignore # since tuple is Iterable(compatible with _ProxyChain) object, we assume that # user wants chained proxies if tuple is a pair of string(url) and BasicAuth diff --git a/aiogram/dispatcher/event/telegram.py b/aiogram/dispatcher/event/telegram.py index f9f1c6ee..ab185043 100644 --- a/aiogram/dispatcher/event/telegram.py +++ b/aiogram/dispatcher/event/telegram.py @@ -163,7 +163,8 @@ class TelegramEventObserver: return wrapper def middleware( - self, middleware: Optional[MiddlewareType] = None, + self, + middleware: Optional[MiddlewareType] = None, ) -> Union[Callable[[MiddlewareType], MiddlewareType], MiddlewareType]: """ Decorator for registering inner middlewares @@ -193,7 +194,8 @@ class TelegramEventObserver: return wrapper(middleware) def outer_middleware( - self, middleware: Optional[MiddlewareType] = None, + self, + middleware: Optional[MiddlewareType] = None, ) -> Union[Callable[[MiddlewareType], MiddlewareType], MiddlewareType]: """ Decorator for registering outer middlewares diff --git a/aiogram/methods/add_sticker_to_set.py b/aiogram/methods/add_sticker_to_set.py index b31f2cb2..12120964 100644 --- a/aiogram/methods/add_sticker_to_set.py +++ b/aiogram/methods/add_sticker_to_set.py @@ -11,7 +11,7 @@ if TYPE_CHECKING: # pragma: no cover class AddStickerToSet(TelegramMethod[bool]): """ - Use this method to add a new sticker to a set created by the bot. You **must** use exactly one of the fields *png_sticker* or *tgs_sticker*. Animated stickers can be added to animated sticker sets and only to them. Animated sticker sets can have up to 50 stickers. Static sticker sets can have up to 120 stickers. Returns *True* on success. + Use this method to add a new sticker to a set created by the bot. You **must** use exactly one of the fields *png_sticker* or *tgs_sticker*. Animated stickers can be added to animated sticker sets and only to them. Animated sticker sets can have up to 50 stickers. Static sticker sets can have up to 120 stickers. Returns :code:`True` on success. Source: https://core.telegram.org/bots/api#addstickertoset """ @@ -25,7 +25,7 @@ class AddStickerToSet(TelegramMethod[bool]): emojis: str """One or more emoji corresponding to the sticker""" png_sticker: Optional[Union[InputFile, str]] = None - """**PNG** image with the sticker, must be up to 512 kilobytes in size, dimensions must not exceed 512px, and either width or height must be exactly 512px. Pass a *file_id* as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. `More info on Sending Files » `_""" + """**PNG** image with the sticker, must be up to 512 kilobytes in size, dimensions must not exceed 512px, and either width or height must be exactly 512px. Pass a *file_id* as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. :ref:`More info on Sending Files » `""" tgs_sticker: Optional[InputFile] = None """**TGS** animation with the sticker, uploaded using multipart/form-data. See `https://core.telegram.org/animated_stickers#technical-requirements `_`https://core.telegram.org/animated_stickers#technical-requirements `_ for technical requirements""" mask_position: Optional[MaskPosition] = None diff --git a/aiogram/methods/answer_callback_query.py b/aiogram/methods/answer_callback_query.py index f3ac688b..7ab79207 100644 --- a/aiogram/methods/answer_callback_query.py +++ b/aiogram/methods/answer_callback_query.py @@ -10,8 +10,9 @@ if TYPE_CHECKING: # pragma: no cover class AnswerCallbackQuery(TelegramMethod[bool]): """ - Use this method to send answers to callback queries sent from `inline keyboards `_. The answer will be displayed to the user as a notification at the top of the chat screen or as an alert. On success, *True* is returned. - Alternatively, the user can be redirected to the specified Game URL. For this option to work, you must first create a game for your bot via `@Botfather `_ and accept the terms. Otherwise, you may use links like :code:`t.me/your_bot?start=XXXX` that open your bot with a parameter. + Use this method to send answers to callback queries sent from `inline keyboards `_. The answer will be displayed to the user as a notification at the top of the chat screen or as an alert. On success, :code:`True` is returned. + + Alternatively, the user can be redirected to the specified Game URL. For this option to work, you must first create a game for your bot via `@Botfather `_ and accept the terms. Otherwise, you may use links like :code:`t.me/your_bot?start=XXXX` that open your bot with a parameter. Source: https://core.telegram.org/bots/api#answercallbackquery """ @@ -25,7 +26,7 @@ class AnswerCallbackQuery(TelegramMethod[bool]): show_alert: Optional[bool] = None """If *true*, an alert will be shown by the client instead of a notification at the top of the chat screen. Defaults to *false*.""" url: Optional[str] = None - """URL that will be opened by the user's client. If you have created a `Game `_ and accepted the conditions via `@Botfather `_, specify the URL that opens your game — note that this will only work if the query comes from a `https://core.telegram.org/bots/api#inlinekeyboardbutton `_*callback_game* button.""" + """URL that will be opened by the user's client. If you have created a :class:`aiogram.types.game.Game` and accepted the conditions via `@Botfather `_, specify the URL that opens your game — note that this will only work if the query comes from a `https://core.telegram.org/bots/api#inlinekeyboardbutton `_ *callback_game* button.""" cache_time: Optional[int] = None """The maximum amount of time in seconds that the result of the callback query may be cached client-side. Telegram apps will support caching starting in version 3.14. Defaults to 0.""" diff --git a/aiogram/methods/answer_inline_query.py b/aiogram/methods/answer_inline_query.py index 2d7e085d..95c9b66d 100644 --- a/aiogram/methods/answer_inline_query.py +++ b/aiogram/methods/answer_inline_query.py @@ -11,7 +11,7 @@ if TYPE_CHECKING: # pragma: no cover class AnswerInlineQuery(TelegramMethod[bool]): """ - Use this method to send answers to an inline query. On success, *True* is returned. + Use this method to send answers to an inline query. On success, :code:`True` is returned. No more than **50** results per query are allowed. @@ -27,7 +27,7 @@ class AnswerInlineQuery(TelegramMethod[bool]): cache_time: Optional[int] = None """The maximum amount of time in seconds that the result of the inline query may be cached on the server. Defaults to 300.""" is_personal: Optional[bool] = None - """Pass *True*, if results may be cached on the server side only for the user that sent the query. By default, results may be returned to any user who sends the same query""" + """Pass :code:`True`, if results may be cached on the server side only for the user that sent the query. By default, results may be returned to any user who sends the same query""" next_offset: Optional[str] = None """Pass the offset that a client should send in the next query with the same text to receive more results. Pass an empty string if there are no more results or if you don't support pagination. Offset length can't exceed 64 bytes.""" switch_pm_text: Optional[str] = None @@ -38,5 +38,4 @@ class AnswerInlineQuery(TelegramMethod[bool]): def build_request(self, bot: Bot) -> Request: data: Dict[str, Any] = self.dict() prepare_parse_mode(bot, data["results"]) - return Request(method="answerInlineQuery", data=data) diff --git a/aiogram/methods/answer_pre_checkout_query.py b/aiogram/methods/answer_pre_checkout_query.py index 9438ca47..fd47fa15 100644 --- a/aiogram/methods/answer_pre_checkout_query.py +++ b/aiogram/methods/answer_pre_checkout_query.py @@ -10,7 +10,7 @@ if TYPE_CHECKING: # pragma: no cover class AnswerPreCheckoutQuery(TelegramMethod[bool]): """ - Once the user has confirmed their payment and shipping details, the Bot API sends the final confirmation in the form of an `Update `_ with the field *pre_checkout_query*. Use this method to respond to such pre-checkout queries. On success, True is returned. **Note:** The Bot API must receive an answer within 10 seconds after the pre-checkout query was sent. + Once the user has confirmed their payment and shipping details, the Bot API sends the final confirmation in the form of an :class:`aiogram.types.update.Update` with the field *pre_checkout_query*. Use this method to respond to such pre-checkout queries. On success, True is returned. **Note:** The Bot API must receive an answer within 10 seconds after the pre-checkout query was sent. Source: https://core.telegram.org/bots/api#answerprecheckoutquery """ @@ -20,9 +20,9 @@ class AnswerPreCheckoutQuery(TelegramMethod[bool]): pre_checkout_query_id: str """Unique identifier for the query to be answered""" ok: bool - """Specify *True* if everything is alright (goods are available, etc.) and the bot is ready to proceed with the order. Use *False* if there are any problems.""" + """Specify :code:`True` if everything is alright (goods are available, etc.) and the bot is ready to proceed with the order. Use :code:`False` if there are any problems.""" error_message: Optional[str] = None - """Required if *ok* is *False*. Error message in human readable form that explains the reason for failure to proceed with the checkout (e.g. "Sorry, somebody just bought the last of our amazing black T-shirts while you were busy filling out your payment details. Please choose a different color or garment!"). Telegram will display this message to the user.""" + """Required if *ok* is :code:`False`. Error message in human readable form that explains the reason for failure to proceed with the checkout (e.g. "Sorry, somebody just bought the last of our amazing black T-shirts while you were busy filling out your payment details. Please choose a different color or garment!"). Telegram will display this message to the user.""" def build_request(self, bot: Bot) -> Request: data: Dict[str, Any] = self.dict() diff --git a/aiogram/methods/answer_shipping_query.py b/aiogram/methods/answer_shipping_query.py index da3978c5..6c3c7b6d 100644 --- a/aiogram/methods/answer_shipping_query.py +++ b/aiogram/methods/answer_shipping_query.py @@ -11,7 +11,7 @@ if TYPE_CHECKING: # pragma: no cover class AnswerShippingQuery(TelegramMethod[bool]): """ - If you sent an invoice requesting a shipping address and the parameter *is_flexible* was specified, the Bot API will send an `Update `_ with a *shipping_query* field to the bot. Use this method to reply to shipping queries. On success, True is returned. + If you sent an invoice requesting a shipping address and the parameter *is_flexible* was specified, the Bot API will send an :class:`aiogram.types.update.Update` with a *shipping_query* field to the bot. Use this method to reply to shipping queries. On success, True is returned. Source: https://core.telegram.org/bots/api#answershippingquery """ diff --git a/aiogram/methods/close.py b/aiogram/methods/close.py index 16f4dea7..18f00eac 100644 --- a/aiogram/methods/close.py +++ b/aiogram/methods/close.py @@ -10,7 +10,7 @@ if TYPE_CHECKING: # pragma: no cover class Close(TelegramMethod[bool]): """ - Use this method to close the bot instance before moving it from one local server to another. You need to delete the webhook before calling this method to ensure that the bot isn't launched again after server restart. The method will return error 429 in the first 10 minutes after the bot is launched. Returns *True* on success. Requires no parameters. + Use this method to close the bot instance before moving it from one local server to another. You need to delete the webhook before calling this method to ensure that the bot isn't launched again after server restart. The method will return error 429 in the first 10 minutes after the bot is launched. Returns :code:`True` on success. Requires no parameters. Source: https://core.telegram.org/bots/api#close """ diff --git a/aiogram/methods/copy_message.py b/aiogram/methods/copy_message.py index 4b000fd6..dddf2c92 100644 --- a/aiogram/methods/copy_message.py +++ b/aiogram/methods/copy_message.py @@ -19,7 +19,7 @@ if TYPE_CHECKING: # pragma: no cover class CopyMessage(TelegramMethod[MessageId]): """ - Use this method to copy messages of any kind. The method is analogous to the method `forwardMessages `_, but the copied message doesn't have a link to the original message. Returns the `MessageId `_ of the sent message on success. + Use this method to copy messages of any kind. The method is analogous to the method :class:`aiogram.methods.forward_messages.ForwardMessages`, but the copied message doesn't have a link to the original message. Returns the :class:`aiogram.types.message_id.MessageId` of the sent message on success. Source: https://core.telegram.org/bots/api#copymessage """ @@ -43,7 +43,7 @@ class CopyMessage(TelegramMethod[MessageId]): reply_to_message_id: Optional[int] = None """If the message is a reply, ID of the original message""" allow_sending_without_reply: Optional[bool] = None - """Pass *True*, if the message should be sent even if the specified replied-to message is not found""" + """Pass :code:`True`, if the message should be sent even if the specified replied-to message is not found""" reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None diff --git a/aiogram/methods/create_new_sticker_set.py b/aiogram/methods/create_new_sticker_set.py index f9cdfe5c..9c0750e2 100644 --- a/aiogram/methods/create_new_sticker_set.py +++ b/aiogram/methods/create_new_sticker_set.py @@ -11,7 +11,7 @@ if TYPE_CHECKING: # pragma: no cover class CreateNewStickerSet(TelegramMethod[bool]): """ - Use this method to create a new sticker set owned by a user. The bot will be able to edit the sticker set thus created. You **must** use exactly one of the fields *png_sticker* or *tgs_sticker*. Returns *True* on success. + Use this method to create a new sticker set owned by a user. The bot will be able to edit the sticker set thus created. You **must** use exactly one of the fields *png_sticker* or *tgs_sticker*. Returns :code:`True` on success. Source: https://core.telegram.org/bots/api#createnewstickerset """ @@ -21,17 +21,17 @@ class CreateNewStickerSet(TelegramMethod[bool]): user_id: int """User identifier of created sticker set owner""" name: str - """Short name of sticker set, to be used in :code:`t.me/addstickers/` URLs (e.g., *animals*). Can contain only english letters, digits and underscores. Must begin with a letter, can't contain consecutive underscores and must end in *“_by_”*. ** is case insensitive. 1-64 characters.""" + """Short name of sticker set, to be used in :code:`t.me/addstickers/` URLs (e.g., *animals*). Can contain only english letters, digits and underscores. Must begin with a letter, can't contain consecutive underscores and must end in *'_by_'*. ** is case insensitive. 1-64 characters.""" title: str """Sticker set title, 1-64 characters""" emojis: str """One or more emoji corresponding to the sticker""" png_sticker: Optional[Union[InputFile, str]] = None - """**PNG** image with the sticker, must be up to 512 kilobytes in size, dimensions must not exceed 512px, and either width or height must be exactly 512px. Pass a *file_id* as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. `More info on Sending Files » `_""" + """**PNG** image with the sticker, must be up to 512 kilobytes in size, dimensions must not exceed 512px, and either width or height must be exactly 512px. Pass a *file_id* as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. :ref:`More info on Sending Files » `""" tgs_sticker: Optional[InputFile] = None """**TGS** animation with the sticker, uploaded using multipart/form-data. See `https://core.telegram.org/animated_stickers#technical-requirements `_`https://core.telegram.org/animated_stickers#technical-requirements `_ for technical requirements""" contains_masks: Optional[bool] = None - """Pass *True*, if a set of mask stickers should be created""" + """Pass :code:`True`, if a set of mask stickers should be created""" mask_position: Optional[MaskPosition] = None """A JSON-serialized object for position where the mask should be placed on faces""" diff --git a/aiogram/methods/delete_chat_photo.py b/aiogram/methods/delete_chat_photo.py index 55e3f447..dac07e6f 100644 --- a/aiogram/methods/delete_chat_photo.py +++ b/aiogram/methods/delete_chat_photo.py @@ -10,7 +10,7 @@ if TYPE_CHECKING: # pragma: no cover class DeleteChatPhoto(TelegramMethod[bool]): """ - Use this method to delete a chat photo. Photos can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Returns *True* on success. + Use this method to delete a chat photo. Photos can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Returns :code:`True` on success. Source: https://core.telegram.org/bots/api#deletechatphoto """ diff --git a/aiogram/methods/delete_chat_sticker_set.py b/aiogram/methods/delete_chat_sticker_set.py index ce92e799..fb9f92d0 100644 --- a/aiogram/methods/delete_chat_sticker_set.py +++ b/aiogram/methods/delete_chat_sticker_set.py @@ -10,7 +10,7 @@ if TYPE_CHECKING: # pragma: no cover class DeleteChatStickerSet(TelegramMethod[bool]): """ - Use this method to delete a group sticker set from a supergroup. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Use the field *can_set_sticker_set* optionally returned in `getChat `_ requests to check if the bot can use this method. Returns *True* on success. + Use this method to delete a group sticker set from a supergroup. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Use the field *can_set_sticker_set* optionally returned in :class:`aiogram.methods.get_chat.GetChat` requests to check if the bot can use this method. Returns :code:`True` on success. Source: https://core.telegram.org/bots/api#deletechatstickerset """ diff --git a/aiogram/methods/delete_message.py b/aiogram/methods/delete_message.py index cd6984d6..7fe18d55 100644 --- a/aiogram/methods/delete_message.py +++ b/aiogram/methods/delete_message.py @@ -26,7 +26,7 @@ class DeleteMessage(TelegramMethod[bool]): - If the bot has *can_delete_messages* permission in a supergroup or a channel, it can delete any message there. - Returns *True* on success. + Returns :code:`True` on success. Source: https://core.telegram.org/bots/api#deletemessage """ diff --git a/aiogram/methods/delete_sticker_from_set.py b/aiogram/methods/delete_sticker_from_set.py index 0c04254f..25499a7e 100644 --- a/aiogram/methods/delete_sticker_from_set.py +++ b/aiogram/methods/delete_sticker_from_set.py @@ -10,7 +10,7 @@ if TYPE_CHECKING: # pragma: no cover class DeleteStickerFromSet(TelegramMethod[bool]): """ - Use this method to delete a sticker from a set created by the bot. Returns *True* on success. + Use this method to delete a sticker from a set created by the bot. Returns :code:`True` on success. Source: https://core.telegram.org/bots/api#deletestickerfromset """ diff --git a/aiogram/methods/delete_webhook.py b/aiogram/methods/delete_webhook.py index fe80b5f0..4672645f 100644 --- a/aiogram/methods/delete_webhook.py +++ b/aiogram/methods/delete_webhook.py @@ -10,7 +10,7 @@ if TYPE_CHECKING: # pragma: no cover class DeleteWebhook(TelegramMethod[bool]): """ - Use this method to remove webhook integration if you decide to switch back to `getUpdates `_. Returns *True* on success. + Use this method to remove webhook integration if you decide to switch back to :class:`aiogram.methods.get_updates.GetUpdates`. Returns :code:`True` on success. Source: https://core.telegram.org/bots/api#deletewebhook """ @@ -18,7 +18,7 @@ class DeleteWebhook(TelegramMethod[bool]): __returning__ = bool drop_pending_updates: Optional[bool] = None - """Pass *True* to drop all pending updates""" + """Pass :code:`True` to drop all pending updates""" def build_request(self, bot: Bot) -> Request: data: Dict[str, Any] = self.dict() diff --git a/aiogram/methods/edit_message_caption.py b/aiogram/methods/edit_message_caption.py index 47f1f756..6e7a1661 100644 --- a/aiogram/methods/edit_message_caption.py +++ b/aiogram/methods/edit_message_caption.py @@ -11,7 +11,7 @@ if TYPE_CHECKING: # pragma: no cover class EditMessageCaption(TelegramMethod[Union[Message, bool]]): """ - Use this method to edit captions of messages. On success, if the edited message is not an inline message, the edited `Message `_ is returned, otherwise *True* is returned. + Use this method to edit captions of messages. On success, if the edited message is not an inline message, the edited :class:`aiogram.types.message.Message` is returned, otherwise :code:`True` is returned. Source: https://core.telegram.org/bots/api#editmessagecaption """ diff --git a/aiogram/methods/edit_message_live_location.py b/aiogram/methods/edit_message_live_location.py index f3e48e77..99207cf3 100644 --- a/aiogram/methods/edit_message_live_location.py +++ b/aiogram/methods/edit_message_live_location.py @@ -11,7 +11,7 @@ if TYPE_CHECKING: # pragma: no cover class EditMessageLiveLocation(TelegramMethod[Union[Message, bool]]): """ - Use this method to edit live location messages. A location can be edited until its *live_period* expires or editing is explicitly disabled by a call to `stopMessageLiveLocation `_. On success, if the edited message is not an inline message, the edited `Message `_ is returned, otherwise *True* is returned. + Use this method to edit live location messages. A location can be edited until its *live_period* expires or editing is explicitly disabled by a call to :class:`aiogram.methods.stop_message_live_location.StopMessageLiveLocation`. On success, if the edited message is not an inline message, the edited :class:`aiogram.types.message.Message` is returned, otherwise :code:`True` is returned. Source: https://core.telegram.org/bots/api#editmessagelivelocation """ diff --git a/aiogram/methods/edit_message_media.py b/aiogram/methods/edit_message_media.py index c7b30376..be34133c 100644 --- a/aiogram/methods/edit_message_media.py +++ b/aiogram/methods/edit_message_media.py @@ -11,7 +11,7 @@ if TYPE_CHECKING: # pragma: no cover class EditMessageMedia(TelegramMethod[Union[Message, bool]]): """ - Use this method to edit animation, audio, document, photo, or video messages. If a message is part of a message album, then it can be edited only to an audio for audio albums, only to a document for document albums and to a photo or a video otherwise. When an inline message is edited, a new file can't be uploaded. Use a previously uploaded file via its file_id or specify a URL. On success, if the edited message was sent by the bot, the edited `Message `_ is returned, otherwise *True* is returned. + Use this method to edit animation, audio, document, photo, or video messages. If a message is part of a message album, then it can be edited only to an audio for audio albums, only to a document for document albums and to a photo or a video otherwise. When an inline message is edited, a new file can't be uploaded. Use a previously uploaded file via its file_id or specify a URL. On success, if the edited message was sent by the bot, the edited :class:`aiogram.types.message.Message` is returned, otherwise :code:`True` is returned. Source: https://core.telegram.org/bots/api#editmessagemedia """ @@ -32,7 +32,6 @@ class EditMessageMedia(TelegramMethod[Union[Message, bool]]): def build_request(self, bot: Bot) -> Request: data: Dict[str, Any] = self.dict() prepare_parse_mode(bot, data["media"]) - files: Dict[str, InputFile] = {} prepare_media_file(data=data, files=files) diff --git a/aiogram/methods/edit_message_reply_markup.py b/aiogram/methods/edit_message_reply_markup.py index ea0c2596..eb16e43c 100644 --- a/aiogram/methods/edit_message_reply_markup.py +++ b/aiogram/methods/edit_message_reply_markup.py @@ -11,7 +11,7 @@ if TYPE_CHECKING: # pragma: no cover class EditMessageReplyMarkup(TelegramMethod[Union[Message, bool]]): """ - Use this method to edit only the reply markup of messages. On success, if the edited message is not an inline message, the edited `Message `_ is returned, otherwise *True* is returned. + Use this method to edit only the reply markup of messages. On success, if the edited message is not an inline message, the edited :class:`aiogram.types.message.Message` is returned, otherwise :code:`True` is returned. Source: https://core.telegram.org/bots/api#editmessagereplymarkup """ diff --git a/aiogram/methods/edit_message_text.py b/aiogram/methods/edit_message_text.py index 3e3b58e8..9bd578ff 100644 --- a/aiogram/methods/edit_message_text.py +++ b/aiogram/methods/edit_message_text.py @@ -11,7 +11,7 @@ if TYPE_CHECKING: # pragma: no cover class EditMessageText(TelegramMethod[Union[Message, bool]]): """ - Use this method to edit text and `game `_ messages. On success, if the edited message is not an inline message, the edited `Message `_ is returned, otherwise *True* is returned. + Use this method to edit text and `game `_ messages. On success, if the edited message is not an inline message, the edited :class:`aiogram.types.message.Message` is returned, otherwise :code:`True` is returned. Source: https://core.telegram.org/bots/api#editmessagetext """ diff --git a/aiogram/methods/export_chat_invite_link.py b/aiogram/methods/export_chat_invite_link.py index c057f8c1..5ee6b6d9 100644 --- a/aiogram/methods/export_chat_invite_link.py +++ b/aiogram/methods/export_chat_invite_link.py @@ -11,7 +11,8 @@ if TYPE_CHECKING: # pragma: no cover class ExportChatInviteLink(TelegramMethod[str]): """ Use this method to generate a new invite link for a chat; any previously generated link is revoked. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Returns the new invite link as *String* on success. - Note: Each administrator in a chat generates their own invite links. Bots can't use invite links generated by other administrators. If you want your bot to work with invite links, it will need to generate its own link using `exportChatInviteLink `_ — after this the link will become available to the bot via the `getChat `_ method. If your bot needs to generate a new invite link replacing its previous one, use `exportChatInviteLink `_ again. + + Note: Each administrator in a chat generates their own invite links. Bots can't use invite links generated by other administrators. If you want your bot to work with invite links, it will need to generate its own link using :class:`aiogram.methods.export_chat_invite_link.ExportChatInviteLink` — after this the link will become available to the bot via the :class:`aiogram.methods.get_chat.GetChat` method. If your bot needs to generate a new invite link replacing its previous one, use :class:`aiogram.methods.export_chat_invite_link.ExportChatInviteLink` again. Source: https://core.telegram.org/bots/api#exportchatinvitelink """ diff --git a/aiogram/methods/forward_message.py b/aiogram/methods/forward_message.py index 8b781da5..24b68919 100644 --- a/aiogram/methods/forward_message.py +++ b/aiogram/methods/forward_message.py @@ -11,7 +11,7 @@ if TYPE_CHECKING: # pragma: no cover class ForwardMessage(TelegramMethod[Message]): """ - Use this method to forward messages of any kind. On success, the sent `Message `_ is returned. + Use this method to forward messages of any kind. On success, the sent :class:`aiogram.types.message.Message` is returned. Source: https://core.telegram.org/bots/api#forwardmessage """ diff --git a/aiogram/methods/get_chat.py b/aiogram/methods/get_chat.py index 2f69108b..ef84aa1e 100644 --- a/aiogram/methods/get_chat.py +++ b/aiogram/methods/get_chat.py @@ -11,7 +11,7 @@ if TYPE_CHECKING: # pragma: no cover class GetChat(TelegramMethod[Chat]): """ - Use this method to get up to date information about the chat (current name of the user for one-on-one conversations, current username of a user, group or channel, etc.). Returns a `Chat `_ object on success. + Use this method to get up to date information about the chat (current name of the user for one-on-one conversations, current username of a user, group or channel, etc.). Returns a :class:`aiogram.types.chat.Chat` object on success. Source: https://core.telegram.org/bots/api#getchat """ diff --git a/aiogram/methods/get_chat_administrators.py b/aiogram/methods/get_chat_administrators.py index 9fb17ad5..961fb959 100644 --- a/aiogram/methods/get_chat_administrators.py +++ b/aiogram/methods/get_chat_administrators.py @@ -11,7 +11,7 @@ if TYPE_CHECKING: # pragma: no cover class GetChatAdministrators(TelegramMethod[List[ChatMember]]): """ - Use this method to get a list of administrators in a chat. On success, returns an Array of `ChatMember `_ objects that contains information about all chat administrators except other bots. If the chat is a group or a supergroup and no administrators were appointed, only the creator will be returned. + Use this method to get a list of administrators in a chat. On success, returns an Array of :class:`aiogram.types.chat_member.ChatMember` objects that contains information about all chat administrators except other bots. If the chat is a group or a supergroup and no administrators were appointed, only the creator will be returned. Source: https://core.telegram.org/bots/api#getchatadministrators """ diff --git a/aiogram/methods/get_chat_member.py b/aiogram/methods/get_chat_member.py index de193808..cb21e1ff 100644 --- a/aiogram/methods/get_chat_member.py +++ b/aiogram/methods/get_chat_member.py @@ -11,7 +11,7 @@ if TYPE_CHECKING: # pragma: no cover class GetChatMember(TelegramMethod[ChatMember]): """ - Use this method to get information about a member of a chat. Returns a `ChatMember `_ object on success. + Use this method to get information about a member of a chat. Returns a :class:`aiogram.types.chat_member.ChatMember` object on success. Source: https://core.telegram.org/bots/api#getchatmember """ diff --git a/aiogram/methods/get_file.py b/aiogram/methods/get_file.py index e77e299d..57d84c3a 100644 --- a/aiogram/methods/get_file.py +++ b/aiogram/methods/get_file.py @@ -11,7 +11,7 @@ if TYPE_CHECKING: # pragma: no cover class GetFile(TelegramMethod[File]): """ - Use this method to get basic info about a file and prepare it for downloading. For the moment, bots can download files of up to 20MB in size. On success, a `File `_ object is returned. The file can then be downloaded via the link :code:`https://api.telegram.org/file/bot/`, where :code:`` is taken from the response. It is guaranteed that the link will be valid for at least 1 hour. When the link expires, a new one can be requested by calling `getFile `_ again. + Use this method to get basic info about a file and prepare it for downloading. For the moment, bots can download files of up to 20MB in size. On success, a :class:`aiogram.types.file.File` object is returned. The file can then be downloaded via the link :code:`https://api.telegram.org/file/bot/`, where :code:`` is taken from the response. It is guaranteed that the link will be valid for at least 1 hour. When the link expires, a new one can be requested by calling :class:`aiogram.methods.get_file.GetFile` again. **Note:** This function may not preserve the original file name and MIME type. You should save the file's MIME type and name (if available) when the File object is received. Source: https://core.telegram.org/bots/api#getfile diff --git a/aiogram/methods/get_game_high_scores.py b/aiogram/methods/get_game_high_scores.py index 9ba04f99..66427ed9 100644 --- a/aiogram/methods/get_game_high_scores.py +++ b/aiogram/methods/get_game_high_scores.py @@ -11,8 +11,9 @@ if TYPE_CHECKING: # pragma: no cover class GetGameHighScores(TelegramMethod[List[GameHighScore]]): """ - Use this method to get data for high score tables. Will return the score of the specified user and several of their neighbors in a game. On success, returns an *Array* of `GameHighScore `_ objects. - This method will currently return scores for the target user, plus two of their closest neighbors on each side. Will also return the top three users if the user and his neighbors are not among them. Please note that this behavior is subject to change. + Use this method to get data for high score tables. Will return the score of the specified user and several of their neighbors in a game. On success, returns an *Array* of :class:`aiogram.types.game_high_score.GameHighScore` objects. + + This method will currently return scores for the target user, plus two of their closest neighbors on each side. Will also return the top three users if the user and his neighbors are not among them. Please note that this behavior is subject to change. Source: https://core.telegram.org/bots/api#getgamehighscores """ diff --git a/aiogram/methods/get_me.py b/aiogram/methods/get_me.py index 29f3323b..4b0c07c9 100644 --- a/aiogram/methods/get_me.py +++ b/aiogram/methods/get_me.py @@ -11,7 +11,7 @@ if TYPE_CHECKING: # pragma: no cover class GetMe(TelegramMethod[User]): """ - A simple method for testing your bot's auth token. Requires no parameters. Returns basic information about the bot in form of a `User `_ object. + A simple method for testing your bot's auth token. Requires no parameters. Returns basic information about the bot in form of a :class:`aiogram.types.user.User` object. Source: https://core.telegram.org/bots/api#getme """ diff --git a/aiogram/methods/get_my_commands.py b/aiogram/methods/get_my_commands.py index 6e10811f..19adb9bd 100644 --- a/aiogram/methods/get_my_commands.py +++ b/aiogram/methods/get_my_commands.py @@ -11,7 +11,7 @@ if TYPE_CHECKING: # pragma: no cover class GetMyCommands(TelegramMethod[List[BotCommand]]): """ - Use this method to get the current list of the bot's commands. Requires no parameters. Returns Array of `BotCommand `_ on success. + Use this method to get the current list of the bot's commands. Requires no parameters. Returns Array of :class:`aiogram.types.bot_command.BotCommand` on success. Source: https://core.telegram.org/bots/api#getmycommands """ diff --git a/aiogram/methods/get_sticker_set.py b/aiogram/methods/get_sticker_set.py index dbf678a8..30a8f35b 100644 --- a/aiogram/methods/get_sticker_set.py +++ b/aiogram/methods/get_sticker_set.py @@ -11,7 +11,7 @@ if TYPE_CHECKING: # pragma: no cover class GetStickerSet(TelegramMethod[StickerSet]): """ - Use this method to get a sticker set. On success, a `StickerSet `_ object is returned. + Use this method to get a sticker set. On success, a :class:`aiogram.types.sticker_set.StickerSet` object is returned. Source: https://core.telegram.org/bots/api#getstickerset """ diff --git a/aiogram/methods/get_updates.py b/aiogram/methods/get_updates.py index 0d4c5354..e47dcbd9 100644 --- a/aiogram/methods/get_updates.py +++ b/aiogram/methods/get_updates.py @@ -11,12 +11,13 @@ if TYPE_CHECKING: # pragma: no cover class GetUpdates(TelegramMethod[List[Update]]): """ - Use this method to receive incoming updates using long polling (`wiki `_). An Array of `Update `_ objects is returned. - **Notes** + Use this method to receive incoming updates using long polling (`wiki `_). An Array of :class:`aiogram.types.update.Update` objects is returned. - **1.** This method will not work if an outgoing webhook is set up. + **Notes** - **2.** In order to avoid getting duplicate updates, recalculate *offset* after each server response. + **1.** This method will not work if an outgoing webhook is set up. + + **2.** In order to avoid getting duplicate updates, recalculate *offset* after each server response. Source: https://core.telegram.org/bots/api#getupdates """ @@ -24,13 +25,13 @@ class GetUpdates(TelegramMethod[List[Update]]): __returning__ = List[Update] offset: Optional[int] = None - """Identifier of the first update to be returned. Must be greater by one than the highest among the identifiers of previously received updates. By default, updates starting with the earliest unconfirmed update are returned. An update is considered confirmed as soon as `getUpdates `_ is called with an *offset* higher than its *update_id*. The negative offset can be specified to retrieve updates starting from *-offset* update from the end of the updates queue. All previous updates will forgotten.""" + """Identifier of the first update to be returned. Must be greater by one than the highest among the identifiers of previously received updates. By default, updates starting with the earliest unconfirmed update are returned. An update is considered confirmed as soon as :class:`aiogram.methods.get_updates.GetUpdates` is called with an *offset* higher than its *update_id*. The negative offset can be specified to retrieve updates starting from *-offset* update from the end of the updates queue. All previous updates will forgotten.""" limit: Optional[int] = None """Limits the number of updates to be retrieved. Values between 1-100 are accepted. Defaults to 100.""" timeout: Optional[int] = None """Timeout in seconds for long polling. Defaults to 0, i.e. usual short polling. Should be positive, short polling should be used for testing purposes only.""" allowed_updates: Optional[List[str]] = None - """A JSON-serialized list of the update types you want your bot to receive. For example, specify [“message”, “edited_channel_post”, “callback_query”] to only receive updates of these types. See `Update `_ for a complete list of available update types. Specify an empty list to receive all updates regardless of type (default). If not specified, the previous setting will be used.""" + """A JSON-serialized list of the update types you want your bot to receive. For example, specify ['message', 'edited_channel_post', 'callback_query'] to only receive updates of these types. See :class:`aiogram.types.update.Update` for a complete list of available update types. Specify an empty list to receive all updates regardless of type (default). If not specified, the previous setting will be used.""" def build_request(self, bot: Bot) -> Request: data: Dict[str, Any] = self.dict() diff --git a/aiogram/methods/get_user_profile_photos.py b/aiogram/methods/get_user_profile_photos.py index 210b198c..b37f8a0e 100644 --- a/aiogram/methods/get_user_profile_photos.py +++ b/aiogram/methods/get_user_profile_photos.py @@ -11,7 +11,7 @@ if TYPE_CHECKING: # pragma: no cover class GetUserProfilePhotos(TelegramMethod[UserProfilePhotos]): """ - Use this method to get a list of profile pictures for a user. Returns a `UserProfilePhotos `_ object. + Use this method to get a list of profile pictures for a user. Returns a :class:`aiogram.types.user_profile_photos.UserProfilePhotos` object. Source: https://core.telegram.org/bots/api#getuserprofilephotos """ diff --git a/aiogram/methods/get_webhook_info.py b/aiogram/methods/get_webhook_info.py index a34bc342..60c8ef52 100644 --- a/aiogram/methods/get_webhook_info.py +++ b/aiogram/methods/get_webhook_info.py @@ -11,7 +11,7 @@ if TYPE_CHECKING: # pragma: no cover class GetWebhookInfo(TelegramMethod[WebhookInfo]): """ - Use this method to get current webhook status. Requires no parameters. On success, returns a `WebhookInfo `_ object. If the bot is using `getUpdates `_, will return an object with the *url* field empty. + Use this method to get current webhook status. Requires no parameters. On success, returns a :class:`aiogram.types.webhook_info.WebhookInfo` object. If the bot is using :class:`aiogram.methods.get_updates.GetUpdates`, will return an object with the *url* field empty. Source: https://core.telegram.org/bots/api#getwebhookinfo """ diff --git a/aiogram/methods/kick_chat_member.py b/aiogram/methods/kick_chat_member.py index 4197d5ea..1c18497e 100644 --- a/aiogram/methods/kick_chat_member.py +++ b/aiogram/methods/kick_chat_member.py @@ -11,7 +11,7 @@ if TYPE_CHECKING: # pragma: no cover class KickChatMember(TelegramMethod[bool]): """ - Use this method to kick a user from a group, a supergroup or a channel. In the case of supergroups and channels, the user will not be able to return to the chat on their own using invite links, etc., unless `unbanned `_ first. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Returns *True* on success. + Use this method to kick a user from a group, a supergroup or a channel. In the case of supergroups and channels, the user will not be able to return to the chat on their own using invite links, etc., unless `unbanned `_ first. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Returns :code:`True` on success. Source: https://core.telegram.org/bots/api#kickchatmember """ diff --git a/aiogram/methods/leave_chat.py b/aiogram/methods/leave_chat.py index 7108fa30..f247caa0 100644 --- a/aiogram/methods/leave_chat.py +++ b/aiogram/methods/leave_chat.py @@ -10,7 +10,7 @@ if TYPE_CHECKING: # pragma: no cover class LeaveChat(TelegramMethod[bool]): """ - Use this method for your bot to leave a group, supergroup or channel. Returns *True* on success. + Use this method for your bot to leave a group, supergroup or channel. Returns :code:`True` on success. Source: https://core.telegram.org/bots/api#leavechat """ diff --git a/aiogram/methods/log_out.py b/aiogram/methods/log_out.py index 70ed9027..c2bbe6d3 100644 --- a/aiogram/methods/log_out.py +++ b/aiogram/methods/log_out.py @@ -10,7 +10,7 @@ if TYPE_CHECKING: # pragma: no cover class LogOut(TelegramMethod[bool]): """ - Use this method to log out from the cloud Bot API server before launching the bot locally. You **must** log out the bot before running it locally, otherwise there is no guarantee that the bot will receive updates. After a successful call, you can immediately log in on a local server, but will not be able to log in back to the cloud Bot API server for 10 minutes. Returns *True* on success. Requires no parameters. + Use this method to log out from the cloud Bot API server before launching the bot locally. You **must** log out the bot before running it locally, otherwise there is no guarantee that the bot will receive updates. After a successful call, you can immediately log in on a local server, but will not be able to log in back to the cloud Bot API server for 10 minutes. Returns :code:`True` on success. Requires no parameters. Source: https://core.telegram.org/bots/api#logout """ diff --git a/aiogram/methods/pin_chat_message.py b/aiogram/methods/pin_chat_message.py index 2c6a8950..51726dd5 100644 --- a/aiogram/methods/pin_chat_message.py +++ b/aiogram/methods/pin_chat_message.py @@ -10,7 +10,7 @@ if TYPE_CHECKING: # pragma: no cover class PinChatMessage(TelegramMethod[bool]): """ - Use this method to add a message to the list of pinned messages in a chat. If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' admin right in a supergroup or 'can_edit_messages' admin right in a channel. Returns *True* on success. + Use this method to add a message to the list of pinned messages in a chat. If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' admin right in a supergroup or 'can_edit_messages' admin right in a channel. Returns :code:`True` on success. Source: https://core.telegram.org/bots/api#pinchatmessage """ @@ -22,7 +22,7 @@ class PinChatMessage(TelegramMethod[bool]): message_id: int """Identifier of a message to pin""" disable_notification: Optional[bool] = None - """Pass *True*, if it is not necessary to send a notification to all chat members about the new pinned message. Notifications are always disabled in channels and private chats.""" + """Pass :code:`True`, if it is not necessary to send a notification to all chat members about the new pinned message. Notifications are always disabled in channels and private chats.""" def build_request(self, bot: Bot) -> Request: data: Dict[str, Any] = self.dict() diff --git a/aiogram/methods/promote_chat_member.py b/aiogram/methods/promote_chat_member.py index 2b714579..c48b734b 100644 --- a/aiogram/methods/promote_chat_member.py +++ b/aiogram/methods/promote_chat_member.py @@ -10,7 +10,7 @@ if TYPE_CHECKING: # pragma: no cover class PromoteChatMember(TelegramMethod[bool]): """ - Use this method to promote or demote a user in a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Pass *False* for all boolean parameters to demote a user. Returns *True* on success. + Use this method to promote or demote a user in a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Pass *False* for all boolean parameters to demote a user. Returns :code:`True` on success. Source: https://core.telegram.org/bots/api#promotechatmember """ @@ -22,7 +22,7 @@ class PromoteChatMember(TelegramMethod[bool]): user_id: int """Unique identifier of the target user""" is_anonymous: Optional[bool] = None - """Pass *True*, if the administrator's presence in the chat is hidden""" + """Pass :code:`True`, if the administrator's presence in the chat is hidden""" can_change_info: Optional[bool] = None """Pass True, if the administrator can change chat title, photo and other settings""" can_post_messages: Optional[bool] = None diff --git a/aiogram/methods/restrict_chat_member.py b/aiogram/methods/restrict_chat_member.py index 42984596..dec75404 100644 --- a/aiogram/methods/restrict_chat_member.py +++ b/aiogram/methods/restrict_chat_member.py @@ -12,7 +12,7 @@ if TYPE_CHECKING: # pragma: no cover class RestrictChatMember(TelegramMethod[bool]): """ - Use this method to restrict a user in a supergroup. The bot must be an administrator in the supergroup for this to work and must have the appropriate admin rights. Pass *True* for all permissions to lift restrictions from a user. Returns *True* on success. + Use this method to restrict a user in a supergroup. The bot must be an administrator in the supergroup for this to work and must have the appropriate admin rights. Pass :code:`True` for all permissions to lift restrictions from a user. Returns :code:`True` on success. Source: https://core.telegram.org/bots/api#restrictchatmember """ diff --git a/aiogram/methods/send_animation.py b/aiogram/methods/send_animation.py index 9191e5ff..2399ee0d 100644 --- a/aiogram/methods/send_animation.py +++ b/aiogram/methods/send_animation.py @@ -20,7 +20,7 @@ if TYPE_CHECKING: # pragma: no cover class SendAnimation(TelegramMethod[Message]): """ - Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without sound). On success, the sent `Message `_ is returned. Bots can currently send animation files of up to 50 MB in size, this limit may be changed in the future. + Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without sound). On success, the sent :class:`aiogram.types.message.Message` is returned. Bots can currently send animation files of up to 50 MB in size, this limit may be changed in the future. Source: https://core.telegram.org/bots/api#sendanimation """ @@ -30,7 +30,7 @@ class SendAnimation(TelegramMethod[Message]): chat_id: Union[int, str] """Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)""" animation: Union[InputFile, str] - """Animation to send. Pass a file_id as String to send an animation that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an animation from the Internet, or upload a new animation using multipart/form-data. `More info on Sending Files » `_""" + """Animation to send. Pass a file_id as String to send an animation that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an animation from the Internet, or upload a new animation using multipart/form-data. :ref:`More info on Sending Files » `""" duration: Optional[int] = None """Duration of sent animation in seconds""" width: Optional[int] = None @@ -38,7 +38,7 @@ class SendAnimation(TelegramMethod[Message]): height: Optional[int] = None """Animation height""" thumb: Optional[Union[InputFile, str]] = None - """Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://” if the thumbnail was uploaded using multipart/form-data under . `More info on Sending Files » `_""" + """Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://' if the thumbnail was uploaded using multipart/form-data under . :ref:`More info on Sending Files » `""" caption: Optional[str] = None """Animation caption (may also be used when resending animation by *file_id*), 0-1024 characters after entities parsing""" parse_mode: Optional[str] = UNSET @@ -50,7 +50,7 @@ class SendAnimation(TelegramMethod[Message]): reply_to_message_id: Optional[int] = None """If the message is a reply, ID of the original message""" allow_sending_without_reply: Optional[bool] = None - """Pass *True*, if the message should be sent even if the specified replied-to message is not found""" + """Pass :code:`True`, if the message should be sent even if the specified replied-to message is not found""" reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None diff --git a/aiogram/methods/send_audio.py b/aiogram/methods/send_audio.py index 72d4558c..58899f81 100644 --- a/aiogram/methods/send_audio.py +++ b/aiogram/methods/send_audio.py @@ -20,8 +20,8 @@ if TYPE_CHECKING: # pragma: no cover class SendAudio(TelegramMethod[Message]): """ - Use this method to send audio files, if you want Telegram clients to display them in the music player. Your audio must be in the .MP3 or .M4A format. On success, the sent `Message `_ is returned. Bots can currently send audio files of up to 50 MB in size, this limit may be changed in the future. - For sending voice messages, use the `sendVoice `_ method instead. + Use this method to send audio files, if you want Telegram clients to display them in the music player. Your audio must be in the .MP3 or .M4A format. On success, the sent :class:`aiogram.types.message.Message` is returned. Bots can currently send audio files of up to 50 MB in size, this limit may be changed in the future. + For sending voice messages, use the :class:`aiogram.methods.send_voice.SendVoice` method instead. Source: https://core.telegram.org/bots/api#sendaudio """ @@ -31,7 +31,7 @@ class SendAudio(TelegramMethod[Message]): chat_id: Union[int, str] """Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)""" audio: Union[InputFile, str] - """Audio file to send. Pass a file_id as String to send an audio file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an audio file from the Internet, or upload a new one using multipart/form-data. `More info on Sending Files » `_""" + """Audio file to send. Pass a file_id as String to send an audio file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an audio file from the Internet, or upload a new one using multipart/form-data. :ref:`More info on Sending Files » `""" caption: Optional[str] = None """Audio caption, 0-1024 characters after entities parsing""" parse_mode: Optional[str] = UNSET @@ -45,13 +45,13 @@ class SendAudio(TelegramMethod[Message]): title: Optional[str] = None """Track name""" thumb: Optional[Union[InputFile, str]] = None - """Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://” if the thumbnail was uploaded using multipart/form-data under . `More info on Sending Files » `_""" + """Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://' if the thumbnail was uploaded using multipart/form-data under . :ref:`More info on Sending Files » `""" disable_notification: Optional[bool] = None """Sends the message `silently `_. Users will receive a notification with no sound.""" reply_to_message_id: Optional[int] = None """If the message is a reply, ID of the original message""" allow_sending_without_reply: Optional[bool] = None - """Pass *True*, if the message should be sent even if the specified replied-to message is not found""" + """Pass :code:`True`, if the message should be sent even if the specified replied-to message is not found""" reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None diff --git a/aiogram/methods/send_chat_action.py b/aiogram/methods/send_chat_action.py index f54d0a1c..2db43414 100644 --- a/aiogram/methods/send_chat_action.py +++ b/aiogram/methods/send_chat_action.py @@ -10,8 +10,9 @@ if TYPE_CHECKING: # pragma: no cover class SendChatAction(TelegramMethod[bool]): """ - Use this method when you need to tell the user that something is happening on the bot's side. The status is set for 5 seconds or less (when a message arrives from your bot, Telegram clients clear its typing status). Returns *True* on success. - Example: The `ImageBot `_ needs some time to process a request and upload the image. Instead of sending a text message along the lines of “Retrieving image, please wait…”, the bot may use `sendChatAction `_ with *action* = *upload_photo*. The user will see a “sending photo” status for the bot. + Use this method when you need to tell the user that something is happening on the bot's side. The status is set for 5 seconds or less (when a message arrives from your bot, Telegram clients clear its typing status). Returns :code:`True` on success. + + Example: The `ImageBot `_ needs some time to process a request and upload the image. Instead of sending a text message along the lines of 'Retrieving image, please wait…', the bot may use :class:`aiogram.methods.send_chat_action.SendChatAction` with *action* = *upload_photo*. The user will see a 'sending photo' status for the bot. We only recommend using this method when a response from the bot will take a **noticeable** amount of time to arrive. diff --git a/aiogram/methods/send_contact.py b/aiogram/methods/send_contact.py index 4c9ea1da..226a091d 100644 --- a/aiogram/methods/send_contact.py +++ b/aiogram/methods/send_contact.py @@ -17,7 +17,7 @@ if TYPE_CHECKING: # pragma: no cover class SendContact(TelegramMethod[Message]): """ - Use this method to send phone contacts. On success, the sent `Message `_ is returned. + Use this method to send phone contacts. On success, the sent :class:`aiogram.types.message.Message` is returned. Source: https://core.telegram.org/bots/api#sendcontact """ @@ -39,7 +39,7 @@ class SendContact(TelegramMethod[Message]): reply_to_message_id: Optional[int] = None """If the message is a reply, ID of the original message""" allow_sending_without_reply: Optional[bool] = None - """Pass *True*, if the message should be sent even if the specified replied-to message is not found""" + """Pass :code:`True`, if the message should be sent even if the specified replied-to message is not found""" reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None diff --git a/aiogram/methods/send_dice.py b/aiogram/methods/send_dice.py index 06d1f33b..c8a8d981 100644 --- a/aiogram/methods/send_dice.py +++ b/aiogram/methods/send_dice.py @@ -17,7 +17,7 @@ if TYPE_CHECKING: # pragma: no cover class SendDice(TelegramMethod[Message]): """ - Use this method to send an animated emoji that will display a random value. On success, the sent `Message `_ is returned. + Use this method to send an animated emoji that will display a random value. On success, the sent :class:`aiogram.types.message.Message` is returned. Source: https://core.telegram.org/bots/api#senddice """ @@ -27,13 +27,13 @@ class SendDice(TelegramMethod[Message]): chat_id: Union[int, str] """Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)""" emoji: Optional[str] = None - """Emoji on which the dice throw animation is based. Currently, must be one of “”, “”, “”, “”, or “”. Dice can have values 1-6 for “” and “”, values 1-5 for “” and “”, and values 1-64 for “”. Defaults to “”""" + """Emoji on which the dice throw animation is based. Currently, must be one of '', '', '', '', or ''. Dice can have values 1-6 for '' and '', values 1-5 for '' and '', and values 1-64 for ''. Defaults to ''""" disable_notification: Optional[bool] = None """Sends the message `silently `_. Users will receive a notification with no sound.""" reply_to_message_id: Optional[int] = None """If the message is a reply, ID of the original message""" allow_sending_without_reply: Optional[bool] = None - """Pass *True*, if the message should be sent even if the specified replied-to message is not found""" + """Pass :code:`True`, if the message should be sent even if the specified replied-to message is not found""" reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None diff --git a/aiogram/methods/send_document.py b/aiogram/methods/send_document.py index a8d2c46c..5cb155c2 100644 --- a/aiogram/methods/send_document.py +++ b/aiogram/methods/send_document.py @@ -20,7 +20,7 @@ if TYPE_CHECKING: # pragma: no cover class SendDocument(TelegramMethod[Message]): """ - Use this method to send general files. On success, the sent `Message `_ is returned. Bots can currently send files of any type of up to 50 MB in size, this limit may be changed in the future. + Use this method to send general files. On success, the sent :class:`aiogram.types.message.Message` is returned. Bots can currently send files of any type of up to 50 MB in size, this limit may be changed in the future. Source: https://core.telegram.org/bots/api#senddocument """ @@ -30,9 +30,9 @@ class SendDocument(TelegramMethod[Message]): chat_id: Union[int, str] """Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)""" document: Union[InputFile, str] - """File to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. `More info on Sending Files » `_""" + """File to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. :ref:`More info on Sending Files » `""" thumb: Optional[Union[InputFile, str]] = None - """Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://” if the thumbnail was uploaded using multipart/form-data under . `More info on Sending Files » `_""" + """Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://' if the thumbnail was uploaded using multipart/form-data under . :ref:`More info on Sending Files » `""" caption: Optional[str] = None """Document caption (may also be used when resending documents by *file_id*), 0-1024 characters after entities parsing""" parse_mode: Optional[str] = UNSET @@ -46,7 +46,7 @@ class SendDocument(TelegramMethod[Message]): reply_to_message_id: Optional[int] = None """If the message is a reply, ID of the original message""" allow_sending_without_reply: Optional[bool] = None - """Pass *True*, if the message should be sent even if the specified replied-to message is not found""" + """Pass :code:`True`, if the message should be sent even if the specified replied-to message is not found""" reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None diff --git a/aiogram/methods/send_game.py b/aiogram/methods/send_game.py index 517fd700..690bf101 100644 --- a/aiogram/methods/send_game.py +++ b/aiogram/methods/send_game.py @@ -11,7 +11,7 @@ if TYPE_CHECKING: # pragma: no cover class SendGame(TelegramMethod[Message]): """ - Use this method to send a game. On success, the sent `Message `_ is returned. + Use this method to send a game. On success, the sent :class:`aiogram.types.message.Message` is returned. Source: https://core.telegram.org/bots/api#sendgame """ @@ -27,7 +27,7 @@ class SendGame(TelegramMethod[Message]): reply_to_message_id: Optional[int] = None """If the message is a reply, ID of the original message""" allow_sending_without_reply: Optional[bool] = None - """Pass *True*, if the message should be sent even if the specified replied-to message is not found""" + """Pass :code:`True`, if the message should be sent even if the specified replied-to message is not found""" reply_markup: Optional[InlineKeyboardMarkup] = None """A JSON-serialized object for an `inline keyboard `_. If empty, one 'Play game_title' button will be shown. If not empty, the first button must launch the game.""" diff --git a/aiogram/methods/send_invoice.py b/aiogram/methods/send_invoice.py index 56e8fdbb..99bacb6c 100644 --- a/aiogram/methods/send_invoice.py +++ b/aiogram/methods/send_invoice.py @@ -11,7 +11,7 @@ if TYPE_CHECKING: # pragma: no cover class SendInvoice(TelegramMethod[Message]): """ - Use this method to send invoices. On success, the sent `Message `_ is returned. + Use this method to send invoices. On success, the sent :class:`aiogram.types.message.Message` is returned. Source: https://core.telegram.org/bots/api#sendinvoice """ @@ -45,25 +45,25 @@ class SendInvoice(TelegramMethod[Message]): photo_height: Optional[int] = None """Photo height""" need_name: Optional[bool] = None - """Pass *True*, if you require the user's full name to complete the order""" + """Pass :code:`True`, if you require the user's full name to complete the order""" need_phone_number: Optional[bool] = None - """Pass *True*, if you require the user's phone number to complete the order""" + """Pass :code:`True`, if you require the user's phone number to complete the order""" need_email: Optional[bool] = None - """Pass *True*, if you require the user's email address to complete the order""" + """Pass :code:`True`, if you require the user's email address to complete the order""" need_shipping_address: Optional[bool] = None - """Pass *True*, if you require the user's shipping address to complete the order""" + """Pass :code:`True`, if you require the user's shipping address to complete the order""" send_phone_number_to_provider: Optional[bool] = None - """Pass *True*, if user's phone number should be sent to provider""" + """Pass :code:`True`, if user's phone number should be sent to provider""" send_email_to_provider: Optional[bool] = None - """Pass *True*, if user's email address should be sent to provider""" + """Pass :code:`True`, if user's email address should be sent to provider""" is_flexible: Optional[bool] = None - """Pass *True*, if the final price depends on the shipping method""" + """Pass :code:`True`, if the final price depends on the shipping method""" disable_notification: Optional[bool] = None """Sends the message `silently `_. Users will receive a notification with no sound.""" reply_to_message_id: Optional[int] = None """If the message is a reply, ID of the original message""" allow_sending_without_reply: Optional[bool] = None - """Pass *True*, if the message should be sent even if the specified replied-to message is not found""" + """Pass :code:`True`, if the message should be sent even if the specified replied-to message is not found""" reply_markup: Optional[InlineKeyboardMarkup] = None """A JSON-serialized object for an `inline keyboard `_. If empty, one 'Pay :code:`total price`' button will be shown. If not empty, the first button must be a Pay button.""" diff --git a/aiogram/methods/send_location.py b/aiogram/methods/send_location.py index 70d04242..f9646468 100644 --- a/aiogram/methods/send_location.py +++ b/aiogram/methods/send_location.py @@ -17,7 +17,7 @@ if TYPE_CHECKING: # pragma: no cover class SendLocation(TelegramMethod[Message]): """ - Use this method to send point on the map. On success, the sent `Message `_ is returned. + Use this method to send point on the map. On success, the sent :class:`aiogram.types.message.Message` is returned. Source: https://core.telegram.org/bots/api#sendlocation """ @@ -43,7 +43,7 @@ class SendLocation(TelegramMethod[Message]): reply_to_message_id: Optional[int] = None """If the message is a reply, ID of the original message""" allow_sending_without_reply: Optional[bool] = None - """Pass *True*, if the message should be sent even if the specified replied-to message is not found""" + """Pass :code:`True`, if the message should be sent even if the specified replied-to message is not found""" reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None diff --git a/aiogram/methods/send_media_group.py b/aiogram/methods/send_media_group.py index 483e14e3..46da358e 100644 --- a/aiogram/methods/send_media_group.py +++ b/aiogram/methods/send_media_group.py @@ -34,7 +34,7 @@ class SendMediaGroup(TelegramMethod[List[Message]]): reply_to_message_id: Optional[int] = None """If the messages are a reply, ID of the original message""" allow_sending_without_reply: Optional[bool] = None - """Pass *True*, if the message should be sent even if the specified replied-to message is not found""" + """Pass :code:`True`, if the message should be sent even if the specified replied-to message is not found""" def build_request(self, bot: Bot) -> Request: data: Dict[str, Any] = self.dict() diff --git a/aiogram/methods/send_message.py b/aiogram/methods/send_message.py index 93c98b53..bbacb6af 100644 --- a/aiogram/methods/send_message.py +++ b/aiogram/methods/send_message.py @@ -19,7 +19,7 @@ if TYPE_CHECKING: # pragma: no cover class SendMessage(TelegramMethod[Message]): """ - Use this method to send text messages. On success, the sent `Message `_ is returned. + Use this method to send text messages. On success, the sent :class:`aiogram.types.message.Message` is returned. Source: https://core.telegram.org/bots/api#sendmessage """ @@ -41,7 +41,7 @@ class SendMessage(TelegramMethod[Message]): reply_to_message_id: Optional[int] = None """If the message is a reply, ID of the original message""" allow_sending_without_reply: Optional[bool] = None - """Pass *True*, if the message should be sent even if the specified replied-to message is not found""" + """Pass :code:`True`, if the message should be sent even if the specified replied-to message is not found""" reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None diff --git a/aiogram/methods/send_photo.py b/aiogram/methods/send_photo.py index 53a22249..46b2a808 100644 --- a/aiogram/methods/send_photo.py +++ b/aiogram/methods/send_photo.py @@ -20,7 +20,7 @@ if TYPE_CHECKING: # pragma: no cover class SendPhoto(TelegramMethod[Message]): """ - Use this method to send photos. On success, the sent `Message `_ is returned. + Use this method to send photos. On success, the sent :class:`aiogram.types.message.Message` is returned. Source: https://core.telegram.org/bots/api#sendphoto """ @@ -30,7 +30,7 @@ class SendPhoto(TelegramMethod[Message]): chat_id: Union[int, str] """Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)""" photo: Union[InputFile, str] - """Photo to send. Pass a file_id as String to send a photo that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a photo from the Internet, or upload a new photo using multipart/form-data. The photo must be at most 10 MB in size. The photo's width and height must not exceed 10000 in total. Width and height ratio must be at most 20. `More info on Sending Files » `_""" + """Photo to send. Pass a file_id as String to send a photo that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a photo from the Internet, or upload a new photo using multipart/form-data. The photo must be at most 10 MB in size. The photo's width and height must not exceed 10000 in total. Width and height ratio must be at most 20. :ref:`More info on Sending Files » `""" caption: Optional[str] = None """Photo caption (may also be used when resending photos by *file_id*), 0-1024 characters after entities parsing""" parse_mode: Optional[str] = UNSET @@ -42,7 +42,7 @@ class SendPhoto(TelegramMethod[Message]): reply_to_message_id: Optional[int] = None """If the message is a reply, ID of the original message""" allow_sending_without_reply: Optional[bool] = None - """Pass *True*, if the message should be sent even if the specified replied-to message is not found""" + """Pass :code:`True`, if the message should be sent even if the specified replied-to message is not found""" reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None diff --git a/aiogram/methods/send_poll.py b/aiogram/methods/send_poll.py index 9f553dbe..c9a6fdd0 100644 --- a/aiogram/methods/send_poll.py +++ b/aiogram/methods/send_poll.py @@ -20,7 +20,7 @@ if TYPE_CHECKING: # pragma: no cover class SendPoll(TelegramMethod[Message]): """ - Use this method to send a native poll. On success, the sent `Message `_ is returned. + Use this method to send a native poll. On success, the sent :class:`aiogram.types.message.Message` is returned. Source: https://core.telegram.org/bots/api#sendpoll """ @@ -34,11 +34,11 @@ class SendPoll(TelegramMethod[Message]): options: List[str] """A JSON-serialized list of answer options, 2-10 strings 1-100 characters each""" is_anonymous: Optional[bool] = None - """True, if the poll needs to be anonymous, defaults to *True*""" + """True, if the poll needs to be anonymous, defaults to :code:`True`""" type: Optional[str] = None - """Poll type, “quiz” or “regular”, defaults to “regular”""" + """Poll type, 'quiz' or 'regular', defaults to 'regular'""" allows_multiple_answers: Optional[bool] = None - """True, if the poll allows multiple answers, ignored for polls in quiz mode, defaults to *False*""" + """True, if the poll allows multiple answers, ignored for polls in quiz mode, defaults to :code:`False`""" correct_option_id: Optional[int] = None """0-based identifier of the correct answer option, required for polls in quiz mode""" explanation: Optional[str] = None @@ -52,13 +52,13 @@ class SendPoll(TelegramMethod[Message]): close_date: Optional[Union[datetime.datetime, datetime.timedelta, int]] = None """Point in time (Unix timestamp) when the poll will be automatically closed. Must be at least 5 and no more than 600 seconds in the future. Can't be used together with *open_period*.""" is_closed: Optional[bool] = None - """Pass *True*, if the poll needs to be immediately closed. This can be useful for poll preview.""" + """Pass :code:`True`, if the poll needs to be immediately closed. This can be useful for poll preview.""" disable_notification: Optional[bool] = None """Sends the message `silently `_. Users will receive a notification with no sound.""" reply_to_message_id: Optional[int] = None """If the message is a reply, ID of the original message""" allow_sending_without_reply: Optional[bool] = None - """Pass *True*, if the message should be sent even if the specified replied-to message is not found""" + """Pass :code:`True`, if the message should be sent even if the specified replied-to message is not found""" reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None diff --git a/aiogram/methods/send_sticker.py b/aiogram/methods/send_sticker.py index 3b860457..05f0cf8d 100644 --- a/aiogram/methods/send_sticker.py +++ b/aiogram/methods/send_sticker.py @@ -18,7 +18,7 @@ if TYPE_CHECKING: # pragma: no cover class SendSticker(TelegramMethod[Message]): """ - Use this method to send static .WEBP or `animated `_ .TGS stickers. On success, the sent `Message `_ is returned. + Use this method to send static .WEBP or `animated `_ .TGS stickers. On success, the sent :class:`aiogram.types.message.Message` is returned. Source: https://core.telegram.org/bots/api#sendsticker """ @@ -28,13 +28,13 @@ class SendSticker(TelegramMethod[Message]): chat_id: Union[int, str] """Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)""" sticker: Union[InputFile, str] - """Sticker to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a .WEBP file from the Internet, or upload a new one using multipart/form-data. `More info on Sending Files » `_""" + """Sticker to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a .WEBP file from the Internet, or upload a new one using multipart/form-data. :ref:`More info on Sending Files » `""" disable_notification: Optional[bool] = None """Sends the message `silently `_. Users will receive a notification with no sound.""" reply_to_message_id: Optional[int] = None """If the message is a reply, ID of the original message""" allow_sending_without_reply: Optional[bool] = None - """Pass *True*, if the message should be sent even if the specified replied-to message is not found""" + """Pass :code:`True`, if the message should be sent even if the specified replied-to message is not found""" reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None diff --git a/aiogram/methods/send_venue.py b/aiogram/methods/send_venue.py index 538defc1..cdadf416 100644 --- a/aiogram/methods/send_venue.py +++ b/aiogram/methods/send_venue.py @@ -17,7 +17,7 @@ if TYPE_CHECKING: # pragma: no cover class SendVenue(TelegramMethod[Message]): """ - Use this method to send information about a venue. On success, the sent `Message `_ is returned. + Use this method to send information about a venue. On success, the sent :class:`aiogram.types.message.Message` is returned. Source: https://core.telegram.org/bots/api#sendvenue """ @@ -37,7 +37,7 @@ class SendVenue(TelegramMethod[Message]): foursquare_id: Optional[str] = None """Foursquare identifier of the venue""" foursquare_type: Optional[str] = None - """Foursquare type of the venue, if known. (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.)""" + """Foursquare type of the venue, if known. (For example, 'arts_entertainment/default', 'arts_entertainment/aquarium' or 'food/icecream'.)""" google_place_id: Optional[str] = None """Google Places identifier of the venue""" google_place_type: Optional[str] = None @@ -47,7 +47,7 @@ class SendVenue(TelegramMethod[Message]): reply_to_message_id: Optional[int] = None """If the message is a reply, ID of the original message""" allow_sending_without_reply: Optional[bool] = None - """Pass *True*, if the message should be sent even if the specified replied-to message is not found""" + """Pass :code:`True`, if the message should be sent even if the specified replied-to message is not found""" reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None diff --git a/aiogram/methods/send_video.py b/aiogram/methods/send_video.py index cd853764..0105beaa 100644 --- a/aiogram/methods/send_video.py +++ b/aiogram/methods/send_video.py @@ -20,7 +20,7 @@ if TYPE_CHECKING: # pragma: no cover class SendVideo(TelegramMethod[Message]): """ - Use this method to send video files, Telegram clients support mp4 videos (other formats may be sent as `Document `_). On success, the sent `Message `_ is returned. Bots can currently send video files of up to 50 MB in size, this limit may be changed in the future. + Use this method to send video files, Telegram clients support mp4 videos (other formats may be sent as :class:`aiogram.types.document.Document`). On success, the sent :class:`aiogram.types.message.Message` is returned. Bots can currently send video files of up to 50 MB in size, this limit may be changed in the future. Source: https://core.telegram.org/bots/api#sendvideo """ @@ -30,7 +30,7 @@ class SendVideo(TelegramMethod[Message]): chat_id: Union[int, str] """Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)""" video: Union[InputFile, str] - """Video to send. Pass a file_id as String to send a video that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a video from the Internet, or upload a new video using multipart/form-data. `More info on Sending Files » `_""" + """Video to send. Pass a file_id as String to send a video that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a video from the Internet, or upload a new video using multipart/form-data. :ref:`More info on Sending Files » `""" duration: Optional[int] = None """Duration of sent video in seconds""" width: Optional[int] = None @@ -38,7 +38,7 @@ class SendVideo(TelegramMethod[Message]): height: Optional[int] = None """Video height""" thumb: Optional[Union[InputFile, str]] = None - """Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://” if the thumbnail was uploaded using multipart/form-data under . `More info on Sending Files » `_""" + """Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://' if the thumbnail was uploaded using multipart/form-data under . :ref:`More info on Sending Files » `""" caption: Optional[str] = None """Video caption (may also be used when resending videos by *file_id*), 0-1024 characters after entities parsing""" parse_mode: Optional[str] = UNSET @@ -46,13 +46,13 @@ class SendVideo(TelegramMethod[Message]): caption_entities: Optional[List[MessageEntity]] = None """List of special entities that appear in the caption, which can be specified instead of *parse_mode*""" supports_streaming: Optional[bool] = None - """Pass *True*, if the uploaded video is suitable for streaming""" + """Pass :code:`True`, if the uploaded video is suitable for streaming""" disable_notification: Optional[bool] = None """Sends the message `silently `_. Users will receive a notification with no sound.""" reply_to_message_id: Optional[int] = None """If the message is a reply, ID of the original message""" allow_sending_without_reply: Optional[bool] = None - """Pass *True*, if the message should be sent even if the specified replied-to message is not found""" + """Pass :code:`True`, if the message should be sent even if the specified replied-to message is not found""" reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None diff --git a/aiogram/methods/send_video_note.py b/aiogram/methods/send_video_note.py index 8f1549c0..4e475222 100644 --- a/aiogram/methods/send_video_note.py +++ b/aiogram/methods/send_video_note.py @@ -18,7 +18,7 @@ if TYPE_CHECKING: # pragma: no cover class SendVideoNote(TelegramMethod[Message]): """ - As of `v.4.0 `_, Telegram clients support rounded square mp4 videos of up to 1 minute long. Use this method to send video messages. On success, the sent `Message `_ is returned. + As of `v.4.0 `_, Telegram clients support rounded square mp4 videos of up to 1 minute long. Use this method to send video messages. On success, the sent :class:`aiogram.types.message.Message` is returned. Source: https://core.telegram.org/bots/api#sendvideonote """ @@ -28,19 +28,19 @@ class SendVideoNote(TelegramMethod[Message]): chat_id: Union[int, str] """Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)""" video_note: Union[InputFile, str] - """Video note to send. Pass a file_id as String to send a video note that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. `More info on Sending Files » `_. Sending video notes by a URL is currently unsupported""" + """Video note to send. Pass a file_id as String to send a video note that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. :ref:`More info on Sending Files » `. Sending video notes by a URL is currently unsupported""" duration: Optional[int] = None """Duration of sent video in seconds""" length: Optional[int] = None """Video width and height, i.e. diameter of the video message""" thumb: Optional[Union[InputFile, str]] = None - """Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://” if the thumbnail was uploaded using multipart/form-data under . `More info on Sending Files » `_""" + """Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://' if the thumbnail was uploaded using multipart/form-data under . :ref:`More info on Sending Files » `""" disable_notification: Optional[bool] = None """Sends the message `silently `_. Users will receive a notification with no sound.""" reply_to_message_id: Optional[int] = None """If the message is a reply, ID of the original message""" allow_sending_without_reply: Optional[bool] = None - """Pass *True*, if the message should be sent even if the specified replied-to message is not found""" + """Pass :code:`True`, if the message should be sent even if the specified replied-to message is not found""" reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None diff --git a/aiogram/methods/send_voice.py b/aiogram/methods/send_voice.py index 700f6c59..abd16217 100644 --- a/aiogram/methods/send_voice.py +++ b/aiogram/methods/send_voice.py @@ -20,7 +20,7 @@ if TYPE_CHECKING: # pragma: no cover class SendVoice(TelegramMethod[Message]): """ - Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .OGG file encoded with OPUS (other formats may be sent as `Audio `_ or `Document `_). On success, the sent `Message `_ is returned. Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future. + Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .OGG file encoded with OPUS (other formats may be sent as :class:`aiogram.types.audio.Audio` or :class:`aiogram.types.document.Document`). On success, the sent :class:`aiogram.types.message.Message` is returned. Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future. Source: https://core.telegram.org/bots/api#sendvoice """ @@ -30,7 +30,7 @@ class SendVoice(TelegramMethod[Message]): chat_id: Union[int, str] """Unique identifier for the target chat or username of the target channel (in the format :code:`@channelusername`)""" voice: Union[InputFile, str] - """Audio file to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. `More info on Sending Files » `_""" + """Audio file to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. :ref:`More info on Sending Files » `""" caption: Optional[str] = None """Voice message caption, 0-1024 characters after entities parsing""" parse_mode: Optional[str] = UNSET @@ -44,7 +44,7 @@ class SendVoice(TelegramMethod[Message]): reply_to_message_id: Optional[int] = None """If the message is a reply, ID of the original message""" allow_sending_without_reply: Optional[bool] = None - """Pass *True*, if the message should be sent even if the specified replied-to message is not found""" + """Pass :code:`True`, if the message should be sent even if the specified replied-to message is not found""" reply_markup: Optional[ Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply] ] = None diff --git a/aiogram/methods/set_chat_administrator_custom_title.py b/aiogram/methods/set_chat_administrator_custom_title.py index 01392c43..cb570940 100644 --- a/aiogram/methods/set_chat_administrator_custom_title.py +++ b/aiogram/methods/set_chat_administrator_custom_title.py @@ -10,7 +10,7 @@ if TYPE_CHECKING: # pragma: no cover class SetChatAdministratorCustomTitle(TelegramMethod[bool]): """ - Use this method to set a custom title for an administrator in a supergroup promoted by the bot. Returns *True* on success. + Use this method to set a custom title for an administrator in a supergroup promoted by the bot. Returns :code:`True` on success. Source: https://core.telegram.org/bots/api#setchatadministratorcustomtitle """ diff --git a/aiogram/methods/set_chat_description.py b/aiogram/methods/set_chat_description.py index 02705a7c..109aa270 100644 --- a/aiogram/methods/set_chat_description.py +++ b/aiogram/methods/set_chat_description.py @@ -10,7 +10,7 @@ if TYPE_CHECKING: # pragma: no cover class SetChatDescription(TelegramMethod[bool]): """ - Use this method to change the description of a group, a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Returns *True* on success. + Use this method to change the description of a group, a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Returns :code:`True` on success. Source: https://core.telegram.org/bots/api#setchatdescription """ diff --git a/aiogram/methods/set_chat_permissions.py b/aiogram/methods/set_chat_permissions.py index 00e1eaf3..75181e88 100644 --- a/aiogram/methods/set_chat_permissions.py +++ b/aiogram/methods/set_chat_permissions.py @@ -11,7 +11,7 @@ if TYPE_CHECKING: # pragma: no cover class SetChatPermissions(TelegramMethod[bool]): """ - Use this method to set default chat permissions for all members. The bot must be an administrator in the group or a supergroup for this to work and must have the *can_restrict_members* admin rights. Returns *True* on success. + Use this method to set default chat permissions for all members. The bot must be an administrator in the group or a supergroup for this to work and must have the *can_restrict_members* admin rights. Returns :code:`True` on success. Source: https://core.telegram.org/bots/api#setchatpermissions """ diff --git a/aiogram/methods/set_chat_photo.py b/aiogram/methods/set_chat_photo.py index b4b65288..2aaa6cca 100644 --- a/aiogram/methods/set_chat_photo.py +++ b/aiogram/methods/set_chat_photo.py @@ -11,7 +11,7 @@ if TYPE_CHECKING: # pragma: no cover class SetChatPhoto(TelegramMethod[bool]): """ - Use this method to set a new profile photo for the chat. Photos can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Returns *True* on success. + Use this method to set a new profile photo for the chat. Photos can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Returns :code:`True` on success. Source: https://core.telegram.org/bots/api#setchatphoto """ diff --git a/aiogram/methods/set_chat_sticker_set.py b/aiogram/methods/set_chat_sticker_set.py index 65984af6..91a8896b 100644 --- a/aiogram/methods/set_chat_sticker_set.py +++ b/aiogram/methods/set_chat_sticker_set.py @@ -10,7 +10,7 @@ if TYPE_CHECKING: # pragma: no cover class SetChatStickerSet(TelegramMethod[bool]): """ - Use this method to set a new group sticker set for a supergroup. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Use the field *can_set_sticker_set* optionally returned in `getChat `_ requests to check if the bot can use this method. Returns *True* on success. + Use this method to set a new group sticker set for a supergroup. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Use the field *can_set_sticker_set* optionally returned in :class:`aiogram.methods.get_chat.GetChat` requests to check if the bot can use this method. Returns :code:`True` on success. Source: https://core.telegram.org/bots/api#setchatstickerset """ diff --git a/aiogram/methods/set_chat_title.py b/aiogram/methods/set_chat_title.py index a949df75..f86ace4f 100644 --- a/aiogram/methods/set_chat_title.py +++ b/aiogram/methods/set_chat_title.py @@ -10,7 +10,7 @@ if TYPE_CHECKING: # pragma: no cover class SetChatTitle(TelegramMethod[bool]): """ - Use this method to change the title of a chat. Titles can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Returns *True* on success. + Use this method to change the title of a chat. Titles can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Returns :code:`True` on success. Source: https://core.telegram.org/bots/api#setchattitle """ diff --git a/aiogram/methods/set_game_score.py b/aiogram/methods/set_game_score.py index cb579825..9965dced 100644 --- a/aiogram/methods/set_game_score.py +++ b/aiogram/methods/set_game_score.py @@ -11,7 +11,7 @@ if TYPE_CHECKING: # pragma: no cover class SetGameScore(TelegramMethod[Union[Message, bool]]): """ - Use this method to set the score of the specified user in a game. On success, if the message was sent by the bot, returns the edited `Message `_, otherwise returns *True*. Returns an error, if the new score is not greater than the user's current score in the chat and *force* is *False*. + Use this method to set the score of the specified user in a game. On success, if the message was sent by the bot, returns the edited :class:`aiogram.types.message.Message`, otherwise returns :code:`True`. Returns an error, if the new score is not greater than the user's current score in the chat and *force* is :code:`False`. Source: https://core.telegram.org/bots/api#setgamescore """ diff --git a/aiogram/methods/set_my_commands.py b/aiogram/methods/set_my_commands.py index 8d1458f4..a739b228 100644 --- a/aiogram/methods/set_my_commands.py +++ b/aiogram/methods/set_my_commands.py @@ -11,7 +11,7 @@ if TYPE_CHECKING: # pragma: no cover class SetMyCommands(TelegramMethod[bool]): """ - Use this method to change the list of the bot's commands. Returns *True* on success. + Use this method to change the list of the bot's commands. Returns :code:`True` on success. Source: https://core.telegram.org/bots/api#setmycommands """ diff --git a/aiogram/methods/set_passport_data_errors.py b/aiogram/methods/set_passport_data_errors.py index 85dfcff5..e3c215ce 100644 --- a/aiogram/methods/set_passport_data_errors.py +++ b/aiogram/methods/set_passport_data_errors.py @@ -11,7 +11,7 @@ if TYPE_CHECKING: # pragma: no cover class SetPassportDataErrors(TelegramMethod[bool]): """ - Informs a user that some of the Telegram Passport elements they provided contains errors. The user will not be able to re-submit their Passport to you until the errors are fixed (the contents of the field for which you returned the error must change). Returns *True* on success. + Informs a user that some of the Telegram Passport elements they provided contains errors. The user will not be able to re-submit their Passport to you until the errors are fixed (the contents of the field for which you returned the error must change). Returns :code:`True` on success. Use this if the data submitted by the user doesn't satisfy the standards your service requires for any reason. For example, if a birthday date seems invalid, a submitted document is blurry, a scan shows evidence of tampering, etc. Supply some details in the error message to make sure the user knows how to correct the issues. Source: https://core.telegram.org/bots/api#setpassportdataerrors diff --git a/aiogram/methods/set_sticker_position_in_set.py b/aiogram/methods/set_sticker_position_in_set.py index 1b3cc37f..8c60c0ea 100644 --- a/aiogram/methods/set_sticker_position_in_set.py +++ b/aiogram/methods/set_sticker_position_in_set.py @@ -10,7 +10,7 @@ if TYPE_CHECKING: # pragma: no cover class SetStickerPositionInSet(TelegramMethod[bool]): """ - Use this method to move a sticker in a set created by the bot to a specific position. Returns *True* on success. + Use this method to move a sticker in a set created by the bot to a specific position. Returns :code:`True` on success. Source: https://core.telegram.org/bots/api#setstickerpositioninset """ diff --git a/aiogram/methods/set_sticker_set_thumb.py b/aiogram/methods/set_sticker_set_thumb.py index 57f88557..ab97d663 100644 --- a/aiogram/methods/set_sticker_set_thumb.py +++ b/aiogram/methods/set_sticker_set_thumb.py @@ -11,7 +11,7 @@ if TYPE_CHECKING: # pragma: no cover class SetStickerSetThumb(TelegramMethod[bool]): """ - Use this method to set the thumbnail of a sticker set. Animated thumbnails can be set for animated sticker sets only. Returns *True* on success. + Use this method to set the thumbnail of a sticker set. Animated thumbnails can be set for animated sticker sets only. Returns :code:`True` on success. Source: https://core.telegram.org/bots/api#setstickersetthumb """ @@ -23,7 +23,7 @@ class SetStickerSetThumb(TelegramMethod[bool]): user_id: int """User identifier of the sticker set owner""" thumb: Optional[Union[InputFile, str]] = None - """A **PNG** image with the thumbnail, must be up to 128 kilobytes in size and have width and height exactly 100px, or a **TGS** animation with the thumbnail up to 32 kilobytes in size; see `https://core.telegram.org/animated_stickers#technical-requirements `_`https://core.telegram.org/animated_stickers#technical-requirements `_ for animated sticker technical requirements. Pass a *file_id* as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. `More info on Sending Files » `_. Animated sticker set thumbnail can't be uploaded via HTTP URL.""" + """A **PNG** image with the thumbnail, must be up to 128 kilobytes in size and have width and height exactly 100px, or a **TGS** animation with the thumbnail up to 32 kilobytes in size; see `https://core.telegram.org/animated_stickers#technical-requirements `_`https://core.telegram.org/animated_stickers#technical-requirements `_ for animated sticker technical requirements. Pass a *file_id* as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. :ref:`More info on Sending Files » `. Animated sticker set thumbnail can't be uploaded via HTTP URL.""" def build_request(self, bot: Bot) -> Request: data: Dict[str, Any] = self.dict(exclude={"thumb"}) diff --git a/aiogram/methods/set_webhook.py b/aiogram/methods/set_webhook.py index a0584603..fc7539c4 100644 --- a/aiogram/methods/set_webhook.py +++ b/aiogram/methods/set_webhook.py @@ -11,16 +11,17 @@ if TYPE_CHECKING: # pragma: no cover class SetWebhook(TelegramMethod[bool]): """ - Use this method to specify a url and receive incoming updates via an outgoing webhook. Whenever there is an update for the bot, we will send an HTTPS POST request to the specified url, containing a JSON-serialized `Update `_. In case of an unsuccessful request, we will give up after a reasonable amount of attempts. Returns *True* on success. + Use this method to specify a url and receive incoming updates via an outgoing webhook. Whenever there is an update for the bot, we will send an HTTPS POST request to the specified url, containing a JSON-serialized :class:`aiogram.types.update.Update`. In case of an unsuccessful request, we will give up after a reasonable amount of attempts. Returns :code:`True` on success. If you'd like to make sure that the Webhook request comes from Telegram, we recommend using a secret path in the URL, e.g. :code:`https://www.example.com/`. Since nobody else knows your bot's token, you can be pretty sure it's us. - **Notes** - **1.** You will not be able to receive updates using `getUpdates `_ for as long as an outgoing webhook is set up. + **Notes** - **2.** To use a self-signed certificate, you need to upload your `public key certificate `_ using *certificate* parameter. Please upload as InputFile, sending a String will not work. + **1.** You will not be able to receive updates using :class:`aiogram.methods.get_updates.GetUpdates` for as long as an outgoing webhook is set up. - **3.** Ports currently supported *for Webhooks*: **443, 80, 88, 8443**. - **NEW!** If you're having any trouble setting up webhooks, please check out this `amazing guide to Webhooks `_. + **2.** To use a self-signed certificate, you need to upload your `public key certificate `_ using *certificate* parameter. Please upload as InputFile, sending a String will not work. + + **3.** Ports currently supported *for Webhooks*: **443, 80, 88, 8443**. + **NEW!** If you're having any trouble setting up webhooks, please check out this `amazing guide to Webhooks `_. Source: https://core.telegram.org/bots/api#setwebhook """ @@ -36,9 +37,9 @@ class SetWebhook(TelegramMethod[bool]): max_connections: Optional[int] = None """Maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery, 1-100. Defaults to *40*. Use lower values to limit the load on your bot's server, and higher values to increase your bot's throughput.""" allowed_updates: Optional[List[str]] = None - """A JSON-serialized list of the update types you want your bot to receive. For example, specify [“message”, “edited_channel_post”, “callback_query”] to only receive updates of these types. See `Update `_ for a complete list of available update types. Specify an empty list to receive all updates regardless of type (default). If not specified, the previous setting will be used.""" + """A JSON-serialized list of the update types you want your bot to receive. For example, specify ['message', 'edited_channel_post', 'callback_query'] to only receive updates of these types. See :class:`aiogram.types.update.Update` for a complete list of available update types. Specify an empty list to receive all updates regardless of type (default). If not specified, the previous setting will be used.""" drop_pending_updates: Optional[bool] = None - """Pass *True* to drop all pending updates""" + """Pass :code:`True` to drop all pending updates""" def build_request(self, bot: Bot) -> Request: data: Dict[str, Any] = self.dict(exclude={"certificate"}) diff --git a/aiogram/methods/stop_message_live_location.py b/aiogram/methods/stop_message_live_location.py index 183a3195..2565eb0d 100644 --- a/aiogram/methods/stop_message_live_location.py +++ b/aiogram/methods/stop_message_live_location.py @@ -11,7 +11,7 @@ if TYPE_CHECKING: # pragma: no cover class StopMessageLiveLocation(TelegramMethod[Union[Message, bool]]): """ - Use this method to stop updating a live location message before *live_period* expires. On success, if the message was sent by the bot, the sent `Message `_ is returned, otherwise *True* is returned. + Use this method to stop updating a live location message before *live_period* expires. On success, if the message was sent by the bot, the sent :class:`aiogram.types.message.Message` is returned, otherwise :code:`True` is returned. Source: https://core.telegram.org/bots/api#stopmessagelivelocation """ diff --git a/aiogram/methods/stop_poll.py b/aiogram/methods/stop_poll.py index b39cf848..027241bf 100644 --- a/aiogram/methods/stop_poll.py +++ b/aiogram/methods/stop_poll.py @@ -11,7 +11,7 @@ if TYPE_CHECKING: # pragma: no cover class StopPoll(TelegramMethod[Poll]): """ - Use this method to stop a poll which was sent by the bot. On success, the stopped `Poll `_ with the final results is returned. + Use this method to stop a poll which was sent by the bot. On success, the stopped :class:`aiogram.types.poll.Poll` with the final results is returned. Source: https://core.telegram.org/bots/api#stoppoll """ diff --git a/aiogram/methods/unban_chat_member.py b/aiogram/methods/unban_chat_member.py index 4c37c5eb..cae62f8e 100644 --- a/aiogram/methods/unban_chat_member.py +++ b/aiogram/methods/unban_chat_member.py @@ -10,7 +10,7 @@ if TYPE_CHECKING: # pragma: no cover class UnbanChatMember(TelegramMethod[bool]): """ - Use this method to unban a previously kicked user in a supergroup or channel. The user will **not** return to the group or channel automatically, but will be able to join via link, etc. The bot must be an administrator for this to work. By default, this method guarantees that after the call the user is not a member of the chat, but will be able to join it. So if the user is a member of the chat they will also be **removed** from the chat. If you don't want this, use the parameter *only_if_banned*. Returns *True* on success. + Use this method to unban a previously kicked user in a supergroup or channel. The user will **not** return to the group or channel automatically, but will be able to join via link, etc. The bot must be an administrator for this to work. By default, this method guarantees that after the call the user is not a member of the chat, but will be able to join it. So if the user is a member of the chat they will also be **removed** from the chat. If you don't want this, use the parameter *only_if_banned*. Returns :code:`True` on success. Source: https://core.telegram.org/bots/api#unbanchatmember """ diff --git a/aiogram/methods/unpin_all_chat_messages.py b/aiogram/methods/unpin_all_chat_messages.py index a0020047..b37677f9 100644 --- a/aiogram/methods/unpin_all_chat_messages.py +++ b/aiogram/methods/unpin_all_chat_messages.py @@ -10,7 +10,7 @@ if TYPE_CHECKING: # pragma: no cover class UnpinAllChatMessages(TelegramMethod[bool]): """ - Use this method to clear the list of pinned messages in a chat. If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' admin right in a supergroup or 'can_edit_messages' admin right in a channel. Returns *True* on success. + Use this method to clear the list of pinned messages in a chat. If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' admin right in a supergroup or 'can_edit_messages' admin right in a channel. Returns :code:`True` on success. Source: https://core.telegram.org/bots/api#unpinallchatmessages """ diff --git a/aiogram/methods/unpin_chat_message.py b/aiogram/methods/unpin_chat_message.py index a2c02ff8..736f6472 100644 --- a/aiogram/methods/unpin_chat_message.py +++ b/aiogram/methods/unpin_chat_message.py @@ -10,7 +10,7 @@ if TYPE_CHECKING: # pragma: no cover class UnpinChatMessage(TelegramMethod[bool]): """ - Use this method to remove a message from the list of pinned messages in a chat. If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' admin right in a supergroup or 'can_edit_messages' admin right in a channel. Returns *True* on success. + Use this method to remove a message from the list of pinned messages in a chat. If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' admin right in a supergroup or 'can_edit_messages' admin right in a channel. Returns :code:`True` on success. Source: https://core.telegram.org/bots/api#unpinchatmessage """ diff --git a/aiogram/methods/upload_sticker_file.py b/aiogram/methods/upload_sticker_file.py index 80a4c237..7d5bc86b 100644 --- a/aiogram/methods/upload_sticker_file.py +++ b/aiogram/methods/upload_sticker_file.py @@ -11,7 +11,7 @@ if TYPE_CHECKING: # pragma: no cover class UploadStickerFile(TelegramMethod[File]): """ - Use this method to upload a .PNG file with a sticker for later use in *createNewStickerSet* and *addStickerToSet* methods (can be used multiple times). Returns the uploaded `File `_ on success. + Use this method to upload a .PNG file with a sticker for later use in *createNewStickerSet* and *addStickerToSet* methods (can be used multiple times). Returns the uploaded :class:`aiogram.types.file.File` on success. Source: https://core.telegram.org/bots/api#uploadstickerfile """ @@ -21,7 +21,7 @@ class UploadStickerFile(TelegramMethod[File]): user_id: int """User identifier of sticker file owner""" png_sticker: InputFile - """**PNG** image with the sticker, must be up to 512 kilobytes in size, dimensions must not exceed 512px, and either width or height must be exactly 512px. `More info on Sending Files » `_""" + """**PNG** image with the sticker, must be up to 512 kilobytes in size, dimensions must not exceed 512px, and either width or height must be exactly 512px. :ref:`More info on Sending Files » `""" def build_request(self, bot: Bot) -> Request: data: Dict[str, Any] = self.dict(exclude={"png_sticker"}) diff --git a/aiogram/types/animation.py b/aiogram/types/animation.py index ffa3141b..c97fb548 100644 --- a/aiogram/types/animation.py +++ b/aiogram/types/animation.py @@ -18,8 +18,7 @@ class Animation(TelegramObject): file_id: str """Identifier for this file, which can be used to download or reuse the file""" file_unique_id: str - """Unique identifier for this file, which is supposed to be the same over time and for - different bots. Can't be used to download or reuse the file.""" + """Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.""" width: int """Video width as defined by sender""" height: int @@ -27,10 +26,10 @@ class Animation(TelegramObject): duration: int """Duration of the video in seconds as defined by sender""" thumb: Optional[PhotoSize] = None - """Animation thumbnail as defined by sender""" + """*Optional*. Animation thumbnail as defined by sender""" file_name: Optional[str] = None - """Original animation filename as defined by sender""" + """*Optional*. Original animation filename as defined by sender""" mime_type: Optional[str] = None - """MIME type of the file as defined by sender""" + """*Optional*. MIME type of the file as defined by sender""" file_size: Optional[int] = None - """File size""" + """*Optional*. File size""" diff --git a/aiogram/types/audio.py b/aiogram/types/audio.py index e1ecd36f..cbb468f3 100644 --- a/aiogram/types/audio.py +++ b/aiogram/types/audio.py @@ -18,19 +18,18 @@ class Audio(TelegramObject): file_id: str """Identifier for this file, which can be used to download or reuse the file""" file_unique_id: str - """Unique identifier for this file, which is supposed to be the same over time and for - different bots. Can't be used to download or reuse the file.""" + """Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.""" duration: int """Duration of the audio in seconds as defined by sender""" performer: Optional[str] = None - """Performer of the audio as defined by sender or by audio tags""" + """*Optional*. Performer of the audio as defined by sender or by audio tags""" title: Optional[str] = None - """Title of the audio as defined by sender or by audio tags""" + """*Optional*. Title of the audio as defined by sender or by audio tags""" file_name: Optional[str] = None - """Original filename as defined by sender""" + """*Optional*. Original filename as defined by sender""" mime_type: Optional[str] = None - """MIME type of the file as defined by sender""" + """*Optional*. MIME type of the file as defined by sender""" file_size: Optional[int] = None - """File size""" + """*Optional*. File size""" thumb: Optional[PhotoSize] = None - """Thumbnail of the album cover to which the music file belongs""" + """*Optional*. Thumbnail of the album cover to which the music file belongs""" diff --git a/aiogram/types/base.py b/aiogram/types/base.py index 99db1a01..0b5d08ad 100644 --- a/aiogram/types/base.py +++ b/aiogram/types/base.py @@ -23,4 +23,6 @@ class MutableTelegramObject(TelegramObject): allow_mutation = True -UNSET: Any = sentinel.UNSET # special sentinel object which used in sutuation when None might be a useful value +UNSET: Any = ( + sentinel.UNSET +) # special sentinel object which used in sutuation when None might be a useful value diff --git a/aiogram/types/bot_command.py b/aiogram/types/bot_command.py index 96ef0a31..844abffb 100644 --- a/aiogram/types/bot_command.py +++ b/aiogram/types/bot_command.py @@ -11,7 +11,6 @@ class BotCommand(MutableTelegramObject): """ command: str - """Text of the command, 1-32 characters. Can contain only lowercase English letters, digits - and underscores.""" + """Text of the command, 1-32 characters. Can contain only lowercase English letters, digits and underscores.""" description: str """Description of the command, 3-256 characters.""" diff --git a/aiogram/types/callback_game.py b/aiogram/types/callback_game.py index fe0676d5..6d8c556a 100644 --- a/aiogram/types/callback_game.py +++ b/aiogram/types/callback_game.py @@ -5,7 +5,7 @@ from .base import TelegramObject class CallbackGame(TelegramObject): """ - A placeholder, currently holds no information. Use BotFather to set up your game. + A placeholder, currently holds no information. Use `BotFather `_ to set up your game. Source: https://core.telegram.org/bots/api#callbackgame """ diff --git a/aiogram/types/callback_query.py b/aiogram/types/callback_query.py index 1991ca8d..90786e8f 100644 --- a/aiogram/types/callback_query.py +++ b/aiogram/types/callback_query.py @@ -7,22 +7,16 @@ from pydantic import Field from .base import TelegramObject if TYPE_CHECKING: # pragma: no cover + from ..methods import AnswerCallbackQuery from .message import Message from .user import User - from ..methods import AnswerCallbackQuery class CallbackQuery(TelegramObject): """ - This object represents an incoming callback query from a callback button in an inline - keyboard. If the button that originated the query was attached to a message sent by the bot, - the field message will be present. If the button was attached to a message sent via the bot - (in inline mode), the field inline_message_id will be present. Exactly one of the fields data - or game_short_name will be present. - NOTE: After the user presses a callback button, Telegram clients will display a progress bar - until you call answerCallbackQuery. It is, therefore, necessary to react by calling - answerCallbackQuery even if no notification to the user is needed (e.g., without specifying - any of the optional parameters). + This object represents an incoming callback query from a callback button in an `inline keyboard `_. If the button that originated the query was attached to a message sent by the bot, the field *message* will be present. If the button was attached to a message sent via the bot (in `inline mode `_), the field *inline_message_id* will be present. Exactly one of the fields *data* or *game_short_name* will be present. + + **NOTE:** After the user presses a callback button, Telegram clients will display a progress bar until you call :class:`aiogram.methods.answer_callback_query.AnswerCallbackQuery`. It is, therefore, necessary to react by calling :class:`aiogram.methods.answer_callback_query.AnswerCallbackQuery` even if no notification to the user is needed (e.g., without specifying any of the optional parameters). Source: https://core.telegram.org/bots/api#callbackquery """ @@ -32,18 +26,15 @@ class CallbackQuery(TelegramObject): from_user: User = Field(..., alias="from") """Sender""" chat_instance: str - """Global identifier, uniquely corresponding to the chat to which the message with the - callback button was sent. Useful for high scores in games.""" + """Global identifier, uniquely corresponding to the chat to which the message with the callback button was sent. Useful for high scores in :class:`aiogram.methods.games.Games`.""" message: Optional[Message] = None - """Message with the callback button that originated the query. Note that message content and - message date will not be available if the message is too old""" + """*Optional*. Message with the callback button that originated the query. Note that message content and message date will not be available if the message is too old""" inline_message_id: Optional[str] = None - """Identifier of the message sent via the bot in inline mode, that originated the query.""" + """*Optional*. Identifier of the message sent via the bot in inline mode, that originated the query.""" data: Optional[str] = None - """Data associated with the callback button. Be aware that a bad client can send arbitrary - data in this field.""" + """*Optional*. Data associated with the callback button. Be aware that a bad client can send arbitrary data in this field.""" game_short_name: Optional[str] = None - """Short name of a Game to be returned, serves as the unique identifier for the game""" + """*Optional*. Short name of a `Game `_ to be returned, serves as the unique identifier for the game""" def answer( self, diff --git a/aiogram/types/chat.py b/aiogram/types/chat.py index c2125a02..8714ceb8 100644 --- a/aiogram/types/chat.py +++ b/aiogram/types/chat.py @@ -19,47 +19,36 @@ class Chat(TelegramObject): """ id: int - """Unique identifier for this chat. This number may be greater than 32 bits and some - programming languages may have difficulty/silent defects in interpreting it. But it is - smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe - for storing this identifier.""" + """Unique identifier for this chat. This number may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier.""" type: str """Type of chat, can be either 'private', 'group', 'supergroup' or 'channel'""" title: Optional[str] = None - """Title, for supergroups, channels and group chats""" + """*Optional*. Title, for supergroups, channels and group chats""" username: Optional[str] = None - """Username, for private chats, supergroups and channels if available""" + """*Optional*. Username, for private chats, supergroups and channels if available""" first_name: Optional[str] = None - """First name of the other party in a private chat""" + """*Optional*. First name of the other party in a private chat""" last_name: Optional[str] = None - """Last name of the other party in a private chat""" + """*Optional*. Last name of the other party in a private chat""" photo: Optional[ChatPhoto] = None - """Chat photo. Returned only in getChat.""" + """*Optional*. Chat photo. Returned only in :class:`aiogram.methods.get_chat.GetChat`.""" bio: Optional[str] = None - """Bio of the other party in a private chat. Returned only in getChat.""" + """*Optional*. Bio of the other party in a private chat. Returned only in :class:`aiogram.methods.get_chat.GetChat`.""" description: Optional[str] = None - """Description, for groups, supergroups and channel chats. Returned only in getChat.""" + """*Optional*. Description, for groups, supergroups and channel chats. Returned only in :class:`aiogram.methods.get_chat.GetChat`.""" invite_link: Optional[str] = None - """Chat invite link, for groups, supergroups and channel chats. Each administrator in a chat - generates their own invite links, so the bot must first generate the link using - exportChatInviteLink. Returned only in getChat.""" + """*Optional*. Chat invite link, for groups, supergroups and channel chats. Each administrator in a chat generates their own invite links, so the bot must first generate the link using :class:`aiogram.methods.export_chat_invite_link.ExportChatInviteLink`. Returned only in :class:`aiogram.methods.get_chat.GetChat`.""" pinned_message: Optional[Message] = None - """The most recent pinned message (by sending date). Returned only in getChat.""" + """*Optional*. The most recent pinned message (by sending date). Returned only in :class:`aiogram.methods.get_chat.GetChat`.""" permissions: Optional[ChatPermissions] = None - """Default chat member permissions, for groups and supergroups. Returned only in getChat.""" + """*Optional*. Default chat member permissions, for groups and supergroups. Returned only in :class:`aiogram.methods.get_chat.GetChat`.""" slow_mode_delay: Optional[int] = None - """For supergroups, the minimum allowed delay between consecutive messages sent by each - unpriviledged user. Returned only in getChat.""" + """*Optional*. For supergroups, the minimum allowed delay between consecutive messages sent by each unpriviledged user. Returned only in :class:`aiogram.methods.get_chat.GetChat`.""" sticker_set_name: Optional[str] = None - """For supergroups, name of group sticker set. Returned only in getChat.""" + """*Optional*. For supergroups, name of group sticker set. Returned only in :class:`aiogram.methods.get_chat.GetChat`.""" can_set_sticker_set: Optional[bool] = None - """True, if the bot can change the group sticker set. Returned only in getChat.""" + """*Optional*. True, if the bot can change the group sticker set. Returned only in :class:`aiogram.methods.get_chat.GetChat`.""" linked_chat_id: Optional[int] = None - """Unique identifier for the linked chat, i.e. the discussion group identifier for a channel - and vice versa; for supergroups and channel chats. This identifier may be greater than 32 - bits and some programming languages may have difficulty/silent defects in interpreting it. - But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type - are safe for storing this identifier. Returned only in getChat.""" + """*Optional*. Unique identifier for the linked chat, i.e. the discussion group identifier for a channel and vice versa; for supergroups and channel chats. This identifier may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier. Returned only in :class:`aiogram.methods.get_chat.GetChat`.""" location: Optional[ChatLocation] = None - """For supergroups, the location to which the supergroup is connected. Returned only in - getChat.""" + """*Optional*. For supergroups, the location to which the supergroup is connected. Returned only in :class:`aiogram.methods.get_chat.GetChat`.""" diff --git a/aiogram/types/chat_member.py b/aiogram/types/chat_member.py index ded87878..aa1809aa 100644 --- a/aiogram/types/chat_member.py +++ b/aiogram/types/chat_member.py @@ -21,53 +21,43 @@ class ChatMember(TelegramObject): user: User """Information about the user""" status: str - """The member's status in the chat. Can be 'creator', 'administrator', 'member', 'restricted', - 'left' or 'kicked'""" + """The member's status in the chat. Can be 'creator', 'administrator', 'member', 'restricted', 'left' or 'kicked'""" custom_title: Optional[str] = None - """Owner and administrators only. Custom title for this user""" + """*Optional*. Owner and administrators only. Custom title for this user""" is_anonymous: Optional[bool] = None - """Owner and administrators only. True, if the user's presence in the chat is hidden""" + """*Optional*. Owner and administrators only. True, if the user's presence in the chat is hidden""" can_be_edited: Optional[bool] = None - """Administrators only. True, if the bot is allowed to edit administrator privileges of that - user""" + """*Optional*. Administrators only. True, if the bot is allowed to edit administrator privileges of that user""" can_post_messages: Optional[bool] = None - """Administrators only. True, if the administrator can post in the channel; channels only""" + """*Optional*. Administrators only. True, if the administrator can post in the channel; channels only""" can_edit_messages: Optional[bool] = None - """Administrators only. True, if the administrator can edit messages of other users and can - pin messages; channels only""" + """*Optional*. Administrators only. True, if the administrator can edit messages of other users and can pin messages; channels only""" can_delete_messages: Optional[bool] = None - """Administrators only. True, if the administrator can delete messages of other users""" + """*Optional*. Administrators only. True, if the administrator can delete messages of other users""" can_restrict_members: Optional[bool] = None - """Administrators only. True, if the administrator can restrict, ban or unban chat members""" + """*Optional*. Administrators only. True, if the administrator can restrict, ban or unban chat members""" can_promote_members: Optional[bool] = None - """Administrators only. True, if the administrator can add new administrators with a subset of - their own privileges or demote administrators that he has promoted, directly or indirectly - (promoted by administrators that were appointed by the user)""" + """*Optional*. Administrators only. True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by the user)""" can_change_info: Optional[bool] = None - """Administrators and restricted only. True, if the user is allowed to change the chat title, - photo and other settings""" + """*Optional*. Administrators and restricted only. True, if the user is allowed to change the chat title, photo and other settings""" can_invite_users: Optional[bool] = None - """Administrators and restricted only. True, if the user is allowed to invite new users to the - chat""" + """*Optional*. Administrators and restricted only. True, if the user is allowed to invite new users to the chat""" can_pin_messages: Optional[bool] = None - """Administrators and restricted only. True, if the user is allowed to pin messages; groups - and supergroups only""" + """*Optional*. Administrators and restricted only. True, if the user is allowed to pin messages; groups and supergroups only""" is_member: Optional[bool] = None - """Restricted only. True, if the user is a member of the chat at the moment of the request""" + """*Optional*. Restricted only. True, if the user is a member of the chat at the moment of the request""" can_send_messages: Optional[bool] = None - """Restricted only. True, if the user is allowed to send text messages, contacts, locations - and venues""" + """*Optional*. Restricted only. True, if the user is allowed to send text messages, contacts, locations and venues""" can_send_media_messages: Optional[bool] = None - """Restricted only. True, if the user is allowed to send audios, documents, photos, videos, - video notes and voice notes""" + """*Optional*. Restricted only. True, if the user is allowed to send audios, documents, photos, videos, video notes and voice notes""" can_send_polls: Optional[bool] = None - """Restricted only. True, if the user is allowed to send polls""" + """*Optional*. Restricted only. True, if the user is allowed to send polls""" can_send_other_messages: Optional[bool] = None - """Restricted only. True, if the user is allowed to send animations, games, stickers and use - inline bots""" + """*Optional*. Restricted only. True, if the user is allowed to send animations, games, stickers and use inline bots""" can_add_web_page_previews: Optional[bool] = None - """Restricted only. True, if the user is allowed to add web page previews to their messages""" + """*Optional*. Restricted only. True, if the user is allowed to add web page previews to their messages""" until_date: Optional[Union[datetime.datetime, datetime.timedelta, int]] = None + """*Optional*. Restricted and kicked only. Date when restrictions will be lifted for this user; unix time""" """Restricted and kicked only. Date when restrictions will be lifted for this user; unix time""" @property diff --git a/aiogram/types/chat_permissions.py b/aiogram/types/chat_permissions.py index aef8d9ff..348d5bbc 100644 --- a/aiogram/types/chat_permissions.py +++ b/aiogram/types/chat_permissions.py @@ -13,22 +13,18 @@ class ChatPermissions(MutableTelegramObject): """ can_send_messages: Optional[bool] = None - """True, if the user is allowed to send text messages, contacts, locations and venues""" + """*Optional*. True, if the user is allowed to send text messages, contacts, locations and venues""" can_send_media_messages: Optional[bool] = None - """True, if the user is allowed to send audios, documents, photos, videos, video notes and - voice notes, implies can_send_messages""" + """*Optional*. True, if the user is allowed to send audios, documents, photos, videos, video notes and voice notes, implies can_send_messages""" can_send_polls: Optional[bool] = None - """True, if the user is allowed to send polls, implies can_send_messages""" + """*Optional*. True, if the user is allowed to send polls, implies can_send_messages""" can_send_other_messages: Optional[bool] = None - """True, if the user is allowed to send animations, games, stickers and use inline bots, - implies can_send_media_messages""" + """*Optional*. True, if the user is allowed to send animations, games, stickers and use inline bots, implies can_send_media_messages""" can_add_web_page_previews: Optional[bool] = None - """True, if the user is allowed to add web page previews to their messages, implies - can_send_media_messages""" + """*Optional*. True, if the user is allowed to add web page previews to their messages, implies can_send_media_messages""" can_change_info: Optional[bool] = None - """True, if the user is allowed to change the chat title, photo and other settings. Ignored in - public supergroups""" + """*Optional*. True, if the user is allowed to change the chat title, photo and other settings. Ignored in public supergroups""" can_invite_users: Optional[bool] = None - """True, if the user is allowed to invite new users to the chat""" + """*Optional*. True, if the user is allowed to invite new users to the chat""" can_pin_messages: Optional[bool] = None - """True, if the user is allowed to pin messages. Ignored in public supergroups""" + """*Optional*. True, if the user is allowed to pin messages. Ignored in public supergroups""" diff --git a/aiogram/types/chat_photo.py b/aiogram/types/chat_photo.py index 9fd53d32..a3f95f94 100644 --- a/aiogram/types/chat_photo.py +++ b/aiogram/types/chat_photo.py @@ -11,14 +11,10 @@ class ChatPhoto(TelegramObject): """ small_file_id: str - """File identifier of small (160x160) chat photo. This file_id can be used only for photo - download and only for as long as the photo is not changed.""" + """File identifier of small (160x160) chat photo. This file_id can be used only for photo download and only for as long as the photo is not changed.""" small_file_unique_id: str - """Unique file identifier of small (160x160) chat photo, which is supposed to be the same over - time and for different bots. Can't be used to download or reuse the file.""" + """Unique file identifier of small (160x160) chat photo, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.""" big_file_id: str - """File identifier of big (640x640) chat photo. This file_id can be used only for photo - download and only for as long as the photo is not changed.""" + """File identifier of big (640x640) chat photo. This file_id can be used only for photo download and only for as long as the photo is not changed.""" big_file_unique_id: str - """Unique file identifier of big (640x640) chat photo, which is supposed to be the same over - time and for different bots. Can't be used to download or reuse the file.""" + """Unique file identifier of big (640x640) chat photo, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.""" diff --git a/aiogram/types/chosen_inline_result.py b/aiogram/types/chosen_inline_result.py index f6dfdede..445e81fd 100644 --- a/aiogram/types/chosen_inline_result.py +++ b/aiogram/types/chosen_inline_result.py @@ -13,10 +13,8 @@ if TYPE_CHECKING: # pragma: no cover class ChosenInlineResult(TelegramObject): """ - Represents a result of an inline query that was chosen by the user and sent to their chat - partner. - Note: It is necessary to enable inline feedback via @Botfather in order to receive these - objects in updates. + Represents a `result `_ of an inline query that was chosen by the user and sent to their chat partner. + **Note:** It is necessary to enable `inline feedback `_ via `@Botfather `_ in order to receive these objects in updates. Source: https://core.telegram.org/bots/api#choseninlineresult """ @@ -28,8 +26,6 @@ class ChosenInlineResult(TelegramObject): query: str """The query that was used to obtain the result""" location: Optional[Location] = None - """Sender location, only for bots that require user location""" + """*Optional*. Sender location, only for bots that require user location""" inline_message_id: Optional[str] = None - """Identifier of the sent inline message. Available only if there is an inline keyboard - attached to the message. Will be also received in callback queries and can be used to edit - the message.""" + """*Optional*. Identifier of the sent inline message. Available only if there is an `inline keyboard `_ attached to the message. Will be also received in `callback queries `_ and can be used to `edit `_ the message.""" diff --git a/aiogram/types/contact.py b/aiogram/types/contact.py index 1c005a7d..951a5b8f 100644 --- a/aiogram/types/contact.py +++ b/aiogram/types/contact.py @@ -17,8 +17,8 @@ class Contact(TelegramObject): first_name: str """Contact's first name""" last_name: Optional[str] = None - """Contact's last name""" + """*Optional*. Contact's last name""" user_id: Optional[int] = None - """Contact's user identifier in Telegram""" + """*Optional*. Contact's user identifier in Telegram""" vcard: Optional[str] = None - """Additional data about the contact in the form of a vCard""" + """*Optional*. Additional data about the contact in the form of a `vCard `_""" diff --git a/aiogram/types/dice.py b/aiogram/types/dice.py index 54a36afd..41dfbf75 100644 --- a/aiogram/types/dice.py +++ b/aiogram/types/dice.py @@ -13,8 +13,7 @@ class Dice(TelegramObject): emoji: str """Emoji on which the dice throw animation is based""" value: int - """Value of the dice, 1-6 for '' and '' base emoji, 1-5 for '' and '' base emoji, 1-64 for '' - base emoji""" + """Value of the dice, 1-6 for '' and '' base emoji, 1-5 for '' and '' base emoji, 1-64 for '' base emoji""" class DiceEmoji: diff --git a/aiogram/types/document.py b/aiogram/types/document.py index 7939cd9a..788c47c1 100644 --- a/aiogram/types/document.py +++ b/aiogram/types/document.py @@ -10,7 +10,7 @@ if TYPE_CHECKING: # pragma: no cover class Document(TelegramObject): """ - This object represents a general file (as opposed to photos, voice messages and audio files). + This object represents a general file (as opposed to `photos `_, `voice messages `_ and `audio files `_). Source: https://core.telegram.org/bots/api#document """ @@ -18,13 +18,12 @@ class Document(TelegramObject): file_id: str """Identifier for this file, which can be used to download or reuse the file""" file_unique_id: str - """Unique identifier for this file, which is supposed to be the same over time and for - different bots. Can't be used to download or reuse the file.""" + """Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.""" thumb: Optional[PhotoSize] = None - """Document thumbnail as defined by sender""" + """*Optional*. Document thumbnail as defined by sender""" file_name: Optional[str] = None - """Original filename as defined by sender""" + """*Optional*. Original filename as defined by sender""" mime_type: Optional[str] = None - """MIME type of the file as defined by sender""" + """*Optional*. MIME type of the file as defined by sender""" file_size: Optional[int] = None - """File size""" + """*Optional*. File size""" diff --git a/aiogram/types/encrypted_credentials.py b/aiogram/types/encrypted_credentials.py index 7cf2c1e1..91fd7714 100644 --- a/aiogram/types/encrypted_credentials.py +++ b/aiogram/types/encrypted_credentials.py @@ -5,18 +5,14 @@ from .base import TelegramObject class EncryptedCredentials(TelegramObject): """ - Contains data required for decrypting and authenticating EncryptedPassportElement. See the - Telegram Passport Documentation for a complete description of the data decryption and - authentication processes. + Contains data required for decrypting and authenticating :class:`aiogram.types.encrypted_passport_element.EncryptedPassportElement`. See the `Telegram Passport Documentation `_ for a complete description of the data decryption and authentication processes. Source: https://core.telegram.org/bots/api#encryptedcredentials """ data: str - """Base64-encoded encrypted JSON-serialized data with unique user's payload, data hashes and - secrets required for EncryptedPassportElement decryption and authentication""" + """Base64-encoded encrypted JSON-serialized data with unique user's payload, data hashes and secrets required for :class:`aiogram.types.encrypted_passport_element.EncryptedPassportElement` decryption and authentication""" hash: str """Base64-encoded data hash for data authentication""" secret: str - """Base64-encoded secret, encrypted with the bot's public RSA key, required for data - decryption""" + """Base64-encoded secret, encrypted with the bot's public RSA key, required for data decryption""" diff --git a/aiogram/types/encrypted_passport_element.py b/aiogram/types/encrypted_passport_element.py index 2e786009..b17ae382 100644 --- a/aiogram/types/encrypted_passport_element.py +++ b/aiogram/types/encrypted_passport_element.py @@ -10,45 +10,28 @@ if TYPE_CHECKING: # pragma: no cover class EncryptedPassportElement(TelegramObject): """ - Contains information about documents or other Telegram Passport elements shared with the bot - by the user. + Contains information about documents or other Telegram Passport elements shared with the bot by the user. Source: https://core.telegram.org/bots/api#encryptedpassportelement """ type: str - """Element type. One of 'personal_details', 'passport', 'driver_license', 'identity_card', - 'internal_passport', 'address', 'utility_bill', 'bank_statement', 'rental_agreement', - 'passport_registration', 'temporary_registration', 'phone_number', 'email'.""" + """Element type. One of 'personal_details', 'passport', 'driver_license', 'identity_card', 'internal_passport', 'address', 'utility_bill', 'bank_statement', 'rental_agreement', 'passport_registration', 'temporary_registration', 'phone_number', 'email'.""" hash: str - """Base64-encoded element hash for using in PassportElementErrorUnspecified""" + """Base64-encoded element hash for using in :class:`aiogram.types.passport_element_error_unspecified.PassportElementErrorUnspecified`""" data: Optional[str] = None - """Base64-encoded encrypted Telegram Passport element data provided by the user, available for - 'personal_details', 'passport', 'driver_license', 'identity_card', 'internal_passport' and - 'address' types. Can be decrypted and verified using the accompanying EncryptedCredentials.""" + """*Optional*. Base64-encoded encrypted Telegram Passport element data provided by the user, available for 'personal_details', 'passport', 'driver_license', 'identity_card', 'internal_passport' and 'address' types. Can be decrypted and verified using the accompanying :class:`aiogram.types.encrypted_credentials.EncryptedCredentials`.""" phone_number: Optional[str] = None - """User's verified phone number, available only for 'phone_number' type""" + """*Optional*. User's verified phone number, available only for 'phone_number' type""" email: Optional[str] = None - """User's verified email address, available only for 'email' type""" + """*Optional*. User's verified email address, available only for 'email' type""" files: Optional[List[PassportFile]] = None - """Array of encrypted files with documents provided by the user, available for 'utility_bill', - 'bank_statement', 'rental_agreement', 'passport_registration' and 'temporary_registration' - types. Files can be decrypted and verified using the accompanying EncryptedCredentials.""" + """*Optional*. Array of encrypted files with documents provided by the user, available for 'utility_bill', 'bank_statement', 'rental_agreement', 'passport_registration' and 'temporary_registration' types. Files can be decrypted and verified using the accompanying :class:`aiogram.types.encrypted_credentials.EncryptedCredentials`.""" front_side: Optional[PassportFile] = None - """Encrypted file with the front side of the document, provided by the user. Available for - 'passport', 'driver_license', 'identity_card' and 'internal_passport'. The file can be - decrypted and verified using the accompanying EncryptedCredentials.""" + """*Optional*. Encrypted file with the front side of the document, provided by the user. Available for 'passport', 'driver_license', 'identity_card' and 'internal_passport'. The file can be decrypted and verified using the accompanying :class:`aiogram.types.encrypted_credentials.EncryptedCredentials`.""" reverse_side: Optional[PassportFile] = None - """Encrypted file with the reverse side of the document, provided by the user. Available for - 'driver_license' and 'identity_card'. The file can be decrypted and verified using the - accompanying EncryptedCredentials.""" + """*Optional*. Encrypted file with the reverse side of the document, provided by the user. Available for 'driver_license' and 'identity_card'. The file can be decrypted and verified using the accompanying :class:`aiogram.types.encrypted_credentials.EncryptedCredentials`.""" selfie: Optional[PassportFile] = None - """Encrypted file with the selfie of the user holding a document, provided by the user; - available for 'passport', 'driver_license', 'identity_card' and 'internal_passport'. The - file can be decrypted and verified using the accompanying EncryptedCredentials.""" + """*Optional*. Encrypted file with the selfie of the user holding a document, provided by the user; available for 'passport', 'driver_license', 'identity_card' and 'internal_passport'. The file can be decrypted and verified using the accompanying :class:`aiogram.types.encrypted_credentials.EncryptedCredentials`.""" translation: Optional[List[PassportFile]] = None - """Array of encrypted files with translated versions of documents provided by the user. - Available if requested for 'passport', 'driver_license', 'identity_card', - 'internal_passport', 'utility_bill', 'bank_statement', 'rental_agreement', - 'passport_registration' and 'temporary_registration' types. Files can be decrypted and - verified using the accompanying EncryptedCredentials.""" + """*Optional*. Array of encrypted files with translated versions of documents provided by the user. Available if requested for 'passport', 'driver_license', 'identity_card', 'internal_passport', 'utility_bill', 'bank_statement', 'rental_agreement', 'passport_registration' and 'temporary_registration' types. Files can be decrypted and verified using the accompanying :class:`aiogram.types.encrypted_credentials.EncryptedCredentials`.""" diff --git a/aiogram/types/file.py b/aiogram/types/file.py index f914fe00..34ec4a8a 100644 --- a/aiogram/types/file.py +++ b/aiogram/types/file.py @@ -7,11 +7,9 @@ from .base import TelegramObject class File(TelegramObject): """ - This object represents a file ready to be downloaded. The file can be downloaded via the link - https://api.telegram.org/file/bot/. It is guaranteed that the link will be - valid for at least 1 hour. When the link expires, a new one can be requested by calling - getFile. - Maximum file size to download is 20 MB + This object represents a file ready to be downloaded. The file can be downloaded via the link :code:`https://api.telegram.org/file/bot/`. It is guaranteed that the link will be valid for at least 1 hour. When the link expires, a new one can be requested by calling :class:`aiogram.methods.get_file.GetFile`. + + Maximum file size to download is 20 MB Source: https://core.telegram.org/bots/api#file """ @@ -19,9 +17,8 @@ class File(TelegramObject): file_id: str """Identifier for this file, which can be used to download or reuse the file""" file_unique_id: str - """Unique identifier for this file, which is supposed to be the same over time and for - different bots. Can't be used to download or reuse the file.""" + """Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.""" file_size: Optional[int] = None - """File size, if known""" + """*Optional*. File size, if known""" file_path: Optional[str] = None - """File path. Use https://api.telegram.org/file/bot/ to get the file.""" + """*Optional*. File path. Use :code:`https://api.telegram.org/file/bot/` to get the file.""" diff --git a/aiogram/types/force_reply.py b/aiogram/types/force_reply.py index 8cbc1653..9c29d130 100644 --- a/aiogram/types/force_reply.py +++ b/aiogram/types/force_reply.py @@ -7,29 +7,19 @@ from .base import MutableTelegramObject class ForceReply(MutableTelegramObject): """ - Upon receiving a message with this object, Telegram clients will display a reply interface to - the user (act as if the user has selected the bot's message and tapped 'Reply'). This can be - extremely useful if you want to create user-friendly step-by-step interfaces without having to - sacrifice privacy mode. - Example: A poll bot for groups runs in privacy mode (only receives commands, replies to its - messages and mentions). There could be two ways to create a new poll: + Upon receiving a message with this object, Telegram clients will display a reply interface to the user (act as if the user has selected the bot's message and tapped 'Reply'). This can be extremely useful if you want to create user-friendly step-by-step interfaces without having to sacrifice `privacy mode `_. - Explain the user how to send a command with parameters (e.g. /newpoll question answer1 - answer2). May be appealing for hardcore users but lacks modern day polish. - Guide the user through a step-by-step process. 'Please send me your question', 'Cool, now - let's add the first answer option', 'Great. Keep adding answer options, then send /done when - you're ready'. - The last option is definitely more attractive. And if you use ForceReply in your bot's - questions, it will receive the user's answers even if it only receives replies, commands and - mentions — without any extra work for the user. + **Example:** A `poll bot `_ for groups runs in privacy mode (only receives commands, replies to its messages and mentions). There could be two ways to create a new poll: + + - Explain the user how to send a command with parameters (e.g. /newpoll question answer1 answer2). May be appealing for hardcore users but lacks modern day polish. + - Guide the user through a step-by-step process. 'Please send me your question', 'Cool, now let's add the first answer option', 'Great. Keep adding answer options, then send /done when you're ready'. + + The last option is definitely more attractive. And if you use :class:`aiogram.types.force_reply.ForceReply` in your bot's questions, it will receive the user's answers even if it only receives replies, commands and mentions — without any extra work for the user. Source: https://core.telegram.org/bots/api#forcereply """ force_reply: bool - """Shows reply interface to the user, as if they manually selected the bot's message and - tapped 'Reply'""" + """Shows reply interface to the user, as if they manually selected the bot's message and tapped 'Reply'""" selective: Optional[bool] = None - """Use this parameter if you want to force reply from specific users only. Targets: 1) users - that are @mentioned in the text of the Message object; 2) if the bot's message is a reply - (has reply_to_message_id), sender of the original message.""" + """*Optional*. Use this parameter if you want to force reply from specific users only. Targets: 1) users that are @mentioned in the *text* of the :class:`aiogram.types.message.Message` object; 2) if the bot's message is a reply (has *reply_to_message_id*), sender of the original message.""" diff --git a/aiogram/types/game.py b/aiogram/types/game.py index 0d4d8510..e8d41cc0 100644 --- a/aiogram/types/game.py +++ b/aiogram/types/game.py @@ -12,8 +12,7 @@ if TYPE_CHECKING: # pragma: no cover class Game(TelegramObject): """ - This object represents a game. Use BotFather to create and edit games, their short names will - act as unique identifiers. + This object represents a game. Use BotFather to create and edit games, their short names will act as unique identifiers. Source: https://core.telegram.org/bots/api#game """ @@ -25,10 +24,8 @@ class Game(TelegramObject): photo: List[PhotoSize] """Photo that will be displayed in the game message in chats.""" text: Optional[str] = None - """Brief description of the game or high scores included in the game message. Can be - automatically edited to include current high scores for the game when the bot calls - setGameScore, or manually edited using editMessageText. 0-4096 characters.""" + """*Optional*. Brief description of the game or high scores included in the game message. Can be automatically edited to include current high scores for the game when the bot calls :class:`aiogram.methods.set_game_score.SetGameScore`, or manually edited using :class:`aiogram.methods.edit_message_text.EditMessageText`. 0-4096 characters.""" text_entities: Optional[List[MessageEntity]] = None - """Special entities that appear in text, such as usernames, URLs, bot commands, etc.""" + """*Optional*. Special entities that appear in *text*, such as usernames, URLs, bot commands, etc.""" animation: Optional[Animation] = None - """Animation that will be displayed in the game message in chats. Upload via BotFather""" + """*Optional*. Animation that will be displayed in the game message in chats. Upload via `BotFather `_""" diff --git a/aiogram/types/game_high_score.py b/aiogram/types/game_high_score.py index 7bc35de6..848306f8 100644 --- a/aiogram/types/game_high_score.py +++ b/aiogram/types/game_high_score.py @@ -12,7 +12,8 @@ class GameHighScore(TelegramObject): """ This object represents one row of the high scores table for a game. And that's about all we've got for now. - If you've got any questions, please check out our Bot FAQ + + If you've got any questions, please check out our `https://core.telegram.org/bots/faq `_ **Bot FAQ »** Source: https://core.telegram.org/bots/api#gamehighscore """ diff --git a/aiogram/types/inline_keyboard_button.py b/aiogram/types/inline_keyboard_button.py index 33ade442..62ab33e9 100644 --- a/aiogram/types/inline_keyboard_button.py +++ b/aiogram/types/inline_keyboard_button.py @@ -11,8 +11,7 @@ if TYPE_CHECKING: # pragma: no cover class InlineKeyboardButton(MutableTelegramObject): """ - This object represents one button of an inline keyboard. You must use exactly one of the - optional fields. + This object represents one button of an inline keyboard. You **must** use exactly one of the optional fields. Source: https://core.telegram.org/bots/api#inlinekeyboardbutton """ @@ -20,21 +19,16 @@ class InlineKeyboardButton(MutableTelegramObject): text: str """Label text on the button""" url: Optional[str] = None - """HTTP or tg:// url to be opened when button is pressed""" + """*Optional*. HTTP or tg:// url to be opened when button is pressed""" login_url: Optional[LoginUrl] = None - """An HTTP URL used to automatically authorize the user. Can be used as a replacement for the - Telegram Login Widget.""" + """*Optional*. An HTTP URL used to automatically authorize the user. Can be used as a replacement for the `Telegram Login Widget `_.""" callback_data: Optional[str] = None - """Data to be sent in a callback query to the bot when button is pressed, 1-64 bytes""" + """*Optional*. Data to be sent in a `callback query `_ to the bot when button is pressed, 1-64 bytes""" switch_inline_query: Optional[str] = None - """If set, pressing the button will prompt the user to select one of their chats, open that - chat and insert the bot's username and the specified inline query in the input field. Can - be empty, in which case just the bot's username will be inserted.""" + """*Optional*. If set, pressing the button will prompt the user to select one of their chats, open that chat and insert the bot's username and the specified inline query in the input field. Can be empty, in which case just the bot's username will be inserted.""" switch_inline_query_current_chat: Optional[str] = None - """If set, pressing the button will insert the bot's username and the specified inline query - in the current chat's input field. Can be empty, in which case only the bot's username will - be inserted.""" + """*Optional*. If set, pressing the button will insert the bot's username and the specified inline query in the current chat's input field. Can be empty, in which case only the bot's username will be inserted.""" callback_game: Optional[CallbackGame] = None - """Description of the game that will be launched when the user presses the button.""" + """*Optional*. Description of the game that will be launched when the user presses the button.""" pay: Optional[bool] = None - """Specify True, to send a Pay button.""" + """*Optional*. Specify True, to send a `Pay button `_.""" diff --git a/aiogram/types/inline_keyboard_markup.py b/aiogram/types/inline_keyboard_markup.py index 73c43f0d..21fdce6f 100644 --- a/aiogram/types/inline_keyboard_markup.py +++ b/aiogram/types/inline_keyboard_markup.py @@ -10,13 +10,11 @@ if TYPE_CHECKING: # pragma: no cover class InlineKeyboardMarkup(MutableTelegramObject): """ - This object represents an inline keyboard that appears right next to the message it belongs - to. - Note: This will only work in Telegram versions released after 9 April, 2016. Older clients - will display unsupported message. + This object represents an `inline keyboard `_ that appears right next to the message it belongs to. + **Note:** This will only work in Telegram versions released after 9 April, 2016. Older clients will display *unsupported message*. Source: https://core.telegram.org/bots/api#inlinekeyboardmarkup """ inline_keyboard: List[List[InlineKeyboardButton]] - """Array of button rows, each represented by an Array of InlineKeyboardButton objects""" + """Array of button rows, each represented by an Array of :class:`aiogram.types.inline_keyboard_button.InlineKeyboardButton` objects""" diff --git a/aiogram/types/inline_query.py b/aiogram/types/inline_query.py index 29373d39..1389181b 100644 --- a/aiogram/types/inline_query.py +++ b/aiogram/types/inline_query.py @@ -7,16 +7,15 @@ from pydantic import Field from .base import TelegramObject if TYPE_CHECKING: # pragma: no cover + from ..methods import AnswerInlineQuery + from .inline_query_result import InlineQueryResult from .location import Location from .user import User - from .inline_query_result import InlineQueryResult - from ..methods import AnswerInlineQuery class InlineQuery(TelegramObject): """ - This object represents an incoming inline query. When the user sends an empty query, your bot - could return some default or trending results. + This object represents an incoming inline query. When the user sends an empty query, your bot could return some default or trending results. Source: https://core.telegram.org/bots/api#inlinequery """ @@ -30,7 +29,7 @@ class InlineQuery(TelegramObject): offset: str """Offset of the results to be returned, can be controlled by the bot""" location: Optional[Location] = None - """Sender location, only for bots that request user location""" + """*Optional*. Sender location, only for bots that request user location""" def answer( self, diff --git a/aiogram/types/inline_query_result.py b/aiogram/types/inline_query_result.py index 9df3573b..a8a66403 100644 --- a/aiogram/types/inline_query_result.py +++ b/aiogram/types/inline_query_result.py @@ -5,28 +5,28 @@ from .base import MutableTelegramObject class InlineQueryResult(MutableTelegramObject): """ - This object represents one result of an inline query. Telegram clients currently support - results of the following 20 types: - - InlineQueryResultCachedAudio - - InlineQueryResultCachedDocument - - InlineQueryResultCachedGif - - InlineQueryResultCachedMpeg4Gif - - InlineQueryResultCachedPhoto - - InlineQueryResultCachedSticker - - InlineQueryResultCachedVideo - - InlineQueryResultCachedVoice - - InlineQueryResultArticle - - InlineQueryResultAudio - - InlineQueryResultContact - - InlineQueryResultGame - - InlineQueryResultDocument - - InlineQueryResultGif - - InlineQueryResultLocation - - InlineQueryResultMpeg4Gif - - InlineQueryResultPhoto - - InlineQueryResultVenue - - InlineQueryResultVideo - - InlineQueryResultVoice + This object represents one result of an inline query. Telegram clients currently support results of the following 20 types: + + - :class:`aiogram.types.inline_query_result_cached_audio.InlineQueryResultCachedAudio` + - :class:`aiogram.types.inline_query_result_cached_document.InlineQueryResultCachedDocument` + - :class:`aiogram.types.inline_query_result_cached_gif.InlineQueryResultCachedGif` + - :class:`aiogram.types.inline_query_result_cached_mpeg4_gif.InlineQueryResultCachedMpeg4Gif` + - :class:`aiogram.types.inline_query_result_cached_photo.InlineQueryResultCachedPhoto` + - :class:`aiogram.types.inline_query_result_cached_sticker.InlineQueryResultCachedSticker` + - :class:`aiogram.types.inline_query_result_cached_video.InlineQueryResultCachedVideo` + - :class:`aiogram.types.inline_query_result_cached_voice.InlineQueryResultCachedVoice` + - :class:`aiogram.types.inline_query_result_article.InlineQueryResultArticle` + - :class:`aiogram.types.inline_query_result_audio.InlineQueryResultAudio` + - :class:`aiogram.types.inline_query_result_contact.InlineQueryResultContact` + - :class:`aiogram.types.inline_query_result_game.InlineQueryResultGame` + - :class:`aiogram.types.inline_query_result_document.InlineQueryResultDocument` + - :class:`aiogram.types.inline_query_result_gif.InlineQueryResultGif` + - :class:`aiogram.types.inline_query_result_location.InlineQueryResultLocation` + - :class:`aiogram.types.inline_query_result_mpeg4_gif.InlineQueryResultMpeg4Gif` + - :class:`aiogram.types.inline_query_result_photo.InlineQueryResultPhoto` + - :class:`aiogram.types.inline_query_result_venue.InlineQueryResultVenue` + - :class:`aiogram.types.inline_query_result_video.InlineQueryResultVideo` + - :class:`aiogram.types.inline_query_result_voice.InlineQueryResultVoice` Source: https://core.telegram.org/bots/api#inlinequeryresult """ diff --git a/aiogram/types/inline_query_result_article.py b/aiogram/types/inline_query_result_article.py index 0c34bdb5..a4f22bed 100644 --- a/aiogram/types/inline_query_result_article.py +++ b/aiogram/types/inline_query_result_article.py @@ -19,7 +19,7 @@ class InlineQueryResultArticle(InlineQueryResult): """ type: str = Field("article", const=True) - """Type of the result, must be article""" + """Type of the result, must be *article*""" id: str """Unique identifier for this result, 1-64 Bytes""" title: str @@ -27,16 +27,16 @@ class InlineQueryResultArticle(InlineQueryResult): input_message_content: InputMessageContent """Content of the message to be sent""" reply_markup: Optional[InlineKeyboardMarkup] = None - """Inline keyboard attached to the message""" + """*Optional*. `Inline keyboard `_ attached to the message""" url: Optional[str] = None - """URL of the result""" + """*Optional*. URL of the result""" hide_url: Optional[bool] = None - """Pass True, if you don't want the URL to be shown in the message""" + """*Optional*. Pass :code:`True`, if you don't want the URL to be shown in the message""" description: Optional[str] = None - """Short description of the result""" + """*Optional*. Short description of the result""" thumb_url: Optional[str] = None - """Url of the thumbnail for the result""" + """*Optional*. Url of the thumbnail for the result""" thumb_width: Optional[int] = None - """Thumbnail width""" + """*Optional*. Thumbnail width""" thumb_height: Optional[int] = None - """Thumbnail height""" + """*Optional*. Thumbnail height""" diff --git a/aiogram/types/inline_query_result_audio.py b/aiogram/types/inline_query_result_audio.py index f959b7e6..d124f5fa 100644 --- a/aiogram/types/inline_query_result_audio.py +++ b/aiogram/types/inline_query_result_audio.py @@ -15,17 +15,14 @@ if TYPE_CHECKING: # pragma: no cover class InlineQueryResultAudio(InlineQueryResult): """ - Represents a link to an MP3 audio file. By default, this audio file will be sent by the user. - Alternatively, you can use input_message_content to send a message with the specified content - instead of the audio. - Note: This will only work in Telegram versions released after 9 April, 2016. Older clients - will ignore them. + Represents a link to an MP3 audio file. By default, this audio file will be sent by the user. Alternatively, you can use *input_message_content* to send a message with the specified content instead of the audio. + **Note:** This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them. Source: https://core.telegram.org/bots/api#inlinequeryresultaudio """ type: str = Field("audio", const=True) - """Type of the result, must be audio""" + """Type of the result, must be *audio*""" id: str """Unique identifier for this result, 1-64 bytes""" audio_url: str @@ -33,17 +30,16 @@ class InlineQueryResultAudio(InlineQueryResult): title: str """Title""" caption: Optional[str] = None - """Caption, 0-1024 characters after entities parsing""" + """*Optional*. Caption, 0-1024 characters after entities parsing""" parse_mode: Optional[str] = UNSET - """Mode for parsing entities in the audio caption. See formatting options for more details.""" + """*Optional*. Mode for parsing entities in the audio caption. See `formatting options `_ for more details.""" caption_entities: Optional[List[MessageEntity]] = None - """List of special entities that appear in the caption, which can be specified instead of - parse_mode""" + """*Optional*. List of special entities that appear in the caption, which can be specified instead of *parse_mode*""" performer: Optional[str] = None - """Performer""" + """*Optional*. Performer""" audio_duration: Optional[int] = None - """Audio duration in seconds""" + """*Optional*. Audio duration in seconds""" reply_markup: Optional[InlineKeyboardMarkup] = None - """Inline keyboard attached to the message""" + """*Optional*. `Inline keyboard `_ attached to the message""" input_message_content: Optional[InputMessageContent] = None - """Content of the message to be sent instead of the audio""" + """*Optional*. Content of the message to be sent instead of the audio""" diff --git a/aiogram/types/inline_query_result_cached_audio.py b/aiogram/types/inline_query_result_cached_audio.py index ff666f26..81817051 100644 --- a/aiogram/types/inline_query_result_cached_audio.py +++ b/aiogram/types/inline_query_result_cached_audio.py @@ -15,29 +15,25 @@ if TYPE_CHECKING: # pragma: no cover class InlineQueryResultCachedAudio(InlineQueryResult): """ - Represents a link to an MP3 audio file stored on the Telegram servers. By default, this audio - file will be sent by the user. Alternatively, you can use input_message_content to send a - message with the specified content instead of the audio. - Note: This will only work in Telegram versions released after 9 April, 2016. Older clients - will ignore them. + Represents a link to an MP3 audio file stored on the Telegram servers. By default, this audio file will be sent by the user. Alternatively, you can use *input_message_content* to send a message with the specified content instead of the audio. + **Note:** This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them. Source: https://core.telegram.org/bots/api#inlinequeryresultcachedaudio """ type: str = Field("audio", const=True) - """Type of the result, must be audio""" + """Type of the result, must be *audio*""" id: str """Unique identifier for this result, 1-64 bytes""" audio_file_id: str """A valid file identifier for the audio file""" caption: Optional[str] = None - """Caption, 0-1024 characters after entities parsing""" + """*Optional*. Caption, 0-1024 characters after entities parsing""" parse_mode: Optional[str] = UNSET - """Mode for parsing entities in the audio caption. See formatting options for more details.""" + """*Optional*. Mode for parsing entities in the audio caption. See `formatting options `_ for more details.""" caption_entities: Optional[List[MessageEntity]] = None - """List of special entities that appear in the caption, which can be specified instead of - parse_mode""" + """*Optional*. List of special entities that appear in the caption, which can be specified instead of *parse_mode*""" reply_markup: Optional[InlineKeyboardMarkup] = None - """Inline keyboard attached to the message""" + """*Optional*. `Inline keyboard `_ attached to the message""" input_message_content: Optional[InputMessageContent] = None - """Content of the message to be sent instead of the audio""" + """*Optional*. Content of the message to be sent instead of the audio""" diff --git a/aiogram/types/inline_query_result_cached_document.py b/aiogram/types/inline_query_result_cached_document.py index 145527f3..ef0cfe7e 100644 --- a/aiogram/types/inline_query_result_cached_document.py +++ b/aiogram/types/inline_query_result_cached_document.py @@ -15,17 +15,14 @@ if TYPE_CHECKING: # pragma: no cover class InlineQueryResultCachedDocument(InlineQueryResult): """ - Represents a link to a file stored on the Telegram servers. By default, this file will be sent - by the user with an optional caption. Alternatively, you can use input_message_content to send - a message with the specified content instead of the file. - Note: This will only work in Telegram versions released after 9 April, 2016. Older clients - will ignore them. + Represents a link to a file stored on the Telegram servers. By default, this file will be sent by the user with an optional caption. Alternatively, you can use *input_message_content* to send a message with the specified content instead of the file. + **Note:** This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them. Source: https://core.telegram.org/bots/api#inlinequeryresultcacheddocument """ type: str = Field("document", const=True) - """Type of the result, must be document""" + """Type of the result, must be *document*""" id: str """Unique identifier for this result, 1-64 bytes""" title: str @@ -33,15 +30,14 @@ class InlineQueryResultCachedDocument(InlineQueryResult): document_file_id: str """A valid file identifier for the file""" description: Optional[str] = None - """Short description of the result""" + """*Optional*. Short description of the result""" caption: Optional[str] = None - """Caption of the document to be sent, 0-1024 characters after entities parsing""" + """*Optional*. Caption of the document to be sent, 0-1024 characters after entities parsing""" parse_mode: Optional[str] = UNSET - """Mode for parsing entities in the document caption. See formatting options for more details.""" + """*Optional*. Mode for parsing entities in the document caption. See `formatting options `_ for more details.""" caption_entities: Optional[List[MessageEntity]] = None - """List of special entities that appear in the caption, which can be specified instead of - parse_mode""" + """*Optional*. List of special entities that appear in the caption, which can be specified instead of *parse_mode*""" reply_markup: Optional[InlineKeyboardMarkup] = None - """Inline keyboard attached to the message""" + """*Optional*. `Inline keyboard `_ attached to the message""" input_message_content: Optional[InputMessageContent] = None - """Content of the message to be sent instead of the file""" + """*Optional*. Content of the message to be sent instead of the file""" diff --git a/aiogram/types/inline_query_result_cached_gif.py b/aiogram/types/inline_query_result_cached_gif.py index 80c5c916..393f3c87 100644 --- a/aiogram/types/inline_query_result_cached_gif.py +++ b/aiogram/types/inline_query_result_cached_gif.py @@ -15,29 +15,26 @@ if TYPE_CHECKING: # pragma: no cover class InlineQueryResultCachedGif(InlineQueryResult): """ - Represents a link to an animated GIF file stored on the Telegram servers. By default, this - animated GIF file will be sent by the user with an optional caption. Alternatively, you can - use input_message_content to send a message with specified content instead of the animation. + Represents a link to an animated GIF file stored on the Telegram servers. By default, this animated GIF file will be sent by the user with an optional caption. Alternatively, you can use *input_message_content* to send a message with specified content instead of the animation. Source: https://core.telegram.org/bots/api#inlinequeryresultcachedgif """ type: str = Field("gif", const=True) - """Type of the result, must be gif""" + """Type of the result, must be *gif*""" id: str """Unique identifier for this result, 1-64 bytes""" gif_file_id: str """A valid file identifier for the GIF file""" title: Optional[str] = None - """Title for the result""" + """*Optional*. Title for the result""" caption: Optional[str] = None - """Caption of the GIF file to be sent, 0-1024 characters after entities parsing""" + """*Optional*. Caption of the GIF file to be sent, 0-1024 characters after entities parsing""" parse_mode: Optional[str] = UNSET - """Mode for parsing entities in the caption. See formatting options for more details.""" + """*Optional*. Mode for parsing entities in the caption. See `formatting options `_ for more details.""" caption_entities: Optional[List[MessageEntity]] = None - """List of special entities that appear in the caption, which can be specified instead of - parse_mode""" + """*Optional*. List of special entities that appear in the caption, which can be specified instead of *parse_mode*""" reply_markup: Optional[InlineKeyboardMarkup] = None - """Inline keyboard attached to the message""" + """*Optional*. `Inline keyboard `_ attached to the message""" input_message_content: Optional[InputMessageContent] = None - """Content of the message to be sent instead of the GIF animation""" + """*Optional*. Content of the message to be sent instead of the GIF animation""" diff --git a/aiogram/types/inline_query_result_cached_mpeg4_gif.py b/aiogram/types/inline_query_result_cached_mpeg4_gif.py index d459cd8e..10e779b0 100644 --- a/aiogram/types/inline_query_result_cached_mpeg4_gif.py +++ b/aiogram/types/inline_query_result_cached_mpeg4_gif.py @@ -15,30 +15,26 @@ if TYPE_CHECKING: # pragma: no cover class InlineQueryResultCachedMpeg4Gif(InlineQueryResult): """ - Represents a link to a video animation (H.264/MPEG-4 AVC video without sound) stored on the - Telegram servers. By default, this animated MPEG-4 file will be sent by the user with an - optional caption. Alternatively, you can use input_message_content to send a message with the - specified content instead of the animation. + Represents a link to a video animation (H.264/MPEG-4 AVC video without sound) stored on the Telegram servers. By default, this animated MPEG-4 file will be sent by the user with an optional caption. Alternatively, you can use *input_message_content* to send a message with the specified content instead of the animation. Source: https://core.telegram.org/bots/api#inlinequeryresultcachedmpeg4gif """ type: str = Field("mpeg4_gif", const=True) - """Type of the result, must be mpeg4_gif""" + """Type of the result, must be *mpeg4_gif*""" id: str """Unique identifier for this result, 1-64 bytes""" mpeg4_file_id: str """A valid file identifier for the MP4 file""" title: Optional[str] = None - """Title for the result""" + """*Optional*. Title for the result""" caption: Optional[str] = None - """Caption of the MPEG-4 file to be sent, 0-1024 characters after entities parsing""" + """*Optional*. Caption of the MPEG-4 file to be sent, 0-1024 characters after entities parsing""" parse_mode: Optional[str] = UNSET - """Mode for parsing entities in the caption. See formatting options for more details.""" + """*Optional*. Mode for parsing entities in the caption. See `formatting options `_ for more details.""" caption_entities: Optional[List[MessageEntity]] = None - """List of special entities that appear in the caption, which can be specified instead of - parse_mode""" + """*Optional*. List of special entities that appear in the caption, which can be specified instead of *parse_mode*""" reply_markup: Optional[InlineKeyboardMarkup] = None - """Inline keyboard attached to the message""" + """*Optional*. `Inline keyboard `_ attached to the message""" input_message_content: Optional[InputMessageContent] = None - """Content of the message to be sent instead of the video animation""" + """*Optional*. Content of the message to be sent instead of the video animation""" diff --git a/aiogram/types/inline_query_result_cached_photo.py b/aiogram/types/inline_query_result_cached_photo.py index 779415a3..ca9d8356 100644 --- a/aiogram/types/inline_query_result_cached_photo.py +++ b/aiogram/types/inline_query_result_cached_photo.py @@ -15,31 +15,28 @@ if TYPE_CHECKING: # pragma: no cover class InlineQueryResultCachedPhoto(InlineQueryResult): """ - Represents a link to a photo stored on the Telegram servers. By default, this photo will be - sent by the user with an optional caption. Alternatively, you can use input_message_content to - send a message with the specified content instead of the photo. + Represents a link to a photo stored on the Telegram servers. By default, this photo will be sent by the user with an optional caption. Alternatively, you can use *input_message_content* to send a message with the specified content instead of the photo. Source: https://core.telegram.org/bots/api#inlinequeryresultcachedphoto """ type: str = Field("photo", const=True) - """Type of the result, must be photo""" + """Type of the result, must be *photo*""" id: str """Unique identifier for this result, 1-64 bytes""" photo_file_id: str """A valid file identifier of the photo""" title: Optional[str] = None - """Title for the result""" + """*Optional*. Title for the result""" description: Optional[str] = None - """Short description of the result""" + """*Optional*. Short description of the result""" caption: Optional[str] = None - """Caption of the photo to be sent, 0-1024 characters after entities parsing""" + """*Optional*. Caption of the photo to be sent, 0-1024 characters after entities parsing""" parse_mode: Optional[str] = UNSET - """Mode for parsing entities in the photo caption. See formatting options for more details.""" + """*Optional*. Mode for parsing entities in the photo caption. See `formatting options `_ for more details.""" caption_entities: Optional[List[MessageEntity]] = None - """List of special entities that appear in the caption, which can be specified instead of - parse_mode""" + """*Optional*. List of special entities that appear in the caption, which can be specified instead of *parse_mode*""" reply_markup: Optional[InlineKeyboardMarkup] = None - """Inline keyboard attached to the message""" + """*Optional*. `Inline keyboard `_ attached to the message""" input_message_content: Optional[InputMessageContent] = None - """Content of the message to be sent instead of the photo""" + """*Optional*. Content of the message to be sent instead of the photo""" diff --git a/aiogram/types/inline_query_result_cached_sticker.py b/aiogram/types/inline_query_result_cached_sticker.py index 52c21c6d..2d6911df 100644 --- a/aiogram/types/inline_query_result_cached_sticker.py +++ b/aiogram/types/inline_query_result_cached_sticker.py @@ -13,22 +13,19 @@ if TYPE_CHECKING: # pragma: no cover class InlineQueryResultCachedSticker(InlineQueryResult): """ - Represents a link to a sticker stored on the Telegram servers. By default, this sticker will - be sent by the user. Alternatively, you can use input_message_content to send a message with - the specified content instead of the sticker. - Note: This will only work in Telegram versions released after 9 April, 2016 for static - stickers and after 06 July, 2019 for animated stickers. Older clients will ignore them. + Represents a link to a sticker stored on the Telegram servers. By default, this sticker will be sent by the user. Alternatively, you can use *input_message_content* to send a message with the specified content instead of the sticker. + **Note:** This will only work in Telegram versions released after 9 April, 2016 for static stickers and after 06 July, 2019 for `animated stickers `_. Older clients will ignore them. Source: https://core.telegram.org/bots/api#inlinequeryresultcachedsticker """ type: str = Field("sticker", const=True) - """Type of the result, must be sticker""" + """Type of the result, must be *sticker*""" id: str """Unique identifier for this result, 1-64 bytes""" sticker_file_id: str """A valid file identifier of the sticker""" reply_markup: Optional[InlineKeyboardMarkup] = None - """Inline keyboard attached to the message""" + """*Optional*. `Inline keyboard `_ attached to the message""" input_message_content: Optional[InputMessageContent] = None - """Content of the message to be sent instead of the sticker""" + """*Optional*. Content of the message to be sent instead of the sticker""" diff --git a/aiogram/types/inline_query_result_cached_video.py b/aiogram/types/inline_query_result_cached_video.py index c75a288f..1e23b7ae 100644 --- a/aiogram/types/inline_query_result_cached_video.py +++ b/aiogram/types/inline_query_result_cached_video.py @@ -15,15 +15,13 @@ if TYPE_CHECKING: # pragma: no cover class InlineQueryResultCachedVideo(InlineQueryResult): """ - Represents a link to a video file stored on the Telegram servers. By default, this video file - will be sent by the user with an optional caption. Alternatively, you can use - input_message_content to send a message with the specified content instead of the video. + Represents a link to a video file stored on the Telegram servers. By default, this video file will be sent by the user with an optional caption. Alternatively, you can use *input_message_content* to send a message with the specified content instead of the video. Source: https://core.telegram.org/bots/api#inlinequeryresultcachedvideo """ type: str = Field("video", const=True) - """Type of the result, must be video""" + """Type of the result, must be *video*""" id: str """Unique identifier for this result, 1-64 bytes""" video_file_id: str @@ -31,15 +29,14 @@ class InlineQueryResultCachedVideo(InlineQueryResult): title: str """Title for the result""" description: Optional[str] = None - """Short description of the result""" + """*Optional*. Short description of the result""" caption: Optional[str] = None - """Caption of the video to be sent, 0-1024 characters after entities parsing""" + """*Optional*. Caption of the video to be sent, 0-1024 characters after entities parsing""" parse_mode: Optional[str] = UNSET - """Mode for parsing entities in the video caption. See formatting options for more details.""" + """*Optional*. Mode for parsing entities in the video caption. See `formatting options `_ for more details.""" caption_entities: Optional[List[MessageEntity]] = None - """List of special entities that appear in the caption, which can be specified instead of - parse_mode""" + """*Optional*. List of special entities that appear in the caption, which can be specified instead of *parse_mode*""" reply_markup: Optional[InlineKeyboardMarkup] = None - """Inline keyboard attached to the message""" + """*Optional*. `Inline keyboard `_ attached to the message""" input_message_content: Optional[InputMessageContent] = None - """Content of the message to be sent instead of the video""" + """*Optional*. Content of the message to be sent instead of the video""" diff --git a/aiogram/types/inline_query_result_cached_voice.py b/aiogram/types/inline_query_result_cached_voice.py index 98c7825c..43c55551 100644 --- a/aiogram/types/inline_query_result_cached_voice.py +++ b/aiogram/types/inline_query_result_cached_voice.py @@ -15,17 +15,14 @@ if TYPE_CHECKING: # pragma: no cover class InlineQueryResultCachedVoice(InlineQueryResult): """ - Represents a link to a voice message stored on the Telegram servers. By default, this voice - message will be sent by the user. Alternatively, you can use input_message_content to send a - message with the specified content instead of the voice message. - Note: This will only work in Telegram versions released after 9 April, 2016. Older clients - will ignore them. + Represents a link to a voice message stored on the Telegram servers. By default, this voice message will be sent by the user. Alternatively, you can use *input_message_content* to send a message with the specified content instead of the voice message. + **Note:** This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them. Source: https://core.telegram.org/bots/api#inlinequeryresultcachedvoice """ type: str = Field("voice", const=True) - """Type of the result, must be voice""" + """Type of the result, must be *voice*""" id: str """Unique identifier for this result, 1-64 bytes""" voice_file_id: str @@ -33,14 +30,12 @@ class InlineQueryResultCachedVoice(InlineQueryResult): title: str """Voice message title""" caption: Optional[str] = None - """Caption, 0-1024 characters after entities parsing""" + """*Optional*. Caption, 0-1024 characters after entities parsing""" parse_mode: Optional[str] = UNSET - """Mode for parsing entities in the voice message caption. See formatting options for more - details.""" + """*Optional*. Mode for parsing entities in the voice message caption. See `formatting options `_ for more details.""" caption_entities: Optional[List[MessageEntity]] = None - """List of special entities that appear in the caption, which can be specified instead of - parse_mode""" + """*Optional*. List of special entities that appear in the caption, which can be specified instead of *parse_mode*""" reply_markup: Optional[InlineKeyboardMarkup] = None - """Inline keyboard attached to the message""" + """*Optional*. `Inline keyboard `_ attached to the message""" input_message_content: Optional[InputMessageContent] = None - """Content of the message to be sent instead of the voice message""" + """*Optional*. Content of the message to be sent instead of the voice message""" diff --git a/aiogram/types/inline_query_result_contact.py b/aiogram/types/inline_query_result_contact.py index e394fd2f..c54c0d2e 100644 --- a/aiogram/types/inline_query_result_contact.py +++ b/aiogram/types/inline_query_result_contact.py @@ -13,17 +13,14 @@ if TYPE_CHECKING: # pragma: no cover class InlineQueryResultContact(InlineQueryResult): """ - Represents a contact with a phone number. By default, this contact will be sent by the user. - Alternatively, you can use input_message_content to send a message with the specified content - instead of the contact. - Note: This will only work in Telegram versions released after 9 April, 2016. Older clients - will ignore them. + Represents a contact with a phone number. By default, this contact will be sent by the user. Alternatively, you can use *input_message_content* to send a message with the specified content instead of the contact. + **Note:** This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them. Source: https://core.telegram.org/bots/api#inlinequeryresultcontact """ type: str = Field("contact", const=True) - """Type of the result, must be contact""" + """Type of the result, must be *contact*""" id: str """Unique identifier for this result, 1-64 Bytes""" phone_number: str @@ -31,16 +28,16 @@ class InlineQueryResultContact(InlineQueryResult): first_name: str """Contact's first name""" last_name: Optional[str] = None - """Contact's last name""" + """*Optional*. Contact's last name""" vcard: Optional[str] = None - """Additional data about the contact in the form of a vCard, 0-2048 bytes""" + """*Optional*. Additional data about the contact in the form of a `vCard `_, 0-2048 bytes""" reply_markup: Optional[InlineKeyboardMarkup] = None - """Inline keyboard attached to the message""" + """*Optional*. `Inline keyboard `_ attached to the message""" input_message_content: Optional[InputMessageContent] = None - """Content of the message to be sent instead of the contact""" + """*Optional*. Content of the message to be sent instead of the contact""" thumb_url: Optional[str] = None - """Url of the thumbnail for the result""" + """*Optional*. Url of the thumbnail for the result""" thumb_width: Optional[int] = None - """Thumbnail width""" + """*Optional*. Thumbnail width""" thumb_height: Optional[int] = None - """Thumbnail height""" + """*Optional*. Thumbnail height""" diff --git a/aiogram/types/inline_query_result_document.py b/aiogram/types/inline_query_result_document.py index 1a9e964d..d817eb01 100644 --- a/aiogram/types/inline_query_result_document.py +++ b/aiogram/types/inline_query_result_document.py @@ -15,18 +15,14 @@ if TYPE_CHECKING: # pragma: no cover class InlineQueryResultDocument(InlineQueryResult): """ - Represents a link to a file. By default, this file will be sent by the user with an optional - caption. Alternatively, you can use input_message_content to send a message with the specified - content instead of the file. Currently, only .PDF and .ZIP files can be sent using this - method. - Note: This will only work in Telegram versions released after 9 April, 2016. Older clients - will ignore them. + Represents a link to a file. By default, this file will be sent by the user with an optional caption. Alternatively, you can use *input_message_content* to send a message with the specified content instead of the file. Currently, only **.PDF** and **.ZIP** files can be sent using this method. + **Note:** This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them. Source: https://core.telegram.org/bots/api#inlinequeryresultdocument """ type: str = Field("document", const=True) - """Type of the result, must be document""" + """Type of the result, must be *document*""" id: str """Unique identifier for this result, 1-64 bytes""" title: str @@ -36,21 +32,20 @@ class InlineQueryResultDocument(InlineQueryResult): mime_type: str """Mime type of the content of the file, either 'application/pdf' or 'application/zip'""" caption: Optional[str] = None - """Caption of the document to be sent, 0-1024 characters after entities parsing""" + """*Optional*. Caption of the document to be sent, 0-1024 characters after entities parsing""" parse_mode: Optional[str] = UNSET - """Mode for parsing entities in the document caption. See formatting options for more details.""" + """*Optional*. Mode for parsing entities in the document caption. See `formatting options `_ for more details.""" caption_entities: Optional[List[MessageEntity]] = None - """List of special entities that appear in the caption, which can be specified instead of - parse_mode""" + """*Optional*. List of special entities that appear in the caption, which can be specified instead of *parse_mode*""" description: Optional[str] = None - """Short description of the result""" + """*Optional*. Short description of the result""" reply_markup: Optional[InlineKeyboardMarkup] = None - """Inline keyboard attached to the message""" + """*Optional*. Inline keyboard attached to the message""" input_message_content: Optional[InputMessageContent] = None - """Content of the message to be sent instead of the file""" + """*Optional*. Content of the message to be sent instead of the file""" thumb_url: Optional[str] = None - """URL of the thumbnail (jpeg only) for the file""" + """*Optional*. URL of the thumbnail (jpeg only) for the file""" thumb_width: Optional[int] = None - """Thumbnail width""" + """*Optional*. Thumbnail width""" thumb_height: Optional[int] = None - """Thumbnail height""" + """*Optional*. Thumbnail height""" diff --git a/aiogram/types/inline_query_result_game.py b/aiogram/types/inline_query_result_game.py index 5ddc7222..8ed9862d 100644 --- a/aiogram/types/inline_query_result_game.py +++ b/aiogram/types/inline_query_result_game.py @@ -12,18 +12,17 @@ if TYPE_CHECKING: # pragma: no cover class InlineQueryResultGame(InlineQueryResult): """ - Represents a Game. - Note: This will only work in Telegram versions released after October 1, 2016. Older clients - will not display any inline results if a game result is among them. + Represents a `Game `_. + **Note:** This will only work in Telegram versions released after October 1, 2016. Older clients will not display any inline results if a game result is among them. Source: https://core.telegram.org/bots/api#inlinequeryresultgame """ type: str = Field("game", const=True) - """Type of the result, must be game""" + """Type of the result, must be *game*""" id: str """Unique identifier for this result, 1-64 bytes""" game_short_name: str """Short name of the game""" reply_markup: Optional[InlineKeyboardMarkup] = None - """Inline keyboard attached to the message""" + """*Optional*. `Inline keyboard `_ attached to the message""" diff --git a/aiogram/types/inline_query_result_gif.py b/aiogram/types/inline_query_result_gif.py index e449b00f..2688cd30 100644 --- a/aiogram/types/inline_query_result_gif.py +++ b/aiogram/types/inline_query_result_gif.py @@ -15,15 +15,13 @@ if TYPE_CHECKING: # pragma: no cover class InlineQueryResultGif(InlineQueryResult): """ - Represents a link to an animated GIF file. By default, this animated GIF file will be sent by - the user with optional caption. Alternatively, you can use input_message_content to send a - message with the specified content instead of the animation. + Represents a link to an animated GIF file. By default, this animated GIF file will be sent by the user with optional caption. Alternatively, you can use *input_message_content* to send a message with the specified content instead of the animation. Source: https://core.telegram.org/bots/api#inlinequeryresultgif """ type: str = Field("gif", const=True) - """Type of the result, must be gif""" + """Type of the result, must be *gif*""" id: str """Unique identifier for this result, 1-64 bytes""" gif_url: str @@ -31,24 +29,22 @@ class InlineQueryResultGif(InlineQueryResult): thumb_url: str """URL of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the result""" gif_width: Optional[int] = None - """Width of the GIF""" + """*Optional*. Width of the GIF""" gif_height: Optional[int] = None - """Height of the GIF""" + """*Optional*. Height of the GIF""" gif_duration: Optional[int] = None - """Duration of the GIF""" + """*Optional*. Duration of the GIF""" thumb_mime_type: Optional[str] = None - """MIME type of the thumbnail, must be one of 'image/jpeg', 'image/gif', or 'video/mp4'. - Defaults to 'image/jpeg'""" + """*Optional*. MIME type of the thumbnail, must be one of 'image/jpeg', 'image/gif', or 'video/mp4'. Defaults to 'image/jpeg'""" title: Optional[str] = None - """Title for the result""" + """*Optional*. Title for the result""" caption: Optional[str] = None - """Caption of the GIF file to be sent, 0-1024 characters after entities parsing""" + """*Optional*. Caption of the GIF file to be sent, 0-1024 characters after entities parsing""" parse_mode: Optional[str] = UNSET - """Mode for parsing entities in the caption. See formatting options for more details.""" + """*Optional*. Mode for parsing entities in the caption. See `formatting options `_ for more details.""" caption_entities: Optional[List[MessageEntity]] = None - """List of special entities that appear in the caption, which can be specified instead of - parse_mode""" + """*Optional*. List of special entities that appear in the caption, which can be specified instead of *parse_mode*""" reply_markup: Optional[InlineKeyboardMarkup] = None - """Inline keyboard attached to the message""" + """*Optional*. `Inline keyboard `_ attached to the message""" input_message_content: Optional[InputMessageContent] = None - """Content of the message to be sent instead of the GIF animation""" + """*Optional*. Content of the message to be sent instead of the GIF animation""" diff --git a/aiogram/types/inline_query_result_location.py b/aiogram/types/inline_query_result_location.py index 404ecb6b..01d501a2 100644 --- a/aiogram/types/inline_query_result_location.py +++ b/aiogram/types/inline_query_result_location.py @@ -13,17 +13,14 @@ if TYPE_CHECKING: # pragma: no cover class InlineQueryResultLocation(InlineQueryResult): """ - Represents a location on a map. By default, the location will be sent by the user. - Alternatively, you can use input_message_content to send a message with the specified content - instead of the location. - Note: This will only work in Telegram versions released after 9 April, 2016. Older clients - will ignore them. + Represents a location on a map. By default, the location will be sent by the user. Alternatively, you can use *input_message_content* to send a message with the specified content instead of the location. + **Note:** This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them. Source: https://core.telegram.org/bots/api#inlinequeryresultlocation """ type: str = Field("location", const=True) - """Type of the result, must be location""" + """Type of the result, must be *location*""" id: str """Unique identifier for this result, 1-64 Bytes""" latitude: float @@ -33,22 +30,20 @@ class InlineQueryResultLocation(InlineQueryResult): title: str """Location title""" horizontal_accuracy: Optional[float] = None - """The radius of uncertainty for the location, measured in meters; 0-1500""" + """*Optional*. The radius of uncertainty for the location, measured in meters; 0-1500""" live_period: Optional[int] = None - """Period in seconds for which the location can be updated, should be between 60 and 86400.""" + """*Optional*. Period in seconds for which the location can be updated, should be between 60 and 86400.""" heading: Optional[int] = None - """For live locations, a direction in which the user is moving, in degrees. Must be between 1 - and 360 if specified.""" + """*Optional*. For live locations, a direction in which the user is moving, in degrees. Must be between 1 and 360 if specified.""" proximity_alert_radius: Optional[int] = None - """For live locations, a maximum distance for proximity alerts about approaching another chat - member, in meters. Must be between 1 and 100000 if specified.""" + """*Optional*. For live locations, a maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified.""" reply_markup: Optional[InlineKeyboardMarkup] = None - """Inline keyboard attached to the message""" + """*Optional*. `Inline keyboard `_ attached to the message""" input_message_content: Optional[InputMessageContent] = None - """Content of the message to be sent instead of the location""" + """*Optional*. Content of the message to be sent instead of the location""" thumb_url: Optional[str] = None - """Url of the thumbnail for the result""" + """*Optional*. Url of the thumbnail for the result""" thumb_width: Optional[int] = None - """Thumbnail width""" + """*Optional*. Thumbnail width""" thumb_height: Optional[int] = None - """Thumbnail height""" + """*Optional*. Thumbnail height""" diff --git a/aiogram/types/inline_query_result_mpeg4_gif.py b/aiogram/types/inline_query_result_mpeg4_gif.py index d50d413e..ea6d4ab2 100644 --- a/aiogram/types/inline_query_result_mpeg4_gif.py +++ b/aiogram/types/inline_query_result_mpeg4_gif.py @@ -15,16 +15,13 @@ if TYPE_CHECKING: # pragma: no cover class InlineQueryResultMpeg4Gif(InlineQueryResult): """ - Represents a link to a video animation (H.264/MPEG-4 AVC video without sound). By default, - this animated MPEG-4 file will be sent by the user with optional caption. Alternatively, you - can use input_message_content to send a message with the specified content instead of the - animation. + Represents a link to a video animation (H.264/MPEG-4 AVC video without sound). By default, this animated MPEG-4 file will be sent by the user with optional caption. Alternatively, you can use *input_message_content* to send a message with the specified content instead of the animation. Source: https://core.telegram.org/bots/api#inlinequeryresultmpeg4gif """ type: str = Field("mpeg4_gif", const=True) - """Type of the result, must be mpeg4_gif""" + """Type of the result, must be *mpeg4_gif*""" id: str """Unique identifier for this result, 1-64 bytes""" mpeg4_url: str @@ -32,24 +29,22 @@ class InlineQueryResultMpeg4Gif(InlineQueryResult): thumb_url: str """URL of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the result""" mpeg4_width: Optional[int] = None - """Video width""" + """*Optional*. Video width""" mpeg4_height: Optional[int] = None - """Video height""" + """*Optional*. Video height""" mpeg4_duration: Optional[int] = None - """Video duration""" + """*Optional*. Video duration""" thumb_mime_type: Optional[str] = None - """MIME type of the thumbnail, must be one of 'image/jpeg', 'image/gif', or 'video/mp4'. - Defaults to 'image/jpeg'""" + """*Optional*. MIME type of the thumbnail, must be one of 'image/jpeg', 'image/gif', or 'video/mp4'. Defaults to 'image/jpeg'""" title: Optional[str] = None - """Title for the result""" + """*Optional*. Title for the result""" caption: Optional[str] = None - """Caption of the MPEG-4 file to be sent, 0-1024 characters after entities parsing""" + """*Optional*. Caption of the MPEG-4 file to be sent, 0-1024 characters after entities parsing""" parse_mode: Optional[str] = UNSET - """Mode for parsing entities in the caption. See formatting options for more details.""" + """*Optional*. Mode for parsing entities in the caption. See `formatting options `_ for more details.""" caption_entities: Optional[List[MessageEntity]] = None - """List of special entities that appear in the caption, which can be specified instead of - parse_mode""" + """*Optional*. List of special entities that appear in the caption, which can be specified instead of *parse_mode*""" reply_markup: Optional[InlineKeyboardMarkup] = None - """Inline keyboard attached to the message""" + """*Optional*. `Inline keyboard `_ attached to the message""" input_message_content: Optional[InputMessageContent] = None - """Content of the message to be sent instead of the video animation""" + """*Optional*. Content of the message to be sent instead of the video animation""" diff --git a/aiogram/types/inline_query_result_photo.py b/aiogram/types/inline_query_result_photo.py index aadbded6..9e2935b1 100644 --- a/aiogram/types/inline_query_result_photo.py +++ b/aiogram/types/inline_query_result_photo.py @@ -15,37 +15,34 @@ if TYPE_CHECKING: # pragma: no cover class InlineQueryResultPhoto(InlineQueryResult): """ - Represents a link to a photo. By default, this photo will be sent by the user with optional - caption. Alternatively, you can use input_message_content to send a message with the specified - content instead of the photo. + Represents a link to a photo. By default, this photo will be sent by the user with optional caption. Alternatively, you can use *input_message_content* to send a message with the specified content instead of the photo. Source: https://core.telegram.org/bots/api#inlinequeryresultphoto """ type: str = Field("photo", const=True) - """Type of the result, must be photo""" + """Type of the result, must be *photo*""" id: str """Unique identifier for this result, 1-64 bytes""" photo_url: str - """A valid URL of the photo. Photo must be in jpeg format. Photo size must not exceed 5MB""" + """A valid URL of the photo. Photo must be in **jpeg** format. Photo size must not exceed 5MB""" thumb_url: str """URL of the thumbnail for the photo""" photo_width: Optional[int] = None - """Width of the photo""" + """*Optional*. Width of the photo""" photo_height: Optional[int] = None - """Height of the photo""" + """*Optional*. Height of the photo""" title: Optional[str] = None - """Title for the result""" + """*Optional*. Title for the result""" description: Optional[str] = None - """Short description of the result""" + """*Optional*. Short description of the result""" caption: Optional[str] = None - """Caption of the photo to be sent, 0-1024 characters after entities parsing""" + """*Optional*. Caption of the photo to be sent, 0-1024 characters after entities parsing""" parse_mode: Optional[str] = UNSET - """Mode for parsing entities in the photo caption. See formatting options for more details.""" + """*Optional*. Mode for parsing entities in the photo caption. See `formatting options `_ for more details.""" caption_entities: Optional[List[MessageEntity]] = None - """List of special entities that appear in the caption, which can be specified instead of - parse_mode""" + """*Optional*. List of special entities that appear in the caption, which can be specified instead of *parse_mode*""" reply_markup: Optional[InlineKeyboardMarkup] = None - """Inline keyboard attached to the message""" + """*Optional*. `Inline keyboard `_ attached to the message""" input_message_content: Optional[InputMessageContent] = None - """Content of the message to be sent instead of the photo""" + """*Optional*. Content of the message to be sent instead of the photo""" diff --git a/aiogram/types/inline_query_result_venue.py b/aiogram/types/inline_query_result_venue.py index 05aa9919..f5c5c3ca 100644 --- a/aiogram/types/inline_query_result_venue.py +++ b/aiogram/types/inline_query_result_venue.py @@ -13,16 +13,14 @@ if TYPE_CHECKING: # pragma: no cover class InlineQueryResultVenue(InlineQueryResult): """ - Represents a venue. By default, the venue will be sent by the user. Alternatively, you can use - input_message_content to send a message with the specified content instead of the venue. - Note: This will only work in Telegram versions released after 9 April, 2016. Older clients - will ignore them. + Represents a venue. By default, the venue will be sent by the user. Alternatively, you can use *input_message_content* to send a message with the specified content instead of the venue. + **Note:** This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them. Source: https://core.telegram.org/bots/api#inlinequeryresultvenue """ type: str = Field("venue", const=True) - """Type of the result, must be venue""" + """Type of the result, must be *venue*""" id: str """Unique identifier for this result, 1-64 Bytes""" latitude: float @@ -34,21 +32,20 @@ class InlineQueryResultVenue(InlineQueryResult): address: str """Address of the venue""" foursquare_id: Optional[str] = None - """Foursquare identifier of the venue if known""" + """*Optional*. Foursquare identifier of the venue if known""" foursquare_type: Optional[str] = None - """Foursquare type of the venue, if known. (For example, 'arts_entertainment/default', - 'arts_entertainment/aquarium' or 'food/icecream'.)""" + """*Optional*. Foursquare type of the venue, if known. (For example, 'arts_entertainment/default', 'arts_entertainment/aquarium' or 'food/icecream'.)""" google_place_id: Optional[str] = None - """Google Places identifier of the venue""" + """*Optional*. Google Places identifier of the venue""" google_place_type: Optional[str] = None - """Google Places type of the venue. (See supported types.)""" + """*Optional*. Google Places type of the venue. (See `supported types `_.)""" reply_markup: Optional[InlineKeyboardMarkup] = None - """Inline keyboard attached to the message""" + """*Optional*. `Inline keyboard `_ attached to the message""" input_message_content: Optional[InputMessageContent] = None - """Content of the message to be sent instead of the venue""" + """*Optional*. Content of the message to be sent instead of the venue""" thumb_url: Optional[str] = None - """Url of the thumbnail for the result""" + """*Optional*. Url of the thumbnail for the result""" thumb_width: Optional[int] = None - """Thumbnail width""" + """*Optional*. Thumbnail width""" thumb_height: Optional[int] = None - """Thumbnail height""" + """*Optional*. Thumbnail height""" diff --git a/aiogram/types/inline_query_result_video.py b/aiogram/types/inline_query_result_video.py index 07e4af97..c1494d69 100644 --- a/aiogram/types/inline_query_result_video.py +++ b/aiogram/types/inline_query_result_video.py @@ -15,17 +15,15 @@ if TYPE_CHECKING: # pragma: no cover class InlineQueryResultVideo(InlineQueryResult): """ - Represents a link to a page containing an embedded video player or a video file. By default, - this video file will be sent by the user with an optional caption. Alternatively, you can use - input_message_content to send a message with the specified content instead of the video. - If an InlineQueryResultVideo message contains an embedded video (e.g., YouTube), you must - replace its content using input_message_content. + Represents a link to a page containing an embedded video player or a video file. By default, this video file will be sent by the user with an optional caption. Alternatively, you can use *input_message_content* to send a message with the specified content instead of the video. + + If an InlineQueryResultVideo message contains an embedded video (e.g., YouTube), you **must** replace its content using *input_message_content*. Source: https://core.telegram.org/bots/api#inlinequeryresultvideo """ type: str = Field("video", const=True) - """Type of the result, must be video""" + """Type of the result, must be *video*""" id: str """Unique identifier for this result, 1-64 bytes""" video_url: str @@ -37,22 +35,20 @@ class InlineQueryResultVideo(InlineQueryResult): title: str """Title for the result""" caption: Optional[str] = None - """Caption of the video to be sent, 0-1024 characters after entities parsing""" + """*Optional*. Caption of the video to be sent, 0-1024 characters after entities parsing""" parse_mode: Optional[str] = UNSET - """Mode for parsing entities in the video caption. See formatting options for more details.""" + """*Optional*. Mode for parsing entities in the video caption. See `formatting options `_ for more details.""" caption_entities: Optional[List[MessageEntity]] = None - """List of special entities that appear in the caption, which can be specified instead of - parse_mode""" + """*Optional*. List of special entities that appear in the caption, which can be specified instead of *parse_mode*""" video_width: Optional[int] = None - """Video width""" + """*Optional*. Video width""" video_height: Optional[int] = None - """Video height""" + """*Optional*. Video height""" video_duration: Optional[int] = None - """Video duration in seconds""" + """*Optional*. Video duration in seconds""" description: Optional[str] = None - """Short description of the result""" + """*Optional*. Short description of the result""" reply_markup: Optional[InlineKeyboardMarkup] = None - """Inline keyboard attached to the message""" + """*Optional*. `Inline keyboard `_ attached to the message""" input_message_content: Optional[InputMessageContent] = None - """Content of the message to be sent instead of the video. This field is required if - InlineQueryResultVideo is used to send an HTML-page as a result (e.g., a YouTube video).""" + """*Optional*. Content of the message to be sent instead of the video. This field is **required** if InlineQueryResultVideo is used to send an HTML-page as a result (e.g., a YouTube video).""" diff --git a/aiogram/types/inline_query_result_voice.py b/aiogram/types/inline_query_result_voice.py index e51484cb..eac64546 100644 --- a/aiogram/types/inline_query_result_voice.py +++ b/aiogram/types/inline_query_result_voice.py @@ -15,18 +15,14 @@ if TYPE_CHECKING: # pragma: no cover class InlineQueryResultVoice(InlineQueryResult): """ - Represents a link to a voice recording in an .OGG container encoded with OPUS. By default, - this voice recording will be sent by the user. Alternatively, you can use - input_message_content to send a message with the specified content instead of the the voice - message. - Note: This will only work in Telegram versions released after 9 April, 2016. Older clients - will ignore them. + Represents a link to a voice recording in an .OGG container encoded with OPUS. By default, this voice recording will be sent by the user. Alternatively, you can use *input_message_content* to send a message with the specified content instead of the the voice message. + **Note:** This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them. Source: https://core.telegram.org/bots/api#inlinequeryresultvoice """ type: str = Field("voice", const=True) - """Type of the result, must be voice""" + """Type of the result, must be *voice*""" id: str """Unique identifier for this result, 1-64 bytes""" voice_url: str @@ -34,16 +30,14 @@ class InlineQueryResultVoice(InlineQueryResult): title: str """Recording title""" caption: Optional[str] = None - """Caption, 0-1024 characters after entities parsing""" + """*Optional*. Caption, 0-1024 characters after entities parsing""" parse_mode: Optional[str] = UNSET - """Mode for parsing entities in the voice message caption. See formatting options for more - details.""" + """*Optional*. Mode for parsing entities in the voice message caption. See `formatting options `_ for more details.""" caption_entities: Optional[List[MessageEntity]] = None - """List of special entities that appear in the caption, which can be specified instead of - parse_mode""" + """*Optional*. List of special entities that appear in the caption, which can be specified instead of *parse_mode*""" voice_duration: Optional[int] = None - """Recording duration in seconds""" + """*Optional*. Recording duration in seconds""" reply_markup: Optional[InlineKeyboardMarkup] = None - """Inline keyboard attached to the message""" + """*Optional*. `Inline keyboard `_ attached to the message""" input_message_content: Optional[InputMessageContent] = None - """Content of the message to be sent instead of the voice recording""" + """*Optional*. Content of the message to be sent instead of the voice recording""" diff --git a/aiogram/types/input_contact_message_content.py b/aiogram/types/input_contact_message_content.py index 6630d7c7..2e5a7823 100644 --- a/aiogram/types/input_contact_message_content.py +++ b/aiogram/types/input_contact_message_content.py @@ -7,7 +7,7 @@ from .input_message_content import InputMessageContent class InputContactMessageContent(InputMessageContent): """ - Represents the content of a contact message to be sent as the result of an inline query. + Represents the `content `_ of a contact message to be sent as the result of an inline query. Source: https://core.telegram.org/bots/api#inputcontactmessagecontent """ @@ -17,6 +17,6 @@ class InputContactMessageContent(InputMessageContent): first_name: str """Contact's first name""" last_name: Optional[str] = None - """Contact's last name""" + """*Optional*. Contact's last name""" vcard: Optional[str] = None - """Additional data about the contact in the form of a vCard, 0-2048 bytes""" + """*Optional*. Additional data about the contact in the form of a `vCard `_, 0-2048 bytes""" diff --git a/aiogram/types/input_file.py b/aiogram/types/input_file.py index 9c323627..9efa455d 100644 --- a/aiogram/types/input_file.py +++ b/aiogram/types/input_file.py @@ -13,8 +13,7 @@ DEFAULT_CHUNK_SIZE = 64 * 1024 # 64 kb class InputFile(ABC): """ - This object represents the contents of a file to be uploaded. Must be posted using - multipart/form-data in the usual way that files are uploaded via the browser. + This object represents the contents of a file to be uploaded. Must be posted using multipart/form-data in the usual way that files are uploaded via the browser. Source: https://core.telegram.org/bots/api#inputfile """ diff --git a/aiogram/types/input_location_message_content.py b/aiogram/types/input_location_message_content.py index 8f3224e6..700532c2 100644 --- a/aiogram/types/input_location_message_content.py +++ b/aiogram/types/input_location_message_content.py @@ -7,7 +7,7 @@ from .input_message_content import InputMessageContent class InputLocationMessageContent(InputMessageContent): """ - Represents the content of a location message to be sent as the result of an inline query. + Represents the `content `_ of a location message to be sent as the result of an inline query. Source: https://core.telegram.org/bots/api#inputlocationmessagecontent """ @@ -17,12 +17,10 @@ class InputLocationMessageContent(InputMessageContent): longitude: float """Longitude of the location in degrees""" horizontal_accuracy: Optional[float] = None - """The radius of uncertainty for the location, measured in meters; 0-1500""" + """*Optional*. The radius of uncertainty for the location, measured in meters; 0-1500""" live_period: Optional[int] = None - """Period in seconds for which the location can be updated, should be between 60 and 86400.""" + """*Optional*. Period in seconds for which the location can be updated, should be between 60 and 86400.""" heading: Optional[int] = None - """For live locations, a direction in which the user is moving, in degrees. Must be between 1 - and 360 if specified.""" + """*Optional*. For live locations, a direction in which the user is moving, in degrees. Must be between 1 and 360 if specified.""" proximity_alert_radius: Optional[int] = None - """For live locations, a maximum distance for proximity alerts about approaching another chat - member, in meters. Must be between 1 and 100000 if specified.""" + """*Optional*. For live locations, a maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified.""" diff --git a/aiogram/types/input_media.py b/aiogram/types/input_media.py index a9e7b2be..f7523c9e 100644 --- a/aiogram/types/input_media.py +++ b/aiogram/types/input_media.py @@ -6,11 +6,12 @@ from .base import MutableTelegramObject class InputMedia(MutableTelegramObject): """ This object represents the content of a media message to be sent. It should be one of - - InputMediaAnimation - - InputMediaDocument - - InputMediaAudio - - InputMediaPhoto - - InputMediaVideo + + - :class:`aiogram.types.input_media_animation.InputMediaAnimation` + - :class:`aiogram.types.input_media_document.InputMediaDocument` + - :class:`aiogram.types.input_media_audio.InputMediaAudio` + - :class:`aiogram.types.input_media_photo.InputMediaPhoto` + - :class:`aiogram.types.input_media_video.InputMediaVideo` Source: https://core.telegram.org/bots/api#inputmedia """ diff --git a/aiogram/types/input_media_animation.py b/aiogram/types/input_media_animation.py index 73685672..a18e1e88 100644 --- a/aiogram/types/input_media_animation.py +++ b/aiogram/types/input_media_animation.py @@ -20,30 +20,20 @@ class InputMediaAnimation(InputMedia): """ type: str = Field("animation", const=True) - """Type of the result, must be animation""" + """Type of the result, must be *animation*""" media: Union[str, InputFile] - """File to send. Pass a file_id to send a file that exists on the Telegram servers - (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass - 'attach://' to upload a new one using multipart/form-data under - name.""" + """File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass 'attach://' to upload a new one using multipart/form-data under name. :ref:`More info on Sending Files » `""" thumb: Optional[Union[InputFile, str]] = None - """Thumbnail of the file sent; can be ignored if thumbnail generation for the file is - supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. - A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded - using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new - file, so you can pass 'attach://' if the thumbnail was uploaded using - multipart/form-data under .""" + """*Optional*. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://' if the thumbnail was uploaded using multipart/form-data under . :ref:`More info on Sending Files » `""" caption: Optional[str] = None - """Caption of the animation to be sent, 0-1024 characters after entities parsing""" + """*Optional*. Caption of the animation to be sent, 0-1024 characters after entities parsing""" parse_mode: Optional[str] = UNSET - """Mode for parsing entities in the animation caption. See formatting options for more - details.""" + """*Optional*. Mode for parsing entities in the animation caption. See `formatting options `_ for more details.""" caption_entities: Optional[List[MessageEntity]] = None - """List of special entities that appear in the caption, which can be specified instead of - parse_mode""" + """*Optional*. List of special entities that appear in the caption, which can be specified instead of *parse_mode*""" width: Optional[int] = None - """Animation width""" + """*Optional*. Animation width""" height: Optional[int] = None - """Animation height""" + """*Optional*. Animation height""" duration: Optional[int] = None - """Animation duration""" + """*Optional*. Animation duration""" diff --git a/aiogram/types/input_media_audio.py b/aiogram/types/input_media_audio.py index 7418954c..6252dbaf 100644 --- a/aiogram/types/input_media_audio.py +++ b/aiogram/types/input_media_audio.py @@ -20,29 +20,20 @@ class InputMediaAudio(InputMedia): """ type: str = Field("audio", const=True) - """Type of the result, must be audio""" + """Type of the result, must be *audio*""" media: Union[str, InputFile] - """File to send. Pass a file_id to send a file that exists on the Telegram servers - (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass - 'attach://' to upload a new one using multipart/form-data under - name.""" + """File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass 'attach://' to upload a new one using multipart/form-data under name. :ref:`More info on Sending Files » `""" thumb: Optional[Union[InputFile, str]] = None - """Thumbnail of the file sent; can be ignored if thumbnail generation for the file is - supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. - A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded - using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new - file, so you can pass 'attach://' if the thumbnail was uploaded using - multipart/form-data under .""" + """*Optional*. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://' if the thumbnail was uploaded using multipart/form-data under . :ref:`More info on Sending Files » `""" caption: Optional[str] = None - """Caption of the audio to be sent, 0-1024 characters after entities parsing""" + """*Optional*. Caption of the audio to be sent, 0-1024 characters after entities parsing""" parse_mode: Optional[str] = UNSET - """Mode for parsing entities in the audio caption. See formatting options for more details.""" + """*Optional*. Mode for parsing entities in the audio caption. See `formatting options `_ for more details.""" caption_entities: Optional[List[MessageEntity]] = None - """List of special entities that appear in the caption, which can be specified instead of - parse_mode""" + """*Optional*. List of special entities that appear in the caption, which can be specified instead of *parse_mode*""" duration: Optional[int] = None - """Duration of the audio in seconds""" + """*Optional*. Duration of the audio in seconds""" performer: Optional[str] = None - """Performer of the audio""" + """*Optional*. Performer of the audio""" title: Optional[str] = None - """Title of the audio""" + """*Optional*. Title of the audio""" diff --git a/aiogram/types/input_media_document.py b/aiogram/types/input_media_document.py index a75a657a..0e3df5fe 100644 --- a/aiogram/types/input_media_document.py +++ b/aiogram/types/input_media_document.py @@ -20,26 +20,16 @@ class InputMediaDocument(InputMedia): """ type: str = Field("document", const=True) - """Type of the result, must be document""" + """Type of the result, must be *document*""" media: Union[str, InputFile] - """File to send. Pass a file_id to send a file that exists on the Telegram servers - (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass - 'attach://' to upload a new one using multipart/form-data under - name.""" + """File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass 'attach://' to upload a new one using multipart/form-data under name. :ref:`More info on Sending Files » `""" thumb: Optional[Union[InputFile, str]] = None - """Thumbnail of the file sent; can be ignored if thumbnail generation for the file is - supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. - A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded - using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new - file, so you can pass 'attach://' if the thumbnail was uploaded using - multipart/form-data under .""" + """*Optional*. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://' if the thumbnail was uploaded using multipart/form-data under . :ref:`More info on Sending Files » `""" caption: Optional[str] = None - """Caption of the document to be sent, 0-1024 characters after entities parsing""" + """*Optional*. Caption of the document to be sent, 0-1024 characters after entities parsing""" parse_mode: Optional[str] = UNSET - """Mode for parsing entities in the document caption. See formatting options for more details.""" + """*Optional*. Mode for parsing entities in the document caption. See `formatting options `_ for more details.""" caption_entities: Optional[List[MessageEntity]] = None - """List of special entities that appear in the caption, which can be specified instead of - parse_mode""" + """*Optional*. List of special entities that appear in the caption, which can be specified instead of *parse_mode*""" disable_content_type_detection: Optional[bool] = None - """Disables automatic server-side content type detection for files uploaded using - multipart/form-data. Always true, if the document is sent as part of an album.""" + """*Optional*. Disables automatic server-side content type detection for files uploaded using multipart/form-data. Always true, if the document is sent as part of an album.""" diff --git a/aiogram/types/input_media_photo.py b/aiogram/types/input_media_photo.py index 7e53754b..f32be92f 100644 --- a/aiogram/types/input_media_photo.py +++ b/aiogram/types/input_media_photo.py @@ -20,16 +20,12 @@ class InputMediaPhoto(InputMedia): """ type: str = Field("photo", const=True) - """Type of the result, must be photo""" + """Type of the result, must be *photo*""" media: Union[str, InputFile] - """File to send. Pass a file_id to send a file that exists on the Telegram servers - (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass - 'attach://' to upload a new one using multipart/form-data under - name.""" + """File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass 'attach://' to upload a new one using multipart/form-data under name. :ref:`More info on Sending Files » `""" caption: Optional[str] = None - """Caption of the photo to be sent, 0-1024 characters after entities parsing""" + """*Optional*. Caption of the photo to be sent, 0-1024 characters after entities parsing""" parse_mode: Optional[str] = UNSET - """Mode for parsing entities in the photo caption. See formatting options for more details.""" + """*Optional*. Mode for parsing entities in the photo caption. See `formatting options `_ for more details.""" caption_entities: Optional[List[MessageEntity]] = None - """List of special entities that appear in the caption, which can be specified instead of - parse_mode""" + """*Optional*. List of special entities that appear in the caption, which can be specified instead of *parse_mode*""" diff --git a/aiogram/types/input_media_video.py b/aiogram/types/input_media_video.py index a0868954..b6328736 100644 --- a/aiogram/types/input_media_video.py +++ b/aiogram/types/input_media_video.py @@ -20,31 +20,22 @@ class InputMediaVideo(InputMedia): """ type: str = Field("video", const=True) - """Type of the result, must be video""" + """Type of the result, must be *video*""" media: Union[str, InputFile] - """File to send. Pass a file_id to send a file that exists on the Telegram servers - (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass - 'attach://' to upload a new one using multipart/form-data under - name.""" + """File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass 'attach://' to upload a new one using multipart/form-data under name. :ref:`More info on Sending Files » `""" thumb: Optional[Union[InputFile, str]] = None - """Thumbnail of the file sent; can be ignored if thumbnail generation for the file is - supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. - A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded - using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new - file, so you can pass 'attach://' if the thumbnail was uploaded using - multipart/form-data under .""" + """*Optional*. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass 'attach://' if the thumbnail was uploaded using multipart/form-data under . :ref:`More info on Sending Files » `""" caption: Optional[str] = None - """Caption of the video to be sent, 0-1024 characters after entities parsing""" + """*Optional*. Caption of the video to be sent, 0-1024 characters after entities parsing""" parse_mode: Optional[str] = UNSET - """Mode for parsing entities in the video caption. See formatting options for more details.""" + """*Optional*. Mode for parsing entities in the video caption. See `formatting options `_ for more details.""" caption_entities: Optional[List[MessageEntity]] = None - """List of special entities that appear in the caption, which can be specified instead of - parse_mode""" + """*Optional*. List of special entities that appear in the caption, which can be specified instead of *parse_mode*""" width: Optional[int] = None - """Video width""" + """*Optional*. Video width""" height: Optional[int] = None - """Video height""" + """*Optional*. Video height""" duration: Optional[int] = None - """Video duration""" + """*Optional*. Video duration""" supports_streaming: Optional[bool] = None - """Pass True, if the uploaded video is suitable for streaming""" + """*Optional*. Pass :code:`True`, if the uploaded video is suitable for streaming""" diff --git a/aiogram/types/input_message_content.py b/aiogram/types/input_message_content.py index 38da01f8..b763dd92 100644 --- a/aiogram/types/input_message_content.py +++ b/aiogram/types/input_message_content.py @@ -5,12 +5,12 @@ from .base import TelegramObject class InputMessageContent(TelegramObject): """ - This object represents the content of a message to be sent as a result of an inline query. - Telegram clients currently support the following 4 types: - - InputTextMessageContent - - InputLocationMessageContent - - InputVenueMessageContent - - InputContactMessageContent + This object represents the content of a message to be sent as a result of an inline query. Telegram clients currently support the following 4 types: + + - :class:`aiogram.types.input_text_message_content.InputTextMessageContent` + - :class:`aiogram.types.input_location_message_content.InputLocationMessageContent` + - :class:`aiogram.types.input_venue_message_content.InputVenueMessageContent` + - :class:`aiogram.types.input_contact_message_content.InputContactMessageContent` Source: https://core.telegram.org/bots/api#inputmessagecontent """ diff --git a/aiogram/types/input_text_message_content.py b/aiogram/types/input_text_message_content.py index 07a47b61..5d0950a1 100644 --- a/aiogram/types/input_text_message_content.py +++ b/aiogram/types/input_text_message_content.py @@ -11,7 +11,7 @@ if TYPE_CHECKING: # pragma: no cover class InputTextMessageContent(InputMessageContent): """ - Represents the content of a text message to be sent as the result of an inline query. + Represents the `content `_ of a text message to be sent as the result of an inline query. Source: https://core.telegram.org/bots/api#inputtextmessagecontent """ @@ -19,9 +19,8 @@ class InputTextMessageContent(InputMessageContent): message_text: str """Text of the message to be sent, 1-4096 characters""" parse_mode: Optional[str] = UNSET - """Mode for parsing entities in the message text. See formatting options for more details.""" + """*Optional*. Mode for parsing entities in the message text. See `formatting options `_ for more details.""" entities: Optional[List[MessageEntity]] = None - """List of special entities that appear in message text, which can be specified instead of - parse_mode""" + """*Optional*. List of special entities that appear in message text, which can be specified instead of *parse_mode*""" disable_web_page_preview: Optional[bool] = None - """Disables link previews for links in the sent message""" + """*Optional*. Disables link previews for links in the sent message""" diff --git a/aiogram/types/input_venue_message_content.py b/aiogram/types/input_venue_message_content.py index 354f4f85..f6ccd76f 100644 --- a/aiogram/types/input_venue_message_content.py +++ b/aiogram/types/input_venue_message_content.py @@ -7,7 +7,7 @@ from .input_message_content import InputMessageContent class InputVenueMessageContent(InputMessageContent): """ - Represents the content of a venue message to be sent as the result of an inline query. + Represents the `content `_ of a venue message to be sent as the result of an inline query. Source: https://core.telegram.org/bots/api#inputvenuemessagecontent """ @@ -21,11 +21,10 @@ class InputVenueMessageContent(InputMessageContent): address: str """Address of the venue""" foursquare_id: Optional[str] = None - """Foursquare identifier of the venue, if known""" + """*Optional*. Foursquare identifier of the venue, if known""" foursquare_type: Optional[str] = None - """Foursquare type of the venue, if known. (For example, 'arts_entertainment/default', - 'arts_entertainment/aquarium' or 'food/icecream'.)""" + """*Optional*. Foursquare type of the venue, if known. (For example, 'arts_entertainment/default', 'arts_entertainment/aquarium' or 'food/icecream'.)""" google_place_id: Optional[str] = None - """Google Places identifier of the venue""" + """*Optional*. Google Places identifier of the venue""" google_place_type: Optional[str] = None - """Google Places type of the venue. (See supported types.)""" + """*Optional*. Google Places type of the venue. (See `supported types `_.)""" diff --git a/aiogram/types/invoice.py b/aiogram/types/invoice.py index 2d8d74ff..1e734895 100644 --- a/aiogram/types/invoice.py +++ b/aiogram/types/invoice.py @@ -17,9 +17,6 @@ class Invoice(TelegramObject): start_parameter: str """Unique bot deep-linking parameter that can be used to generate this invoice""" currency: str - """Three-letter ISO 4217 currency code""" + """Three-letter ISO 4217 `currency `_ code""" total_amount: int - """Total price in the smallest units of the currency (integer, not float/double). For example, - for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it - shows the number of digits past the decimal point for each currency (2 for the majority of - currencies).""" + """Total price in the *smallest units* of the currency (integer, **not** float/double). For example, for a price of :code:`US$ 1.45` pass :code:`amount = 145`. See the *exp* parameter in `currencies.json `_, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies).""" diff --git a/aiogram/types/keyboard_button.py b/aiogram/types/keyboard_button.py index d04fa016..a5d83cbc 100644 --- a/aiogram/types/keyboard_button.py +++ b/aiogram/types/keyboard_button.py @@ -10,26 +10,19 @@ if TYPE_CHECKING: # pragma: no cover class KeyboardButton(MutableTelegramObject): """ - This object represents one button of the reply keyboard. For simple text buttons String can be - used instead of this object to specify text of the button. Optional fields request_contact, - request_location, and request_poll are mutually exclusive. - Note: request_contact and request_location options will only work in Telegram versions - released after 9 April, 2016. Older clients will display unsupported message. - Note: request_poll option will only work in Telegram versions released after 23 January, 2020. - Older clients will display unsupported message. + This object represents one button of the reply keyboard. For simple text buttons *String* can be used instead of this object to specify text of the button. Optional fields *request_contact*, *request_location*, and *request_poll* are mutually exclusive. + **Note:** *request_contact* and *request_location* options will only work in Telegram versions released after 9 April, 2016. Older clients will display *unsupported message*. + + **Note:** *request_poll* option will only work in Telegram versions released after 23 January, 2020. Older clients will display *unsupported message*. Source: https://core.telegram.org/bots/api#keyboardbutton """ text: str - """Text of the button. If none of the optional fields are used, it will be sent as a message - when the button is pressed""" + """Text of the button. If none of the optional fields are used, it will be sent as a message when the button is pressed""" request_contact: Optional[bool] = None - """If True, the user's phone number will be sent as a contact when the button is pressed. - Available in private chats only""" + """*Optional*. If :code:`True`, the user's phone number will be sent as a contact when the button is pressed. Available in private chats only""" request_location: Optional[bool] = None - """If True, the user's current location will be sent when the button is pressed. Available in - private chats only""" + """*Optional*. If :code:`True`, the user's current location will be sent when the button is pressed. Available in private chats only""" request_poll: Optional[KeyboardButtonPollType] = None - """If specified, the user will be asked to create a poll and send it to the bot when the - button is pressed. Available in private chats only""" + """*Optional*. If specified, the user will be asked to create a poll and send it to the bot when the button is pressed. Available in private chats only""" diff --git a/aiogram/types/keyboard_button_poll_type.py b/aiogram/types/keyboard_button_poll_type.py index fa216e45..2747adfb 100644 --- a/aiogram/types/keyboard_button_poll_type.py +++ b/aiogram/types/keyboard_button_poll_type.py @@ -7,13 +7,10 @@ from .base import MutableTelegramObject class KeyboardButtonPollType(MutableTelegramObject): """ - This object represents type of a poll, which is allowed to be created and sent when the - corresponding button is pressed. + This object represents type of a poll, which is allowed to be created and sent when the corresponding button is pressed. Source: https://core.telegram.org/bots/api#keyboardbuttonpolltype """ type: Optional[str] = None - """If quiz is passed, the user will be allowed to create only polls in the quiz mode. If - regular is passed, only regular polls will be allowed. Otherwise, the user will be allowed - to create a poll of any type.""" + """*Optional*. If *quiz* is passed, the user will be allowed to create only polls in the quiz mode. If *regular* is passed, only regular polls will be allowed. Otherwise, the user will be allowed to create a poll of any type.""" diff --git a/aiogram/types/labeled_price.py b/aiogram/types/labeled_price.py index 1b057f38..3dcffb89 100644 --- a/aiogram/types/labeled_price.py +++ b/aiogram/types/labeled_price.py @@ -13,7 +13,4 @@ class LabeledPrice(MutableTelegramObject): label: str """Portion label""" amount: int - """Price of the product in the smallest units of the currency (integer, not float/double). For - example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in - currencies.json, it shows the number of digits past the decimal point for each currency (2 - for the majority of currencies).""" + """Price of the product in the *smallest units* of the `currency `_ (integer, **not** float/double). For example, for a price of :code:`US$ 1.45` pass :code:`amount = 145`. See the *exp* parameter in `currencies.json `_, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies).""" diff --git a/aiogram/types/location.py b/aiogram/types/location.py index 4d8a4fab..e86c56f3 100644 --- a/aiogram/types/location.py +++ b/aiogram/types/location.py @@ -17,12 +17,10 @@ class Location(TelegramObject): latitude: float """Latitude as defined by sender""" horizontal_accuracy: Optional[float] = None - """The radius of uncertainty for the location, measured in meters; 0-1500""" + """*Optional*. The radius of uncertainty for the location, measured in meters; 0-1500""" live_period: Optional[int] = None - """Time relative to the message sending date, during which the location can be updated, in - seconds. For active live locations only.""" + """*Optional*. Time relative to the message sending date, during which the location can be updated, in seconds. For active live locations only.""" heading: Optional[int] = None - """The direction in which user is moving, in degrees; 1-360. For active live locations only.""" + """*Optional*. The direction in which user is moving, in degrees; 1-360. For active live locations only.""" proximity_alert_radius: Optional[int] = None - """Maximum distance for proximity alerts about approaching another chat member, in meters. For - sent live locations only.""" + """*Optional*. Maximum distance for proximity alerts about approaching another chat member, in meters. For sent live locations only.""" diff --git a/aiogram/types/login_url.py b/aiogram/types/login_url.py index cf422252..ff969643 100644 --- a/aiogram/types/login_url.py +++ b/aiogram/types/login_url.py @@ -7,27 +7,19 @@ from .base import TelegramObject class LoginUrl(TelegramObject): """ - This object represents a parameter of the inline keyboard button used to automatically - authorize a user. Serves as a great replacement for the Telegram Login Widget when the user is - coming from Telegram. All the user needs to do is tap/click a button and confirm that they - want to log in: - Telegram apps support these buttons as of version 5.7. - Sample bot: @discussbot + This object represents a parameter of the inline keyboard button used to automatically authorize a user. Serves as a great replacement for the `Telegram Login Widget `_ when the user is coming from Telegram. All the user needs to do is tap/click a button and confirm that they want to log in: + Telegram apps support these buttons as of `version 5.7 `_. + + Sample bot: `@discussbot `_ Source: https://core.telegram.org/bots/api#loginurl """ url: str - """An HTTP URL to be opened with user authorization data added to the query string when the - button is pressed. If the user refuses to provide authorization data, the original URL - without information about the user will be opened. The data added is the same as described - in Receiving authorization data.""" + """An HTTP URL to be opened with user authorization data added to the query string when the button is pressed. If the user refuses to provide authorization data, the original URL without information about the user will be opened. The data added is the same as described in `Receiving authorization data `_.""" forward_text: Optional[str] = None - """New text of the button in forwarded messages.""" + """*Optional*. New text of the button in forwarded messages.""" bot_username: Optional[str] = None - """Username of a bot, which will be used for user authorization. See Setting up a bot for more - details. If not specified, the current bot's username will be assumed. The url's domain - must be the same as the domain linked with the bot. See Linking your domain to the bot for - more details.""" + """*Optional*. Username of a bot, which will be used for user authorization. See `Setting up a bot `_ for more details. If not specified, the current bot's username will be assumed. The *url*'s domain must be the same as the domain linked with the bot. See `Linking your domain to the bot `_ for more details.""" request_write_access: Optional[bool] = None - """Pass True to request the permission for your bot to send messages to the user.""" + """*Optional*. Pass True to request the permission for your bot to send messages to the user.""" diff --git a/aiogram/types/mask_position.py b/aiogram/types/mask_position.py index a9bc365d..3eea5bda 100644 --- a/aiogram/types/mask_position.py +++ b/aiogram/types/mask_position.py @@ -11,13 +11,10 @@ class MaskPosition(TelegramObject): """ point: str - """The part of the face relative to which the mask should be placed. One of 'forehead', - 'eyes', 'mouth', or 'chin'.""" + """The part of the face relative to which the mask should be placed. One of 'forehead', 'eyes', 'mouth', or 'chin'.""" x_shift: float - """Shift by X-axis measured in widths of the mask scaled to the face size, from left to right. - For example, choosing -1.0 will place mask just to the left of the default mask position.""" + """Shift by X-axis measured in widths of the mask scaled to the face size, from left to right. For example, choosing -1.0 will place mask just to the left of the default mask position.""" y_shift: float - """Shift by Y-axis measured in heights of the mask scaled to the face size, from top to - bottom. For example, 1.0 will place the mask just below the default mask position.""" + """Shift by Y-axis measured in heights of the mask scaled to the face size, from top to bottom. For example, 1.0 will place the mask just below the default mask position.""" scale: float """Mask scaling coefficient. For example, 2.0 means double size.""" diff --git a/aiogram/types/message.py b/aiogram/types/message.py index a0d5bce8..063f0521 100644 --- a/aiogram/types/message.py +++ b/aiogram/types/message.py @@ -10,6 +10,25 @@ from aiogram.utils import helper from .base import UNSET, TelegramObject if TYPE_CHECKING: # pragma: no cover + from ..methods import ( + SendAnimation, + SendAudio, + SendContact, + SendDice, + SendDocument, + SendGame, + SendInvoice, + SendLocation, + SendMediaGroup, + SendMessage, + SendPhoto, + SendPoll, + SendSticker, + SendVenue, + SendVideo, + SendVideoNote, + SendVoice, + ) from .animation import Animation from .audio import Audio from .chat import Chat @@ -19,19 +38,19 @@ if TYPE_CHECKING: # pragma: no cover from .force_reply import ForceReply from .game import Game from .inline_keyboard_markup import InlineKeyboardMarkup - from .invoice import Invoice from .input_file import InputFile from .input_media_photo import InputMediaPhoto from .input_media_video import InputMediaVideo + from .invoice import Invoice from .labeled_price import LabeledPrice from .location import Location from .message_entity import MessageEntity from .passport_data import PassportData from .photo_size import PhotoSize from .poll import Poll + from .proximity_alert_triggered import ProximityAlertTriggered from .reply_keyboard_markup import ReplyKeyboardMarkup from .reply_keyboard_remove import ReplyKeyboardRemove - from .proximity_alert_triggered import ProximityAlertTriggered from .sticker import Sticker from .successful_payment import SuccessfulPayment from .user import User @@ -40,26 +59,6 @@ if TYPE_CHECKING: # pragma: no cover from .video_note import VideoNote from .voice import Voice - from ..methods import ( - SendAnimation, - SendAudio, - SendContact, - SendDocument, - SendGame, - SendInvoice, - SendLocation, - SendMediaGroup, - SendMessage, - SendPhoto, - SendPoll, - SendDice, - SendSticker, - SendVenue, - SendVideo, - SendVideoNote, - SendVoice, - ) - class Message(TelegramObject): """ @@ -75,128 +74,101 @@ class Message(TelegramObject): chat: Chat """Conversation the message belongs to""" from_user: Optional[User] = Field(None, alias="from") - """Sender, empty for messages sent to channels""" + """*Optional*. Sender, empty for messages sent to channels""" sender_chat: Optional[Chat] = None - """Sender of the message, sent on behalf of a chat. The channel itself for channel messages. - The supergroup itself for messages from anonymous group administrators. The linked channel - for messages automatically forwarded to the discussion group""" + """*Optional*. Sender of the message, sent on behalf of a chat. The channel itself for channel messages. The supergroup itself for messages from anonymous group administrators. The linked channel for messages automatically forwarded to the discussion group""" forward_from: Optional[User] = None - """For forwarded messages, sender of the original message""" + """*Optional*. For forwarded messages, sender of the original message""" forward_from_chat: Optional[Chat] = None - """For messages forwarded from channels or from anonymous administrators, information about - the original sender chat""" + """*Optional*. For messages forwarded from channels or from anonymous administrators, information about the original sender chat""" forward_from_message_id: Optional[int] = None - """For messages forwarded from channels, identifier of the original message in the channel""" + """*Optional*. For messages forwarded from channels, identifier of the original message in the channel""" forward_signature: Optional[str] = None - """For messages forwarded from channels, signature of the post author if present""" + """*Optional*. For messages forwarded from channels, signature of the post author if present""" forward_sender_name: Optional[str] = None - """Sender's name for messages forwarded from users who disallow adding a link to their account - in forwarded messages""" + """*Optional*. Sender's name for messages forwarded from users who disallow adding a link to their account in forwarded messages""" forward_date: Optional[int] = None - """For forwarded messages, date the original message was sent in Unix time""" + """*Optional*. For forwarded messages, date the original message was sent in Unix time""" reply_to_message: Optional[Message] = None - """For replies, the original message. Note that the Message object in this field will not - contain further reply_to_message fields even if it itself is a reply.""" + """*Optional*. For replies, the original message. Note that the Message object in this field will not contain further *reply_to_message* fields even if it itself is a reply.""" via_bot: Optional[User] = None - """Bot through which the message was sent""" + """*Optional*. Bot through which the message was sent""" edit_date: Optional[int] = None - """Date the message was last edited in Unix time""" + """*Optional*. Date the message was last edited in Unix time""" media_group_id: Optional[str] = None - """The unique identifier of a media message group this message belongs to""" + """*Optional*. The unique identifier of a media message group this message belongs to""" author_signature: Optional[str] = None - """Signature of the post author for messages in channels, or the custom title of an anonymous - group administrator""" + """*Optional*. Signature of the post author for messages in channels, or the custom title of an anonymous group administrator""" text: Optional[str] = None - """For text messages, the actual UTF-8 text of the message, 0-4096 characters""" + """*Optional*. For text messages, the actual UTF-8 text of the message, 0-4096 characters""" entities: Optional[List[MessageEntity]] = None - """For text messages, special entities like usernames, URLs, bot commands, etc. that appear in - the text""" + """*Optional*. For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text""" animation: Optional[Animation] = None - """Message is an animation, information about the animation. For backward compatibility, when - this field is set, the document field will also be set""" + """*Optional*. Message is an animation, information about the animation. For backward compatibility, when this field is set, the *document* field will also be set""" audio: Optional[Audio] = None - """Message is an audio file, information about the file""" + """*Optional*. Message is an audio file, information about the file""" document: Optional[Document] = None - """Message is a general file, information about the file""" + """*Optional*. Message is a general file, information about the file""" photo: Optional[List[PhotoSize]] = None - """Message is a photo, available sizes of the photo""" + """*Optional*. Message is a photo, available sizes of the photo""" sticker: Optional[Sticker] = None - """Message is a sticker, information about the sticker""" + """*Optional*. Message is a sticker, information about the sticker""" video: Optional[Video] = None - """Message is a video, information about the video""" + """*Optional*. Message is a video, information about the video""" video_note: Optional[VideoNote] = None - """Message is a video note, information about the video message""" + """*Optional*. Message is a `video note `_, information about the video message""" voice: Optional[Voice] = None - """Message is a voice message, information about the file""" + """*Optional*. Message is a voice message, information about the file""" caption: Optional[str] = None - """Caption for the animation, audio, document, photo, video or voice, 0-1024 characters""" + """*Optional*. Caption for the animation, audio, document, photo, video or voice, 0-1024 characters""" caption_entities: Optional[List[MessageEntity]] = None - """For messages with a caption, special entities like usernames, URLs, bot commands, etc. that - appear in the caption""" + """*Optional*. For messages with a caption, special entities like usernames, URLs, bot commands, etc. that appear in the caption""" contact: Optional[Contact] = None - """Message is a shared contact, information about the contact""" + """*Optional*. Message is a shared contact, information about the contact""" dice: Optional[Dice] = None - """Message is a dice with random value from 1 to 6""" + """*Optional*. Message is a dice with random value""" game: Optional[Game] = None - """Message is a game, information about the game.""" + """*Optional*. Message is a game, information about the game. `More about games » `_""" poll: Optional[Poll] = None - """Message is a native poll, information about the poll""" + """*Optional*. Message is a native poll, information about the poll""" venue: Optional[Venue] = None - """Message is a venue, information about the venue. For backward compatibility, when this - field is set, the location field will also be set""" + """*Optional*. Message is a venue, information about the venue. For backward compatibility, when this field is set, the *location* field will also be set""" location: Optional[Location] = None - """Message is a shared location, information about the location""" + """*Optional*. Message is a shared location, information about the location""" new_chat_members: Optional[List[User]] = None - """New members that were added to the group or supergroup and information about them (the bot - itself may be one of these members)""" + """*Optional*. New members that were added to the group or supergroup and information about them (the bot itself may be one of these members)""" left_chat_member: Optional[User] = None - """A member was removed from the group, information about them (this member may be the bot - itself)""" + """*Optional*. A member was removed from the group, information about them (this member may be the bot itself)""" new_chat_title: Optional[str] = None - """A chat title was changed to this value""" + """*Optional*. A chat title was changed to this value""" new_chat_photo: Optional[List[PhotoSize]] = None - """A chat photo was change to this value""" + """*Optional*. A chat photo was change to this value""" delete_chat_photo: Optional[bool] = None - """Service message: the chat photo was deleted""" + """*Optional*. Service message: the chat photo was deleted""" group_chat_created: Optional[bool] = None - """Service message: the group has been created""" + """*Optional*. Service message: the group has been created""" supergroup_chat_created: Optional[bool] = None - """Service message: the supergroup has been created. This field can't be received in a message - coming through updates, because bot can't be a member of a supergroup when it is created. - It can only be found in reply_to_message if someone replies to a very first message in a - directly created supergroup.""" + """*Optional*. Service message: the supergroup has been created. This field can't be received in a message coming through updates, because bot can't be a member of a supergroup when it is created. It can only be found in reply_to_message if someone replies to a very first message in a directly created supergroup.""" channel_chat_created: Optional[bool] = None - """Service message: the channel has been created. This field can't be received in a message - coming through updates, because bot can't be a member of a channel when it is created. It - can only be found in reply_to_message if someone replies to a very first message in a - channel.""" + """*Optional*. Service message: the channel has been created. This field can't be received in a message coming through updates, because bot can't be a member of a channel when it is created. It can only be found in reply_to_message if someone replies to a very first message in a channel.""" migrate_to_chat_id: Optional[int] = None - """The group has been migrated to a supergroup with the specified identifier. This number may - be greater than 32 bits and some programming languages may have difficulty/silent defects - in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or - double-precision float type are safe for storing this identifier.""" + """*Optional*. The group has been migrated to a supergroup with the specified identifier. This number may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier.""" migrate_from_chat_id: Optional[int] = None - """The supergroup has been migrated from a group with the specified identifier. This number - may be greater than 32 bits and some programming languages may have difficulty/silent - defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or - double-precision float type are safe for storing this identifier.""" + """*Optional*. The supergroup has been migrated from a group with the specified identifier. This number may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier.""" pinned_message: Optional[Message] = None - """Specified message was pinned. Note that the Message object in this field will not contain - further reply_to_message fields even if it is itself a reply.""" + """*Optional*. Specified message was pinned. Note that the Message object in this field will not contain further *reply_to_message* fields even if it is itself a reply.""" invoice: Optional[Invoice] = None - """Message is an invoice for a payment, information about the invoice.""" + """*Optional*. Message is an invoice for a `payment `_, information about the invoice. `More about payments » `_""" successful_payment: Optional[SuccessfulPayment] = None - """Message is a service message about a successful payment, information about the payment.""" + """*Optional*. Message is a service message about a successful payment, information about the payment. `More about payments » `_""" connected_website: Optional[str] = None - """The domain name of the website on which the user has logged in.""" + """*Optional*. The domain name of the website on which the user has logged in. `More about Telegram Login » `_""" passport_data: Optional[PassportData] = None - """Telegram Passport data""" + """*Optional*. Telegram Passport data""" proximity_alert_triggered: Optional[ProximityAlertTriggered] = None - """Service message. A user in the chat triggered another user's proximity alert while sharing - Live Location.""" + """*Optional*. Service message. A user in the chat triggered another user's proximity alert while sharing Live Location.""" reply_markup: Optional[InlineKeyboardMarkup] = None - """Inline keyboard attached to the message. login_url buttons are represented as ordinary url - buttons.""" + """*Optional*. Inline keyboard attached to the message. :code:`login_url` buttons are represented as ordinary :code:`url` buttons.""" @property def content_type(self) -> str: diff --git a/aiogram/types/message_entity.py b/aiogram/types/message_entity.py index fa56baf7..c0324656 100644 --- a/aiogram/types/message_entity.py +++ b/aiogram/types/message_entity.py @@ -10,26 +10,20 @@ if TYPE_CHECKING: # pragma: no cover class MessageEntity(MutableTelegramObject): """ - This object represents one special entity in a text message. For example, hashtags, usernames, - URLs, etc. + This object represents one special entity in a text message. For example, hashtags, usernames, URLs, etc. Source: https://core.telegram.org/bots/api#messageentity """ type: str - """Type of the entity. Can be 'mention' (@username), 'hashtag' (#hashtag), 'cashtag' ($USD), - 'bot_command' (/start@jobs_bot), 'url' (https://telegram.org), 'email' - (do-not-reply@telegram.org), 'phone_number' (+1-212-555-0123), 'bold' (bold text), 'italic' - (italic text), 'underline' (underlined text), 'strikethrough' (strikethrough text), 'code' - (monowidth string), 'pre' (monowidth block), 'text_link' (for clickable text URLs), - 'text_mention' (for users without usernames)""" + """Type of the entity. Can be 'mention' (:code:`@username`), 'hashtag' (:code:`#hashtag`), 'cashtag' (:code:`$USD`), 'bot_command' (:code:`/start@jobs_bot`), 'url' (:code:`https://telegram.org`), 'email' (:code:`do-not-reply@telegram.org`), 'phone_number' (:code:`+1-212-555-0123`), 'bold' (**bold text**), 'italic' (*italic text*), 'underline' (underlined text), 'strikethrough' (strikethrough text), 'code' (monowidth string), 'pre' (monowidth block), 'text_link' (for clickable text URLs), 'text_mention' (for users `without usernames `_)""" offset: int """Offset in UTF-16 code units to the start of the entity""" length: int """Length of the entity in UTF-16 code units""" url: Optional[str] = None - """For 'text_link' only, url that will be opened after user taps on the text""" + """*Optional*. For 'text_link' only, url that will be opened after user taps on the text""" user: Optional[User] = None - """For 'text_mention' only, the mentioned user""" + """*Optional*. For 'text_mention' only, the mentioned user""" language: Optional[str] = None - """For 'pre' only, the programming language of the entity text""" + """*Optional*. For 'pre' only, the programming language of the entity text""" diff --git a/aiogram/types/order_info.py b/aiogram/types/order_info.py index f96bc4cc..5283a967 100644 --- a/aiogram/types/order_info.py +++ b/aiogram/types/order_info.py @@ -16,10 +16,10 @@ class OrderInfo(TelegramObject): """ name: Optional[str] = None - """User name""" + """*Optional*. User name""" phone_number: Optional[str] = None - """User's phone number""" + """*Optional*. User's phone number""" email: Optional[str] = None - """User email""" + """*Optional*. User email""" shipping_address: Optional[ShippingAddress] = None - """User shipping address""" + """*Optional*. User shipping address""" diff --git a/aiogram/types/passport_data.py b/aiogram/types/passport_data.py index da625263..028334b2 100644 --- a/aiogram/types/passport_data.py +++ b/aiogram/types/passport_data.py @@ -17,7 +17,6 @@ class PassportData(TelegramObject): """ data: List[EncryptedPassportElement] - """Array with information about documents and other Telegram Passport elements that was shared - with the bot""" + """Array with information about documents and other Telegram Passport elements that was shared with the bot""" credentials: EncryptedCredentials """Encrypted credentials required to decrypt the data""" diff --git a/aiogram/types/passport_element_error.py b/aiogram/types/passport_element_error.py index 691cc348..36a1db86 100644 --- a/aiogram/types/passport_element_error.py +++ b/aiogram/types/passport_element_error.py @@ -5,17 +5,17 @@ from .base import MutableTelegramObject class PassportElementError(MutableTelegramObject): """ - This object represents an error in the Telegram Passport element which was submitted that - should be resolved by the user. It should be one of: - - PassportElementErrorDataField - - PassportElementErrorFrontSide - - PassportElementErrorReverseSide - - PassportElementErrorSelfie - - PassportElementErrorFile - - PassportElementErrorFiles - - PassportElementErrorTranslationFile - - PassportElementErrorTranslationFiles - - PassportElementErrorUnspecified + This object represents an error in the Telegram Passport element which was submitted that should be resolved by the user. It should be one of: + + - :class:`aiogram.types.passport_element_error_data_field.PassportElementErrorDataField` + - :class:`aiogram.types.passport_element_error_front_side.PassportElementErrorFrontSide` + - :class:`aiogram.types.passport_element_error_reverse_side.PassportElementErrorReverseSide` + - :class:`aiogram.types.passport_element_error_selfie.PassportElementErrorSelfie` + - :class:`aiogram.types.passport_element_error_file.PassportElementErrorFile` + - :class:`aiogram.types.passport_element_error_files.PassportElementErrorFiles` + - :class:`aiogram.types.passport_element_error_translation_file.PassportElementErrorTranslationFile` + - :class:`aiogram.types.passport_element_error_translation_files.PassportElementErrorTranslationFiles` + - :class:`aiogram.types.passport_element_error_unspecified.PassportElementErrorUnspecified` Source: https://core.telegram.org/bots/api#passportelementerror """ diff --git a/aiogram/types/passport_element_error_data_field.py b/aiogram/types/passport_element_error_data_field.py index 41dcc790..f5b0b67b 100644 --- a/aiogram/types/passport_element_error_data_field.py +++ b/aiogram/types/passport_element_error_data_field.py @@ -7,17 +7,15 @@ from .passport_element_error import PassportElementError class PassportElementErrorDataField(PassportElementError): """ - Represents an issue in one of the data fields that was provided by the user. The error is - considered resolved when the field's value changes. + Represents an issue in one of the data fields that was provided by the user. The error is considered resolved when the field's value changes. Source: https://core.telegram.org/bots/api#passportelementerrordatafield """ source: str = Field("data", const=True) - """Error source, must be data""" + """Error source, must be *data*""" type: str - """The section of the user's Telegram Passport which has the error, one of 'personal_details', - 'passport', 'driver_license', 'identity_card', 'internal_passport', 'address'""" + """The section of the user's Telegram Passport which has the error, one of 'personal_details', 'passport', 'driver_license', 'identity_card', 'internal_passport', 'address'""" field_name: str """Name of the data field which has the error""" data_hash: str diff --git a/aiogram/types/passport_element_error_file.py b/aiogram/types/passport_element_error_file.py index 90e4ffd5..217deaaa 100644 --- a/aiogram/types/passport_element_error_file.py +++ b/aiogram/types/passport_element_error_file.py @@ -7,17 +7,15 @@ from .passport_element_error import PassportElementError class PassportElementErrorFile(PassportElementError): """ - Represents an issue with a document scan. The error is considered resolved when the file with - the document scan changes. + Represents an issue with a document scan. The error is considered resolved when the file with the document scan changes. Source: https://core.telegram.org/bots/api#passportelementerrorfile """ source: str = Field("file", const=True) - """Error source, must be file""" + """Error source, must be *file*""" type: str - """The section of the user's Telegram Passport which has the issue, one of 'utility_bill', - 'bank_statement', 'rental_agreement', 'passport_registration', 'temporary_registration'""" + """The section of the user's Telegram Passport which has the issue, one of 'utility_bill', 'bank_statement', 'rental_agreement', 'passport_registration', 'temporary_registration'""" file_hash: str """Base64-encoded file hash""" message: str diff --git a/aiogram/types/passport_element_error_files.py b/aiogram/types/passport_element_error_files.py index 83507e2a..6f42d693 100644 --- a/aiogram/types/passport_element_error_files.py +++ b/aiogram/types/passport_element_error_files.py @@ -9,17 +9,15 @@ from .passport_element_error import PassportElementError class PassportElementErrorFiles(PassportElementError): """ - Represents an issue with a list of scans. The error is considered resolved when the list of - files containing the scans changes. + Represents an issue with a list of scans. The error is considered resolved when the list of files containing the scans changes. Source: https://core.telegram.org/bots/api#passportelementerrorfiles """ source: str = Field("files", const=True) - """Error source, must be files""" + """Error source, must be *files*""" type: str - """The section of the user's Telegram Passport which has the issue, one of 'utility_bill', - 'bank_statement', 'rental_agreement', 'passport_registration', 'temporary_registration'""" + """The section of the user's Telegram Passport which has the issue, one of 'utility_bill', 'bank_statement', 'rental_agreement', 'passport_registration', 'temporary_registration'""" file_hashes: List[str] """List of base64-encoded file hashes""" message: str diff --git a/aiogram/types/passport_element_error_front_side.py b/aiogram/types/passport_element_error_front_side.py index 6c8d40d6..98e60acd 100644 --- a/aiogram/types/passport_element_error_front_side.py +++ b/aiogram/types/passport_element_error_front_side.py @@ -7,17 +7,15 @@ from .passport_element_error import PassportElementError class PassportElementErrorFrontSide(PassportElementError): """ - Represents an issue with the front side of a document. The error is considered resolved when - the file with the front side of the document changes. + Represents an issue with the front side of a document. The error is considered resolved when the file with the front side of the document changes. Source: https://core.telegram.org/bots/api#passportelementerrorfrontside """ source: str = Field("front_side", const=True) - """Error source, must be front_side""" + """Error source, must be *front_side*""" type: str - """The section of the user's Telegram Passport which has the issue, one of 'passport', - 'driver_license', 'identity_card', 'internal_passport'""" + """The section of the user's Telegram Passport which has the issue, one of 'passport', 'driver_license', 'identity_card', 'internal_passport'""" file_hash: str """Base64-encoded hash of the file with the front side of the document""" message: str diff --git a/aiogram/types/passport_element_error_reverse_side.py b/aiogram/types/passport_element_error_reverse_side.py index abcb7739..0c6073ba 100644 --- a/aiogram/types/passport_element_error_reverse_side.py +++ b/aiogram/types/passport_element_error_reverse_side.py @@ -7,17 +7,15 @@ from .passport_element_error import PassportElementError class PassportElementErrorReverseSide(PassportElementError): """ - Represents an issue with the reverse side of a document. The error is considered resolved when - the file with reverse side of the document changes. + Represents an issue with the reverse side of a document. The error is considered resolved when the file with reverse side of the document changes. Source: https://core.telegram.org/bots/api#passportelementerrorreverseside """ source: str = Field("reverse_side", const=True) - """Error source, must be reverse_side""" + """Error source, must be *reverse_side*""" type: str - """The section of the user's Telegram Passport which has the issue, one of 'driver_license', - 'identity_card'""" + """The section of the user's Telegram Passport which has the issue, one of 'driver_license', 'identity_card'""" file_hash: str """Base64-encoded hash of the file with the reverse side of the document""" message: str diff --git a/aiogram/types/passport_element_error_selfie.py b/aiogram/types/passport_element_error_selfie.py index 772d2880..4a3b2fe1 100644 --- a/aiogram/types/passport_element_error_selfie.py +++ b/aiogram/types/passport_element_error_selfie.py @@ -7,17 +7,15 @@ from .passport_element_error import PassportElementError class PassportElementErrorSelfie(PassportElementError): """ - Represents an issue with the selfie with a document. The error is considered resolved when the - file with the selfie changes. + Represents an issue with the selfie with a document. The error is considered resolved when the file with the selfie changes. Source: https://core.telegram.org/bots/api#passportelementerrorselfie """ source: str = Field("selfie", const=True) - """Error source, must be selfie""" + """Error source, must be *selfie*""" type: str - """The section of the user's Telegram Passport which has the issue, one of 'passport', - 'driver_license', 'identity_card', 'internal_passport'""" + """The section of the user's Telegram Passport which has the issue, one of 'passport', 'driver_license', 'identity_card', 'internal_passport'""" file_hash: str """Base64-encoded hash of the file with the selfie""" message: str diff --git a/aiogram/types/passport_element_error_translation_file.py b/aiogram/types/passport_element_error_translation_file.py index a9d952e2..d4106453 100644 --- a/aiogram/types/passport_element_error_translation_file.py +++ b/aiogram/types/passport_element_error_translation_file.py @@ -7,18 +7,15 @@ from .passport_element_error import PassportElementError class PassportElementErrorTranslationFile(PassportElementError): """ - Represents an issue with one of the files that constitute the translation of a document. The - error is considered resolved when the file changes. + Represents an issue with one of the files that constitute the translation of a document. The error is considered resolved when the file changes. Source: https://core.telegram.org/bots/api#passportelementerrortranslationfile """ source: str = Field("translation_file", const=True) - """Error source, must be translation_file""" + """Error source, must be *translation_file*""" type: str - """Type of element of the user's Telegram Passport which has the issue, one of 'passport', - 'driver_license', 'identity_card', 'internal_passport', 'utility_bill', 'bank_statement', - 'rental_agreement', 'passport_registration', 'temporary_registration'""" + """Type of element of the user's Telegram Passport which has the issue, one of 'passport', 'driver_license', 'identity_card', 'internal_passport', 'utility_bill', 'bank_statement', 'rental_agreement', 'passport_registration', 'temporary_registration'""" file_hash: str """Base64-encoded file hash""" message: str diff --git a/aiogram/types/passport_element_error_translation_files.py b/aiogram/types/passport_element_error_translation_files.py index 06d90f59..df0db64f 100644 --- a/aiogram/types/passport_element_error_translation_files.py +++ b/aiogram/types/passport_element_error_translation_files.py @@ -9,18 +9,15 @@ from .passport_element_error import PassportElementError class PassportElementErrorTranslationFiles(PassportElementError): """ - Represents an issue with the translated version of a document. The error is considered - resolved when a file with the document translation change. + Represents an issue with the translated version of a document. The error is considered resolved when a file with the document translation change. Source: https://core.telegram.org/bots/api#passportelementerrortranslationfiles """ source: str = Field("translation_files", const=True) - """Error source, must be translation_files""" + """Error source, must be *translation_files*""" type: str - """Type of element of the user's Telegram Passport which has the issue, one of 'passport', - 'driver_license', 'identity_card', 'internal_passport', 'utility_bill', 'bank_statement', - 'rental_agreement', 'passport_registration', 'temporary_registration'""" + """Type of element of the user's Telegram Passport which has the issue, one of 'passport', 'driver_license', 'identity_card', 'internal_passport', 'utility_bill', 'bank_statement', 'rental_agreement', 'passport_registration', 'temporary_registration'""" file_hashes: List[str] """List of base64-encoded file hashes""" message: str diff --git a/aiogram/types/passport_element_error_unspecified.py b/aiogram/types/passport_element_error_unspecified.py index cdccba7d..39d0c417 100644 --- a/aiogram/types/passport_element_error_unspecified.py +++ b/aiogram/types/passport_element_error_unspecified.py @@ -7,14 +7,13 @@ from .passport_element_error import PassportElementError class PassportElementErrorUnspecified(PassportElementError): """ - Represents an issue in an unspecified place. The error is considered resolved when new data is - added. + Represents an issue in an unspecified place. The error is considered resolved when new data is added. Source: https://core.telegram.org/bots/api#passportelementerrorunspecified """ source: str = Field("unspecified", const=True) - """Error source, must be unspecified""" + """Error source, must be *unspecified*""" type: str """Type of element of the user's Telegram Passport which has the issue""" element_hash: str diff --git a/aiogram/types/passport_file.py b/aiogram/types/passport_file.py index 9b7185f2..4ec8b6ec 100644 --- a/aiogram/types/passport_file.py +++ b/aiogram/types/passport_file.py @@ -5,8 +5,7 @@ from .base import TelegramObject class PassportFile(TelegramObject): """ - This object represents a file uploaded to Telegram Passport. Currently all Telegram Passport - files are in JPEG format when decrypted and don't exceed 10MB. + This object represents a file uploaded to Telegram Passport. Currently all Telegram Passport files are in JPEG format when decrypted and don't exceed 10MB. Source: https://core.telegram.org/bots/api#passportfile """ @@ -14,8 +13,7 @@ class PassportFile(TelegramObject): file_id: str """Identifier for this file, which can be used to download or reuse the file""" file_unique_id: str - """Unique identifier for this file, which is supposed to be the same over time and for - different bots. Can't be used to download or reuse the file.""" + """Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.""" file_size: int """File size""" file_date: int diff --git a/aiogram/types/photo_size.py b/aiogram/types/photo_size.py index 7aeb89fd..2bc2e5b1 100644 --- a/aiogram/types/photo_size.py +++ b/aiogram/types/photo_size.py @@ -7,7 +7,7 @@ from .base import TelegramObject class PhotoSize(TelegramObject): """ - This object represents one size of a photo or a file / sticker thumbnail. + This object represents one size of a photo or a `file `_ / :class:`aiogram.methods.sticker.Sticker` thumbnail. Source: https://core.telegram.org/bots/api#photosize """ @@ -15,11 +15,10 @@ class PhotoSize(TelegramObject): file_id: str """Identifier for this file, which can be used to download or reuse the file""" file_unique_id: str - """Unique identifier for this file, which is supposed to be the same over time and for - different bots. Can't be used to download or reuse the file.""" + """Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.""" width: int """Photo width""" height: int """Photo height""" file_size: Optional[int] = None - """File size""" + """*Optional*. File size""" diff --git a/aiogram/types/poll.py b/aiogram/types/poll.py index c19808fc..bcb80085 100644 --- a/aiogram/types/poll.py +++ b/aiogram/types/poll.py @@ -20,7 +20,7 @@ class Poll(TelegramObject): id: str """Unique poll identifier""" question: str - """Poll question, 1-255 characters""" + """Poll question, 1-300 characters""" options: List[PollOption] """List of poll options""" total_voter_count: int @@ -34,15 +34,12 @@ class Poll(TelegramObject): allows_multiple_answers: bool """True, if the poll allows multiple answers""" correct_option_id: Optional[int] = None - """0-based identifier of the correct answer option. Available only for polls in the quiz mode, - which are closed, or was sent (not forwarded) by the bot or to the private chat with the - bot.""" + """*Optional*. 0-based identifier of the correct answer option. Available only for polls in the quiz mode, which are closed, or was sent (not forwarded) by the bot or to the private chat with the bot.""" explanation: Optional[str] = None - """Text that is shown when a user chooses an incorrect answer or taps on the lamp icon in a - quiz-style poll, 0-200 characters""" + """*Optional*. Text that is shown when a user chooses an incorrect answer or taps on the lamp icon in a quiz-style poll, 0-200 characters""" explanation_entities: Optional[List[MessageEntity]] = None - """Special entities like usernames, URLs, bot commands, etc. that appear in the explanation""" + """*Optional*. Special entities like usernames, URLs, bot commands, etc. that appear in the *explanation*""" open_period: Optional[int] = None - """Amount of time in seconds the poll will be active after creation""" + """*Optional*. Amount of time in seconds the poll will be active after creation""" close_date: Optional[Union[datetime.datetime, datetime.timedelta, int]] = None - """Point in time (Unix timestamp) when the poll will be automatically closed""" + """*Optional*. Point in time (Unix timestamp) when the poll will be automatically closed""" diff --git a/aiogram/types/poll_answer.py b/aiogram/types/poll_answer.py index a0498019..2f394451 100644 --- a/aiogram/types/poll_answer.py +++ b/aiogram/types/poll_answer.py @@ -20,5 +20,4 @@ class PollAnswer(TelegramObject): user: User """The user, who changed the answer to the poll""" option_ids: List[int] - """0-based identifiers of answer options, chosen by the user. May be empty if the user - retracted their vote.""" + """0-based identifiers of answer options, chosen by the user. May be empty if the user retracted their vote.""" diff --git a/aiogram/types/pre_checkout_query.py b/aiogram/types/pre_checkout_query.py index e99f4378..fdac4033 100644 --- a/aiogram/types/pre_checkout_query.py +++ b/aiogram/types/pre_checkout_query.py @@ -7,9 +7,9 @@ from pydantic import Field from .base import TelegramObject if TYPE_CHECKING: # pragma: no cover + from ..methods import AnswerPreCheckoutQuery from .order_info import OrderInfo from .user import User - from ..methods import AnswerPreCheckoutQuery class PreCheckoutQuery(TelegramObject): @@ -24,18 +24,15 @@ class PreCheckoutQuery(TelegramObject): from_user: User = Field(..., alias="from") """User who sent the query""" currency: str - """Three-letter ISO 4217 currency code""" + """Three-letter ISO 4217 `currency `_ code""" total_amount: int - """Total price in the smallest units of the currency (integer, not float/double). For example, - for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it - shows the number of digits past the decimal point for each currency (2 for the majority of - currencies).""" + """Total price in the *smallest units* of the currency (integer, **not** float/double). For example, for a price of :code:`US$ 1.45` pass :code:`amount = 145`. See the *exp* parameter in `currencies.json `_, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies).""" invoice_payload: str """Bot specified invoice payload""" shipping_option_id: Optional[str] = None - """Identifier of the shipping option chosen by the user""" + """*Optional*. Identifier of the shipping option chosen by the user""" order_info: Optional[OrderInfo] = None - """Order info provided by the user""" + """*Optional*. Order info provided by the user""" def answer(self, ok: bool, error_message: Optional[str] = None) -> AnswerPreCheckoutQuery: """ @@ -46,5 +43,7 @@ class PreCheckoutQuery(TelegramObject): from ..methods import AnswerPreCheckoutQuery return AnswerPreCheckoutQuery( - pre_checkout_query_id=self.id, ok=ok, error_message=error_message, + pre_checkout_query_id=self.id, + ok=ok, + error_message=error_message, ) diff --git a/aiogram/types/proximity_alert_triggered.py b/aiogram/types/proximity_alert_triggered.py index 7ff1ae9d..95b707ec 100644 --- a/aiogram/types/proximity_alert_triggered.py +++ b/aiogram/types/proximity_alert_triggered.py @@ -10,8 +10,7 @@ if TYPE_CHECKING: # pragma: no cover class ProximityAlertTriggered(TelegramObject): """ - This object represents the content of a service message, sent whenever a user in the chat - triggers a proximity alert set by another user. + This object represents the content of a service message, sent whenever a user in the chat triggers a proximity alert set by another user. Source: https://core.telegram.org/bots/api#proximityalerttriggered """ diff --git a/aiogram/types/reply_keyboard_markup.py b/aiogram/types/reply_keyboard_markup.py index 5d30cc9b..33c364d0 100644 --- a/aiogram/types/reply_keyboard_markup.py +++ b/aiogram/types/reply_keyboard_markup.py @@ -10,24 +10,16 @@ if TYPE_CHECKING: # pragma: no cover class ReplyKeyboardMarkup(MutableTelegramObject): """ - This object represents a custom keyboard with reply options (see Introduction to bots for - details and examples). + This object represents a `custom keyboard `_ with reply options (see `Introduction to bots `_ for details and examples). Source: https://core.telegram.org/bots/api#replykeyboardmarkup """ keyboard: List[List[KeyboardButton]] - """Array of button rows, each represented by an Array of KeyboardButton objects""" + """Array of button rows, each represented by an Array of :class:`aiogram.types.keyboard_button.KeyboardButton` objects""" resize_keyboard: Optional[bool] = None - """Requests clients to resize the keyboard vertically for optimal fit (e.g., make the keyboard - smaller if there are just two rows of buttons). Defaults to false, in which case the custom - keyboard is always of the same height as the app's standard keyboard.""" + """*Optional*. Requests clients to resize the keyboard vertically for optimal fit (e.g., make the keyboard smaller if there are just two rows of buttons). Defaults to *false*, in which case the custom keyboard is always of the same height as the app's standard keyboard.""" one_time_keyboard: Optional[bool] = None - """Requests clients to hide the keyboard as soon as it's been used. The keyboard will still be - available, but clients will automatically display the usual letter-keyboard in the chat – - the user can press a special button in the input field to see the custom keyboard again. - Defaults to false.""" + """*Optional*. Requests clients to hide the keyboard as soon as it's been used. The keyboard will still be available, but clients will automatically display the usual letter-keyboard in the chat – the user can press a special button in the input field to see the custom keyboard again. Defaults to *false*.""" selective: Optional[bool] = None - """Use this parameter if you want to show the keyboard to specific users only. Targets: 1) - users that are @mentioned in the text of the Message object; 2) if the bot's message is a - reply (has reply_to_message_id), sender of the original message.""" + """*Optional*. Use this parameter if you want to show the keyboard to specific users only. Targets: 1) users that are @mentioned in the *text* of the :class:`aiogram.types.message.Message` object; 2) if the bot's message is a reply (has *reply_to_message_id*), sender of the original message.""" diff --git a/aiogram/types/reply_keyboard_remove.py b/aiogram/types/reply_keyboard_remove.py index ae092d94..c5ca6bda 100644 --- a/aiogram/types/reply_keyboard_remove.py +++ b/aiogram/types/reply_keyboard_remove.py @@ -7,19 +7,12 @@ from .base import MutableTelegramObject class ReplyKeyboardRemove(MutableTelegramObject): """ - Upon receiving a message with this object, Telegram clients will remove the current custom - keyboard and display the default letter-keyboard. By default, custom keyboards are displayed - until a new keyboard is sent by a bot. An exception is made for one-time keyboards that are - hidden immediately after the user presses a button (see ReplyKeyboardMarkup). + Upon receiving a message with this object, Telegram clients will remove the current custom keyboard and display the default letter-keyboard. By default, custom keyboards are displayed until a new keyboard is sent by a bot. An exception is made for one-time keyboards that are hidden immediately after the user presses a button (see :class:`aiogram.types.reply_keyboard_markup.ReplyKeyboardMarkup`). Source: https://core.telegram.org/bots/api#replykeyboardremove """ - remove_keyboard: bool = True - """Requests clients to remove the custom keyboard (user will not be able to summon this - keyboard; if you want to hide the keyboard from sight but keep it accessible, use - one_time_keyboard in ReplyKeyboardMarkup)""" + remove_keyboard: bool + """Requests clients to remove the custom keyboard (user will not be able to summon this keyboard; if you want to hide the keyboard from sight but keep it accessible, use *one_time_keyboard* in :class:`aiogram.types.reply_keyboard_markup.ReplyKeyboardMarkup`)""" selective: Optional[bool] = None - """Use this parameter if you want to remove the keyboard for specific users only. Targets: 1) - users that are @mentioned in the text of the Message object; 2) if the bot's message is a - reply (has reply_to_message_id), sender of the original message.""" + """*Optional*. Use this parameter if you want to remove the keyboard for specific users only. Targets: 1) users that are @mentioned in the *text* of the :class:`aiogram.types.message.Message` object; 2) if the bot's message is a reply (has *reply_to_message_id*), sender of the original message.""" diff --git a/aiogram/types/response_parameters.py b/aiogram/types/response_parameters.py index 2e1e4eb8..8bfb3cf5 100644 --- a/aiogram/types/response_parameters.py +++ b/aiogram/types/response_parameters.py @@ -13,10 +13,6 @@ class ResponseParameters(TelegramObject): """ migrate_to_chat_id: Optional[int] = None - """The group has been migrated to a supergroup with the specified identifier. This number may - be greater than 32 bits and some programming languages may have difficulty/silent defects - in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or - double-precision float type are safe for storing this identifier.""" + """*Optional*. The group has been migrated to a supergroup with the specified identifier. This number may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier.""" retry_after: Optional[int] = None - """In case of exceeding flood control, the number of seconds left to wait before the request - can be repeated""" + """*Optional*. In case of exceeding flood control, the number of seconds left to wait before the request can be repeated""" diff --git a/aiogram/types/shipping_query.py b/aiogram/types/shipping_query.py index b8228ce1..8e2d2a31 100644 --- a/aiogram/types/shipping_query.py +++ b/aiogram/types/shipping_query.py @@ -7,10 +7,10 @@ from pydantic import Field from .base import TelegramObject if TYPE_CHECKING: # pragma: no cover - from .shipping_address import ShippingAddress - from .user import User from ..methods import AnswerShippingQuery from ..types import ShippingOption + from .shipping_address import ShippingAddress + from .user import User class ShippingQuery(TelegramObject): diff --git a/aiogram/types/sticker.py b/aiogram/types/sticker.py index 23d22bfc..ad5486b4 100644 --- a/aiogram/types/sticker.py +++ b/aiogram/types/sticker.py @@ -19,21 +19,20 @@ class Sticker(TelegramObject): file_id: str """Identifier for this file, which can be used to download or reuse the file""" file_unique_id: str - """Unique identifier for this file, which is supposed to be the same over time and for - different bots. Can't be used to download or reuse the file.""" + """Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.""" width: int """Sticker width""" height: int """Sticker height""" is_animated: bool - """True, if the sticker is animated""" + """:code:`True`, if the sticker is `animated `_""" thumb: Optional[PhotoSize] = None - """Sticker thumbnail in the .WEBP or .JPG format""" + """*Optional*. Sticker thumbnail in the .WEBP or .JPG format""" emoji: Optional[str] = None - """Emoji associated with the sticker""" + """*Optional*. Emoji associated with the sticker""" set_name: Optional[str] = None - """Name of the sticker set to which the sticker belongs""" + """*Optional*. Name of the sticker set to which the sticker belongs""" mask_position: Optional[MaskPosition] = None - """For mask stickers, the position where the mask should be placed""" + """*Optional*. For mask stickers, the position where the mask should be placed""" file_size: Optional[int] = None - """File size""" + """*Optional*. File size""" diff --git a/aiogram/types/sticker_set.py b/aiogram/types/sticker_set.py index 2b9e7ab1..9132daf0 100644 --- a/aiogram/types/sticker_set.py +++ b/aiogram/types/sticker_set.py @@ -21,10 +21,10 @@ class StickerSet(TelegramObject): title: str """Sticker set title""" is_animated: bool - """True, if the sticker set contains animated stickers""" + """:code:`True`, if the sticker set contains `animated stickers `_""" contains_masks: bool - """True, if the sticker set contains masks""" + """:code:`True`, if the sticker set contains masks""" stickers: List[Sticker] """List of all set stickers""" thumb: Optional[PhotoSize] = None - """Sticker set thumbnail in the .WEBP or .TGS format""" + """*Optional*. Sticker set thumbnail in the .WEBP or .TGS format""" diff --git a/aiogram/types/successful_payment.py b/aiogram/types/successful_payment.py index d4105472..d87acf10 100644 --- a/aiogram/types/successful_payment.py +++ b/aiogram/types/successful_payment.py @@ -16,12 +16,9 @@ class SuccessfulPayment(TelegramObject): """ currency: str - """Three-letter ISO 4217 currency code""" + """Three-letter ISO 4217 `currency `_ code""" total_amount: int - """Total price in the smallest units of the currency (integer, not float/double). For example, - for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it - shows the number of digits past the decimal point for each currency (2 for the majority of - currencies).""" + """Total price in the *smallest units* of the currency (integer, **not** float/double). For example, for a price of :code:`US$ 1.45` pass :code:`amount = 145`. See the *exp* parameter in `currencies.json `_, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies).""" invoice_payload: str """Bot specified invoice payload""" telegram_payment_charge_id: str @@ -29,6 +26,6 @@ class SuccessfulPayment(TelegramObject): provider_payment_charge_id: str """Provider payment identifier""" shipping_option_id: Optional[str] = None - """Identifier of the shipping option chosen by the user""" + """*Optional*. Identifier of the shipping option chosen by the user""" order_info: Optional[OrderInfo] = None - """Order info provided by the user""" + """*Optional*. Order info provided by the user""" diff --git a/aiogram/types/update.py b/aiogram/types/update.py index 84803baa..625fce4a 100644 --- a/aiogram/types/update.py +++ b/aiogram/types/update.py @@ -17,41 +17,34 @@ if TYPE_CHECKING: # pragma: no cover class Update(TelegramObject): """ - This object represents an incoming update. - At most one of the optional parameters can be present in any given update. + This `object `_ represents an incoming update. + + At most **one** of the optional parameters can be present in any given update. Source: https://core.telegram.org/bots/api#update """ update_id: int - """The update's unique identifier. Update identifiers start from a certain positive number and - increase sequentially. This ID becomes especially handy if you're using Webhooks, since it - allows you to ignore repeated updates or to restore the correct update sequence, should - they get out of order. If there are no new updates for at least a week, then identifier of - the next update will be chosen randomly instead of sequentially.""" + """The update's unique identifier. Update identifiers start from a certain positive number and increase sequentially. This ID becomes especially handy if you're using `Webhooks `_, since it allows you to ignore repeated updates or to restore the correct update sequence, should they get out of order. If there are no new updates for at least a week, then identifier of the next update will be chosen randomly instead of sequentially.""" message: Optional[Message] = None - """New incoming message of any kind — text, photo, sticker, etc.""" + """*Optional*. New incoming message of any kind — text, photo, sticker, etc.""" edited_message: Optional[Message] = None - """New version of a message that is known to the bot and was edited""" + """*Optional*. New version of a message that is known to the bot and was edited""" channel_post: Optional[Message] = None - """New incoming channel post of any kind — text, photo, sticker, etc.""" + """*Optional*. New incoming channel post of any kind — text, photo, sticker, etc.""" edited_channel_post: Optional[Message] = None - """New version of a channel post that is known to the bot and was edited""" + """*Optional*. New version of a channel post that is known to the bot and was edited""" inline_query: Optional[InlineQuery] = None - """New incoming inline query""" + """*Optional*. New incoming `inline `_ query""" chosen_inline_result: Optional[ChosenInlineResult] = None - """The result of an inline query that was chosen by a user and sent to their chat partner. - Please see our documentation on the feedback collecting for details on how to enable these - updates for your bot.""" + """*Optional*. The result of an `inline `_ query that was chosen by a user and sent to their chat partner. Please see our documentation on the `feedback collecting `_ for details on how to enable these updates for your bot.""" callback_query: Optional[CallbackQuery] = None - """New incoming callback query""" + """*Optional*. New incoming callback query""" shipping_query: Optional[ShippingQuery] = None - """New incoming shipping query. Only for invoices with flexible price""" + """*Optional*. New incoming shipping query. Only for invoices with flexible price""" pre_checkout_query: Optional[PreCheckoutQuery] = None - """New incoming pre-checkout query. Contains full information about checkout""" + """*Optional*. New incoming pre-checkout query. Contains full information about checkout""" poll: Optional[Poll] = None - """New poll state. Bots receive only updates about stopped polls and polls, which are sent by - the bot""" + """*Optional*. New poll state. Bots receive only updates about stopped polls and polls, which are sent by the bot""" poll_answer: Optional[PollAnswer] = None - """A user changed their answer in a non-anonymous poll. Bots receive new votes only in polls - that were sent by the bot itself.""" + """*Optional*. A user changed their answer in a non-anonymous poll. Bots receive new votes only in polls that were sent by the bot itself.""" diff --git a/aiogram/types/user.py b/aiogram/types/user.py index 15c87c12..7f687e17 100644 --- a/aiogram/types/user.py +++ b/aiogram/types/user.py @@ -19,17 +19,17 @@ class User(TelegramObject): first_name: str """User's or bot's first name""" last_name: Optional[str] = None - """User's or bot's last name""" + """*Optional*. User's or bot's last name""" username: Optional[str] = None - """User's or bot's username""" + """*Optional*. User's or bot's username""" language_code: Optional[str] = None - """IETF language tag of the user's language""" + """*Optional*. `IETF language tag `_ of the user's language""" can_join_groups: Optional[bool] = None - """True, if the bot can be invited to groups. Returned only in getMe.""" + """*Optional*. True, if the bot can be invited to groups. Returned only in :class:`aiogram.methods.get_me.GetMe`.""" can_read_all_group_messages: Optional[bool] = None - """True, if privacy mode is disabled for the bot. Returned only in getMe.""" + """*Optional*. True, if `privacy mode `_ is disabled for the bot. Returned only in :class:`aiogram.methods.get_me.GetMe`.""" supports_inline_queries: Optional[bool] = None - """True, if the bot supports inline queries. Returned only in getMe.""" + """*Optional*. True, if the bot supports inline queries. Returned only in :class:`aiogram.methods.get_me.GetMe`.""" @property def full_name(self) -> str: diff --git a/aiogram/types/venue.py b/aiogram/types/venue.py index 08ff1c34..8641ec0d 100644 --- a/aiogram/types/venue.py +++ b/aiogram/types/venue.py @@ -22,11 +22,10 @@ class Venue(TelegramObject): address: str """Address of the venue""" foursquare_id: Optional[str] = None - """Foursquare identifier of the venue""" + """*Optional*. Foursquare identifier of the venue""" foursquare_type: Optional[str] = None - """Foursquare type of the venue. (For example, 'arts_entertainment/default', - 'arts_entertainment/aquarium' or 'food/icecream'.)""" + """*Optional*. Foursquare type of the venue. (For example, 'arts_entertainment/default', 'arts_entertainment/aquarium' or 'food/icecream'.)""" google_place_id: Optional[str] = None - """Google Places identifier of the venue""" + """*Optional*. Google Places identifier of the venue""" google_place_type: Optional[str] = None - """Google Places type of the venue. (See supported types.)""" + """*Optional*. Google Places type of the venue. (See `supported types `_.)""" diff --git a/aiogram/types/video.py b/aiogram/types/video.py index 5c731ab1..151abc58 100644 --- a/aiogram/types/video.py +++ b/aiogram/types/video.py @@ -18,8 +18,7 @@ class Video(TelegramObject): file_id: str """Identifier for this file, which can be used to download or reuse the file""" file_unique_id: str - """Unique identifier for this file, which is supposed to be the same over time and for - different bots. Can't be used to download or reuse the file.""" + """Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.""" width: int """Video width as defined by sender""" height: int @@ -27,10 +26,10 @@ class Video(TelegramObject): duration: int """Duration of the video in seconds as defined by sender""" thumb: Optional[PhotoSize] = None - """Video thumbnail""" + """*Optional*. Video thumbnail""" file_name: Optional[str] = None - """Original filename as defined by sender""" + """*Optional*. Original filename as defined by sender""" mime_type: Optional[str] = None - """Mime type of a file as defined by sender""" + """*Optional*. Mime type of a file as defined by sender""" file_size: Optional[int] = None - """File size""" + """*Optional*. File size""" diff --git a/aiogram/types/video_note.py b/aiogram/types/video_note.py index b33baa39..99f0dd47 100644 --- a/aiogram/types/video_note.py +++ b/aiogram/types/video_note.py @@ -10,7 +10,7 @@ if TYPE_CHECKING: # pragma: no cover class VideoNote(TelegramObject): """ - This object represents a video message (available in Telegram apps as of v.4.0). + This object represents a `video message `_ (available in Telegram apps as of `v.4.0 `_). Source: https://core.telegram.org/bots/api#videonote """ @@ -18,13 +18,12 @@ class VideoNote(TelegramObject): file_id: str """Identifier for this file, which can be used to download or reuse the file""" file_unique_id: str - """Unique identifier for this file, which is supposed to be the same over time and for - different bots. Can't be used to download or reuse the file.""" + """Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.""" length: int """Video width and height (diameter of the video message) as defined by sender""" duration: int """Duration of the video in seconds as defined by sender""" thumb: Optional[PhotoSize] = None - """Video thumbnail""" + """*Optional*. Video thumbnail""" file_size: Optional[int] = None - """File size""" + """*Optional*. File size""" diff --git a/aiogram/types/voice.py b/aiogram/types/voice.py index 52e5bb71..79fd8d6f 100644 --- a/aiogram/types/voice.py +++ b/aiogram/types/voice.py @@ -15,11 +15,10 @@ class Voice(TelegramObject): file_id: str """Identifier for this file, which can be used to download or reuse the file""" file_unique_id: str - """Unique identifier for this file, which is supposed to be the same over time and for - different bots. Can't be used to download or reuse the file.""" + """Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.""" duration: int """Duration of the audio in seconds as defined by sender""" mime_type: Optional[str] = None - """MIME type of the file as defined by sender""" + """*Optional*. MIME type of the file as defined by sender""" file_size: Optional[int] = None - """File size""" + """*Optional*. File size""" diff --git a/aiogram/types/webhook_info.py b/aiogram/types/webhook_info.py index a1ee8847..24a9844e 100644 --- a/aiogram/types/webhook_info.py +++ b/aiogram/types/webhook_info.py @@ -19,14 +19,12 @@ class WebhookInfo(TelegramObject): pending_update_count: int """Number of updates awaiting delivery""" ip_address: Optional[str] = None - """Currently used webhook IP address""" + """*Optional*. Currently used webhook IP address""" last_error_date: Optional[int] = None - """Unix time for the most recent error that happened when trying to deliver an update via - webhook""" + """*Optional*. Unix time for the most recent error that happened when trying to deliver an update via webhook""" last_error_message: Optional[str] = None - """Error message in human-readable format for the most recent error that happened when trying - to deliver an update via webhook""" + """*Optional*. Error message in human-readable format for the most recent error that happened when trying to deliver an update via webhook""" max_connections: Optional[int] = None - """Maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery""" + """*Optional*. Maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery""" allowed_updates: Optional[List[str]] = None - """A list of update types the bot is subscribed to. Defaults to all update types""" + """*Optional*. A list of update types the bot is subscribed to. Defaults to all update types""" diff --git a/aiogram/utils/helper.py b/aiogram/utils/helper.py index 57f4e76e..3ceff6aa 100644 --- a/aiogram/utils/helper.py +++ b/aiogram/utils/helper.py @@ -263,7 +263,10 @@ class Default(Generic[T]): __slots__ = "fget", "_descriptor_instances" def __init__( - self, default: Optional[T] = None, *, fget: Optional[Callable[[Any], T]] = None, + self, + default: Optional[T] = None, + *, + fget: Optional[Callable[[Any], T]] = None, ) -> None: self.fget = fget or (lambda _: cast(T, default)) self._descriptor_instances = WeakKeyDictionary() # type: ignore diff --git a/docs2/api/methods/add_sticker_to_set.rst b/docs2/api/methods/add_sticker_to_set.rst index 94fbe6c0..32cec35c 100644 --- a/docs2/api/methods/add_sticker_to_set.rst +++ b/docs2/api/methods/add_sticker_to_set.rst @@ -2,14 +2,11 @@ addStickerToSet ############### -Use this method to add a new sticker to a set created by the bot. You must use exactly one of the fields png_sticker or tgs_sticker. Animated stickers can be added to animated sticker sets and only to them. Animated sticker sets can have up to 50 stickers. Static sticker sets can have up to 120 stickers. Returns True on success. - Returns: :obj:`bool` .. automodule:: aiogram.methods.add_sticker_to_set :members: :member-order: bysource - :special-members: __init__ :undoc-members: True @@ -29,27 +26,26 @@ Method as object Imports: -- :code:`from aiogram.methods import AddStickerToSet` -- :code:`from aiogram.methods import AddStickerToSet` - :code:`from aiogram.methods.add_sticker_to_set import AddStickerToSet` +- alias: :code:`from aiogram.methods import AddStickerToSet` In handlers with current bot ---------------------------- -.. code-block:: +.. code-block:: python result: bool = await AddStickerToSet(...) With specific bot ~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python result: bool = await bot(AddStickerToSet(...)) As reply into Webhook in handler ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python return AddStickerToSet(...) \ No newline at end of file diff --git a/docs2/api/methods/answer_callback_query.rst b/docs2/api/methods/answer_callback_query.rst index 25c35234..f0afd844 100644 --- a/docs2/api/methods/answer_callback_query.rst +++ b/docs2/api/methods/answer_callback_query.rst @@ -2,16 +2,11 @@ answerCallbackQuery ################### -Use this method to send answers to callback queries sent from inline keyboards. The answer will be displayed to the user as a notification at the top of the chat screen or as an alert. On success, True is returned. - -Alternatively, the user can be redirected to the specified Game URL. For this option to work, you must first create a game for your bot via @Botfather and accept the terms. Otherwise, you may use links like t.me/your_bot?start=XXXX that open your bot with a parameter. - Returns: :obj:`bool` .. automodule:: aiogram.methods.answer_callback_query :members: :member-order: bysource - :special-members: __init__ :undoc-members: True @@ -31,27 +26,26 @@ Method as object Imports: -- :code:`from aiogram.methods import AnswerCallbackQuery` -- :code:`from aiogram.methods import AnswerCallbackQuery` - :code:`from aiogram.methods.answer_callback_query import AnswerCallbackQuery` +- alias: :code:`from aiogram.methods import AnswerCallbackQuery` In handlers with current bot ---------------------------- -.. code-block:: +.. code-block:: python result: bool = await AnswerCallbackQuery(...) With specific bot ~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python result: bool = await bot(AnswerCallbackQuery(...)) As reply into Webhook in handler ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python return AnswerCallbackQuery(...) \ No newline at end of file diff --git a/docs2/api/methods/answer_inline_query.rst b/docs2/api/methods/answer_inline_query.rst index de92c682..8998eb53 100644 --- a/docs2/api/methods/answer_inline_query.rst +++ b/docs2/api/methods/answer_inline_query.rst @@ -2,16 +2,11 @@ answerInlineQuery ################# -Use this method to send answers to an inline query. On success, True is returned. - -No more than 50 results per query are allowed. - Returns: :obj:`bool` .. automodule:: aiogram.methods.answer_inline_query :members: :member-order: bysource - :special-members: __init__ :undoc-members: True @@ -31,27 +26,26 @@ Method as object Imports: -- :code:`from aiogram.methods import AnswerInlineQuery` -- :code:`from aiogram.methods import AnswerInlineQuery` - :code:`from aiogram.methods.answer_inline_query import AnswerInlineQuery` +- alias: :code:`from aiogram.methods import AnswerInlineQuery` In handlers with current bot ---------------------------- -.. code-block:: +.. code-block:: python result: bool = await AnswerInlineQuery(...) With specific bot ~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python result: bool = await bot(AnswerInlineQuery(...)) As reply into Webhook in handler ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python return AnswerInlineQuery(...) \ No newline at end of file diff --git a/docs2/api/methods/answer_pre_checkout_query.rst b/docs2/api/methods/answer_pre_checkout_query.rst index 5d92b201..d3e3c6f0 100644 --- a/docs2/api/methods/answer_pre_checkout_query.rst +++ b/docs2/api/methods/answer_pre_checkout_query.rst @@ -2,14 +2,11 @@ answerPreCheckoutQuery ###################### -Once the user has confirmed their payment and shipping details, the Bot API sends the final confirmation in the form of an Update with the field pre_checkout_query. Use this method to respond to such pre-checkout queries. On success, True is returned. Note: The Bot API must receive an answer within 10 seconds after the pre-checkout query was sent. - Returns: :obj:`bool` .. automodule:: aiogram.methods.answer_pre_checkout_query :members: :member-order: bysource - :special-members: __init__ :undoc-members: True @@ -29,27 +26,26 @@ Method as object Imports: -- :code:`from aiogram.methods import AnswerPreCheckoutQuery` -- :code:`from aiogram.methods import AnswerPreCheckoutQuery` - :code:`from aiogram.methods.answer_pre_checkout_query import AnswerPreCheckoutQuery` +- alias: :code:`from aiogram.methods import AnswerPreCheckoutQuery` In handlers with current bot ---------------------------- -.. code-block:: +.. code-block:: python result: bool = await AnswerPreCheckoutQuery(...) With specific bot ~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python result: bool = await bot(AnswerPreCheckoutQuery(...)) As reply into Webhook in handler ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python return AnswerPreCheckoutQuery(...) \ No newline at end of file diff --git a/docs2/api/methods/answer_shipping_query.rst b/docs2/api/methods/answer_shipping_query.rst index 984e2bf9..14689178 100644 --- a/docs2/api/methods/answer_shipping_query.rst +++ b/docs2/api/methods/answer_shipping_query.rst @@ -2,14 +2,11 @@ answerShippingQuery ################### -If you sent an invoice requesting a shipping address and the parameter is_flexible was specified, the Bot API will send an Update with a shipping_query field to the bot. Use this method to reply to shipping queries. On success, True is returned. - Returns: :obj:`bool` .. automodule:: aiogram.methods.answer_shipping_query :members: :member-order: bysource - :special-members: __init__ :undoc-members: True @@ -29,27 +26,26 @@ Method as object Imports: -- :code:`from aiogram.methods import AnswerShippingQuery` -- :code:`from aiogram.methods import AnswerShippingQuery` - :code:`from aiogram.methods.answer_shipping_query import AnswerShippingQuery` +- alias: :code:`from aiogram.methods import AnswerShippingQuery` In handlers with current bot ---------------------------- -.. code-block:: +.. code-block:: python result: bool = await AnswerShippingQuery(...) With specific bot ~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python result: bool = await bot(AnswerShippingQuery(...)) As reply into Webhook in handler ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python return AnswerShippingQuery(...) \ No newline at end of file diff --git a/docs2/api/methods/close.rst b/docs2/api/methods/close.rst new file mode 100644 index 00000000..8daec78d --- /dev/null +++ b/docs2/api/methods/close.rst @@ -0,0 +1,51 @@ +##### +close +##### + +Returns: :obj:`bool` + +.. automodule:: aiogram.methods.close + :members: + :member-order: bysource + :undoc-members: True + + +Usage +===== + +As bot method +------------- + +.. code-block:: + + result: bool = await bot.close(...) + + +Method as object +---------------- + +Imports: + +- :code:`from aiogram.methods.close import Close` +- alias: :code:`from aiogram.methods import Close` + +In handlers with current bot +---------------------------- + +.. code-block:: python + + result: bool = await Close(...) + +With specific bot +~~~~~~~~~~~~~~~~~ + +.. code-block:: python + + result: bool = await bot(Close(...)) + +As reply into Webhook in handler +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. code-block:: python + + return Close(...) \ No newline at end of file diff --git a/docs2/api/methods/copy_message.rst b/docs2/api/methods/copy_message.rst new file mode 100644 index 00000000..44406c3a --- /dev/null +++ b/docs2/api/methods/copy_message.rst @@ -0,0 +1,51 @@ +########### +copyMessage +########### + +Returns: :obj:`MessageId` + +.. automodule:: aiogram.methods.copy_message + :members: + :member-order: bysource + :undoc-members: True + + +Usage +===== + +As bot method +------------- + +.. code-block:: + + result: MessageId = await bot.copy_message(...) + + +Method as object +---------------- + +Imports: + +- :code:`from aiogram.methods.copy_message import CopyMessage` +- alias: :code:`from aiogram.methods import CopyMessage` + +In handlers with current bot +---------------------------- + +.. code-block:: python + + result: MessageId = await CopyMessage(...) + +With specific bot +~~~~~~~~~~~~~~~~~ + +.. code-block:: python + + result: MessageId = await bot(CopyMessage(...)) + +As reply into Webhook in handler +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. code-block:: python + + return CopyMessage(...) \ No newline at end of file diff --git a/docs2/api/methods/create_new_sticker_set.rst b/docs2/api/methods/create_new_sticker_set.rst index 6288994d..230f49fe 100644 --- a/docs2/api/methods/create_new_sticker_set.rst +++ b/docs2/api/methods/create_new_sticker_set.rst @@ -2,14 +2,11 @@ createNewStickerSet ################### -Use this method to create a new sticker set owned by a user. The bot will be able to edit the sticker set thus created. You must use exactly one of the fields png_sticker or tgs_sticker. Returns True on success. - Returns: :obj:`bool` .. automodule:: aiogram.methods.create_new_sticker_set :members: :member-order: bysource - :special-members: __init__ :undoc-members: True @@ -29,27 +26,26 @@ Method as object Imports: -- :code:`from aiogram.methods import CreateNewStickerSet` -- :code:`from aiogram.methods import CreateNewStickerSet` - :code:`from aiogram.methods.create_new_sticker_set import CreateNewStickerSet` +- alias: :code:`from aiogram.methods import CreateNewStickerSet` In handlers with current bot ---------------------------- -.. code-block:: +.. code-block:: python result: bool = await CreateNewStickerSet(...) With specific bot ~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python result: bool = await bot(CreateNewStickerSet(...)) As reply into Webhook in handler ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python return CreateNewStickerSet(...) \ No newline at end of file diff --git a/docs2/api/methods/delete_chat_photo.rst b/docs2/api/methods/delete_chat_photo.rst index bb16f363..01280b60 100644 --- a/docs2/api/methods/delete_chat_photo.rst +++ b/docs2/api/methods/delete_chat_photo.rst @@ -2,14 +2,11 @@ deleteChatPhoto ############### -Use this method to delete a chat photo. Photos can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Returns True on success. - Returns: :obj:`bool` .. automodule:: aiogram.methods.delete_chat_photo :members: :member-order: bysource - :special-members: __init__ :undoc-members: True @@ -29,27 +26,26 @@ Method as object Imports: -- :code:`from aiogram.methods import DeleteChatPhoto` -- :code:`from aiogram.methods import DeleteChatPhoto` - :code:`from aiogram.methods.delete_chat_photo import DeleteChatPhoto` +- alias: :code:`from aiogram.methods import DeleteChatPhoto` In handlers with current bot ---------------------------- -.. code-block:: +.. code-block:: python result: bool = await DeleteChatPhoto(...) With specific bot ~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python result: bool = await bot(DeleteChatPhoto(...)) As reply into Webhook in handler ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python return DeleteChatPhoto(...) \ No newline at end of file diff --git a/docs2/api/methods/delete_chat_sticker_set.rst b/docs2/api/methods/delete_chat_sticker_set.rst index a21d93fc..67a9eef0 100644 --- a/docs2/api/methods/delete_chat_sticker_set.rst +++ b/docs2/api/methods/delete_chat_sticker_set.rst @@ -2,14 +2,11 @@ deleteChatStickerSet #################### -Use this method to delete a group sticker set from a supergroup. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Use the field can_set_sticker_set optionally returned in getChat requests to check if the bot can use this method. Returns True on success. - Returns: :obj:`bool` .. automodule:: aiogram.methods.delete_chat_sticker_set :members: :member-order: bysource - :special-members: __init__ :undoc-members: True @@ -29,27 +26,26 @@ Method as object Imports: -- :code:`from aiogram.methods import DeleteChatStickerSet` -- :code:`from aiogram.methods import DeleteChatStickerSet` - :code:`from aiogram.methods.delete_chat_sticker_set import DeleteChatStickerSet` +- alias: :code:`from aiogram.methods import DeleteChatStickerSet` In handlers with current bot ---------------------------- -.. code-block:: +.. code-block:: python result: bool = await DeleteChatStickerSet(...) With specific bot ~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python result: bool = await bot(DeleteChatStickerSet(...)) As reply into Webhook in handler ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python return DeleteChatStickerSet(...) \ No newline at end of file diff --git a/docs2/api/methods/delete_message.rst b/docs2/api/methods/delete_message.rst index 010cf5ca..b97f5c41 100644 --- a/docs2/api/methods/delete_message.rst +++ b/docs2/api/methods/delete_message.rst @@ -2,30 +2,11 @@ deleteMessage ############# -Use this method to delete a message, including service messages, with the following limitations: - -- A message can only be deleted if it was sent less than 48 hours ago. - -- A dice message in a private chat can only be deleted if it was sent more than 24 hours ago. - -- Bots can delete outgoing messages in private chats, groups, and supergroups. - -- Bots can delete incoming messages in private chats. - -- Bots granted can_post_messages permissions can delete outgoing messages in channels. - -- If the bot is an administrator of a group, it can delete any message there. - -- If the bot has can_delete_messages permission in a supergroup or a channel, it can delete any message there. - -Returns True on success. - Returns: :obj:`bool` .. automodule:: aiogram.methods.delete_message :members: :member-order: bysource - :special-members: __init__ :undoc-members: True @@ -45,27 +26,26 @@ Method as object Imports: -- :code:`from aiogram.methods import DeleteMessage` -- :code:`from aiogram.methods import DeleteMessage` - :code:`from aiogram.methods.delete_message import DeleteMessage` +- alias: :code:`from aiogram.methods import DeleteMessage` In handlers with current bot ---------------------------- -.. code-block:: +.. code-block:: python result: bool = await DeleteMessage(...) With specific bot ~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python result: bool = await bot(DeleteMessage(...)) As reply into Webhook in handler ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python return DeleteMessage(...) \ No newline at end of file diff --git a/docs2/api/methods/delete_sticker_from_set.rst b/docs2/api/methods/delete_sticker_from_set.rst index cb616555..dfb57a0a 100644 --- a/docs2/api/methods/delete_sticker_from_set.rst +++ b/docs2/api/methods/delete_sticker_from_set.rst @@ -2,14 +2,11 @@ deleteStickerFromSet #################### -Use this method to delete a sticker from a set created by the bot. Returns True on success. - Returns: :obj:`bool` .. automodule:: aiogram.methods.delete_sticker_from_set :members: :member-order: bysource - :special-members: __init__ :undoc-members: True @@ -29,27 +26,26 @@ Method as object Imports: -- :code:`from aiogram.methods import DeleteStickerFromSet` -- :code:`from aiogram.methods import DeleteStickerFromSet` - :code:`from aiogram.methods.delete_sticker_from_set import DeleteStickerFromSet` +- alias: :code:`from aiogram.methods import DeleteStickerFromSet` In handlers with current bot ---------------------------- -.. code-block:: +.. code-block:: python result: bool = await DeleteStickerFromSet(...) With specific bot ~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python result: bool = await bot(DeleteStickerFromSet(...)) As reply into Webhook in handler ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python return DeleteStickerFromSet(...) \ No newline at end of file diff --git a/docs2/api/methods/delete_webhook.rst b/docs2/api/methods/delete_webhook.rst index 29b3ac48..1c7e7d6e 100644 --- a/docs2/api/methods/delete_webhook.rst +++ b/docs2/api/methods/delete_webhook.rst @@ -2,14 +2,11 @@ deleteWebhook ############# -Use this method to remove webhook integration if you decide to switch back to getUpdates. Returns True on success. Requires no parameters. - Returns: :obj:`bool` .. automodule:: aiogram.methods.delete_webhook :members: :member-order: bysource - :special-members: __init__ :undoc-members: True @@ -29,27 +26,26 @@ Method as object Imports: -- :code:`from aiogram.methods import DeleteWebhook` -- :code:`from aiogram.methods import DeleteWebhook` - :code:`from aiogram.methods.delete_webhook import DeleteWebhook` +- alias: :code:`from aiogram.methods import DeleteWebhook` In handlers with current bot ---------------------------- -.. code-block:: +.. code-block:: python result: bool = await DeleteWebhook(...) With specific bot ~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python result: bool = await bot(DeleteWebhook(...)) As reply into Webhook in handler ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python return DeleteWebhook(...) \ No newline at end of file diff --git a/docs2/api/methods/edit_message_caption.rst b/docs2/api/methods/edit_message_caption.rst index d672cd2f..d05a83b8 100644 --- a/docs2/api/methods/edit_message_caption.rst +++ b/docs2/api/methods/edit_message_caption.rst @@ -2,14 +2,11 @@ editMessageCaption ################## -Use this method to edit captions of messages. On success, if edited message is sent by the bot, the edited Message is returned, otherwise True is returned. - Returns: :obj:`Union[Message, bool]` .. automodule:: aiogram.methods.edit_message_caption :members: :member-order: bysource - :special-members: __init__ :undoc-members: True @@ -29,27 +26,26 @@ Method as object Imports: -- :code:`from aiogram.methods import EditMessageCaption` -- :code:`from aiogram.methods import EditMessageCaption` - :code:`from aiogram.methods.edit_message_caption import EditMessageCaption` +- alias: :code:`from aiogram.methods import EditMessageCaption` In handlers with current bot ---------------------------- -.. code-block:: +.. code-block:: python result: Union[Message, bool] = await EditMessageCaption(...) With specific bot ~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python result: Union[Message, bool] = await bot(EditMessageCaption(...)) As reply into Webhook in handler ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python return EditMessageCaption(...) \ No newline at end of file diff --git a/docs2/api/methods/edit_message_live_location.rst b/docs2/api/methods/edit_message_live_location.rst index 72024073..5516727c 100644 --- a/docs2/api/methods/edit_message_live_location.rst +++ b/docs2/api/methods/edit_message_live_location.rst @@ -2,14 +2,11 @@ editMessageLiveLocation ####################### -Use this method to edit live location messages. A location can be edited until its live_period expires or editing is explicitly disabled by a call to stopMessageLiveLocation. On success, if the edited message was sent by the bot, the edited Message is returned, otherwise True is returned. - Returns: :obj:`Union[Message, bool]` .. automodule:: aiogram.methods.edit_message_live_location :members: :member-order: bysource - :special-members: __init__ :undoc-members: True @@ -29,27 +26,26 @@ Method as object Imports: -- :code:`from aiogram.methods import EditMessageLiveLocation` -- :code:`from aiogram.methods import EditMessageLiveLocation` - :code:`from aiogram.methods.edit_message_live_location import EditMessageLiveLocation` +- alias: :code:`from aiogram.methods import EditMessageLiveLocation` In handlers with current bot ---------------------------- -.. code-block:: +.. code-block:: python result: Union[Message, bool] = await EditMessageLiveLocation(...) With specific bot ~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python result: Union[Message, bool] = await bot(EditMessageLiveLocation(...)) As reply into Webhook in handler ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python return EditMessageLiveLocation(...) \ No newline at end of file diff --git a/docs2/api/methods/edit_message_media.rst b/docs2/api/methods/edit_message_media.rst index 64d83395..057d1d5c 100644 --- a/docs2/api/methods/edit_message_media.rst +++ b/docs2/api/methods/edit_message_media.rst @@ -2,14 +2,11 @@ editMessageMedia ################ -Use this method to edit animation, audio, document, photo, or video messages. If a message is a part of a message album, then it can be edited only to a photo or a video. Otherwise, message type can be changed arbitrarily. When inline message is edited, new file can't be uploaded. Use previously uploaded file via its file_id or specify a URL. On success, if the edited message was sent by the bot, the edited Message is returned, otherwise True is returned. - Returns: :obj:`Union[Message, bool]` .. automodule:: aiogram.methods.edit_message_media :members: :member-order: bysource - :special-members: __init__ :undoc-members: True @@ -29,27 +26,26 @@ Method as object Imports: -- :code:`from aiogram.methods import EditMessageMedia` -- :code:`from aiogram.methods import EditMessageMedia` - :code:`from aiogram.methods.edit_message_media import EditMessageMedia` +- alias: :code:`from aiogram.methods import EditMessageMedia` In handlers with current bot ---------------------------- -.. code-block:: +.. code-block:: python result: Union[Message, bool] = await EditMessageMedia(...) With specific bot ~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python result: Union[Message, bool] = await bot(EditMessageMedia(...)) As reply into Webhook in handler ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python return EditMessageMedia(...) \ No newline at end of file diff --git a/docs2/api/methods/edit_message_reply_markup.rst b/docs2/api/methods/edit_message_reply_markup.rst index 1a260ce2..d37d9400 100644 --- a/docs2/api/methods/edit_message_reply_markup.rst +++ b/docs2/api/methods/edit_message_reply_markup.rst @@ -2,14 +2,11 @@ editMessageReplyMarkup ###################### -Use this method to edit only the reply markup of messages. On success, if edited message is sent by the bot, the edited Message is returned, otherwise True is returned. - Returns: :obj:`Union[Message, bool]` .. automodule:: aiogram.methods.edit_message_reply_markup :members: :member-order: bysource - :special-members: __init__ :undoc-members: True @@ -29,27 +26,26 @@ Method as object Imports: -- :code:`from aiogram.methods import EditMessageReplyMarkup` -- :code:`from aiogram.methods import EditMessageReplyMarkup` - :code:`from aiogram.methods.edit_message_reply_markup import EditMessageReplyMarkup` +- alias: :code:`from aiogram.methods import EditMessageReplyMarkup` In handlers with current bot ---------------------------- -.. code-block:: +.. code-block:: python result: Union[Message, bool] = await EditMessageReplyMarkup(...) With specific bot ~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python result: Union[Message, bool] = await bot(EditMessageReplyMarkup(...)) As reply into Webhook in handler ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python return EditMessageReplyMarkup(...) \ No newline at end of file diff --git a/docs2/api/methods/edit_message_text.rst b/docs2/api/methods/edit_message_text.rst index 880c74da..55cd428c 100644 --- a/docs2/api/methods/edit_message_text.rst +++ b/docs2/api/methods/edit_message_text.rst @@ -2,14 +2,11 @@ editMessageText ############### -Use this method to edit text and game messages. On success, if edited message is sent by the bot, the edited Message is returned, otherwise True is returned. - Returns: :obj:`Union[Message, bool]` .. automodule:: aiogram.methods.edit_message_text :members: :member-order: bysource - :special-members: __init__ :undoc-members: True @@ -29,27 +26,26 @@ Method as object Imports: -- :code:`from aiogram.methods import EditMessageText` -- :code:`from aiogram.methods import EditMessageText` - :code:`from aiogram.methods.edit_message_text import EditMessageText` +- alias: :code:`from aiogram.methods import EditMessageText` In handlers with current bot ---------------------------- -.. code-block:: +.. code-block:: python result: Union[Message, bool] = await EditMessageText(...) With specific bot ~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python result: Union[Message, bool] = await bot(EditMessageText(...)) As reply into Webhook in handler ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python return EditMessageText(...) \ No newline at end of file diff --git a/docs2/api/methods/export_chat_invite_link.rst b/docs2/api/methods/export_chat_invite_link.rst index b169709a..c2cb9c40 100644 --- a/docs2/api/methods/export_chat_invite_link.rst +++ b/docs2/api/methods/export_chat_invite_link.rst @@ -2,16 +2,11 @@ exportChatInviteLink #################### -Use this method to generate a new invite link for a chat; any previously generated link is revoked. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Returns the new invite link as String on success. - -Note: Each administrator in a chat generates their own invite links. Bots can't use invite links generated by other administrators. If you want your bot to work with invite links, it will need to generate its own link using exportChatInviteLink — after this the link will become available to the bot via the getChat method. If your bot needs to generate a new invite link replacing its previous one, use exportChatInviteLink again. - Returns: :obj:`str` .. automodule:: aiogram.methods.export_chat_invite_link :members: :member-order: bysource - :special-members: __init__ :undoc-members: True @@ -31,27 +26,26 @@ Method as object Imports: -- :code:`from aiogram.methods import ExportChatInviteLink` -- :code:`from aiogram.methods import ExportChatInviteLink` - :code:`from aiogram.methods.export_chat_invite_link import ExportChatInviteLink` +- alias: :code:`from aiogram.methods import ExportChatInviteLink` In handlers with current bot ---------------------------- -.. code-block:: +.. code-block:: python result: str = await ExportChatInviteLink(...) With specific bot ~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python result: str = await bot(ExportChatInviteLink(...)) As reply into Webhook in handler ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python return ExportChatInviteLink(...) \ No newline at end of file diff --git a/docs2/api/methods/forward_message.rst b/docs2/api/methods/forward_message.rst index 9d89ffee..b8eace3c 100644 --- a/docs2/api/methods/forward_message.rst +++ b/docs2/api/methods/forward_message.rst @@ -2,14 +2,11 @@ forwardMessage ############## -Use this method to forward messages of any kind. On success, the sent Message is returned. - Returns: :obj:`Message` .. automodule:: aiogram.methods.forward_message :members: :member-order: bysource - :special-members: __init__ :undoc-members: True @@ -29,27 +26,26 @@ Method as object Imports: -- :code:`from aiogram.methods import ForwardMessage` -- :code:`from aiogram.methods import ForwardMessage` - :code:`from aiogram.methods.forward_message import ForwardMessage` +- alias: :code:`from aiogram.methods import ForwardMessage` In handlers with current bot ---------------------------- -.. code-block:: +.. code-block:: python result: Message = await ForwardMessage(...) With specific bot ~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python result: Message = await bot(ForwardMessage(...)) As reply into Webhook in handler ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python return ForwardMessage(...) \ No newline at end of file diff --git a/docs2/api/methods/get_chat.rst b/docs2/api/methods/get_chat.rst index 139d0fde..9953c616 100644 --- a/docs2/api/methods/get_chat.rst +++ b/docs2/api/methods/get_chat.rst @@ -2,14 +2,11 @@ getChat ####### -Use this method to get up to date information about the chat (current name of the user for one-on-one conversations, current username of a user, group or channel, etc.). Returns a Chat object on success. - Returns: :obj:`Chat` .. automodule:: aiogram.methods.get_chat :members: :member-order: bysource - :special-members: __init__ :undoc-members: True @@ -29,21 +26,20 @@ Method as object Imports: -- :code:`from aiogram.methods import GetChat` -- :code:`from aiogram.methods import GetChat` - :code:`from aiogram.methods.get_chat import GetChat` +- alias: :code:`from aiogram.methods import GetChat` In handlers with current bot ---------------------------- -.. code-block:: +.. code-block:: python result: Chat = await GetChat(...) With specific bot ~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python result: Chat = await bot(GetChat(...)) diff --git a/docs2/api/methods/get_chat_administrators.rst b/docs2/api/methods/get_chat_administrators.rst index 2a328737..f5690d73 100644 --- a/docs2/api/methods/get_chat_administrators.rst +++ b/docs2/api/methods/get_chat_administrators.rst @@ -2,14 +2,11 @@ getChatAdministrators ##################### -Use this method to get a list of administrators in a chat. On success, returns an Array of ChatMember objects that contains information about all chat administrators except other bots. If the chat is a group or a supergroup and no administrators were appointed, only the creator will be returned. - Returns: :obj:`List[ChatMember]` .. automodule:: aiogram.methods.get_chat_administrators :members: :member-order: bysource - :special-members: __init__ :undoc-members: True @@ -29,21 +26,20 @@ Method as object Imports: -- :code:`from aiogram.methods import GetChatAdministrators` -- :code:`from aiogram.methods import GetChatAdministrators` - :code:`from aiogram.methods.get_chat_administrators import GetChatAdministrators` +- alias: :code:`from aiogram.methods import GetChatAdministrators` In handlers with current bot ---------------------------- -.. code-block:: +.. code-block:: python result: List[ChatMember] = await GetChatAdministrators(...) With specific bot ~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python result: List[ChatMember] = await bot(GetChatAdministrators(...)) diff --git a/docs2/api/methods/get_chat_member.rst b/docs2/api/methods/get_chat_member.rst index 82562019..53f20f64 100644 --- a/docs2/api/methods/get_chat_member.rst +++ b/docs2/api/methods/get_chat_member.rst @@ -2,14 +2,11 @@ getChatMember ############# -Use this method to get information about a member of a chat. Returns a ChatMember object on success. - Returns: :obj:`ChatMember` .. automodule:: aiogram.methods.get_chat_member :members: :member-order: bysource - :special-members: __init__ :undoc-members: True @@ -29,21 +26,20 @@ Method as object Imports: -- :code:`from aiogram.methods import GetChatMember` -- :code:`from aiogram.methods import GetChatMember` - :code:`from aiogram.methods.get_chat_member import GetChatMember` +- alias: :code:`from aiogram.methods import GetChatMember` In handlers with current bot ---------------------------- -.. code-block:: +.. code-block:: python result: ChatMember = await GetChatMember(...) With specific bot ~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python result: ChatMember = await bot(GetChatMember(...)) diff --git a/docs2/api/methods/get_chat_members_count.rst b/docs2/api/methods/get_chat_members_count.rst index c618afa5..95030cb7 100644 --- a/docs2/api/methods/get_chat_members_count.rst +++ b/docs2/api/methods/get_chat_members_count.rst @@ -2,14 +2,11 @@ getChatMembersCount ################### -Use this method to get the number of members in a chat. Returns Int on success. - Returns: :obj:`int` .. automodule:: aiogram.methods.get_chat_members_count :members: :member-order: bysource - :special-members: __init__ :undoc-members: True @@ -29,21 +26,20 @@ Method as object Imports: -- :code:`from aiogram.methods import GetChatMembersCount` -- :code:`from aiogram.methods import GetChatMembersCount` - :code:`from aiogram.methods.get_chat_members_count import GetChatMembersCount` +- alias: :code:`from aiogram.methods import GetChatMembersCount` In handlers with current bot ---------------------------- -.. code-block:: +.. code-block:: python result: int = await GetChatMembersCount(...) With specific bot ~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python result: int = await bot(GetChatMembersCount(...)) diff --git a/docs2/api/methods/get_file.rst b/docs2/api/methods/get_file.rst index 5ebecd3a..dfdf4411 100644 --- a/docs2/api/methods/get_file.rst +++ b/docs2/api/methods/get_file.rst @@ -2,16 +2,11 @@ getFile ####### -Use this method to get basic info about a file and prepare it for downloading. For the moment, bots can download files of up to 20MB in size. On success, a File object is returned. The file can then be downloaded via the link https://api.telegram.org/file/bot/, where is taken from the response. It is guaranteed that the link will be valid for at least 1 hour. When the link expires, a new one can be requested by calling getFile again. - -Note: This function may not preserve the original file name and MIME type. You should save the file's MIME type and name (if available) when the File object is received. - Returns: :obj:`File` .. automodule:: aiogram.methods.get_file :members: :member-order: bysource - :special-members: __init__ :undoc-members: True @@ -31,21 +26,20 @@ Method as object Imports: -- :code:`from aiogram.methods import GetFile` -- :code:`from aiogram.methods import GetFile` - :code:`from aiogram.methods.get_file import GetFile` +- alias: :code:`from aiogram.methods import GetFile` In handlers with current bot ---------------------------- -.. code-block:: +.. code-block:: python result: File = await GetFile(...) With specific bot ~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python result: File = await bot(GetFile(...)) diff --git a/docs2/api/methods/get_game_high_scores.rst b/docs2/api/methods/get_game_high_scores.rst index 9801380a..cb9dc562 100644 --- a/docs2/api/methods/get_game_high_scores.rst +++ b/docs2/api/methods/get_game_high_scores.rst @@ -2,16 +2,11 @@ getGameHighScores ################# -Use this method to get data for high score tables. Will return the score of the specified user and several of their neighbors in a game. On success, returns an Array of GameHighScore objects. - -This method will currently return scores for the target user, plus two of their closest neighbors on each side. Will also return the top three users if the user and his neighbors are not among them. Please note that this behavior is subject to change. - Returns: :obj:`List[GameHighScore]` .. automodule:: aiogram.methods.get_game_high_scores :members: :member-order: bysource - :special-members: __init__ :undoc-members: True @@ -31,21 +26,20 @@ Method as object Imports: -- :code:`from aiogram.methods import GetGameHighScores` -- :code:`from aiogram.methods import GetGameHighScores` - :code:`from aiogram.methods.get_game_high_scores import GetGameHighScores` +- alias: :code:`from aiogram.methods import GetGameHighScores` In handlers with current bot ---------------------------- -.. code-block:: +.. code-block:: python result: List[GameHighScore] = await GetGameHighScores(...) With specific bot ~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python result: List[GameHighScore] = await bot(GetGameHighScores(...)) diff --git a/docs2/api/methods/get_me.rst b/docs2/api/methods/get_me.rst index ec819ed8..b29e64db 100644 --- a/docs2/api/methods/get_me.rst +++ b/docs2/api/methods/get_me.rst @@ -2,14 +2,11 @@ getMe ##### -A simple method for testing your bot's auth token. Requires no parameters. Returns basic information about the bot in form of a User object. - Returns: :obj:`User` .. automodule:: aiogram.methods.get_me :members: :member-order: bysource - :special-members: __init__ :undoc-members: True @@ -29,21 +26,20 @@ Method as object Imports: -- :code:`from aiogram.methods import GetMe` -- :code:`from aiogram.methods import GetMe` - :code:`from aiogram.methods.get_me import GetMe` +- alias: :code:`from aiogram.methods import GetMe` In handlers with current bot ---------------------------- -.. code-block:: +.. code-block:: python result: User = await GetMe(...) With specific bot ~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python result: User = await bot(GetMe(...)) diff --git a/docs2/api/methods/get_my_commands.rst b/docs2/api/methods/get_my_commands.rst index 2f318e02..13add8e9 100644 --- a/docs2/api/methods/get_my_commands.rst +++ b/docs2/api/methods/get_my_commands.rst @@ -2,14 +2,11 @@ getMyCommands ############# -Use this method to get the current list of the bot's commands. Requires no parameters. Returns Array of BotCommand on success. - Returns: :obj:`List[BotCommand]` .. automodule:: aiogram.methods.get_my_commands :members: :member-order: bysource - :special-members: __init__ :undoc-members: True @@ -29,21 +26,20 @@ Method as object Imports: -- :code:`from aiogram.methods import GetMyCommands` -- :code:`from aiogram.methods import GetMyCommands` - :code:`from aiogram.methods.get_my_commands import GetMyCommands` +- alias: :code:`from aiogram.methods import GetMyCommands` In handlers with current bot ---------------------------- -.. code-block:: +.. code-block:: python result: List[BotCommand] = await GetMyCommands(...) With specific bot ~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python result: List[BotCommand] = await bot(GetMyCommands(...)) diff --git a/docs2/api/methods/get_sticker_set.rst b/docs2/api/methods/get_sticker_set.rst index 15d8f375..bc3faa93 100644 --- a/docs2/api/methods/get_sticker_set.rst +++ b/docs2/api/methods/get_sticker_set.rst @@ -2,14 +2,11 @@ getStickerSet ############# -Use this method to get a sticker set. On success, a StickerSet object is returned. - Returns: :obj:`StickerSet` .. automodule:: aiogram.methods.get_sticker_set :members: :member-order: bysource - :special-members: __init__ :undoc-members: True @@ -29,21 +26,20 @@ Method as object Imports: -- :code:`from aiogram.methods import GetStickerSet` -- :code:`from aiogram.methods import GetStickerSet` - :code:`from aiogram.methods.get_sticker_set import GetStickerSet` +- alias: :code:`from aiogram.methods import GetStickerSet` In handlers with current bot ---------------------------- -.. code-block:: +.. code-block:: python result: StickerSet = await GetStickerSet(...) With specific bot ~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python result: StickerSet = await bot(GetStickerSet(...)) diff --git a/docs2/api/methods/get_updates.rst b/docs2/api/methods/get_updates.rst index d290df3c..15cae582 100644 --- a/docs2/api/methods/get_updates.rst +++ b/docs2/api/methods/get_updates.rst @@ -2,20 +2,11 @@ getUpdates ########## -Use this method to receive incoming updates using long polling (wiki). An Array of Update objects is returned. - -Notes - -1. This method will not work if an outgoing webhook is set up. - -2. In order to avoid getting duplicate updates, recalculate offset after each server response. - Returns: :obj:`List[Update]` .. automodule:: aiogram.methods.get_updates :members: :member-order: bysource - :special-members: __init__ :undoc-members: True @@ -35,21 +26,20 @@ Method as object Imports: -- :code:`from aiogram.methods import GetUpdates` -- :code:`from aiogram.methods import GetUpdates` - :code:`from aiogram.methods.get_updates import GetUpdates` +- alias: :code:`from aiogram.methods import GetUpdates` In handlers with current bot ---------------------------- -.. code-block:: +.. code-block:: python result: List[Update] = await GetUpdates(...) With specific bot ~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python result: List[Update] = await bot(GetUpdates(...)) diff --git a/docs2/api/methods/get_user_profile_photos.rst b/docs2/api/methods/get_user_profile_photos.rst index c058d3a6..3b76b9c4 100644 --- a/docs2/api/methods/get_user_profile_photos.rst +++ b/docs2/api/methods/get_user_profile_photos.rst @@ -2,14 +2,11 @@ getUserProfilePhotos #################### -Use this method to get a list of profile pictures for a user. Returns a UserProfilePhotos object. - Returns: :obj:`UserProfilePhotos` .. automodule:: aiogram.methods.get_user_profile_photos :members: :member-order: bysource - :special-members: __init__ :undoc-members: True @@ -29,21 +26,20 @@ Method as object Imports: -- :code:`from aiogram.methods import GetUserProfilePhotos` -- :code:`from aiogram.methods import GetUserProfilePhotos` - :code:`from aiogram.methods.get_user_profile_photos import GetUserProfilePhotos` +- alias: :code:`from aiogram.methods import GetUserProfilePhotos` In handlers with current bot ---------------------------- -.. code-block:: +.. code-block:: python result: UserProfilePhotos = await GetUserProfilePhotos(...) With specific bot ~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python result: UserProfilePhotos = await bot(GetUserProfilePhotos(...)) diff --git a/docs2/api/methods/get_webhook_info.rst b/docs2/api/methods/get_webhook_info.rst index 02e3bb5c..88bc2a46 100644 --- a/docs2/api/methods/get_webhook_info.rst +++ b/docs2/api/methods/get_webhook_info.rst @@ -2,14 +2,11 @@ getWebhookInfo ############## -Use this method to get current webhook status. Requires no parameters. On success, returns a WebhookInfo object. If the bot is using getUpdates, will return an object with the url field empty. - Returns: :obj:`WebhookInfo` .. automodule:: aiogram.methods.get_webhook_info :members: :member-order: bysource - :special-members: __init__ :undoc-members: True @@ -29,21 +26,20 @@ Method as object Imports: -- :code:`from aiogram.methods import GetWebhookInfo` -- :code:`from aiogram.methods import GetWebhookInfo` - :code:`from aiogram.methods.get_webhook_info import GetWebhookInfo` +- alias: :code:`from aiogram.methods import GetWebhookInfo` In handlers with current bot ---------------------------- -.. code-block:: +.. code-block:: python result: WebhookInfo = await GetWebhookInfo(...) With specific bot ~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python result: WebhookInfo = await bot(GetWebhookInfo(...)) diff --git a/docs2/api/methods/index.rst b/docs2/api/methods/index.rst index 8d83e343..728008f4 100644 --- a/docs2/api/methods/index.rst +++ b/docs2/api/methods/index.rst @@ -2,12 +2,8 @@ Methods ####### -All methods is wrapped as `pydantic `_ models -and placed in :mod:`aiogram.methods` package so that's mean all values which you pass -as arguments to the methods will be validated. +Here is list of all available API methods: -Here is all methods is classes and in due to Python standards all classes named in -upper camel case, for example methods :code:`sendMessage` has the name :code:`SendMessage` Getting updates @@ -29,8 +25,11 @@ Available methods :maxdepth: 1 get_me + log_out + close send_message forward_message + copy_message send_photo send_audio send_document @@ -62,6 +61,7 @@ Available methods set_chat_description pin_chat_message unpin_chat_message + unpin_all_chat_messages leave_chat get_chat get_chat_administrators @@ -136,3 +136,4 @@ Games send_game set_game_score get_game_high_scores + diff --git a/docs2/api/methods/kick_chat_member.rst b/docs2/api/methods/kick_chat_member.rst index 51c5cbdf..7cf3d70d 100644 --- a/docs2/api/methods/kick_chat_member.rst +++ b/docs2/api/methods/kick_chat_member.rst @@ -2,14 +2,11 @@ kickChatMember ############## -Use this method to kick a user from a group, a supergroup or a channel. In the case of supergroups and channels, the user will not be able to return to the group on their own using invite links, etc., unless unbanned first. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Returns True on success. - Returns: :obj:`bool` .. automodule:: aiogram.methods.kick_chat_member :members: :member-order: bysource - :special-members: __init__ :undoc-members: True @@ -29,27 +26,26 @@ Method as object Imports: -- :code:`from aiogram.methods import KickChatMember` -- :code:`from aiogram.methods import KickChatMember` - :code:`from aiogram.methods.kick_chat_member import KickChatMember` +- alias: :code:`from aiogram.methods import KickChatMember` In handlers with current bot ---------------------------- -.. code-block:: +.. code-block:: python result: bool = await KickChatMember(...) With specific bot ~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python result: bool = await bot(KickChatMember(...)) As reply into Webhook in handler ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python return KickChatMember(...) \ No newline at end of file diff --git a/docs2/api/methods/leave_chat.rst b/docs2/api/methods/leave_chat.rst index aa5ecc49..edb603f7 100644 --- a/docs2/api/methods/leave_chat.rst +++ b/docs2/api/methods/leave_chat.rst @@ -2,14 +2,11 @@ leaveChat ######### -Use this method for your bot to leave a group, supergroup or channel. Returns True on success. - Returns: :obj:`bool` .. automodule:: aiogram.methods.leave_chat :members: :member-order: bysource - :special-members: __init__ :undoc-members: True @@ -29,27 +26,26 @@ Method as object Imports: -- :code:`from aiogram.methods import LeaveChat` -- :code:`from aiogram.methods import LeaveChat` - :code:`from aiogram.methods.leave_chat import LeaveChat` +- alias: :code:`from aiogram.methods import LeaveChat` In handlers with current bot ---------------------------- -.. code-block:: +.. code-block:: python result: bool = await LeaveChat(...) With specific bot ~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python result: bool = await bot(LeaveChat(...)) As reply into Webhook in handler ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python return LeaveChat(...) \ No newline at end of file diff --git a/docs2/api/methods/log_out.rst b/docs2/api/methods/log_out.rst new file mode 100644 index 00000000..46cc92c9 --- /dev/null +++ b/docs2/api/methods/log_out.rst @@ -0,0 +1,51 @@ +###### +logOut +###### + +Returns: :obj:`bool` + +.. automodule:: aiogram.methods.log_out + :members: + :member-order: bysource + :undoc-members: True + + +Usage +===== + +As bot method +------------- + +.. code-block:: + + result: bool = await bot.log_out(...) + + +Method as object +---------------- + +Imports: + +- :code:`from aiogram.methods.log_out import LogOut` +- alias: :code:`from aiogram.methods import LogOut` + +In handlers with current bot +---------------------------- + +.. code-block:: python + + result: bool = await LogOut(...) + +With specific bot +~~~~~~~~~~~~~~~~~ + +.. code-block:: python + + result: bool = await bot(LogOut(...)) + +As reply into Webhook in handler +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. code-block:: python + + return LogOut(...) \ No newline at end of file diff --git a/docs2/api/methods/pin_chat_message.rst b/docs2/api/methods/pin_chat_message.rst index adf681cb..1c3dc9ee 100644 --- a/docs2/api/methods/pin_chat_message.rst +++ b/docs2/api/methods/pin_chat_message.rst @@ -2,14 +2,11 @@ pinChatMessage ############## -Use this method to pin a message in a group, a supergroup, or a channel. The bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' admin right in the supergroup or 'can_edit_messages' admin right in the channel. Returns True on success. - Returns: :obj:`bool` .. automodule:: aiogram.methods.pin_chat_message :members: :member-order: bysource - :special-members: __init__ :undoc-members: True @@ -29,27 +26,26 @@ Method as object Imports: -- :code:`from aiogram.methods import PinChatMessage` -- :code:`from aiogram.methods import PinChatMessage` - :code:`from aiogram.methods.pin_chat_message import PinChatMessage` +- alias: :code:`from aiogram.methods import PinChatMessage` In handlers with current bot ---------------------------- -.. code-block:: +.. code-block:: python result: bool = await PinChatMessage(...) With specific bot ~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python result: bool = await bot(PinChatMessage(...)) As reply into Webhook in handler ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python return PinChatMessage(...) \ No newline at end of file diff --git a/docs2/api/methods/promote_chat_member.rst b/docs2/api/methods/promote_chat_member.rst index cfe5d80f..ec883f59 100644 --- a/docs2/api/methods/promote_chat_member.rst +++ b/docs2/api/methods/promote_chat_member.rst @@ -2,14 +2,11 @@ promoteChatMember ################# -Use this method to promote or demote a user in a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Pass False for all boolean parameters to demote a user. Returns True on success. - Returns: :obj:`bool` .. automodule:: aiogram.methods.promote_chat_member :members: :member-order: bysource - :special-members: __init__ :undoc-members: True @@ -29,27 +26,26 @@ Method as object Imports: -- :code:`from aiogram.methods import PromoteChatMember` -- :code:`from aiogram.methods import PromoteChatMember` - :code:`from aiogram.methods.promote_chat_member import PromoteChatMember` +- alias: :code:`from aiogram.methods import PromoteChatMember` In handlers with current bot ---------------------------- -.. code-block:: +.. code-block:: python result: bool = await PromoteChatMember(...) With specific bot ~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python result: bool = await bot(PromoteChatMember(...)) As reply into Webhook in handler ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python return PromoteChatMember(...) \ No newline at end of file diff --git a/docs2/api/methods/restrict_chat_member.rst b/docs2/api/methods/restrict_chat_member.rst index 3f46dd42..47cadd01 100644 --- a/docs2/api/methods/restrict_chat_member.rst +++ b/docs2/api/methods/restrict_chat_member.rst @@ -2,14 +2,11 @@ restrictChatMember ################## -Use this method to restrict a user in a supergroup. The bot must be an administrator in the supergroup for this to work and must have the appropriate admin rights. Pass True for all permissions to lift restrictions from a user. Returns True on success. - Returns: :obj:`bool` .. automodule:: aiogram.methods.restrict_chat_member :members: :member-order: bysource - :special-members: __init__ :undoc-members: True @@ -29,27 +26,26 @@ Method as object Imports: -- :code:`from aiogram.methods import RestrictChatMember` -- :code:`from aiogram.methods import RestrictChatMember` - :code:`from aiogram.methods.restrict_chat_member import RestrictChatMember` +- alias: :code:`from aiogram.methods import RestrictChatMember` In handlers with current bot ---------------------------- -.. code-block:: +.. code-block:: python result: bool = await RestrictChatMember(...) With specific bot ~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python result: bool = await bot(RestrictChatMember(...)) As reply into Webhook in handler ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python return RestrictChatMember(...) \ No newline at end of file diff --git a/docs2/api/methods/send_animation.rst b/docs2/api/methods/send_animation.rst index 2e36eb4b..8c2515a7 100644 --- a/docs2/api/methods/send_animation.rst +++ b/docs2/api/methods/send_animation.rst @@ -2,14 +2,11 @@ sendAnimation ############# -Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without sound). On success, the sent Message is returned. Bots can currently send animation files of up to 50 MB in size, this limit may be changed in the future. - Returns: :obj:`Message` .. automodule:: aiogram.methods.send_animation :members: :member-order: bysource - :special-members: __init__ :undoc-members: True @@ -29,27 +26,26 @@ Method as object Imports: -- :code:`from aiogram.methods import SendAnimation` -- :code:`from aiogram.methods import SendAnimation` - :code:`from aiogram.methods.send_animation import SendAnimation` +- alias: :code:`from aiogram.methods import SendAnimation` In handlers with current bot ---------------------------- -.. code-block:: +.. code-block:: python result: Message = await SendAnimation(...) With specific bot ~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python result: Message = await bot(SendAnimation(...)) As reply into Webhook in handler ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python return SendAnimation(...) \ No newline at end of file diff --git a/docs2/api/methods/send_audio.rst b/docs2/api/methods/send_audio.rst index 653c0f80..9da55ded 100644 --- a/docs2/api/methods/send_audio.rst +++ b/docs2/api/methods/send_audio.rst @@ -2,16 +2,11 @@ sendAudio ######### -Use this method to send audio files, if you want Telegram clients to display them in the music player. Your audio must be in the .MP3 or .M4A format. On success, the sent Message is returned. Bots can currently send audio files of up to 50 MB in size, this limit may be changed in the future. - -For sending voice messages, use the sendVoice method instead. - Returns: :obj:`Message` .. automodule:: aiogram.methods.send_audio :members: :member-order: bysource - :special-members: __init__ :undoc-members: True @@ -31,27 +26,26 @@ Method as object Imports: -- :code:`from aiogram.methods import SendAudio` -- :code:`from aiogram.methods import SendAudio` - :code:`from aiogram.methods.send_audio import SendAudio` +- alias: :code:`from aiogram.methods import SendAudio` In handlers with current bot ---------------------------- -.. code-block:: +.. code-block:: python result: Message = await SendAudio(...) With specific bot ~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python result: Message = await bot(SendAudio(...)) As reply into Webhook in handler ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python return SendAudio(...) \ No newline at end of file diff --git a/docs2/api/methods/send_chat_action.rst b/docs2/api/methods/send_chat_action.rst index a5b14659..156915f8 100644 --- a/docs2/api/methods/send_chat_action.rst +++ b/docs2/api/methods/send_chat_action.rst @@ -2,18 +2,11 @@ sendChatAction ############## -Use this method when you need to tell the user that something is happening on the bot's side. The status is set for 5 seconds or less (when a message arrives from your bot, Telegram clients clear its typing status). Returns True on success. - -Example: The ImageBot needs some time to process a request and upload the image. Instead of sending a text message along the lines of 'Retrieving image, please wait…', the bot may use sendChatAction with action = upload_photo. The user will see a 'sending photo' status for the bot. - -We only recommend using this method when a response from the bot will take a noticeable amount of time to arrive. - Returns: :obj:`bool` .. automodule:: aiogram.methods.send_chat_action :members: :member-order: bysource - :special-members: __init__ :undoc-members: True @@ -33,27 +26,26 @@ Method as object Imports: -- :code:`from aiogram.methods import SendChatAction` -- :code:`from aiogram.methods import SendChatAction` - :code:`from aiogram.methods.send_chat_action import SendChatAction` +- alias: :code:`from aiogram.methods import SendChatAction` In handlers with current bot ---------------------------- -.. code-block:: +.. code-block:: python result: bool = await SendChatAction(...) With specific bot ~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python result: bool = await bot(SendChatAction(...)) As reply into Webhook in handler ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python return SendChatAction(...) \ No newline at end of file diff --git a/docs2/api/methods/send_contact.rst b/docs2/api/methods/send_contact.rst index 1434c851..6560a367 100644 --- a/docs2/api/methods/send_contact.rst +++ b/docs2/api/methods/send_contact.rst @@ -2,14 +2,11 @@ sendContact ########### -Use this method to send phone contacts. On success, the sent Message is returned. - Returns: :obj:`Message` .. automodule:: aiogram.methods.send_contact :members: :member-order: bysource - :special-members: __init__ :undoc-members: True @@ -29,27 +26,26 @@ Method as object Imports: -- :code:`from aiogram.methods import SendContact` -- :code:`from aiogram.methods import SendContact` - :code:`from aiogram.methods.send_contact import SendContact` +- alias: :code:`from aiogram.methods import SendContact` In handlers with current bot ---------------------------- -.. code-block:: +.. code-block:: python result: Message = await SendContact(...) With specific bot ~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python result: Message = await bot(SendContact(...)) As reply into Webhook in handler ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python return SendContact(...) \ No newline at end of file diff --git a/docs2/api/methods/send_dice.rst b/docs2/api/methods/send_dice.rst index 5d4e921a..9348d2b5 100644 --- a/docs2/api/methods/send_dice.rst +++ b/docs2/api/methods/send_dice.rst @@ -2,14 +2,11 @@ sendDice ######## -Use this method to send an animated emoji that will display a random value. On success, the sent Message is returned. - Returns: :obj:`Message` .. automodule:: aiogram.methods.send_dice :members: :member-order: bysource - :special-members: __init__ :undoc-members: True @@ -29,27 +26,26 @@ Method as object Imports: -- :code:`from aiogram.methods import SendDice` -- :code:`from aiogram.methods import SendDice` - :code:`from aiogram.methods.send_dice import SendDice` +- alias: :code:`from aiogram.methods import SendDice` In handlers with current bot ---------------------------- -.. code-block:: +.. code-block:: python result: Message = await SendDice(...) With specific bot ~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python result: Message = await bot(SendDice(...)) As reply into Webhook in handler ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python return SendDice(...) \ No newline at end of file diff --git a/docs2/api/methods/send_document.rst b/docs2/api/methods/send_document.rst index 9fa70b0d..2996da0d 100644 --- a/docs2/api/methods/send_document.rst +++ b/docs2/api/methods/send_document.rst @@ -2,14 +2,11 @@ sendDocument ############ -Use this method to send general files. On success, the sent Message is returned. Bots can currently send files of any type of up to 50 MB in size, this limit may be changed in the future. - Returns: :obj:`Message` .. automodule:: aiogram.methods.send_document :members: :member-order: bysource - :special-members: __init__ :undoc-members: True @@ -29,27 +26,26 @@ Method as object Imports: -- :code:`from aiogram.methods import SendDocument` -- :code:`from aiogram.methods import SendDocument` - :code:`from aiogram.methods.send_document import SendDocument` +- alias: :code:`from aiogram.methods import SendDocument` In handlers with current bot ---------------------------- -.. code-block:: +.. code-block:: python result: Message = await SendDocument(...) With specific bot ~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python result: Message = await bot(SendDocument(...)) As reply into Webhook in handler ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python return SendDocument(...) \ No newline at end of file diff --git a/docs2/api/methods/send_game.rst b/docs2/api/methods/send_game.rst index be03fe66..0526baaa 100644 --- a/docs2/api/methods/send_game.rst +++ b/docs2/api/methods/send_game.rst @@ -2,14 +2,11 @@ sendGame ######## -Use this method to send a game. On success, the sent Message is returned. - Returns: :obj:`Message` .. automodule:: aiogram.methods.send_game :members: :member-order: bysource - :special-members: __init__ :undoc-members: True @@ -29,27 +26,26 @@ Method as object Imports: -- :code:`from aiogram.methods import SendGame` -- :code:`from aiogram.methods import SendGame` - :code:`from aiogram.methods.send_game import SendGame` +- alias: :code:`from aiogram.methods import SendGame` In handlers with current bot ---------------------------- -.. code-block:: +.. code-block:: python result: Message = await SendGame(...) With specific bot ~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python result: Message = await bot(SendGame(...)) As reply into Webhook in handler ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python return SendGame(...) \ No newline at end of file diff --git a/docs2/api/methods/send_invoice.rst b/docs2/api/methods/send_invoice.rst index ab77d76f..f7d88111 100644 --- a/docs2/api/methods/send_invoice.rst +++ b/docs2/api/methods/send_invoice.rst @@ -2,14 +2,11 @@ sendInvoice ########### -Use this method to send invoices. On success, the sent Message is returned. - Returns: :obj:`Message` .. automodule:: aiogram.methods.send_invoice :members: :member-order: bysource - :special-members: __init__ :undoc-members: True @@ -29,27 +26,26 @@ Method as object Imports: -- :code:`from aiogram.methods import SendInvoice` -- :code:`from aiogram.methods import SendInvoice` - :code:`from aiogram.methods.send_invoice import SendInvoice` +- alias: :code:`from aiogram.methods import SendInvoice` In handlers with current bot ---------------------------- -.. code-block:: +.. code-block:: python result: Message = await SendInvoice(...) With specific bot ~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python result: Message = await bot(SendInvoice(...)) As reply into Webhook in handler ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python return SendInvoice(...) \ No newline at end of file diff --git a/docs2/api/methods/send_location.rst b/docs2/api/methods/send_location.rst index 3d67b2d7..3694f8a6 100644 --- a/docs2/api/methods/send_location.rst +++ b/docs2/api/methods/send_location.rst @@ -2,14 +2,11 @@ sendLocation ############ -Use this method to send point on the map. On success, the sent Message is returned. - Returns: :obj:`Message` .. automodule:: aiogram.methods.send_location :members: :member-order: bysource - :special-members: __init__ :undoc-members: True @@ -29,27 +26,26 @@ Method as object Imports: -- :code:`from aiogram.methods import SendLocation` -- :code:`from aiogram.methods import SendLocation` - :code:`from aiogram.methods.send_location import SendLocation` +- alias: :code:`from aiogram.methods import SendLocation` In handlers with current bot ---------------------------- -.. code-block:: +.. code-block:: python result: Message = await SendLocation(...) With specific bot ~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python result: Message = await bot(SendLocation(...)) As reply into Webhook in handler ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python return SendLocation(...) \ No newline at end of file diff --git a/docs2/api/methods/send_media_group.rst b/docs2/api/methods/send_media_group.rst index e2bc61b0..7f0dfe75 100644 --- a/docs2/api/methods/send_media_group.rst +++ b/docs2/api/methods/send_media_group.rst @@ -2,14 +2,11 @@ sendMediaGroup ############## -Use this method to send a group of photos or videos as an album. On success, an array of the sent Messages is returned. - Returns: :obj:`List[Message]` .. automodule:: aiogram.methods.send_media_group :members: :member-order: bysource - :special-members: __init__ :undoc-members: True @@ -29,27 +26,26 @@ Method as object Imports: -- :code:`from aiogram.methods import SendMediaGroup` -- :code:`from aiogram.methods import SendMediaGroup` - :code:`from aiogram.methods.send_media_group import SendMediaGroup` +- alias: :code:`from aiogram.methods import SendMediaGroup` In handlers with current bot ---------------------------- -.. code-block:: +.. code-block:: python result: List[Message] = await SendMediaGroup(...) With specific bot ~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python result: List[Message] = await bot(SendMediaGroup(...)) As reply into Webhook in handler ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python return SendMediaGroup(...) \ No newline at end of file diff --git a/docs2/api/methods/send_message.rst b/docs2/api/methods/send_message.rst index cfc91704..318684bf 100644 --- a/docs2/api/methods/send_message.rst +++ b/docs2/api/methods/send_message.rst @@ -2,14 +2,11 @@ sendMessage ########### -Use this method to send text messages. On success, the sent Message is returned. - Returns: :obj:`Message` .. automodule:: aiogram.methods.send_message :members: :member-order: bysource - :special-members: __init__ :undoc-members: True @@ -29,27 +26,26 @@ Method as object Imports: -- :code:`from aiogram.methods import SendMessage` -- :code:`from aiogram.methods import SendMessage` - :code:`from aiogram.methods.send_message import SendMessage` +- alias: :code:`from aiogram.methods import SendMessage` In handlers with current bot ---------------------------- -.. code-block:: +.. code-block:: python result: Message = await SendMessage(...) With specific bot ~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python result: Message = await bot(SendMessage(...)) As reply into Webhook in handler ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python return SendMessage(...) \ No newline at end of file diff --git a/docs2/api/methods/send_photo.rst b/docs2/api/methods/send_photo.rst index f60d0764..313b815e 100644 --- a/docs2/api/methods/send_photo.rst +++ b/docs2/api/methods/send_photo.rst @@ -2,14 +2,11 @@ sendPhoto ######### -Use this method to send photos. On success, the sent Message is returned. - Returns: :obj:`Message` .. automodule:: aiogram.methods.send_photo :members: :member-order: bysource - :special-members: __init__ :undoc-members: True @@ -29,27 +26,26 @@ Method as object Imports: -- :code:`from aiogram.methods import SendPhoto` -- :code:`from aiogram.methods import SendPhoto` - :code:`from aiogram.methods.send_photo import SendPhoto` +- alias: :code:`from aiogram.methods import SendPhoto` In handlers with current bot ---------------------------- -.. code-block:: +.. code-block:: python result: Message = await SendPhoto(...) With specific bot ~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python result: Message = await bot(SendPhoto(...)) As reply into Webhook in handler ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python return SendPhoto(...) \ No newline at end of file diff --git a/docs2/api/methods/send_poll.rst b/docs2/api/methods/send_poll.rst index 6d1c96d2..e83d3240 100644 --- a/docs2/api/methods/send_poll.rst +++ b/docs2/api/methods/send_poll.rst @@ -2,14 +2,11 @@ sendPoll ######## -Use this method to send a native poll. On success, the sent Message is returned. - Returns: :obj:`Message` .. automodule:: aiogram.methods.send_poll :members: :member-order: bysource - :special-members: __init__ :undoc-members: True @@ -29,27 +26,26 @@ Method as object Imports: -- :code:`from aiogram.methods import SendPoll` -- :code:`from aiogram.methods import SendPoll` - :code:`from aiogram.methods.send_poll import SendPoll` +- alias: :code:`from aiogram.methods import SendPoll` In handlers with current bot ---------------------------- -.. code-block:: +.. code-block:: python result: Message = await SendPoll(...) With specific bot ~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python result: Message = await bot(SendPoll(...)) As reply into Webhook in handler ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python return SendPoll(...) \ No newline at end of file diff --git a/docs2/api/methods/send_sticker.rst b/docs2/api/methods/send_sticker.rst index a1c6be86..ca77bd92 100644 --- a/docs2/api/methods/send_sticker.rst +++ b/docs2/api/methods/send_sticker.rst @@ -2,14 +2,11 @@ sendSticker ########### -Use this method to send static .WEBP or animated .TGS stickers. On success, the sent Message is returned. - Returns: :obj:`Message` .. automodule:: aiogram.methods.send_sticker :members: :member-order: bysource - :special-members: __init__ :undoc-members: True @@ -29,27 +26,26 @@ Method as object Imports: -- :code:`from aiogram.methods import SendSticker` -- :code:`from aiogram.methods import SendSticker` - :code:`from aiogram.methods.send_sticker import SendSticker` +- alias: :code:`from aiogram.methods import SendSticker` In handlers with current bot ---------------------------- -.. code-block:: +.. code-block:: python result: Message = await SendSticker(...) With specific bot ~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python result: Message = await bot(SendSticker(...)) As reply into Webhook in handler ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python return SendSticker(...) \ No newline at end of file diff --git a/docs2/api/methods/send_venue.rst b/docs2/api/methods/send_venue.rst index 18102d28..6c19d76e 100644 --- a/docs2/api/methods/send_venue.rst +++ b/docs2/api/methods/send_venue.rst @@ -2,14 +2,11 @@ sendVenue ######### -Use this method to send information about a venue. On success, the sent Message is returned. - Returns: :obj:`Message` .. automodule:: aiogram.methods.send_venue :members: :member-order: bysource - :special-members: __init__ :undoc-members: True @@ -29,27 +26,26 @@ Method as object Imports: -- :code:`from aiogram.methods import SendVenue` -- :code:`from aiogram.methods import SendVenue` - :code:`from aiogram.methods.send_venue import SendVenue` +- alias: :code:`from aiogram.methods import SendVenue` In handlers with current bot ---------------------------- -.. code-block:: +.. code-block:: python result: Message = await SendVenue(...) With specific bot ~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python result: Message = await bot(SendVenue(...)) As reply into Webhook in handler ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python return SendVenue(...) \ No newline at end of file diff --git a/docs2/api/methods/send_video.rst b/docs2/api/methods/send_video.rst index c8225e76..4328017a 100644 --- a/docs2/api/methods/send_video.rst +++ b/docs2/api/methods/send_video.rst @@ -2,14 +2,11 @@ sendVideo ######### -Use this method to send video files, Telegram clients support mp4 videos (other formats may be sent as Document). On success, the sent Message is returned. Bots can currently send video files of up to 50 MB in size, this limit may be changed in the future. - Returns: :obj:`Message` .. automodule:: aiogram.methods.send_video :members: :member-order: bysource - :special-members: __init__ :undoc-members: True @@ -29,27 +26,26 @@ Method as object Imports: -- :code:`from aiogram.methods import SendVideo` -- :code:`from aiogram.methods import SendVideo` - :code:`from aiogram.methods.send_video import SendVideo` +- alias: :code:`from aiogram.methods import SendVideo` In handlers with current bot ---------------------------- -.. code-block:: +.. code-block:: python result: Message = await SendVideo(...) With specific bot ~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python result: Message = await bot(SendVideo(...)) As reply into Webhook in handler ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python return SendVideo(...) \ No newline at end of file diff --git a/docs2/api/methods/send_video_note.rst b/docs2/api/methods/send_video_note.rst index c70b7e38..f661a9e0 100644 --- a/docs2/api/methods/send_video_note.rst +++ b/docs2/api/methods/send_video_note.rst @@ -2,14 +2,11 @@ sendVideoNote ############# -As of v.4.0, Telegram clients support rounded square mp4 videos of up to 1 minute long. Use this method to send video messages. On success, the sent Message is returned. - Returns: :obj:`Message` .. automodule:: aiogram.methods.send_video_note :members: :member-order: bysource - :special-members: __init__ :undoc-members: True @@ -29,27 +26,26 @@ Method as object Imports: -- :code:`from aiogram.methods import SendVideoNote` -- :code:`from aiogram.methods import SendVideoNote` - :code:`from aiogram.methods.send_video_note import SendVideoNote` +- alias: :code:`from aiogram.methods import SendVideoNote` In handlers with current bot ---------------------------- -.. code-block:: +.. code-block:: python result: Message = await SendVideoNote(...) With specific bot ~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python result: Message = await bot(SendVideoNote(...)) As reply into Webhook in handler ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python return SendVideoNote(...) \ No newline at end of file diff --git a/docs2/api/methods/send_voice.rst b/docs2/api/methods/send_voice.rst index 1e19e224..82159641 100644 --- a/docs2/api/methods/send_voice.rst +++ b/docs2/api/methods/send_voice.rst @@ -2,14 +2,11 @@ sendVoice ######### -Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .OGG file encoded with OPUS (other formats may be sent as Audio or Document). On success, the sent Message is returned. Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future. - Returns: :obj:`Message` .. automodule:: aiogram.methods.send_voice :members: :member-order: bysource - :special-members: __init__ :undoc-members: True @@ -29,27 +26,26 @@ Method as object Imports: -- :code:`from aiogram.methods import SendVoice` -- :code:`from aiogram.methods import SendVoice` - :code:`from aiogram.methods.send_voice import SendVoice` +- alias: :code:`from aiogram.methods import SendVoice` In handlers with current bot ---------------------------- -.. code-block:: +.. code-block:: python result: Message = await SendVoice(...) With specific bot ~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python result: Message = await bot(SendVoice(...)) As reply into Webhook in handler ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python return SendVoice(...) \ No newline at end of file diff --git a/docs2/api/methods/set_chat_administrator_custom_title.rst b/docs2/api/methods/set_chat_administrator_custom_title.rst index 2f48a924..3e942918 100644 --- a/docs2/api/methods/set_chat_administrator_custom_title.rst +++ b/docs2/api/methods/set_chat_administrator_custom_title.rst @@ -2,14 +2,11 @@ setChatAdministratorCustomTitle ############################### -Use this method to set a custom title for an administrator in a supergroup promoted by the bot. Returns True on success. - Returns: :obj:`bool` .. automodule:: aiogram.methods.set_chat_administrator_custom_title :members: :member-order: bysource - :special-members: __init__ :undoc-members: True @@ -29,27 +26,26 @@ Method as object Imports: -- :code:`from aiogram.methods import SetChatAdministratorCustomTitle` -- :code:`from aiogram.methods import SetChatAdministratorCustomTitle` - :code:`from aiogram.methods.set_chat_administrator_custom_title import SetChatAdministratorCustomTitle` +- alias: :code:`from aiogram.methods import SetChatAdministratorCustomTitle` In handlers with current bot ---------------------------- -.. code-block:: +.. code-block:: python result: bool = await SetChatAdministratorCustomTitle(...) With specific bot ~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python result: bool = await bot(SetChatAdministratorCustomTitle(...)) As reply into Webhook in handler ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python return SetChatAdministratorCustomTitle(...) \ No newline at end of file diff --git a/docs2/api/methods/set_chat_description.rst b/docs2/api/methods/set_chat_description.rst index 556f033a..af1ba8c5 100644 --- a/docs2/api/methods/set_chat_description.rst +++ b/docs2/api/methods/set_chat_description.rst @@ -2,14 +2,11 @@ setChatDescription ################## -Use this method to change the description of a group, a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Returns True on success. - Returns: :obj:`bool` .. automodule:: aiogram.methods.set_chat_description :members: :member-order: bysource - :special-members: __init__ :undoc-members: True @@ -29,27 +26,26 @@ Method as object Imports: -- :code:`from aiogram.methods import SetChatDescription` -- :code:`from aiogram.methods import SetChatDescription` - :code:`from aiogram.methods.set_chat_description import SetChatDescription` +- alias: :code:`from aiogram.methods import SetChatDescription` In handlers with current bot ---------------------------- -.. code-block:: +.. code-block:: python result: bool = await SetChatDescription(...) With specific bot ~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python result: bool = await bot(SetChatDescription(...)) As reply into Webhook in handler ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python return SetChatDescription(...) \ No newline at end of file diff --git a/docs2/api/methods/set_chat_permissions.rst b/docs2/api/methods/set_chat_permissions.rst index 77a69fcf..87f8fa84 100644 --- a/docs2/api/methods/set_chat_permissions.rst +++ b/docs2/api/methods/set_chat_permissions.rst @@ -2,14 +2,11 @@ setChatPermissions ################## -Use this method to set default chat permissions for all members. The bot must be an administrator in the group or a supergroup for this to work and must have the can_restrict_members admin rights. Returns True on success. - Returns: :obj:`bool` .. automodule:: aiogram.methods.set_chat_permissions :members: :member-order: bysource - :special-members: __init__ :undoc-members: True @@ -29,27 +26,26 @@ Method as object Imports: -- :code:`from aiogram.methods import SetChatPermissions` -- :code:`from aiogram.methods import SetChatPermissions` - :code:`from aiogram.methods.set_chat_permissions import SetChatPermissions` +- alias: :code:`from aiogram.methods import SetChatPermissions` In handlers with current bot ---------------------------- -.. code-block:: +.. code-block:: python result: bool = await SetChatPermissions(...) With specific bot ~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python result: bool = await bot(SetChatPermissions(...)) As reply into Webhook in handler ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python return SetChatPermissions(...) \ No newline at end of file diff --git a/docs2/api/methods/set_chat_photo.rst b/docs2/api/methods/set_chat_photo.rst index ad895c65..a2133a14 100644 --- a/docs2/api/methods/set_chat_photo.rst +++ b/docs2/api/methods/set_chat_photo.rst @@ -2,14 +2,11 @@ setChatPhoto ############ -Use this method to set a new profile photo for the chat. Photos can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Returns True on success. - Returns: :obj:`bool` .. automodule:: aiogram.methods.set_chat_photo :members: :member-order: bysource - :special-members: __init__ :undoc-members: True @@ -29,21 +26,20 @@ Method as object Imports: -- :code:`from aiogram.methods import SetChatPhoto` -- :code:`from aiogram.methods import SetChatPhoto` - :code:`from aiogram.methods.set_chat_photo import SetChatPhoto` +- alias: :code:`from aiogram.methods import SetChatPhoto` In handlers with current bot ---------------------------- -.. code-block:: +.. code-block:: python result: bool = await SetChatPhoto(...) With specific bot ~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python result: bool = await bot(SetChatPhoto(...)) diff --git a/docs2/api/methods/set_chat_sticker_set.rst b/docs2/api/methods/set_chat_sticker_set.rst index dbfd860c..f0a76edb 100644 --- a/docs2/api/methods/set_chat_sticker_set.rst +++ b/docs2/api/methods/set_chat_sticker_set.rst @@ -2,14 +2,11 @@ setChatStickerSet ################# -Use this method to set a new group sticker set for a supergroup. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Use the field can_set_sticker_set optionally returned in getChat requests to check if the bot can use this method. Returns True on success. - Returns: :obj:`bool` .. automodule:: aiogram.methods.set_chat_sticker_set :members: :member-order: bysource - :special-members: __init__ :undoc-members: True @@ -29,27 +26,26 @@ Method as object Imports: -- :code:`from aiogram.methods import SetChatStickerSet` -- :code:`from aiogram.methods import SetChatStickerSet` - :code:`from aiogram.methods.set_chat_sticker_set import SetChatStickerSet` +- alias: :code:`from aiogram.methods import SetChatStickerSet` In handlers with current bot ---------------------------- -.. code-block:: +.. code-block:: python result: bool = await SetChatStickerSet(...) With specific bot ~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python result: bool = await bot(SetChatStickerSet(...)) As reply into Webhook in handler ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python return SetChatStickerSet(...) \ No newline at end of file diff --git a/docs2/api/methods/set_chat_title.rst b/docs2/api/methods/set_chat_title.rst index c343da43..efba5e20 100644 --- a/docs2/api/methods/set_chat_title.rst +++ b/docs2/api/methods/set_chat_title.rst @@ -2,14 +2,11 @@ setChatTitle ############ -Use this method to change the title of a chat. Titles can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Returns True on success. - Returns: :obj:`bool` .. automodule:: aiogram.methods.set_chat_title :members: :member-order: bysource - :special-members: __init__ :undoc-members: True @@ -29,27 +26,26 @@ Method as object Imports: -- :code:`from aiogram.methods import SetChatTitle` -- :code:`from aiogram.methods import SetChatTitle` - :code:`from aiogram.methods.set_chat_title import SetChatTitle` +- alias: :code:`from aiogram.methods import SetChatTitle` In handlers with current bot ---------------------------- -.. code-block:: +.. code-block:: python result: bool = await SetChatTitle(...) With specific bot ~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python result: bool = await bot(SetChatTitle(...)) As reply into Webhook in handler ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python return SetChatTitle(...) \ No newline at end of file diff --git a/docs2/api/methods/set_game_score.rst b/docs2/api/methods/set_game_score.rst index 7162d34e..e631c07b 100644 --- a/docs2/api/methods/set_game_score.rst +++ b/docs2/api/methods/set_game_score.rst @@ -2,14 +2,11 @@ setGameScore ############ -Use this method to set the score of the specified user in a game. On success, if the message was sent by the bot, returns the edited Message, otherwise returns True. Returns an error, if the new score is not greater than the user's current score in the chat and force is False. - Returns: :obj:`Union[Message, bool]` .. automodule:: aiogram.methods.set_game_score :members: :member-order: bysource - :special-members: __init__ :undoc-members: True @@ -29,27 +26,26 @@ Method as object Imports: -- :code:`from aiogram.methods import SetGameScore` -- :code:`from aiogram.methods import SetGameScore` - :code:`from aiogram.methods.set_game_score import SetGameScore` +- alias: :code:`from aiogram.methods import SetGameScore` In handlers with current bot ---------------------------- -.. code-block:: +.. code-block:: python result: Union[Message, bool] = await SetGameScore(...) With specific bot ~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python result: Union[Message, bool] = await bot(SetGameScore(...)) As reply into Webhook in handler ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python return SetGameScore(...) \ No newline at end of file diff --git a/docs2/api/methods/set_my_commands.rst b/docs2/api/methods/set_my_commands.rst index a98fa366..5f6db367 100644 --- a/docs2/api/methods/set_my_commands.rst +++ b/docs2/api/methods/set_my_commands.rst @@ -2,14 +2,11 @@ setMyCommands ############# -Use this method to change the list of the bot's commands. Returns True on success. - Returns: :obj:`bool` .. automodule:: aiogram.methods.set_my_commands :members: :member-order: bysource - :special-members: __init__ :undoc-members: True @@ -29,27 +26,26 @@ Method as object Imports: -- :code:`from aiogram.methods import SetMyCommands` -- :code:`from aiogram.methods import SetMyCommands` - :code:`from aiogram.methods.set_my_commands import SetMyCommands` +- alias: :code:`from aiogram.methods import SetMyCommands` In handlers with current bot ---------------------------- -.. code-block:: +.. code-block:: python result: bool = await SetMyCommands(...) With specific bot ~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python result: bool = await bot(SetMyCommands(...)) As reply into Webhook in handler ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python return SetMyCommands(...) \ No newline at end of file diff --git a/docs2/api/methods/set_passport_data_errors.rst b/docs2/api/methods/set_passport_data_errors.rst index 2b25423c..14c00b44 100644 --- a/docs2/api/methods/set_passport_data_errors.rst +++ b/docs2/api/methods/set_passport_data_errors.rst @@ -2,16 +2,11 @@ setPassportDataErrors ##################### -Informs a user that some of the Telegram Passport elements they provided contains errors. The user will not be able to re-submit their Passport to you until the errors are fixed (the contents of the field for which you returned the error must change). Returns True on success. - -Use this if the data submitted by the user doesn't satisfy the standards your service requires for any reason. For example, if a birthday date seems invalid, a submitted document is blurry, a scan shows evidence of tampering, etc. Supply some details in the error message to make sure the user knows how to correct the issues. - Returns: :obj:`bool` .. automodule:: aiogram.methods.set_passport_data_errors :members: :member-order: bysource - :special-members: __init__ :undoc-members: True @@ -31,27 +26,26 @@ Method as object Imports: -- :code:`from aiogram.methods import SetPassportDataErrors` -- :code:`from aiogram.methods import SetPassportDataErrors` - :code:`from aiogram.methods.set_passport_data_errors import SetPassportDataErrors` +- alias: :code:`from aiogram.methods import SetPassportDataErrors` In handlers with current bot ---------------------------- -.. code-block:: +.. code-block:: python result: bool = await SetPassportDataErrors(...) With specific bot ~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python result: bool = await bot(SetPassportDataErrors(...)) As reply into Webhook in handler ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python return SetPassportDataErrors(...) \ No newline at end of file diff --git a/docs2/api/methods/set_sticker_position_in_set.rst b/docs2/api/methods/set_sticker_position_in_set.rst index ea039919..a9efce31 100644 --- a/docs2/api/methods/set_sticker_position_in_set.rst +++ b/docs2/api/methods/set_sticker_position_in_set.rst @@ -2,14 +2,11 @@ setStickerPositionInSet ####################### -Use this method to move a sticker in a set created by the bot to a specific position. Returns True on success. - Returns: :obj:`bool` .. automodule:: aiogram.methods.set_sticker_position_in_set :members: :member-order: bysource - :special-members: __init__ :undoc-members: True @@ -29,27 +26,26 @@ Method as object Imports: -- :code:`from aiogram.methods import SetStickerPositionInSet` -- :code:`from aiogram.methods import SetStickerPositionInSet` - :code:`from aiogram.methods.set_sticker_position_in_set import SetStickerPositionInSet` +- alias: :code:`from aiogram.methods import SetStickerPositionInSet` In handlers with current bot ---------------------------- -.. code-block:: +.. code-block:: python result: bool = await SetStickerPositionInSet(...) With specific bot ~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python result: bool = await bot(SetStickerPositionInSet(...)) As reply into Webhook in handler ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python return SetStickerPositionInSet(...) \ No newline at end of file diff --git a/docs2/api/methods/set_sticker_set_thumb.rst b/docs2/api/methods/set_sticker_set_thumb.rst index 9c534a74..d2959f03 100644 --- a/docs2/api/methods/set_sticker_set_thumb.rst +++ b/docs2/api/methods/set_sticker_set_thumb.rst @@ -2,14 +2,11 @@ setStickerSetThumb ################## -Use this method to set the thumbnail of a sticker set. Animated thumbnails can be set for animated sticker sets only. Returns True on success. - Returns: :obj:`bool` .. automodule:: aiogram.methods.set_sticker_set_thumb :members: :member-order: bysource - :special-members: __init__ :undoc-members: True @@ -29,27 +26,26 @@ Method as object Imports: -- :code:`from aiogram.methods import SetStickerSetThumb` -- :code:`from aiogram.methods import SetStickerSetThumb` - :code:`from aiogram.methods.set_sticker_set_thumb import SetStickerSetThumb` +- alias: :code:`from aiogram.methods import SetStickerSetThumb` In handlers with current bot ---------------------------- -.. code-block:: +.. code-block:: python result: bool = await SetStickerSetThumb(...) With specific bot ~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python result: bool = await bot(SetStickerSetThumb(...)) As reply into Webhook in handler ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python return SetStickerSetThumb(...) \ No newline at end of file diff --git a/docs2/api/methods/set_webhook.rst b/docs2/api/methods/set_webhook.rst index 9905ad94..c5188243 100644 --- a/docs2/api/methods/set_webhook.rst +++ b/docs2/api/methods/set_webhook.rst @@ -2,26 +2,11 @@ setWebhook ########## -Use this method to specify a url and receive incoming updates via an outgoing webhook. Whenever there is an update for the bot, we will send an HTTPS POST request to the specified url, containing a JSON-serialized Update. In case of an unsuccessful request, we will give up after a reasonable amount of attempts. Returns True on success. - -If you'd like to make sure that the Webhook request comes from Telegram, we recommend using a secret path in the URL, e.g. https://www.example.com/. Since nobody else knows your bot's token, you can be pretty sure it's us. - -Notes - -1. You will not be able to receive updates using getUpdates for as long as an outgoing webhook is set up. - -2. To use a self-signed certificate, you need to upload your public key certificate using certificate parameter. Please upload as InputFile, sending a String will not work. - -3. Ports currently supported for Webhooks: 443, 80, 88, 8443. - -NEW! If you're having any trouble setting up webhooks, please check out this amazing guide to Webhooks. - Returns: :obj:`bool` .. automodule:: aiogram.methods.set_webhook :members: :member-order: bysource - :special-members: __init__ :undoc-members: True @@ -41,27 +26,26 @@ Method as object Imports: -- :code:`from aiogram.methods import SetWebhook` -- :code:`from aiogram.methods import SetWebhook` - :code:`from aiogram.methods.set_webhook import SetWebhook` +- alias: :code:`from aiogram.methods import SetWebhook` In handlers with current bot ---------------------------- -.. code-block:: +.. code-block:: python result: bool = await SetWebhook(...) With specific bot ~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python result: bool = await bot(SetWebhook(...)) As reply into Webhook in handler ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python return SetWebhook(...) \ No newline at end of file diff --git a/docs2/api/methods/stop_message_live_location.rst b/docs2/api/methods/stop_message_live_location.rst index 10adc392..bc997f43 100644 --- a/docs2/api/methods/stop_message_live_location.rst +++ b/docs2/api/methods/stop_message_live_location.rst @@ -2,14 +2,11 @@ stopMessageLiveLocation ####################### -Use this method to stop updating a live location message before live_period expires. On success, if the message was sent by the bot, the sent Message is returned, otherwise True is returned. - Returns: :obj:`Union[Message, bool]` .. automodule:: aiogram.methods.stop_message_live_location :members: :member-order: bysource - :special-members: __init__ :undoc-members: True @@ -29,27 +26,26 @@ Method as object Imports: -- :code:`from aiogram.methods import StopMessageLiveLocation` -- :code:`from aiogram.methods import StopMessageLiveLocation` - :code:`from aiogram.methods.stop_message_live_location import StopMessageLiveLocation` +- alias: :code:`from aiogram.methods import StopMessageLiveLocation` In handlers with current bot ---------------------------- -.. code-block:: +.. code-block:: python result: Union[Message, bool] = await StopMessageLiveLocation(...) With specific bot ~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python result: Union[Message, bool] = await bot(StopMessageLiveLocation(...)) As reply into Webhook in handler ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python return StopMessageLiveLocation(...) \ No newline at end of file diff --git a/docs2/api/methods/stop_poll.rst b/docs2/api/methods/stop_poll.rst index 904b26da..e0ad1046 100644 --- a/docs2/api/methods/stop_poll.rst +++ b/docs2/api/methods/stop_poll.rst @@ -2,14 +2,11 @@ stopPoll ######## -Use this method to stop a poll which was sent by the bot. On success, the stopped Poll with the final results is returned. - Returns: :obj:`Poll` .. automodule:: aiogram.methods.stop_poll :members: :member-order: bysource - :special-members: __init__ :undoc-members: True @@ -29,27 +26,26 @@ Method as object Imports: -- :code:`from aiogram.methods import StopPoll` -- :code:`from aiogram.methods import StopPoll` - :code:`from aiogram.methods.stop_poll import StopPoll` +- alias: :code:`from aiogram.methods import StopPoll` In handlers with current bot ---------------------------- -.. code-block:: +.. code-block:: python result: Poll = await StopPoll(...) With specific bot ~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python result: Poll = await bot(StopPoll(...)) As reply into Webhook in handler ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python return StopPoll(...) \ No newline at end of file diff --git a/docs2/api/methods/unban_chat_member.rst b/docs2/api/methods/unban_chat_member.rst index 4760047c..c49779e4 100644 --- a/docs2/api/methods/unban_chat_member.rst +++ b/docs2/api/methods/unban_chat_member.rst @@ -2,14 +2,11 @@ unbanChatMember ############### -Use this method to unban a previously kicked user in a supergroup or channel. The user will not return to the group or channel automatically, but will be able to join via link, etc. The bot must be an administrator for this to work. Returns True on success. - Returns: :obj:`bool` .. automodule:: aiogram.methods.unban_chat_member :members: :member-order: bysource - :special-members: __init__ :undoc-members: True @@ -29,27 +26,26 @@ Method as object Imports: -- :code:`from aiogram.methods import UnbanChatMember` -- :code:`from aiogram.methods import UnbanChatMember` - :code:`from aiogram.methods.unban_chat_member import UnbanChatMember` +- alias: :code:`from aiogram.methods import UnbanChatMember` In handlers with current bot ---------------------------- -.. code-block:: +.. code-block:: python result: bool = await UnbanChatMember(...) With specific bot ~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python result: bool = await bot(UnbanChatMember(...)) As reply into Webhook in handler ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python return UnbanChatMember(...) \ No newline at end of file diff --git a/docs2/api/methods/unpin_all_chat_messages.rst b/docs2/api/methods/unpin_all_chat_messages.rst new file mode 100644 index 00000000..c4c9b930 --- /dev/null +++ b/docs2/api/methods/unpin_all_chat_messages.rst @@ -0,0 +1,51 @@ +#################### +unpinAllChatMessages +#################### + +Returns: :obj:`bool` + +.. automodule:: aiogram.methods.unpin_all_chat_messages + :members: + :member-order: bysource + :undoc-members: True + + +Usage +===== + +As bot method +------------- + +.. code-block:: + + result: bool = await bot.unpin_all_chat_messages(...) + + +Method as object +---------------- + +Imports: + +- :code:`from aiogram.methods.unpin_all_chat_messages import UnpinAllChatMessages` +- alias: :code:`from aiogram.methods import UnpinAllChatMessages` + +In handlers with current bot +---------------------------- + +.. code-block:: python + + result: bool = await UnpinAllChatMessages(...) + +With specific bot +~~~~~~~~~~~~~~~~~ + +.. code-block:: python + + result: bool = await bot(UnpinAllChatMessages(...)) + +As reply into Webhook in handler +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. code-block:: python + + return UnpinAllChatMessages(...) \ No newline at end of file diff --git a/docs2/api/methods/unpin_chat_message.rst b/docs2/api/methods/unpin_chat_message.rst index 739bb8ae..c1d1d68d 100644 --- a/docs2/api/methods/unpin_chat_message.rst +++ b/docs2/api/methods/unpin_chat_message.rst @@ -2,14 +2,11 @@ unpinChatMessage ################ -Use this method to unpin a message in a group, a supergroup, or a channel. The bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' admin right in the supergroup or 'can_edit_messages' admin right in the channel. Returns True on success. - Returns: :obj:`bool` .. automodule:: aiogram.methods.unpin_chat_message :members: :member-order: bysource - :special-members: __init__ :undoc-members: True @@ -29,27 +26,26 @@ Method as object Imports: -- :code:`from aiogram.methods import UnpinChatMessage` -- :code:`from aiogram.methods import UnpinChatMessage` - :code:`from aiogram.methods.unpin_chat_message import UnpinChatMessage` +- alias: :code:`from aiogram.methods import UnpinChatMessage` In handlers with current bot ---------------------------- -.. code-block:: +.. code-block:: python result: bool = await UnpinChatMessage(...) With specific bot ~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python result: bool = await bot(UnpinChatMessage(...)) As reply into Webhook in handler ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python return UnpinChatMessage(...) \ No newline at end of file diff --git a/docs2/api/methods/upload_sticker_file.rst b/docs2/api/methods/upload_sticker_file.rst index deb47ada..4d763556 100644 --- a/docs2/api/methods/upload_sticker_file.rst +++ b/docs2/api/methods/upload_sticker_file.rst @@ -2,14 +2,11 @@ uploadStickerFile ################# -Use this method to upload a .PNG file with a sticker for later use in createNewStickerSet and addStickerToSet methods (can be used multiple times). Returns the uploaded File on success. - Returns: :obj:`File` .. automodule:: aiogram.methods.upload_sticker_file :members: :member-order: bysource - :special-members: __init__ :undoc-members: True @@ -29,21 +26,20 @@ Method as object Imports: -- :code:`from aiogram.methods import UploadStickerFile` -- :code:`from aiogram.methods import UploadStickerFile` - :code:`from aiogram.methods.upload_sticker_file import UploadStickerFile` +- alias: :code:`from aiogram.methods import UploadStickerFile` In handlers with current bot ---------------------------- -.. code-block:: +.. code-block:: python result: File = await UploadStickerFile(...) With specific bot ~~~~~~~~~~~~~~~~~ -.. code-block:: +.. code-block:: python result: File = await bot(UploadStickerFile(...)) diff --git a/docs2/api/types/animation.rst b/docs2/api/types/animation.rst index 731eb3f9..4d48b1e1 100644 --- a/docs2/api/types/animation.rst +++ b/docs2/api/types/animation.rst @@ -2,10 +2,8 @@ Animation ######### -This object represents an animation file (GIF or H.264/MPEG-4 AVC video without sound). .. automodule:: aiogram.types.animation :members: :member-order: bysource - :special-members: __init__ :undoc-members: True \ No newline at end of file diff --git a/docs2/api/types/audio.rst b/docs2/api/types/audio.rst index 1ac2eba4..9eba9027 100644 --- a/docs2/api/types/audio.rst +++ b/docs2/api/types/audio.rst @@ -2,10 +2,8 @@ Audio ##### -This object represents an audio file to be treated as music by the Telegram clients. .. automodule:: aiogram.types.audio :members: :member-order: bysource - :special-members: __init__ :undoc-members: True \ No newline at end of file diff --git a/docs2/api/types/bot_command.rst b/docs2/api/types/bot_command.rst index c355045f..a8364c68 100644 --- a/docs2/api/types/bot_command.rst +++ b/docs2/api/types/bot_command.rst @@ -2,10 +2,8 @@ BotCommand ########## -This object represents a bot command. .. automodule:: aiogram.types.bot_command :members: :member-order: bysource - :special-members: __init__ :undoc-members: True \ No newline at end of file diff --git a/docs2/api/types/callback_game.rst b/docs2/api/types/callback_game.rst index efaec6d3..89f2c91e 100644 --- a/docs2/api/types/callback_game.rst +++ b/docs2/api/types/callback_game.rst @@ -2,10 +2,8 @@ CallbackGame ############ -A placeholder, currently holds no information. Use BotFather to set up your game. .. automodule:: aiogram.types.callback_game :members: :member-order: bysource - :special-members: __init__ :undoc-members: True \ No newline at end of file diff --git a/docs2/api/types/callback_query.rst b/docs2/api/types/callback_query.rst index 5a5c14cf..f8d34ddd 100644 --- a/docs2/api/types/callback_query.rst +++ b/docs2/api/types/callback_query.rst @@ -2,12 +2,8 @@ CallbackQuery ############# -This object represents an incoming callback query from a callback button in an inline keyboard. If the button that originated the query was attached to a message sent by the bot, the field message will be present. If the button was attached to a message sent via the bot (in inline mode), the field inline_message_id will be present. Exactly one of the fields data or game_short_name will be present. - -NOTE: After the user presses a callback button, Telegram clients will display a progress bar until you call answerCallbackQuery. It is, therefore, necessary to react by calling answerCallbackQuery even if no notification to the user is needed (e.g., without specifying any of the optional parameters). .. automodule:: aiogram.types.callback_query :members: :member-order: bysource - :special-members: __init__ :undoc-members: True \ No newline at end of file diff --git a/docs2/api/types/chat.rst b/docs2/api/types/chat.rst index 01378fdd..800dead4 100644 --- a/docs2/api/types/chat.rst +++ b/docs2/api/types/chat.rst @@ -2,10 +2,8 @@ Chat #### -This object represents a chat. .. automodule:: aiogram.types.chat :members: :member-order: bysource - :special-members: __init__ :undoc-members: True \ No newline at end of file diff --git a/docs2/api/types/chat_location.rst b/docs2/api/types/chat_location.rst new file mode 100644 index 00000000..84f4bef9 --- /dev/null +++ b/docs2/api/types/chat_location.rst @@ -0,0 +1,9 @@ +############ +ChatLocation +############ + + +.. automodule:: aiogram.types.chat_location + :members: + :member-order: bysource + :undoc-members: True \ No newline at end of file diff --git a/docs2/api/types/chat_member.rst b/docs2/api/types/chat_member.rst index b52cf717..4fff69f9 100644 --- a/docs2/api/types/chat_member.rst +++ b/docs2/api/types/chat_member.rst @@ -2,10 +2,8 @@ ChatMember ########## -This object contains information about one member of a chat. .. automodule:: aiogram.types.chat_member :members: :member-order: bysource - :special-members: __init__ :undoc-members: True \ No newline at end of file diff --git a/docs2/api/types/chat_permissions.rst b/docs2/api/types/chat_permissions.rst index 984e0d84..b3020a19 100644 --- a/docs2/api/types/chat_permissions.rst +++ b/docs2/api/types/chat_permissions.rst @@ -2,10 +2,8 @@ ChatPermissions ############### -Describes actions that a non-administrator user is allowed to take in a chat. .. automodule:: aiogram.types.chat_permissions :members: :member-order: bysource - :special-members: __init__ :undoc-members: True \ No newline at end of file diff --git a/docs2/api/types/chat_photo.rst b/docs2/api/types/chat_photo.rst index 4452b19a..bc7c8a5e 100644 --- a/docs2/api/types/chat_photo.rst +++ b/docs2/api/types/chat_photo.rst @@ -2,10 +2,8 @@ ChatPhoto ######### -This object represents a chat photo. .. automodule:: aiogram.types.chat_photo :members: :member-order: bysource - :special-members: __init__ :undoc-members: True \ No newline at end of file diff --git a/docs2/api/types/chosen_inline_result.rst b/docs2/api/types/chosen_inline_result.rst index f63bab7b..fe4d7c11 100644 --- a/docs2/api/types/chosen_inline_result.rst +++ b/docs2/api/types/chosen_inline_result.rst @@ -2,12 +2,8 @@ ChosenInlineResult ################## -Represents a result of an inline query that was chosen by the user and sent to their chat partner. - -Note: It is necessary to enable inline feedback via @Botfather in order to receive these objects in updates. .. automodule:: aiogram.types.chosen_inline_result :members: :member-order: bysource - :special-members: __init__ :undoc-members: True \ No newline at end of file diff --git a/docs2/api/types/contact.rst b/docs2/api/types/contact.rst index e9bef6d6..aa75232e 100644 --- a/docs2/api/types/contact.rst +++ b/docs2/api/types/contact.rst @@ -2,10 +2,8 @@ Contact ####### -This object represents a phone contact. .. automodule:: aiogram.types.contact :members: :member-order: bysource - :special-members: __init__ :undoc-members: True \ No newline at end of file diff --git a/docs2/api/types/dice.rst b/docs2/api/types/dice.rst index e5654dc2..15dbab13 100644 --- a/docs2/api/types/dice.rst +++ b/docs2/api/types/dice.rst @@ -2,10 +2,8 @@ Dice #### -This object represents an animated emoji that displays a random value. .. automodule:: aiogram.types.dice :members: :member-order: bysource - :special-members: __init__ :undoc-members: True \ No newline at end of file diff --git a/docs2/api/types/document.rst b/docs2/api/types/document.rst index 0e63f422..8138cf2c 100644 --- a/docs2/api/types/document.rst +++ b/docs2/api/types/document.rst @@ -2,10 +2,8 @@ Document ######## -This object represents a general file (as opposed to photos, voice messages and audio files). .. automodule:: aiogram.types.document :members: :member-order: bysource - :special-members: __init__ :undoc-members: True \ No newline at end of file diff --git a/docs2/api/types/encrypted_credentials.rst b/docs2/api/types/encrypted_credentials.rst index a53c1f1d..185e7881 100644 --- a/docs2/api/types/encrypted_credentials.rst +++ b/docs2/api/types/encrypted_credentials.rst @@ -2,10 +2,8 @@ EncryptedCredentials #################### -Contains data required for decrypting and authenticating EncryptedPassportElement. See the Telegram Passport Documentation for a complete description of the data decryption and authentication processes. .. automodule:: aiogram.types.encrypted_credentials :members: :member-order: bysource - :special-members: __init__ :undoc-members: True \ No newline at end of file diff --git a/docs2/api/types/encrypted_passport_element.rst b/docs2/api/types/encrypted_passport_element.rst index 9fb99a42..78a5c223 100644 --- a/docs2/api/types/encrypted_passport_element.rst +++ b/docs2/api/types/encrypted_passport_element.rst @@ -2,10 +2,8 @@ EncryptedPassportElement ######################## -Contains information about documents or other Telegram Passport elements shared with the bot by the user. .. automodule:: aiogram.types.encrypted_passport_element :members: :member-order: bysource - :special-members: __init__ :undoc-members: True \ No newline at end of file diff --git a/docs2/api/types/file.rst b/docs2/api/types/file.rst index 24e00e62..4089e6c8 100644 --- a/docs2/api/types/file.rst +++ b/docs2/api/types/file.rst @@ -2,12 +2,8 @@ File #### -This object represents a file ready to be downloaded. The file can be downloaded via the link https://api.telegram.org/file/bot/. It is guaranteed that the link will be valid for at least 1 hour. When the link expires, a new one can be requested by calling getFile. - -Maximum file size to download is 20 MB .. automodule:: aiogram.types.file :members: :member-order: bysource - :special-members: __init__ :undoc-members: True \ No newline at end of file diff --git a/docs2/api/types/force_reply.rst b/docs2/api/types/force_reply.rst index 9e923453..e15d8b18 100644 --- a/docs2/api/types/force_reply.rst +++ b/docs2/api/types/force_reply.rst @@ -2,20 +2,8 @@ ForceReply ########## -Upon receiving a message with this object, Telegram clients will display a reply interface to the user (act as if the user has selected the bot's message and tapped 'Reply'). This can be extremely useful if you want to create user-friendly step-by-step interfaces without having to sacrifice privacy mode. - -Example: A poll bot for groups runs in privacy mode (only receives commands, replies to its messages and mentions). There could be two ways to create a new poll: - - - -Explain the user how to send a command with parameters (e.g. /newpoll question answer1 answer2). May be appealing for hardcore users but lacks modern day polish. - -Guide the user through a step-by-step process. 'Please send me your question', 'Cool, now let's add the first answer option', 'Great. Keep adding answer options, then send /done when you're ready'. - -The last option is definitely more attractive. And if you use ForceReply in your bot's questions, it will receive the user's answers even if it only receives replies, commands and mentions — without any extra work for the user. .. automodule:: aiogram.types.force_reply :members: :member-order: bysource - :special-members: __init__ :undoc-members: True \ No newline at end of file diff --git a/docs2/api/types/game.rst b/docs2/api/types/game.rst index df08b437..706206fc 100644 --- a/docs2/api/types/game.rst +++ b/docs2/api/types/game.rst @@ -2,10 +2,8 @@ Game #### -This object represents a game. Use BotFather to create and edit games, their short names will act as unique identifiers. .. automodule:: aiogram.types.game :members: :member-order: bysource - :special-members: __init__ :undoc-members: True \ No newline at end of file diff --git a/docs2/api/types/game_high_score.rst b/docs2/api/types/game_high_score.rst index 3ac5372c..044c70ed 100644 --- a/docs2/api/types/game_high_score.rst +++ b/docs2/api/types/game_high_score.rst @@ -2,14 +2,8 @@ GameHighScore ############# -This object represents one row of the high scores table for a game. - -And that's about all we've got for now. - -If you've got any questions, please check out our Bot FAQ .. automodule:: aiogram.types.game_high_score :members: :member-order: bysource - :special-members: __init__ :undoc-members: True \ No newline at end of file diff --git a/docs2/api/types/index.rst b/docs2/api/types/index.rst index 68c601fe..07f8be47 100644 --- a/docs2/api/types/index.rst +++ b/docs2/api/types/index.rst @@ -2,12 +2,9 @@ Types ##### -All types is also wrapped with `pydantic `_ and placed in `aiogram.types` package. -In this place makes some more differences with official documentations: +Here is list of all available API types: + -- name :attr:`from` was renamed to :attr:`from_user` in due to :attr:`from` is an `keyword in python `_ -- timestamps has :class:`datetime.datetime` type instead of :class:`int` -- InputFile is used for sending files and is not use `pydantic.BaseModel` as base class Getting updates =============== @@ -27,6 +24,7 @@ Available types user chat message + message_id message_entity photo_size animation @@ -42,6 +40,7 @@ Available types poll location venue + proximity_alert_triggered user_profile_photos file reply_keyboard_markup @@ -56,6 +55,7 @@ Available types chat_photo chat_member chat_permissions + chat_location bot_command response_parameters input_media @@ -158,3 +158,4 @@ Games game callback_game game_high_score + diff --git a/docs2/api/types/inline_keyboard_button.rst b/docs2/api/types/inline_keyboard_button.rst index 2526ca77..3689b038 100644 --- a/docs2/api/types/inline_keyboard_button.rst +++ b/docs2/api/types/inline_keyboard_button.rst @@ -2,10 +2,8 @@ InlineKeyboardButton #################### -This object represents one button of an inline keyboard. You must use exactly one of the optional fields. .. automodule:: aiogram.types.inline_keyboard_button :members: :member-order: bysource - :special-members: __init__ :undoc-members: True \ No newline at end of file diff --git a/docs2/api/types/inline_keyboard_markup.rst b/docs2/api/types/inline_keyboard_markup.rst index 34113d43..bdb03b8e 100644 --- a/docs2/api/types/inline_keyboard_markup.rst +++ b/docs2/api/types/inline_keyboard_markup.rst @@ -2,12 +2,8 @@ InlineKeyboardMarkup #################### -This object represents an inline keyboard that appears right next to the message it belongs to. - -Note: This will only work in Telegram versions released after 9 April, 2016. Older clients will display unsupported message. .. automodule:: aiogram.types.inline_keyboard_markup :members: :member-order: bysource - :special-members: __init__ :undoc-members: True \ No newline at end of file diff --git a/docs2/api/types/inline_query.rst b/docs2/api/types/inline_query.rst index 6af1dc16..ab1b08e5 100644 --- a/docs2/api/types/inline_query.rst +++ b/docs2/api/types/inline_query.rst @@ -2,10 +2,8 @@ InlineQuery ########### -This object represents an incoming inline query. When the user sends an empty query, your bot could return some default or trending results. .. automodule:: aiogram.types.inline_query :members: :member-order: bysource - :special-members: __init__ :undoc-members: True \ No newline at end of file diff --git a/docs2/api/types/inline_query_result.rst b/docs2/api/types/inline_query_result.rst index 82467610..8f65bd92 100644 --- a/docs2/api/types/inline_query_result.rst +++ b/docs2/api/types/inline_query_result.rst @@ -2,50 +2,8 @@ InlineQueryResult ################# -This object represents one result of an inline query. Telegram clients currently support results of the following 20 types: - - - InlineQueryResultCachedAudio - - - InlineQueryResultCachedDocument - - - InlineQueryResultCachedGif - - - InlineQueryResultCachedMpeg4Gif - - - InlineQueryResultCachedPhoto - - - InlineQueryResultCachedSticker - - - InlineQueryResultCachedVideo - - - InlineQueryResultCachedVoice - - - InlineQueryResultArticle - - - InlineQueryResultAudio - - - InlineQueryResultContact - - - InlineQueryResultGame - - - InlineQueryResultDocument - - - InlineQueryResultGif - - - InlineQueryResultLocation - - - InlineQueryResultMpeg4Gif - - - InlineQueryResultPhoto - - - InlineQueryResultVenue - - - InlineQueryResultVideo - - - InlineQueryResultVoice .. automodule:: aiogram.types.inline_query_result :members: :member-order: bysource - :special-members: __init__ :undoc-members: True \ No newline at end of file diff --git a/docs2/api/types/inline_query_result_article.rst b/docs2/api/types/inline_query_result_article.rst index 0218ceb5..a633ba41 100644 --- a/docs2/api/types/inline_query_result_article.rst +++ b/docs2/api/types/inline_query_result_article.rst @@ -2,10 +2,8 @@ InlineQueryResultArticle ######################## -Represents a link to an article or web page. .. automodule:: aiogram.types.inline_query_result_article :members: :member-order: bysource - :special-members: __init__ :undoc-members: True \ No newline at end of file diff --git a/docs2/api/types/inline_query_result_audio.rst b/docs2/api/types/inline_query_result_audio.rst index d10242f0..584ee611 100644 --- a/docs2/api/types/inline_query_result_audio.rst +++ b/docs2/api/types/inline_query_result_audio.rst @@ -2,12 +2,8 @@ InlineQueryResultAudio ###################### -Represents a link to an MP3 audio file. By default, this audio file will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the audio. - -Note: This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them. .. automodule:: aiogram.types.inline_query_result_audio :members: :member-order: bysource - :special-members: __init__ :undoc-members: True \ No newline at end of file diff --git a/docs2/api/types/inline_query_result_cached_audio.rst b/docs2/api/types/inline_query_result_cached_audio.rst index 74abe8aa..af64c31a 100644 --- a/docs2/api/types/inline_query_result_cached_audio.rst +++ b/docs2/api/types/inline_query_result_cached_audio.rst @@ -2,12 +2,8 @@ InlineQueryResultCachedAudio ############################ -Represents a link to an MP3 audio file stored on the Telegram servers. By default, this audio file will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the audio. - -Note: This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them. .. automodule:: aiogram.types.inline_query_result_cached_audio :members: :member-order: bysource - :special-members: __init__ :undoc-members: True \ No newline at end of file diff --git a/docs2/api/types/inline_query_result_cached_document.rst b/docs2/api/types/inline_query_result_cached_document.rst index 44ccb859..39ebaf3c 100644 --- a/docs2/api/types/inline_query_result_cached_document.rst +++ b/docs2/api/types/inline_query_result_cached_document.rst @@ -2,12 +2,8 @@ InlineQueryResultCachedDocument ############################### -Represents a link to a file stored on the Telegram servers. By default, this file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the file. - -Note: This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them. .. automodule:: aiogram.types.inline_query_result_cached_document :members: :member-order: bysource - :special-members: __init__ :undoc-members: True \ No newline at end of file diff --git a/docs2/api/types/inline_query_result_cached_gif.rst b/docs2/api/types/inline_query_result_cached_gif.rst index 76197701..7d88ab69 100644 --- a/docs2/api/types/inline_query_result_cached_gif.rst +++ b/docs2/api/types/inline_query_result_cached_gif.rst @@ -2,10 +2,8 @@ InlineQueryResultCachedGif ########################## -Represents a link to an animated GIF file stored on the Telegram servers. By default, this animated GIF file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with specified content instead of the animation. .. automodule:: aiogram.types.inline_query_result_cached_gif :members: :member-order: bysource - :special-members: __init__ :undoc-members: True \ No newline at end of file diff --git a/docs2/api/types/inline_query_result_cached_mpeg4_gif.rst b/docs2/api/types/inline_query_result_cached_mpeg4_gif.rst index 5d64aee1..23e06635 100644 --- a/docs2/api/types/inline_query_result_cached_mpeg4_gif.rst +++ b/docs2/api/types/inline_query_result_cached_mpeg4_gif.rst @@ -2,10 +2,8 @@ InlineQueryResultCachedMpeg4Gif ############################### -Represents a link to a video animation (H.264/MPEG-4 AVC video without sound) stored on the Telegram servers. By default, this animated MPEG-4 file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the animation. .. automodule:: aiogram.types.inline_query_result_cached_mpeg4_gif :members: :member-order: bysource - :special-members: __init__ :undoc-members: True \ No newline at end of file diff --git a/docs2/api/types/inline_query_result_cached_photo.rst b/docs2/api/types/inline_query_result_cached_photo.rst index f45bd8fe..3ebcc6be 100644 --- a/docs2/api/types/inline_query_result_cached_photo.rst +++ b/docs2/api/types/inline_query_result_cached_photo.rst @@ -2,10 +2,8 @@ InlineQueryResultCachedPhoto ############################ -Represents a link to a photo stored on the Telegram servers. By default, this photo will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the photo. .. automodule:: aiogram.types.inline_query_result_cached_photo :members: :member-order: bysource - :special-members: __init__ :undoc-members: True \ No newline at end of file diff --git a/docs2/api/types/inline_query_result_cached_sticker.rst b/docs2/api/types/inline_query_result_cached_sticker.rst index 3384839b..3156775a 100644 --- a/docs2/api/types/inline_query_result_cached_sticker.rst +++ b/docs2/api/types/inline_query_result_cached_sticker.rst @@ -2,12 +2,8 @@ InlineQueryResultCachedSticker ############################## -Represents a link to a sticker stored on the Telegram servers. By default, this sticker will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the sticker. - -Note: This will only work in Telegram versions released after 9 April, 2016 for static stickers and after 06 July, 2019 for animated stickers. Older clients will ignore them. .. automodule:: aiogram.types.inline_query_result_cached_sticker :members: :member-order: bysource - :special-members: __init__ :undoc-members: True \ No newline at end of file diff --git a/docs2/api/types/inline_query_result_cached_video.rst b/docs2/api/types/inline_query_result_cached_video.rst index 538f060e..51b95a05 100644 --- a/docs2/api/types/inline_query_result_cached_video.rst +++ b/docs2/api/types/inline_query_result_cached_video.rst @@ -2,10 +2,8 @@ InlineQueryResultCachedVideo ############################ -Represents a link to a video file stored on the Telegram servers. By default, this video file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the video. .. automodule:: aiogram.types.inline_query_result_cached_video :members: :member-order: bysource - :special-members: __init__ :undoc-members: True \ No newline at end of file diff --git a/docs2/api/types/inline_query_result_cached_voice.rst b/docs2/api/types/inline_query_result_cached_voice.rst index 9c441cee..b2c70d60 100644 --- a/docs2/api/types/inline_query_result_cached_voice.rst +++ b/docs2/api/types/inline_query_result_cached_voice.rst @@ -2,12 +2,8 @@ InlineQueryResultCachedVoice ############################ -Represents a link to a voice message stored on the Telegram servers. By default, this voice message will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the voice message. - -Note: This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them. .. automodule:: aiogram.types.inline_query_result_cached_voice :members: :member-order: bysource - :special-members: __init__ :undoc-members: True \ No newline at end of file diff --git a/docs2/api/types/inline_query_result_contact.rst b/docs2/api/types/inline_query_result_contact.rst index 047576df..e2ae2f9c 100644 --- a/docs2/api/types/inline_query_result_contact.rst +++ b/docs2/api/types/inline_query_result_contact.rst @@ -2,12 +2,8 @@ InlineQueryResultContact ######################## -Represents a contact with a phone number. By default, this contact will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the contact. - -Note: This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them. .. automodule:: aiogram.types.inline_query_result_contact :members: :member-order: bysource - :special-members: __init__ :undoc-members: True \ No newline at end of file diff --git a/docs2/api/types/inline_query_result_document.rst b/docs2/api/types/inline_query_result_document.rst index 46be0e65..931b8938 100644 --- a/docs2/api/types/inline_query_result_document.rst +++ b/docs2/api/types/inline_query_result_document.rst @@ -2,12 +2,8 @@ InlineQueryResultDocument ######################### -Represents a link to a file. By default, this file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the file. Currently, only .PDF and .ZIP files can be sent using this method. - -Note: This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them. .. automodule:: aiogram.types.inline_query_result_document :members: :member-order: bysource - :special-members: __init__ :undoc-members: True \ No newline at end of file diff --git a/docs2/api/types/inline_query_result_game.rst b/docs2/api/types/inline_query_result_game.rst index 10f08c96..bbe99fcd 100644 --- a/docs2/api/types/inline_query_result_game.rst +++ b/docs2/api/types/inline_query_result_game.rst @@ -2,12 +2,8 @@ InlineQueryResultGame ##################### -Represents a Game. - -Note: This will only work in Telegram versions released after October 1, 2016. Older clients will not display any inline results if a game result is among them. .. automodule:: aiogram.types.inline_query_result_game :members: :member-order: bysource - :special-members: __init__ :undoc-members: True \ No newline at end of file diff --git a/docs2/api/types/inline_query_result_gif.rst b/docs2/api/types/inline_query_result_gif.rst index 2f94b6c1..fbdf91dd 100644 --- a/docs2/api/types/inline_query_result_gif.rst +++ b/docs2/api/types/inline_query_result_gif.rst @@ -2,10 +2,8 @@ InlineQueryResultGif #################### -Represents a link to an animated GIF file. By default, this animated GIF file will be sent by the user with optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the animation. .. automodule:: aiogram.types.inline_query_result_gif :members: :member-order: bysource - :special-members: __init__ :undoc-members: True \ No newline at end of file diff --git a/docs2/api/types/inline_query_result_location.rst b/docs2/api/types/inline_query_result_location.rst index b8156441..5edd684f 100644 --- a/docs2/api/types/inline_query_result_location.rst +++ b/docs2/api/types/inline_query_result_location.rst @@ -2,12 +2,8 @@ InlineQueryResultLocation ######################### -Represents a location on a map. By default, the location will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the location. - -Note: This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them. .. automodule:: aiogram.types.inline_query_result_location :members: :member-order: bysource - :special-members: __init__ :undoc-members: True \ No newline at end of file diff --git a/docs2/api/types/inline_query_result_mpeg4_gif.rst b/docs2/api/types/inline_query_result_mpeg4_gif.rst index 846d9c1e..6fc64d7d 100644 --- a/docs2/api/types/inline_query_result_mpeg4_gif.rst +++ b/docs2/api/types/inline_query_result_mpeg4_gif.rst @@ -2,10 +2,8 @@ InlineQueryResultMpeg4Gif ######################### -Represents a link to a video animation (H.264/MPEG-4 AVC video without sound). By default, this animated MPEG-4 file will be sent by the user with optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the animation. .. automodule:: aiogram.types.inline_query_result_mpeg4_gif :members: :member-order: bysource - :special-members: __init__ :undoc-members: True \ No newline at end of file diff --git a/docs2/api/types/inline_query_result_photo.rst b/docs2/api/types/inline_query_result_photo.rst index d01743d9..1b171e93 100644 --- a/docs2/api/types/inline_query_result_photo.rst +++ b/docs2/api/types/inline_query_result_photo.rst @@ -2,10 +2,8 @@ InlineQueryResultPhoto ###################### -Represents a link to a photo. By default, this photo will be sent by the user with optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the photo. .. automodule:: aiogram.types.inline_query_result_photo :members: :member-order: bysource - :special-members: __init__ :undoc-members: True \ No newline at end of file diff --git a/docs2/api/types/inline_query_result_venue.rst b/docs2/api/types/inline_query_result_venue.rst index 54cca6c9..20e9289f 100644 --- a/docs2/api/types/inline_query_result_venue.rst +++ b/docs2/api/types/inline_query_result_venue.rst @@ -2,12 +2,8 @@ InlineQueryResultVenue ###################### -Represents a venue. By default, the venue will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the venue. - -Note: This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them. .. automodule:: aiogram.types.inline_query_result_venue :members: :member-order: bysource - :special-members: __init__ :undoc-members: True \ No newline at end of file diff --git a/docs2/api/types/inline_query_result_video.rst b/docs2/api/types/inline_query_result_video.rst index addf28bd..374dcf17 100644 --- a/docs2/api/types/inline_query_result_video.rst +++ b/docs2/api/types/inline_query_result_video.rst @@ -2,12 +2,8 @@ InlineQueryResultVideo ###################### -Represents a link to a page containing an embedded video player or a video file. By default, this video file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the video. - -If an InlineQueryResultVideo message contains an embedded video (e.g., YouTube), you must replace its content using input_message_content. .. automodule:: aiogram.types.inline_query_result_video :members: :member-order: bysource - :special-members: __init__ :undoc-members: True \ No newline at end of file diff --git a/docs2/api/types/inline_query_result_voice.rst b/docs2/api/types/inline_query_result_voice.rst index 278e13bc..23717afa 100644 --- a/docs2/api/types/inline_query_result_voice.rst +++ b/docs2/api/types/inline_query_result_voice.rst @@ -2,12 +2,8 @@ InlineQueryResultVoice ###################### -Represents a link to a voice recording in an .OGG container encoded with OPUS. By default, this voice recording will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the the voice message. - -Note: This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them. .. automodule:: aiogram.types.inline_query_result_voice :members: :member-order: bysource - :special-members: __init__ :undoc-members: True \ No newline at end of file diff --git a/docs2/api/types/input_contact_message_content.rst b/docs2/api/types/input_contact_message_content.rst index 37989885..51c8cc58 100644 --- a/docs2/api/types/input_contact_message_content.rst +++ b/docs2/api/types/input_contact_message_content.rst @@ -2,10 +2,8 @@ InputContactMessageContent ########################## -Represents the content of a contact message to be sent as the result of an inline query. .. automodule:: aiogram.types.input_contact_message_content :members: :member-order: bysource - :special-members: __init__ :undoc-members: True \ No newline at end of file diff --git a/docs2/api/types/input_file.rst b/docs2/api/types/input_file.rst index 8a7b1fce..d295de5f 100644 --- a/docs2/api/types/input_file.rst +++ b/docs2/api/types/input_file.rst @@ -2,30 +2,8 @@ InputFile ######### -This object represents the contents of a file to be uploaded. Must be posted using multipart/form-data in the usual way that files are uploaded via the browser. -Read more at :doc:`../upload_file.rst` - -.. autoclass:: aiogram.types.input_file.InputFile +.. automodule:: aiogram.types.input_file :members: :member-order: bysource - :special-members: __init__ - :undoc-members: True - -.. autoclass:: aiogram.types.input_file.BufferedInputFile - :members: - :member-order: bysource - :special-members: __init__ - :undoc-members: True - -.. autoclass:: aiogram.types.input_file.FSInputFile - :members: - :member-order: bysource - :special-members: __init__ - :undoc-members: True - -.. autoclass:: aiogram.types.input_file.URLInputFile - :members: - :member-order: bysource - :special-members: __init__ - :undoc-members: True + :undoc-members: True \ No newline at end of file diff --git a/docs2/api/types/input_location_message_content.rst b/docs2/api/types/input_location_message_content.rst index 0766b53a..9f33b5cc 100644 --- a/docs2/api/types/input_location_message_content.rst +++ b/docs2/api/types/input_location_message_content.rst @@ -2,10 +2,8 @@ InputLocationMessageContent ########################### -Represents the content of a location message to be sent as the result of an inline query. .. automodule:: aiogram.types.input_location_message_content :members: :member-order: bysource - :special-members: __init__ :undoc-members: True \ No newline at end of file diff --git a/docs2/api/types/input_media.rst b/docs2/api/types/input_media.rst index 78623975..3c4f8e0c 100644 --- a/docs2/api/types/input_media.rst +++ b/docs2/api/types/input_media.rst @@ -2,20 +2,8 @@ InputMedia ########## -This object represents the content of a media message to be sent. It should be one of - - - InputMediaAnimation - - - InputMediaDocument - - - InputMediaAudio - - - InputMediaPhoto - - - InputMediaVideo .. automodule:: aiogram.types.input_media :members: :member-order: bysource - :special-members: __init__ :undoc-members: True \ No newline at end of file diff --git a/docs2/api/types/input_media_animation.rst b/docs2/api/types/input_media_animation.rst index ed22cbb3..9f16d9de 100644 --- a/docs2/api/types/input_media_animation.rst +++ b/docs2/api/types/input_media_animation.rst @@ -2,10 +2,8 @@ InputMediaAnimation ################### -Represents an animation file (GIF or H.264/MPEG-4 AVC video without sound) to be sent. .. automodule:: aiogram.types.input_media_animation :members: :member-order: bysource - :special-members: __init__ :undoc-members: True \ No newline at end of file diff --git a/docs2/api/types/input_media_audio.rst b/docs2/api/types/input_media_audio.rst index 4d2ec316..a312af6f 100644 --- a/docs2/api/types/input_media_audio.rst +++ b/docs2/api/types/input_media_audio.rst @@ -2,10 +2,8 @@ InputMediaAudio ############### -Represents an audio file to be treated as music to be sent. .. automodule:: aiogram.types.input_media_audio :members: :member-order: bysource - :special-members: __init__ :undoc-members: True \ No newline at end of file diff --git a/docs2/api/types/input_media_document.rst b/docs2/api/types/input_media_document.rst index 42407d1a..b5f6c196 100644 --- a/docs2/api/types/input_media_document.rst +++ b/docs2/api/types/input_media_document.rst @@ -2,10 +2,8 @@ InputMediaDocument ################## -Represents a general file to be sent. .. automodule:: aiogram.types.input_media_document :members: :member-order: bysource - :special-members: __init__ :undoc-members: True \ No newline at end of file diff --git a/docs2/api/types/input_media_photo.rst b/docs2/api/types/input_media_photo.rst index de5bf37f..59ddb8f5 100644 --- a/docs2/api/types/input_media_photo.rst +++ b/docs2/api/types/input_media_photo.rst @@ -2,10 +2,8 @@ InputMediaPhoto ############### -Represents a photo to be sent. .. automodule:: aiogram.types.input_media_photo :members: :member-order: bysource - :special-members: __init__ :undoc-members: True \ No newline at end of file diff --git a/docs2/api/types/input_media_video.rst b/docs2/api/types/input_media_video.rst index 1c13efc9..ef2ded4d 100644 --- a/docs2/api/types/input_media_video.rst +++ b/docs2/api/types/input_media_video.rst @@ -2,10 +2,8 @@ InputMediaVideo ############### -Represents a video to be sent. .. automodule:: aiogram.types.input_media_video :members: :member-order: bysource - :special-members: __init__ :undoc-members: True \ No newline at end of file diff --git a/docs2/api/types/input_message_content.rst b/docs2/api/types/input_message_content.rst index 583a3b52..945f4ee1 100644 --- a/docs2/api/types/input_message_content.rst +++ b/docs2/api/types/input_message_content.rst @@ -2,18 +2,8 @@ InputMessageContent ################### -This object represents the content of a message to be sent as a result of an inline query. Telegram clients currently support the following 4 types: - - - InputTextMessageContent - - - InputLocationMessageContent - - - InputVenueMessageContent - - - InputContactMessageContent .. automodule:: aiogram.types.input_message_content :members: :member-order: bysource - :special-members: __init__ :undoc-members: True \ No newline at end of file diff --git a/docs2/api/types/input_text_message_content.rst b/docs2/api/types/input_text_message_content.rst index c6f8cbae..48ca93a1 100644 --- a/docs2/api/types/input_text_message_content.rst +++ b/docs2/api/types/input_text_message_content.rst @@ -2,10 +2,8 @@ InputTextMessageContent ####################### -Represents the content of a text message to be sent as the result of an inline query. .. automodule:: aiogram.types.input_text_message_content :members: :member-order: bysource - :special-members: __init__ :undoc-members: True \ No newline at end of file diff --git a/docs2/api/types/input_venue_message_content.rst b/docs2/api/types/input_venue_message_content.rst index 256f9a15..ed0f5792 100644 --- a/docs2/api/types/input_venue_message_content.rst +++ b/docs2/api/types/input_venue_message_content.rst @@ -2,10 +2,8 @@ InputVenueMessageContent ######################## -Represents the content of a venue message to be sent as the result of an inline query. .. automodule:: aiogram.types.input_venue_message_content :members: :member-order: bysource - :special-members: __init__ :undoc-members: True \ No newline at end of file diff --git a/docs2/api/types/invoice.rst b/docs2/api/types/invoice.rst index 981ef2f6..b8c51922 100644 --- a/docs2/api/types/invoice.rst +++ b/docs2/api/types/invoice.rst @@ -2,10 +2,8 @@ Invoice ####### -This object contains basic information about an invoice. .. automodule:: aiogram.types.invoice :members: :member-order: bysource - :special-members: __init__ :undoc-members: True \ No newline at end of file diff --git a/docs2/api/types/keyboard_button.rst b/docs2/api/types/keyboard_button.rst index bddabe20..7321914d 100644 --- a/docs2/api/types/keyboard_button.rst +++ b/docs2/api/types/keyboard_button.rst @@ -2,14 +2,8 @@ KeyboardButton ############## -This object represents one button of the reply keyboard. For simple text buttons String can be used instead of this object to specify text of the button. Optional fields request_contact, request_location, and request_poll are mutually exclusive. - -Note: request_contact and request_location options will only work in Telegram versions released after 9 April, 2016. Older clients will display unsupported message. - -Note: request_poll option will only work in Telegram versions released after 23 January, 2020. Older clients will display unsupported message. .. automodule:: aiogram.types.keyboard_button :members: :member-order: bysource - :special-members: __init__ :undoc-members: True \ No newline at end of file diff --git a/docs2/api/types/keyboard_button_poll_type.rst b/docs2/api/types/keyboard_button_poll_type.rst index 398778ab..e24d92da 100644 --- a/docs2/api/types/keyboard_button_poll_type.rst +++ b/docs2/api/types/keyboard_button_poll_type.rst @@ -2,10 +2,8 @@ KeyboardButtonPollType ###################### -This object represents type of a poll, which is allowed to be created and sent when the corresponding button is pressed. .. automodule:: aiogram.types.keyboard_button_poll_type :members: :member-order: bysource - :special-members: __init__ :undoc-members: True \ No newline at end of file diff --git a/docs2/api/types/labeled_price.rst b/docs2/api/types/labeled_price.rst index 1c8bcc1e..69512ab2 100644 --- a/docs2/api/types/labeled_price.rst +++ b/docs2/api/types/labeled_price.rst @@ -2,10 +2,8 @@ LabeledPrice ############ -This object represents a portion of the price for goods or services. .. automodule:: aiogram.types.labeled_price :members: :member-order: bysource - :special-members: __init__ :undoc-members: True \ No newline at end of file diff --git a/docs2/api/types/location.rst b/docs2/api/types/location.rst index d15fd18c..244331c8 100644 --- a/docs2/api/types/location.rst +++ b/docs2/api/types/location.rst @@ -2,10 +2,8 @@ Location ######## -This object represents a point on the map. .. automodule:: aiogram.types.location :members: :member-order: bysource - :special-members: __init__ :undoc-members: True \ No newline at end of file diff --git a/docs2/api/types/login_url.rst b/docs2/api/types/login_url.rst index f625bfb3..7122fe50 100644 --- a/docs2/api/types/login_url.rst +++ b/docs2/api/types/login_url.rst @@ -2,14 +2,8 @@ LoginUrl ######## -This object represents a parameter of the inline keyboard button used to automatically authorize a user. Serves as a great replacement for the Telegram Login Widget when the user is coming from Telegram. All the user needs to do is tap/click a button and confirm that they want to log in: - -Telegram apps support these buttons as of version 5.7. - -Sample bot: @discussbot .. automodule:: aiogram.types.login_url :members: :member-order: bysource - :special-members: __init__ :undoc-members: True \ No newline at end of file diff --git a/docs2/api/types/mask_position.rst b/docs2/api/types/mask_position.rst index c8410052..d7dd7bbb 100644 --- a/docs2/api/types/mask_position.rst +++ b/docs2/api/types/mask_position.rst @@ -2,10 +2,8 @@ MaskPosition ############ -This object describes the position on faces where a mask should be placed by default. .. automodule:: aiogram.types.mask_position :members: :member-order: bysource - :special-members: __init__ :undoc-members: True \ No newline at end of file diff --git a/docs2/api/types/message.rst b/docs2/api/types/message.rst index 56fad490..ea9ebcdd 100644 --- a/docs2/api/types/message.rst +++ b/docs2/api/types/message.rst @@ -2,10 +2,8 @@ Message ####### -This object represents a message. .. automodule:: aiogram.types.message :members: :member-order: bysource - :special-members: __init__ :undoc-members: True \ No newline at end of file diff --git a/docs2/api/types/message_entity.rst b/docs2/api/types/message_entity.rst index 5d025e8e..fb4ccb0c 100644 --- a/docs2/api/types/message_entity.rst +++ b/docs2/api/types/message_entity.rst @@ -2,10 +2,8 @@ MessageEntity ############# -This object represents one special entity in a text message. For example, hashtags, usernames, URLs, etc. .. automodule:: aiogram.types.message_entity :members: :member-order: bysource - :special-members: __init__ :undoc-members: True \ No newline at end of file diff --git a/docs2/api/types/message_id.rst b/docs2/api/types/message_id.rst new file mode 100644 index 00000000..35ee56fa --- /dev/null +++ b/docs2/api/types/message_id.rst @@ -0,0 +1,9 @@ +######### +MessageId +######### + + +.. automodule:: aiogram.types.message_id + :members: + :member-order: bysource + :undoc-members: True \ No newline at end of file diff --git a/docs2/api/types/order_info.rst b/docs2/api/types/order_info.rst index 508b3ff4..b32b433c 100644 --- a/docs2/api/types/order_info.rst +++ b/docs2/api/types/order_info.rst @@ -2,10 +2,8 @@ OrderInfo ######### -This object represents information about an order. .. automodule:: aiogram.types.order_info :members: :member-order: bysource - :special-members: __init__ :undoc-members: True \ No newline at end of file diff --git a/docs2/api/types/passport_data.rst b/docs2/api/types/passport_data.rst index 05c50e44..6918a40c 100644 --- a/docs2/api/types/passport_data.rst +++ b/docs2/api/types/passport_data.rst @@ -2,10 +2,8 @@ PassportData ############ -Contains information about Telegram Passport data shared with the bot by the user. .. automodule:: aiogram.types.passport_data :members: :member-order: bysource - :special-members: __init__ :undoc-members: True \ No newline at end of file diff --git a/docs2/api/types/passport_element_error.rst b/docs2/api/types/passport_element_error.rst index 15c4c148..eb8de72b 100644 --- a/docs2/api/types/passport_element_error.rst +++ b/docs2/api/types/passport_element_error.rst @@ -2,28 +2,8 @@ PassportElementError #################### -This object represents an error in the Telegram Passport element which was submitted that should be resolved by the user. It should be one of: - - - PassportElementErrorDataField - - - PassportElementErrorFrontSide - - - PassportElementErrorReverseSide - - - PassportElementErrorSelfie - - - PassportElementErrorFile - - - PassportElementErrorFiles - - - PassportElementErrorTranslationFile - - - PassportElementErrorTranslationFiles - - - PassportElementErrorUnspecified .. automodule:: aiogram.types.passport_element_error :members: :member-order: bysource - :special-members: __init__ :undoc-members: True \ No newline at end of file diff --git a/docs2/api/types/passport_element_error_data_field.rst b/docs2/api/types/passport_element_error_data_field.rst index 83505375..4887f585 100644 --- a/docs2/api/types/passport_element_error_data_field.rst +++ b/docs2/api/types/passport_element_error_data_field.rst @@ -2,10 +2,8 @@ PassportElementErrorDataField ############################# -Represents an issue in one of the data fields that was provided by the user. The error is considered resolved when the field's value changes. .. automodule:: aiogram.types.passport_element_error_data_field :members: :member-order: bysource - :special-members: __init__ :undoc-members: True \ No newline at end of file diff --git a/docs2/api/types/passport_element_error_file.rst b/docs2/api/types/passport_element_error_file.rst index 7a61baa2..849d2904 100644 --- a/docs2/api/types/passport_element_error_file.rst +++ b/docs2/api/types/passport_element_error_file.rst @@ -2,10 +2,8 @@ PassportElementErrorFile ######################## -Represents an issue with a document scan. The error is considered resolved when the file with the document scan changes. .. automodule:: aiogram.types.passport_element_error_file :members: :member-order: bysource - :special-members: __init__ :undoc-members: True \ No newline at end of file diff --git a/docs2/api/types/passport_element_error_files.rst b/docs2/api/types/passport_element_error_files.rst index 28996227..36a3aa94 100644 --- a/docs2/api/types/passport_element_error_files.rst +++ b/docs2/api/types/passport_element_error_files.rst @@ -2,10 +2,8 @@ PassportElementErrorFiles ######################### -Represents an issue with a list of scans. The error is considered resolved when the list of files containing the scans changes. .. automodule:: aiogram.types.passport_element_error_files :members: :member-order: bysource - :special-members: __init__ :undoc-members: True \ No newline at end of file diff --git a/docs2/api/types/passport_element_error_front_side.rst b/docs2/api/types/passport_element_error_front_side.rst index eec4f662..1e6cb1a4 100644 --- a/docs2/api/types/passport_element_error_front_side.rst +++ b/docs2/api/types/passport_element_error_front_side.rst @@ -2,10 +2,8 @@ PassportElementErrorFrontSide ############################# -Represents an issue with the front side of a document. The error is considered resolved when the file with the front side of the document changes. .. automodule:: aiogram.types.passport_element_error_front_side :members: :member-order: bysource - :special-members: __init__ :undoc-members: True \ No newline at end of file diff --git a/docs2/api/types/passport_element_error_reverse_side.rst b/docs2/api/types/passport_element_error_reverse_side.rst index f61673da..56f2291d 100644 --- a/docs2/api/types/passport_element_error_reverse_side.rst +++ b/docs2/api/types/passport_element_error_reverse_side.rst @@ -2,10 +2,8 @@ PassportElementErrorReverseSide ############################### -Represents an issue with the reverse side of a document. The error is considered resolved when the file with reverse side of the document changes. .. automodule:: aiogram.types.passport_element_error_reverse_side :members: :member-order: bysource - :special-members: __init__ :undoc-members: True \ No newline at end of file diff --git a/docs2/api/types/passport_element_error_selfie.rst b/docs2/api/types/passport_element_error_selfie.rst index af4bd0f7..082ee422 100644 --- a/docs2/api/types/passport_element_error_selfie.rst +++ b/docs2/api/types/passport_element_error_selfie.rst @@ -2,10 +2,8 @@ PassportElementErrorSelfie ########################## -Represents an issue with the selfie with a document. The error is considered resolved when the file with the selfie changes. .. automodule:: aiogram.types.passport_element_error_selfie :members: :member-order: bysource - :special-members: __init__ :undoc-members: True \ No newline at end of file diff --git a/docs2/api/types/passport_element_error_translation_file.rst b/docs2/api/types/passport_element_error_translation_file.rst index 970fea03..d30fa6bc 100644 --- a/docs2/api/types/passport_element_error_translation_file.rst +++ b/docs2/api/types/passport_element_error_translation_file.rst @@ -2,10 +2,8 @@ PassportElementErrorTranslationFile ################################### -Represents an issue with one of the files that constitute the translation of a document. The error is considered resolved when the file changes. .. automodule:: aiogram.types.passport_element_error_translation_file :members: :member-order: bysource - :special-members: __init__ :undoc-members: True \ No newline at end of file diff --git a/docs2/api/types/passport_element_error_translation_files.rst b/docs2/api/types/passport_element_error_translation_files.rst index b3c30613..79b0ef79 100644 --- a/docs2/api/types/passport_element_error_translation_files.rst +++ b/docs2/api/types/passport_element_error_translation_files.rst @@ -2,10 +2,8 @@ PassportElementErrorTranslationFiles #################################### -Represents an issue with the translated version of a document. The error is considered resolved when a file with the document translation change. .. automodule:: aiogram.types.passport_element_error_translation_files :members: :member-order: bysource - :special-members: __init__ :undoc-members: True \ No newline at end of file diff --git a/docs2/api/types/passport_element_error_unspecified.rst b/docs2/api/types/passport_element_error_unspecified.rst index efd1519f..d59a985e 100644 --- a/docs2/api/types/passport_element_error_unspecified.rst +++ b/docs2/api/types/passport_element_error_unspecified.rst @@ -2,10 +2,8 @@ PassportElementErrorUnspecified ############################### -Represents an issue in an unspecified place. The error is considered resolved when new data is added. .. automodule:: aiogram.types.passport_element_error_unspecified :members: :member-order: bysource - :special-members: __init__ :undoc-members: True \ No newline at end of file diff --git a/docs2/api/types/passport_file.rst b/docs2/api/types/passport_file.rst index 321bd33e..944cc7e7 100644 --- a/docs2/api/types/passport_file.rst +++ b/docs2/api/types/passport_file.rst @@ -2,10 +2,8 @@ PassportFile ############ -This object represents a file uploaded to Telegram Passport. Currently all Telegram Passport files are in JPEG format when decrypted and don't exceed 10MB. .. automodule:: aiogram.types.passport_file :members: :member-order: bysource - :special-members: __init__ :undoc-members: True \ No newline at end of file diff --git a/docs2/api/types/photo_size.rst b/docs2/api/types/photo_size.rst index a091af19..fbd32f33 100644 --- a/docs2/api/types/photo_size.rst +++ b/docs2/api/types/photo_size.rst @@ -2,10 +2,8 @@ PhotoSize ######### -This object represents one size of a photo or a file / sticker thumbnail. .. automodule:: aiogram.types.photo_size :members: :member-order: bysource - :special-members: __init__ :undoc-members: True \ No newline at end of file diff --git a/docs2/api/types/poll.rst b/docs2/api/types/poll.rst index a0136b44..3b278712 100644 --- a/docs2/api/types/poll.rst +++ b/docs2/api/types/poll.rst @@ -2,10 +2,8 @@ Poll #### -This object contains information about a poll. .. automodule:: aiogram.types.poll :members: :member-order: bysource - :special-members: __init__ :undoc-members: True \ No newline at end of file diff --git a/docs2/api/types/poll_answer.rst b/docs2/api/types/poll_answer.rst index 079807eb..adce5f72 100644 --- a/docs2/api/types/poll_answer.rst +++ b/docs2/api/types/poll_answer.rst @@ -2,10 +2,8 @@ PollAnswer ########## -This object represents an answer of a user in a non-anonymous poll. .. automodule:: aiogram.types.poll_answer :members: :member-order: bysource - :special-members: __init__ :undoc-members: True \ No newline at end of file diff --git a/docs2/api/types/poll_option.rst b/docs2/api/types/poll_option.rst index 9dd676e5..5b7bbefb 100644 --- a/docs2/api/types/poll_option.rst +++ b/docs2/api/types/poll_option.rst @@ -2,10 +2,8 @@ PollOption ########## -This object contains information about one answer option in a poll. .. automodule:: aiogram.types.poll_option :members: :member-order: bysource - :special-members: __init__ :undoc-members: True \ No newline at end of file diff --git a/docs2/api/types/pre_checkout_query.rst b/docs2/api/types/pre_checkout_query.rst index 5d25b291..2d9367ef 100644 --- a/docs2/api/types/pre_checkout_query.rst +++ b/docs2/api/types/pre_checkout_query.rst @@ -2,10 +2,8 @@ PreCheckoutQuery ################ -This object contains information about an incoming pre-checkout query. .. automodule:: aiogram.types.pre_checkout_query :members: :member-order: bysource - :special-members: __init__ :undoc-members: True \ No newline at end of file diff --git a/docs2/api/types/proximity_alert_triggered.rst b/docs2/api/types/proximity_alert_triggered.rst new file mode 100644 index 00000000..1d0ba461 --- /dev/null +++ b/docs2/api/types/proximity_alert_triggered.rst @@ -0,0 +1,9 @@ +####################### +ProximityAlertTriggered +####################### + + +.. automodule:: aiogram.types.proximity_alert_triggered + :members: + :member-order: bysource + :undoc-members: True \ No newline at end of file diff --git a/docs2/api/types/reply_keyboard_markup.rst b/docs2/api/types/reply_keyboard_markup.rst index 66c83a83..2f32bdff 100644 --- a/docs2/api/types/reply_keyboard_markup.rst +++ b/docs2/api/types/reply_keyboard_markup.rst @@ -2,10 +2,8 @@ ReplyKeyboardMarkup ################### -This object represents a custom keyboard with reply options (see Introduction to bots for details and examples). .. automodule:: aiogram.types.reply_keyboard_markup :members: :member-order: bysource - :special-members: __init__ :undoc-members: True \ No newline at end of file diff --git a/docs2/api/types/reply_keyboard_remove.rst b/docs2/api/types/reply_keyboard_remove.rst index ea65a907..acc212ee 100644 --- a/docs2/api/types/reply_keyboard_remove.rst +++ b/docs2/api/types/reply_keyboard_remove.rst @@ -2,10 +2,8 @@ ReplyKeyboardRemove ################### -Upon receiving a message with this object, Telegram clients will remove the current custom keyboard and display the default letter-keyboard. By default, custom keyboards are displayed until a new keyboard is sent by a bot. An exception is made for one-time keyboards that are hidden immediately after the user presses a button (see ReplyKeyboardMarkup). .. automodule:: aiogram.types.reply_keyboard_remove :members: :member-order: bysource - :special-members: __init__ :undoc-members: True \ No newline at end of file diff --git a/docs2/api/types/response_parameters.rst b/docs2/api/types/response_parameters.rst index b4f9f739..42a1a4d6 100644 --- a/docs2/api/types/response_parameters.rst +++ b/docs2/api/types/response_parameters.rst @@ -2,10 +2,8 @@ ResponseParameters ################## -Contains information about why a request was unsuccessful. .. automodule:: aiogram.types.response_parameters :members: :member-order: bysource - :special-members: __init__ :undoc-members: True \ No newline at end of file diff --git a/docs2/api/types/shipping_address.rst b/docs2/api/types/shipping_address.rst index d36ca404..d2b72bde 100644 --- a/docs2/api/types/shipping_address.rst +++ b/docs2/api/types/shipping_address.rst @@ -2,10 +2,8 @@ ShippingAddress ############### -This object represents a shipping address. .. automodule:: aiogram.types.shipping_address :members: :member-order: bysource - :special-members: __init__ :undoc-members: True \ No newline at end of file diff --git a/docs2/api/types/shipping_option.rst b/docs2/api/types/shipping_option.rst index 612613d8..e3976d5f 100644 --- a/docs2/api/types/shipping_option.rst +++ b/docs2/api/types/shipping_option.rst @@ -2,10 +2,8 @@ ShippingOption ############## -This object represents one shipping option. .. automodule:: aiogram.types.shipping_option :members: :member-order: bysource - :special-members: __init__ :undoc-members: True \ No newline at end of file diff --git a/docs2/api/types/shipping_query.rst b/docs2/api/types/shipping_query.rst index 07213c9a..9117bbd5 100644 --- a/docs2/api/types/shipping_query.rst +++ b/docs2/api/types/shipping_query.rst @@ -2,10 +2,8 @@ ShippingQuery ############# -This object contains information about an incoming shipping query. .. automodule:: aiogram.types.shipping_query :members: :member-order: bysource - :special-members: __init__ :undoc-members: True \ No newline at end of file diff --git a/docs2/api/types/sticker.rst b/docs2/api/types/sticker.rst index 1adca43f..643e4122 100644 --- a/docs2/api/types/sticker.rst +++ b/docs2/api/types/sticker.rst @@ -2,10 +2,8 @@ Sticker ####### -This object represents a sticker. .. automodule:: aiogram.types.sticker :members: :member-order: bysource - :special-members: __init__ :undoc-members: True \ No newline at end of file diff --git a/docs2/api/types/sticker_set.rst b/docs2/api/types/sticker_set.rst index 32af00d2..19e2ae99 100644 --- a/docs2/api/types/sticker_set.rst +++ b/docs2/api/types/sticker_set.rst @@ -2,10 +2,8 @@ StickerSet ########## -This object represents a sticker set. .. automodule:: aiogram.types.sticker_set :members: :member-order: bysource - :special-members: __init__ :undoc-members: True \ No newline at end of file diff --git a/docs2/api/types/successful_payment.rst b/docs2/api/types/successful_payment.rst index dd35af97..10ec78b1 100644 --- a/docs2/api/types/successful_payment.rst +++ b/docs2/api/types/successful_payment.rst @@ -2,10 +2,8 @@ SuccessfulPayment ################# -This object contains basic information about a successful payment. .. automodule:: aiogram.types.successful_payment :members: :member-order: bysource - :special-members: __init__ :undoc-members: True \ No newline at end of file diff --git a/docs2/api/types/update.rst b/docs2/api/types/update.rst index 50873f74..c8338f19 100644 --- a/docs2/api/types/update.rst +++ b/docs2/api/types/update.rst @@ -2,12 +2,8 @@ Update ###### -This object represents an incoming update. - -At most one of the optional parameters can be present in any given update. .. automodule:: aiogram.types.update :members: :member-order: bysource - :special-members: __init__ :undoc-members: True \ No newline at end of file diff --git a/docs2/api/types/user.rst b/docs2/api/types/user.rst index 662eb2a9..5c58898d 100644 --- a/docs2/api/types/user.rst +++ b/docs2/api/types/user.rst @@ -2,10 +2,8 @@ User #### -This object represents a Telegram user or bot. .. automodule:: aiogram.types.user :members: :member-order: bysource - :special-members: __init__ :undoc-members: True \ No newline at end of file diff --git a/docs2/api/types/user_profile_photos.rst b/docs2/api/types/user_profile_photos.rst index e1aceb49..7a6876b4 100644 --- a/docs2/api/types/user_profile_photos.rst +++ b/docs2/api/types/user_profile_photos.rst @@ -2,10 +2,8 @@ UserProfilePhotos ################# -This object represent a user's profile pictures. .. automodule:: aiogram.types.user_profile_photos :members: :member-order: bysource - :special-members: __init__ :undoc-members: True \ No newline at end of file diff --git a/docs2/api/types/venue.rst b/docs2/api/types/venue.rst index 3feba747..2621755b 100644 --- a/docs2/api/types/venue.rst +++ b/docs2/api/types/venue.rst @@ -2,10 +2,8 @@ Venue ##### -This object represents a venue. .. automodule:: aiogram.types.venue :members: :member-order: bysource - :special-members: __init__ :undoc-members: True \ No newline at end of file diff --git a/docs2/api/types/video.rst b/docs2/api/types/video.rst index 68db64da..30d29917 100644 --- a/docs2/api/types/video.rst +++ b/docs2/api/types/video.rst @@ -2,10 +2,8 @@ Video ##### -This object represents a video file. .. automodule:: aiogram.types.video :members: :member-order: bysource - :special-members: __init__ :undoc-members: True \ No newline at end of file diff --git a/docs2/api/types/video_note.rst b/docs2/api/types/video_note.rst index 57c9cf6e..a436faa8 100644 --- a/docs2/api/types/video_note.rst +++ b/docs2/api/types/video_note.rst @@ -2,10 +2,8 @@ VideoNote ######### -This object represents a video message (available in Telegram apps as of v.4.0). .. automodule:: aiogram.types.video_note :members: :member-order: bysource - :special-members: __init__ :undoc-members: True \ No newline at end of file diff --git a/docs2/api/types/voice.rst b/docs2/api/types/voice.rst index 2b3d1e7f..29c44ea6 100644 --- a/docs2/api/types/voice.rst +++ b/docs2/api/types/voice.rst @@ -2,10 +2,8 @@ Voice ##### -This object represents a voice note. .. automodule:: aiogram.types.voice :members: :member-order: bysource - :special-members: __init__ :undoc-members: True \ No newline at end of file diff --git a/docs2/api/types/webhook_info.rst b/docs2/api/types/webhook_info.rst index 17dbc737..0491c68d 100644 --- a/docs2/api/types/webhook_info.rst +++ b/docs2/api/types/webhook_info.rst @@ -2,10 +2,8 @@ WebhookInfo ########### -Contains information about the current status of a webhook. .. automodule:: aiogram.types.webhook_info :members: :member-order: bysource - :special-members: __init__ :undoc-members: True \ No newline at end of file diff --git a/docs2/api/upload_file.rst b/docs2/api/upload_file.rst index f9e8610c..4579700e 100644 --- a/docs2/api/upload_file.rst +++ b/docs2/api/upload_file.rst @@ -1,3 +1,5 @@ +.. _sending-files: + ################### How to upload file? ################### @@ -12,9 +14,9 @@ But if you need to upload new file just use subclasses of `InputFile `__ -- :obj:`BufferedInputFile` - `uploading from buffer <#upload-from-buffer>`__ -- :obj:`URLInputFile` - `uploading from URL <#upload-from-url>`__ +- :class:`aiogram.types.input_file.FSInputFile` - `uploading from file system <#upload-from-file-system>`__ +- :class:`aiogram.types.input_file.BufferedInputFile` - `uploading from buffer <#upload-from-buffer>`__ +- :class:`aiogram.types.input_file.URLInputFile` - `uploading from URL <#upload-from-url>`__ .. warning:: @@ -73,7 +75,7 @@ Upload from url If you need to upload a file from another server, but the direct link is bound to your server's IP, or you want to bypass native `upload limits `_ -by URL, you can use :obj:`URLInputFile`. +by URL, you can use :obj:`aiogram.types.input_file.URLInputFile`. Import wrapper: diff --git a/tests/deprecated.py b/tests/deprecated.py index 53d65cf7..f030e515 100644 --- a/tests/deprecated.py +++ b/tests/deprecated.py @@ -9,7 +9,9 @@ import aiogram @contextmanager def check_deprecated( - max_version: str, exception: Type[Exception], warning: Type[Warning] = DeprecationWarning, + max_version: str, + exception: Type[Exception], + warning: Type[Warning] = DeprecationWarning, ) -> None: """ Should be used for modules that are being deprecated or already removed from aiogram diff --git a/tests/test_api/test_client/test_bot.py b/tests/test_api/test_client/test_bot.py index 0cf444ad..a3c11bd9 100644 --- a/tests/test_api/test_client/test_bot.py +++ b/tests/test_api/test_client/test_bot.py @@ -13,7 +13,8 @@ from tests.mocked_bot import MockedBot try: from asynctest import CoroutineMock, patch except ImportError: - from unittest.mock import AsyncMock as CoroutineMock, patch # type: ignore + from unittest.mock import AsyncMock as CoroutineMock # type: ignore + from unittest.mock import patch class TestBot: diff --git a/tests/test_api/test_client/test_session/test_aiohttp_session.py b/tests/test_api/test_client/test_session/test_aiohttp_session.py index 5584348a..3c50f69a 100644 --- a/tests/test_api/test_client/test_session/test_aiohttp_session.py +++ b/tests/test_api/test_client/test_session/test_aiohttp_session.py @@ -14,7 +14,8 @@ from tests.mocked_bot import MockedBot try: from asynctest import CoroutineMock, patch except ImportError: - from unittest.mock import AsyncMock as CoroutineMock, patch # type: ignore + from unittest.mock import AsyncMock as CoroutineMock # type: ignore + from unittest.mock import patch class BareInputFile(InputFile): @@ -212,5 +213,5 @@ class TestAiohttpSession: ) as mocked_close: async with session as ctx: assert session == ctx - mocked_close.awaited_once() - mocked_create_session.awaited_once() + mocked_close.assert_awaited_once() + mocked_create_session.assert_awaited_once() diff --git a/tests/test_api/test_client/test_session/test_base_session.py b/tests/test_api/test_client/test_session/test_base_session.py index ba0e8e1e..3ed8a126 100644 --- a/tests/test_api/test_client/test_session/test_base_session.py +++ b/tests/test_api/test_client/test_session/test_base_session.py @@ -12,7 +12,8 @@ from aiogram.types import UNSET try: from asynctest import CoroutineMock, patch except ImportError: - from unittest.mock import AsyncMock as CoroutineMock, patch # type: ignore + from unittest.mock import AsyncMock as CoroutineMock # type: ignore + from unittest.mock import patch class CustomSession(BaseSession): @@ -169,4 +170,4 @@ class TestBaseSession: ) as mocked_close: async with session as ctx: assert session == ctx - mocked_close.awaited_once() + mocked_close.assert_awaited_once() diff --git a/tests/test_api/test_methods/test_set_my_commands.py b/tests/test_api/test_methods/test_set_my_commands.py index e2d339aa..23b9476e 100644 --- a/tests/test_api/test_methods/test_set_my_commands.py +++ b/tests/test_api/test_methods/test_set_my_commands.py @@ -21,7 +21,9 @@ class TestSetMyCommands: async def test_bot_method(self, bot: MockedBot): prepare_result = bot.add_result_for(SetMyCommands, ok=True, result=None) - response: bool = await bot.set_my_commands(commands=[],) + response: bool = await bot.set_my_commands( + commands=[], + ) request: Request = bot.get_request() assert request.method == "setMyCommands" # assert request.data == {} diff --git a/tests/test_api/test_types/test_message.py b/tests/test_api/test_types/test_message.py index 818dde38..a6cf235e 100644 --- a/tests/test_api/test_types/test_message.py +++ b/tests/test_api/test_types/test_message.py @@ -448,7 +448,12 @@ class TestMessage: ["sticker", dict(sticker="sticker"), SendSticker], [ "venue", - dict(latitude=0.42, longitude=0.42, title="title", address="address",), + dict( + latitude=0.42, + longitude=0.42, + title="title", + address="address", + ), SendVenue, ], ["video", dict(video="video"), SendVideo], diff --git a/tests/test_dispatcher/test_dispatcher.py b/tests/test_dispatcher/test_dispatcher.py index 2fbe08a5..e9cfc495 100644 --- a/tests/test_dispatcher/test_dispatcher.py +++ b/tests/test_dispatcher/test_dispatcher.py @@ -32,7 +32,8 @@ from tests.mocked_bot import MockedBot try: from asynctest import CoroutineMock, patch except ImportError: - from unittest.mock import AsyncMock as CoroutineMock, patch # type: ignore + from unittest.mock import AsyncMock as CoroutineMock # type: ignore + from unittest.mock import patch async def simple_message_handler(message: Message): diff --git a/tests/test_dispatcher/test_event/test_event.py b/tests/test_dispatcher/test_event/test_event.py index 335b864c..be733ebb 100644 --- a/tests/test_dispatcher/test_event/test_event.py +++ b/tests/test_dispatcher/test_event/test_event.py @@ -9,7 +9,8 @@ from aiogram.dispatcher.event.handler import HandlerObject try: from asynctest import CoroutineMock, patch except ImportError: - from unittest.mock import AsyncMock as CoroutineMock, patch # type: ignore + from unittest.mock import AsyncMock as CoroutineMock # type: ignore + from unittest.mock import patch async def my_handler(value: str, index: int = 0) -> Any: @@ -51,7 +52,8 @@ class TestEventObserver: assert observer.handlers[2].awaitable with patch( - "aiogram.dispatcher.event.handler.CallableMixin.call", new_callable=CoroutineMock, + "aiogram.dispatcher.event.handler.CallableMixin.call", + new_callable=CoroutineMock, ) as mocked_my_handler: results = await observer.trigger("test") assert results is None diff --git a/tests/test_dispatcher/test_filters/test_base.py b/tests/test_dispatcher/test_filters/test_base.py index 688b13ab..27a1f349 100644 --- a/tests/test_dispatcher/test_filters/test_base.py +++ b/tests/test_dispatcher/test_filters/test_base.py @@ -7,7 +7,8 @@ from aiogram.dispatcher.filters.base import BaseFilter try: from asynctest import CoroutineMock, patch except ImportError: - from unittest.mock import AsyncMock as CoroutineMock, patch # type: ignore + from unittest.mock import AsyncMock as CoroutineMock # type: ignore + from unittest.mock import patch class MyFilter(BaseFilter):