diff --git a/docs/api/index.md b/docs/api/index.md new file mode 100644 index 00000000..dd67eb7f --- /dev/null +++ b/docs/api/index.md @@ -0,0 +1,26 @@ +# Overview + +**aiogram** now is fully support of [Telegram Bot API v4.4](https://core.telegram.org/bots/api) + +All API methods and types is fully autogenerated from Telegram Bot API docs by parser with code-generator + +Package: `aiogram.api` + +## Methods + +All API methods is wrapped as **pydantic** models and placed in `aiogram.api.methods` package so that's mean all values which you pass as arguments to the methods will be validated. +Here is all methods is classes and in due to Python standards all classes named in upper camel case, for example methods `sendMessage` has the name `SendMessage` +Also in places where you can send + +## Types + +All types is also wrapped with **pydantic** and placed in `aiogram.api.types` package. +In this place makes some more differences with official documentations: + +- name `from` was renamed to `from_user` in due to `from` is an keyword in python +- timestamps has `datetime.datetime` type instead of `int` +- InputFile is used for sending files and is not use `pydantic.BaseModel` as base class + +## Client + +... diff --git a/docs/api/methods/add_sticker_to_set.md b/docs/api/methods/add_sticker_to_set.md new file mode 100644 index 00000000..f5cec973 --- /dev/null +++ b/docs/api/methods/add_sticker_to_set.md @@ -0,0 +1,64 @@ +# addStickerToSet + +## Description + +Use this method to add a new sticker to a set created by the bot. Returns True on success. + + +## Arguments + +| Name | Type | Description | +| - | - | - | +| `user_id` | `#!python3 int` | User identifier of sticker set owner | +| `name` | `#!python3 str` | Sticker set name | +| `png_sticker` | `#!python3 Union[InputFile, str]` | 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. | +| `emojis` | `#!python3 str` | One or more emoji corresponding to the sticker | +| `mask_position` | `#!python3 Optional[MaskPosition]` | Optional. A JSON-serialized object for position where the mask should be placed on faces | + + + +## Response + +Type: `#!python3 bool` + +Description: Returns True on success. + + +## Usage + + +### As bot method bot + +```python3 +result: bool = await bot.add_sticker_to_set(...) +``` + +### Method as object + +Imports: + +- `from aiogram.types import AddStickerToSet` +- `from aiogram.api.types import AddStickerToSet` +- `from aiogram.api.types.add_sticker_to_set import AddStickerToSet` + +#### As reply into Webhook +```python3 +return AddStickerToSet(...) +``` + +#### With specific bot +```python3 +result: bool = await bot.emit(AddStickerToSet(...)) +``` + +#### In handlers with current bot +```python3 +result: bool = await AddStickerToSet(...) +``` + + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#addstickertoset) +- [aiogram.types.InputFile](../types/input_file.md) +- [aiogram.types.MaskPosition](../types/mask_position.md) diff --git a/docs/api/methods/answer_callback_query.md b/docs/api/methods/answer_callback_query.md new file mode 100644 index 00000000..babb4ec2 --- /dev/null +++ b/docs/api/methods/answer_callback_query.md @@ -0,0 +1,64 @@ +# answerCallbackQuery + +## Description + +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. + + +## Arguments + +| Name | Type | Description | +| - | - | - | +| `callback_query_id` | `#!python3 str` | Unique identifier for the query to be answered | +| `text` | `#!python3 Optional[str]` | Optional. Text of the notification. If not specified, nothing will be shown to the user, 0-200 characters | +| `show_alert` | `#!python3 Optional[bool]` | Optional. 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` | `#!python3 Optional[str]` | Optional. 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 callback_game button. | +| `cache_time` | `#!python3 Optional[int]` | Optional. 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. | + + + +## Response + +Type: `#!python3 bool` + +Description: On success, True is returned. + + +## Usage + + +### As bot method bot + +```python3 +result: bool = await bot.answer_callback_query(...) +``` + +### Method as object + +Imports: + +- `from aiogram.types import AnswerCallbackQuery` +- `from aiogram.api.types import AnswerCallbackQuery` +- `from aiogram.api.types.answer_callback_query import AnswerCallbackQuery` + +#### As reply into Webhook +```python3 +return AnswerCallbackQuery(...) +``` + +#### With specific bot +```python3 +result: bool = await bot.emit(AnswerCallbackQuery(...)) +``` + +#### In handlers with current bot +```python3 +result: bool = await AnswerCallbackQuery(...) +``` + + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#answercallbackquery) diff --git a/docs/api/methods/answer_inline_query.md b/docs/api/methods/answer_inline_query.md new file mode 100644 index 00000000..f2241848 --- /dev/null +++ b/docs/api/methods/answer_inline_query.md @@ -0,0 +1,67 @@ +# answerInlineQuery + +## Description + +Use this method to send answers to an inline query. On success, True is returned. + +No more than 50 results per query are allowed. + + +## Arguments + +| Name | Type | Description | +| - | - | - | +| `inline_query_id` | `#!python3 str` | Unique identifier for the answered query | +| `results` | `#!python3 List[InlineQueryResult]` | A JSON-serialized array of results for the inline query | +| `cache_time` | `#!python3 Optional[int]` | Optional. 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` | `#!python3 Optional[bool]` | Optional. 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 | +| `next_offset` | `#!python3 Optional[str]` | Optional. 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` | `#!python3 Optional[str]` | Optional. 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 | +| `switch_pm_parameter` | `#!python3 Optional[str]` | Optional. Deep-linking parameter for the /start message sent to the bot when user presses the switch button. 1-64 characters, only A-Z, a-z, 0-9, _ and - are allowed. | + + + +## Response + +Type: `#!python3 bool` + +Description: On success, True is returned. + + +## Usage + + +### As bot method bot + +```python3 +result: bool = await bot.answer_inline_query(...) +``` + +### Method as object + +Imports: + +- `from aiogram.types import AnswerInlineQuery` +- `from aiogram.api.types import AnswerInlineQuery` +- `from aiogram.api.types.answer_inline_query import AnswerInlineQuery` + +#### As reply into Webhook +```python3 +return AnswerInlineQuery(...) +``` + +#### With specific bot +```python3 +result: bool = await bot.emit(AnswerInlineQuery(...)) +``` + +#### In handlers with current bot +```python3 +result: bool = await AnswerInlineQuery(...) +``` + + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#answerinlinequery) +- [aiogram.types.InlineQueryResult](../types/inline_query_result.md) diff --git a/docs/api/methods/answer_pre_checkout_query.md b/docs/api/methods/answer_pre_checkout_query.md new file mode 100644 index 00000000..fb906031 --- /dev/null +++ b/docs/api/methods/answer_pre_checkout_query.md @@ -0,0 +1,60 @@ +# answerPreCheckoutQuery + +## Description + +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. + + +## Arguments + +| Name | Type | Description | +| - | - | - | +| `pre_checkout_query_id` | `#!python3 str` | Unique identifier for the query to be answered | +| `ok` | `#!python3 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. | +| `error_message` | `#!python3 Optional[str]` | Optional. 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. | + + + +## Response + +Type: `#!python3 bool` + +Description: On success, True is returned. + + +## Usage + + +### As bot method bot + +```python3 +result: bool = await bot.answer_pre_checkout_query(...) +``` + +### Method as object + +Imports: + +- `from aiogram.types import AnswerPreCheckoutQuery` +- `from aiogram.api.types import AnswerPreCheckoutQuery` +- `from aiogram.api.types.answer_pre_checkout_query import AnswerPreCheckoutQuery` + +#### As reply into Webhook +```python3 +return AnswerPreCheckoutQuery(...) +``` + +#### With specific bot +```python3 +result: bool = await bot.emit(AnswerPreCheckoutQuery(...)) +``` + +#### In handlers with current bot +```python3 +result: bool = await AnswerPreCheckoutQuery(...) +``` + + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#answerprecheckoutquery) diff --git a/docs/api/methods/answer_shipping_query.md b/docs/api/methods/answer_shipping_query.md new file mode 100644 index 00000000..a380d373 --- /dev/null +++ b/docs/api/methods/answer_shipping_query.md @@ -0,0 +1,62 @@ +# answerShippingQuery + +## Description + +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. + + +## Arguments + +| Name | Type | Description | +| - | - | - | +| `shipping_query_id` | `#!python3 str` | Unique identifier for the query to be answered | +| `ok` | `#!python3 bool` | Specify True if delivery to the specified address is possible and False if there are any problems (for example, if delivery to the specified address is not possible) | +| `shipping_options` | `#!python3 Optional[List[ShippingOption]]` | Optional. Required if ok is True. A JSON-serialized array of available shipping options. | +| `error_message` | `#!python3 Optional[str]` | Optional. Required if ok is False. Error message in human readable form that explains why it is impossible to complete the order (e.g. "Sorry, delivery to your desired address is unavailable'). Telegram will display this message to the user. | + + + +## Response + +Type: `#!python3 bool` + +Description: On success, True is returned. + + +## Usage + + +### As bot method bot + +```python3 +result: bool = await bot.answer_shipping_query(...) +``` + +### Method as object + +Imports: + +- `from aiogram.types import AnswerShippingQuery` +- `from aiogram.api.types import AnswerShippingQuery` +- `from aiogram.api.types.answer_shipping_query import AnswerShippingQuery` + +#### As reply into Webhook +```python3 +return AnswerShippingQuery(...) +``` + +#### With specific bot +```python3 +result: bool = await bot.emit(AnswerShippingQuery(...)) +``` + +#### In handlers with current bot +```python3 +result: bool = await AnswerShippingQuery(...) +``` + + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#answershippingquery) +- [aiogram.types.ShippingOption](../types/shipping_option.md) diff --git a/docs/api/methods/create_new_sticker_set.md b/docs/api/methods/create_new_sticker_set.md new file mode 100644 index 00000000..7c23efe1 --- /dev/null +++ b/docs/api/methods/create_new_sticker_set.md @@ -0,0 +1,66 @@ +# createNewStickerSet + +## Description + +Use this method to create new sticker set owned by a user. The bot will be able to edit the created sticker set. Returns True on success. + + +## Arguments + +| Name | Type | Description | +| - | - | - | +| `user_id` | `#!python3 int` | User identifier of created sticker set owner | +| `name` | `#!python3 str` | Short name of sticker set, to be used in 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` | `#!python3 str` | Sticker set title, 1-64 characters | +| `png_sticker` | `#!python3 Union[InputFile, str]` | 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. | +| `emojis` | `#!python3 str` | One or more emoji corresponding to the sticker | +| `contains_masks` | `#!python3 Optional[bool]` | Optional. Pass True, if a set of mask stickers should be created | +| `mask_position` | `#!python3 Optional[MaskPosition]` | Optional. A JSON-serialized object for position where the mask should be placed on faces | + + + +## Response + +Type: `#!python3 bool` + +Description: Returns True on success. + + +## Usage + + +### As bot method bot + +```python3 +result: bool = await bot.create_new_sticker_set(...) +``` + +### Method as object + +Imports: + +- `from aiogram.types import CreateNewStickerSet` +- `from aiogram.api.types import CreateNewStickerSet` +- `from aiogram.api.types.create_new_sticker_set import CreateNewStickerSet` + +#### As reply into Webhook +```python3 +return CreateNewStickerSet(...) +``` + +#### With specific bot +```python3 +result: bool = await bot.emit(CreateNewStickerSet(...)) +``` + +#### In handlers with current bot +```python3 +result: bool = await CreateNewStickerSet(...) +``` + + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#createnewstickerset) +- [aiogram.types.InputFile](../types/input_file.md) +- [aiogram.types.MaskPosition](../types/mask_position.md) diff --git a/docs/api/methods/delete_chat_photo.md b/docs/api/methods/delete_chat_photo.md new file mode 100644 index 00000000..f99754e7 --- /dev/null +++ b/docs/api/methods/delete_chat_photo.md @@ -0,0 +1,58 @@ +# deleteChatPhoto + +## Description + +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. + + +## Arguments + +| Name | Type | Description | +| - | - | - | +| `chat_id` | `#!python3 Union[int, str]` | Unique identifier for the target chat or username of the target channel (in the format @channelusername) | + + + +## Response + +Type: `#!python3 bool` + +Description: Returns True on success. + + +## Usage + + +### As bot method bot + +```python3 +result: bool = await bot.delete_chat_photo(...) +``` + +### Method as object + +Imports: + +- `from aiogram.types import DeleteChatPhoto` +- `from aiogram.api.types import DeleteChatPhoto` +- `from aiogram.api.types.delete_chat_photo import DeleteChatPhoto` + +#### As reply into Webhook +```python3 +return DeleteChatPhoto(...) +``` + +#### With specific bot +```python3 +result: bool = await bot.emit(DeleteChatPhoto(...)) +``` + +#### In handlers with current bot +```python3 +result: bool = await DeleteChatPhoto(...) +``` + + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#deletechatphoto) diff --git a/docs/api/methods/delete_chat_sticker_set.md b/docs/api/methods/delete_chat_sticker_set.md new file mode 100644 index 00000000..dda5f0ea --- /dev/null +++ b/docs/api/methods/delete_chat_sticker_set.md @@ -0,0 +1,58 @@ +# deleteChatStickerSet + +## Description + +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. + + +## Arguments + +| Name | Type | Description | +| - | - | - | +| `chat_id` | `#!python3 Union[int, str]` | Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) | + + + +## Response + +Type: `#!python3 bool` + +Description: 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. + + +## Usage + + +### As bot method bot + +```python3 +result: bool = await bot.delete_chat_sticker_set(...) +``` + +### Method as object + +Imports: + +- `from aiogram.types import DeleteChatStickerSet` +- `from aiogram.api.types import DeleteChatStickerSet` +- `from aiogram.api.types.delete_chat_sticker_set import DeleteChatStickerSet` + +#### As reply into Webhook +```python3 +return DeleteChatStickerSet(...) +``` + +#### With specific bot +```python3 +result: bool = await bot.emit(DeleteChatStickerSet(...)) +``` + +#### In handlers with current bot +```python3 +result: bool = await DeleteChatStickerSet(...) +``` + + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#deletechatstickerset) diff --git a/docs/api/methods/delete_message.md b/docs/api/methods/delete_message.md new file mode 100644 index 00000000..cfce1306 --- /dev/null +++ b/docs/api/methods/delete_message.md @@ -0,0 +1,73 @@ +# deleteMessage + +## Description + +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. + +- 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. + + +## Arguments + +| Name | Type | Description | +| - | - | - | +| `chat_id` | `#!python3 Union[int, str]` | Unique identifier for the target chat or username of the target channel (in the format @channelusername) | +| `message_id` | `#!python3 int` | Identifier of the message to delete | + + + +## Response + +Type: `#!python3 bool` + +Description: Returns True on success. + + +## Usage + + +### As bot method bot + +```python3 +result: bool = await bot.delete_message(...) +``` + +### Method as object + +Imports: + +- `from aiogram.types import DeleteMessage` +- `from aiogram.api.types import DeleteMessage` +- `from aiogram.api.types.delete_message import DeleteMessage` + +#### As reply into Webhook +```python3 +return DeleteMessage(...) +``` + +#### With specific bot +```python3 +result: bool = await bot.emit(DeleteMessage(...)) +``` + +#### In handlers with current bot +```python3 +result: bool = await DeleteMessage(...) +``` + + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#deletemessage) diff --git a/docs/api/methods/delete_sticker_from_set.md b/docs/api/methods/delete_sticker_from_set.md new file mode 100644 index 00000000..11c6d335 --- /dev/null +++ b/docs/api/methods/delete_sticker_from_set.md @@ -0,0 +1,58 @@ +# deleteStickerFromSet + +## Description + +Use this method to delete a sticker from a set created by the bot. Returns True on success. + + +## Arguments + +| Name | Type | Description | +| - | - | - | +| `sticker` | `#!python3 str` | File identifier of the sticker | + + + +## Response + +Type: `#!python3 bool` + +Description: Returns True on success. + + +## Usage + + +### As bot method bot + +```python3 +result: bool = await bot.delete_sticker_from_set(...) +``` + +### Method as object + +Imports: + +- `from aiogram.types import DeleteStickerFromSet` +- `from aiogram.api.types import DeleteStickerFromSet` +- `from aiogram.api.types.delete_sticker_from_set import DeleteStickerFromSet` + +#### As reply into Webhook +```python3 +return DeleteStickerFromSet(...) +``` + +#### With specific bot +```python3 +result: bool = await bot.emit(DeleteStickerFromSet(...)) +``` + +#### In handlers with current bot +```python3 +result: bool = await DeleteStickerFromSet(...) +``` + + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#deletestickerfromset) diff --git a/docs/api/methods/delete_webhook.md b/docs/api/methods/delete_webhook.md new file mode 100644 index 00000000..cc6ae8c3 --- /dev/null +++ b/docs/api/methods/delete_webhook.md @@ -0,0 +1,52 @@ +# deleteWebhook + +## Description + +Use this method to remove webhook integration if you decide to switch back to getUpdates. Returns True on success. Requires no parameters. + + + + +## Response + +Type: `#!python3 bool` + +Description: Returns True on success. + + +## Usage + + +### As bot method bot + +```python3 +result: bool = await bot.delete_webhook(...) +``` + +### Method as object + +Imports: + +- `from aiogram.types import DeleteWebhook` +- `from aiogram.api.types import DeleteWebhook` +- `from aiogram.api.types.delete_webhook import DeleteWebhook` + +#### As reply into Webhook +```python3 +return DeleteWebhook(...) +``` + +#### With specific bot +```python3 +result: bool = await bot.emit(DeleteWebhook(...)) +``` + +#### In handlers with current bot +```python3 +result: bool = await DeleteWebhook(...) +``` + + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#deletewebhook) diff --git a/docs/api/methods/edit_message_caption.md b/docs/api/methods/edit_message_caption.md new file mode 100644 index 00000000..c9cb2903 --- /dev/null +++ b/docs/api/methods/edit_message_caption.md @@ -0,0 +1,65 @@ +# editMessageCaption + +## Description + +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. + + +## Arguments + +| Name | Type | Description | +| - | - | - | +| `chat_id` | `#!python3 Optional[Union[int, str]]` | Optional. Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername) | +| `message_id` | `#!python3 Optional[int]` | Optional. Required if inline_message_id is not specified. Identifier of the message to edit | +| `inline_message_id` | `#!python3 Optional[str]` | Optional. Required if chat_id and message_id are not specified. Identifier of the inline message | +| `caption` | `#!python3 Optional[str]` | Optional. New caption of the message | +| `parse_mode` | `#!python3 Optional[str]` | Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption. | +| `reply_markup` | `#!python3 Optional[InlineKeyboardMarkup]` | Optional. A JSON-serialized object for an inline keyboard. | + + + +## Response + +Type: `#!python3 Union[Message, bool]` + +Description: On success, if edited message is sent by the bot, the edited Message is returned, otherwise True is returned. + + +## Usage + + +### As bot method bot + +```python3 +result: Union[Message, bool] = await bot.edit_message_caption(...) +``` + +### Method as object + +Imports: + +- `from aiogram.types import EditMessageCaption` +- `from aiogram.api.types import EditMessageCaption` +- `from aiogram.api.types.edit_message_caption import EditMessageCaption` + +#### As reply into Webhook +```python3 +return EditMessageCaption(...) +``` + +#### With specific bot +```python3 +result: Union[Message, bool] = await bot.emit(EditMessageCaption(...)) +``` + +#### In handlers with current bot +```python3 +result: Union[Message, bool] = await EditMessageCaption(...) +``` + + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#editmessagecaption) +- [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md) +- [aiogram.types.Message](../types/message.md) diff --git a/docs/api/methods/edit_message_live_location.md b/docs/api/methods/edit_message_live_location.md new file mode 100644 index 00000000..6fa661fc --- /dev/null +++ b/docs/api/methods/edit_message_live_location.md @@ -0,0 +1,65 @@ +# editMessageLiveLocation + +## Description + +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. + + +## Arguments + +| Name | Type | Description | +| - | - | - | +| `latitude` | `#!python3 float` | Latitude of new location | +| `longitude` | `#!python3 float` | Longitude of new location | +| `chat_id` | `#!python3 Optional[Union[int, str]]` | Optional. Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername) | +| `message_id` | `#!python3 Optional[int]` | Optional. Required if inline_message_id is not specified. Identifier of the message to edit | +| `inline_message_id` | `#!python3 Optional[str]` | Optional. Required if chat_id and message_id are not specified. Identifier of the inline message | +| `reply_markup` | `#!python3 Optional[InlineKeyboardMarkup]` | Optional. A JSON-serialized object for a new inline keyboard. | + + + +## Response + +Type: `#!python3 Union[Message, bool]` + +Description: On success, if the edited message was sent by the bot, the edited Message is returned, otherwise True is returned. + + +## Usage + + +### As bot method bot + +```python3 +result: Union[Message, bool] = await bot.edit_message_live_location(...) +``` + +### Method as object + +Imports: + +- `from aiogram.types import EditMessageLiveLocation` +- `from aiogram.api.types import EditMessageLiveLocation` +- `from aiogram.api.types.edit_message_live_location import EditMessageLiveLocation` + +#### As reply into Webhook +```python3 +return EditMessageLiveLocation(...) +``` + +#### With specific bot +```python3 +result: Union[Message, bool] = await bot.emit(EditMessageLiveLocation(...)) +``` + +#### In handlers with current bot +```python3 +result: Union[Message, bool] = await EditMessageLiveLocation(...) +``` + + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#editmessagelivelocation) +- [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md) +- [aiogram.types.Message](../types/message.md) diff --git a/docs/api/methods/edit_message_media.md b/docs/api/methods/edit_message_media.md new file mode 100644 index 00000000..c63ad09a --- /dev/null +++ b/docs/api/methods/edit_message_media.md @@ -0,0 +1,65 @@ +# editMessageMedia + +## Description + +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. + + +## Arguments + +| Name | Type | Description | +| - | - | - | +| `media` | `#!python3 InputMedia` | A JSON-serialized object for a new media content of the message | +| `chat_id` | `#!python3 Optional[Union[int, str]]` | Optional. Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername) | +| `message_id` | `#!python3 Optional[int]` | Optional. Required if inline_message_id is not specified. Identifier of the message to edit | +| `inline_message_id` | `#!python3 Optional[str]` | Optional. Required if chat_id and message_id are not specified. Identifier of the inline message | +| `reply_markup` | `#!python3 Optional[InlineKeyboardMarkup]` | Optional. A JSON-serialized object for a new inline keyboard. | + + + +## Response + +Type: `#!python3 Union[Message, bool]` + +Description: On success, if the edited message was sent by the bot, the edited Message is returned, otherwise True is returned. + + +## Usage + + +### As bot method bot + +```python3 +result: Union[Message, bool] = await bot.edit_message_media(...) +``` + +### Method as object + +Imports: + +- `from aiogram.types import EditMessageMedia` +- `from aiogram.api.types import EditMessageMedia` +- `from aiogram.api.types.edit_message_media import EditMessageMedia` + +#### As reply into Webhook +```python3 +return EditMessageMedia(...) +``` + +#### With specific bot +```python3 +result: Union[Message, bool] = await bot.emit(EditMessageMedia(...)) +``` + +#### In handlers with current bot +```python3 +result: Union[Message, bool] = await EditMessageMedia(...) +``` + + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#editmessagemedia) +- [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md) +- [aiogram.types.InputMedia](../types/input_media.md) +- [aiogram.types.Message](../types/message.md) diff --git a/docs/api/methods/edit_message_reply_markup.md b/docs/api/methods/edit_message_reply_markup.md new file mode 100644 index 00000000..9996bb33 --- /dev/null +++ b/docs/api/methods/edit_message_reply_markup.md @@ -0,0 +1,63 @@ +# editMessageReplyMarkup + +## Description + +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. + + +## Arguments + +| Name | Type | Description | +| - | - | - | +| `chat_id` | `#!python3 Optional[Union[int, str]]` | Optional. Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername) | +| `message_id` | `#!python3 Optional[int]` | Optional. Required if inline_message_id is not specified. Identifier of the message to edit | +| `inline_message_id` | `#!python3 Optional[str]` | Optional. Required if chat_id and message_id are not specified. Identifier of the inline message | +| `reply_markup` | `#!python3 Optional[InlineKeyboardMarkup]` | Optional. A JSON-serialized object for an inline keyboard. | + + + +## Response + +Type: `#!python3 Union[Message, bool]` + +Description: On success, if edited message is sent by the bot, the edited Message is returned, otherwise True is returned. + + +## Usage + + +### As bot method bot + +```python3 +result: Union[Message, bool] = await bot.edit_message_reply_markup(...) +``` + +### Method as object + +Imports: + +- `from aiogram.types import EditMessageReplyMarkup` +- `from aiogram.api.types import EditMessageReplyMarkup` +- `from aiogram.api.types.edit_message_reply_markup import EditMessageReplyMarkup` + +#### As reply into Webhook +```python3 +return EditMessageReplyMarkup(...) +``` + +#### With specific bot +```python3 +result: Union[Message, bool] = await bot.emit(EditMessageReplyMarkup(...)) +``` + +#### In handlers with current bot +```python3 +result: Union[Message, bool] = await EditMessageReplyMarkup(...) +``` + + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#editmessagereplymarkup) +- [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md) +- [aiogram.types.Message](../types/message.md) diff --git a/docs/api/methods/edit_message_text.md b/docs/api/methods/edit_message_text.md new file mode 100644 index 00000000..eb42af07 --- /dev/null +++ b/docs/api/methods/edit_message_text.md @@ -0,0 +1,66 @@ +# editMessageText + +## Description + +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. + + +## Arguments + +| Name | Type | Description | +| - | - | - | +| `text` | `#!python3 str` | New text of the message | +| `chat_id` | `#!python3 Optional[Union[int, str]]` | Optional. Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername) | +| `message_id` | `#!python3 Optional[int]` | Optional. Required if inline_message_id is not specified. Identifier of the message to edit | +| `inline_message_id` | `#!python3 Optional[str]` | Optional. Required if chat_id and message_id are not specified. Identifier of the inline message | +| `parse_mode` | `#!python3 Optional[str]` | Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in your bot's message. | +| `disable_web_page_preview` | `#!python3 Optional[bool]` | Optional. Disables link previews for links in this message | +| `reply_markup` | `#!python3 Optional[InlineKeyboardMarkup]` | Optional. A JSON-serialized object for an inline keyboard. | + + + +## Response + +Type: `#!python3 Union[Message, bool]` + +Description: On success, if edited message is sent by the bot, the edited Message is returned, otherwise True is returned. + + +## Usage + + +### As bot method bot + +```python3 +result: Union[Message, bool] = await bot.edit_message_text(...) +``` + +### Method as object + +Imports: + +- `from aiogram.types import EditMessageText` +- `from aiogram.api.types import EditMessageText` +- `from aiogram.api.types.edit_message_text import EditMessageText` + +#### As reply into Webhook +```python3 +return EditMessageText(...) +``` + +#### With specific bot +```python3 +result: Union[Message, bool] = await bot.emit(EditMessageText(...)) +``` + +#### In handlers with current bot +```python3 +result: Union[Message, bool] = await EditMessageText(...) +``` + + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#editmessagetext) +- [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md) +- [aiogram.types.Message](../types/message.md) diff --git a/docs/api/methods/export_chat_invite_link.md b/docs/api/methods/export_chat_invite_link.md new file mode 100644 index 00000000..102a95c9 --- /dev/null +++ b/docs/api/methods/export_chat_invite_link.md @@ -0,0 +1,60 @@ +# exportChatInviteLink + +## Description + +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. + + +## Arguments + +| Name | Type | Description | +| - | - | - | +| `chat_id` | `#!python3 Union[int, str]` | Unique identifier for the target chat or username of the target channel (in the format @channelusername) | + + + +## Response + +Type: `#!python3 str` + +Description: Returns the new invite link as String on success. + + +## Usage + + +### As bot method bot + +```python3 +result: str = await bot.export_chat_invite_link(...) +``` + +### Method as object + +Imports: + +- `from aiogram.types import ExportChatInviteLink` +- `from aiogram.api.types import ExportChatInviteLink` +- `from aiogram.api.types.export_chat_invite_link import ExportChatInviteLink` + +#### As reply into Webhook +```python3 +return ExportChatInviteLink(...) +``` + +#### With specific bot +```python3 +result: str = await bot.emit(ExportChatInviteLink(...)) +``` + +#### In handlers with current bot +```python3 +result: str = await ExportChatInviteLink(...) +``` + + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#exportchatinvitelink) diff --git a/docs/api/methods/forward_message.md b/docs/api/methods/forward_message.md new file mode 100644 index 00000000..549ac6e2 --- /dev/null +++ b/docs/api/methods/forward_message.md @@ -0,0 +1,62 @@ +# forwardMessage + +## Description + +Use this method to forward messages of any kind. On success, the sent Message is returned. + + +## Arguments + +| Name | Type | Description | +| - | - | - | +| `chat_id` | `#!python3 Union[int, str]` | Unique identifier for the target chat or username of the target channel (in the format @channelusername) | +| `from_chat_id` | `#!python3 Union[int, str]` | Unique identifier for the chat where the original message was sent (or channel username in the format @channelusername) | +| `message_id` | `#!python3 int` | Message identifier in the chat specified in from_chat_id | +| `disable_notification` | `#!python3 Optional[bool]` | Optional. Sends the message silently. Users will receive a notification with no sound. | + + + +## Response + +Type: `#!python3 Message` + +Description: On success, the sent Message is returned. + + +## Usage + + +### As bot method bot + +```python3 +result: Message = await bot.forward_message(...) +``` + +### Method as object + +Imports: + +- `from aiogram.types import ForwardMessage` +- `from aiogram.api.types import ForwardMessage` +- `from aiogram.api.types.forward_message import ForwardMessage` + +#### As reply into Webhook +```python3 +return ForwardMessage(...) +``` + +#### With specific bot +```python3 +result: Message = await bot.emit(ForwardMessage(...)) +``` + +#### In handlers with current bot +```python3 +result: Message = await ForwardMessage(...) +``` + + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#forwardmessage) +- [aiogram.types.Message](../types/message.md) diff --git a/docs/api/methods/get_chat.md b/docs/api/methods/get_chat.md new file mode 100644 index 00000000..e6269159 --- /dev/null +++ b/docs/api/methods/get_chat.md @@ -0,0 +1,55 @@ +# getChat + +## Description + +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. + + +## Arguments + +| Name | Type | Description | +| - | - | - | +| `chat_id` | `#!python3 Union[int, str]` | Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername) | + + + +## Response + +Type: `#!python3 Chat` + +Description: Returns a Chat object on success. + + +## Usage + + +### As bot method bot + +```python3 +result: Chat = await bot.get_chat(...) +``` + +### Method as object + +Imports: + +- `from aiogram.types import GetChat` +- `from aiogram.api.types import GetChat` +- `from aiogram.api.types.get_chat import GetChat` + + +#### With specific bot +```python3 +result: Chat = await bot.emit(GetChat(...)) +``` + +#### In handlers with current bot +```python3 +result: Chat = await GetChat(...) +``` + + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#getchat) +- [aiogram.types.Chat](../types/chat.md) diff --git a/docs/api/methods/get_chat_administrators.md b/docs/api/methods/get_chat_administrators.md new file mode 100644 index 00000000..3ee9a3da --- /dev/null +++ b/docs/api/methods/get_chat_administrators.md @@ -0,0 +1,55 @@ +# getChatAdministrators + +## Description + +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. + + +## Arguments + +| Name | Type | Description | +| - | - | - | +| `chat_id` | `#!python3 Union[int, str]` | Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername) | + + + +## Response + +Type: `#!python3 List[ChatMember]` + +Description: 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. + + +## Usage + + +### As bot method bot + +```python3 +result: List[ChatMember] = await bot.get_chat_administrators(...) +``` + +### Method as object + +Imports: + +- `from aiogram.types import GetChatAdministrators` +- `from aiogram.api.types import GetChatAdministrators` +- `from aiogram.api.types.get_chat_administrators import GetChatAdministrators` + + +#### With specific bot +```python3 +result: List[ChatMember] = await bot.emit(GetChatAdministrators(...)) +``` + +#### In handlers with current bot +```python3 +result: List[ChatMember] = await GetChatAdministrators(...) +``` + + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#getchatadministrators) +- [aiogram.types.ChatMember](../types/chat_member.md) diff --git a/docs/api/methods/get_chat_member.md b/docs/api/methods/get_chat_member.md new file mode 100644 index 00000000..12559e0c --- /dev/null +++ b/docs/api/methods/get_chat_member.md @@ -0,0 +1,56 @@ +# getChatMember + +## Description + +Use this method to get information about a member of a chat. Returns a ChatMember object on success. + + +## Arguments + +| Name | Type | Description | +| - | - | - | +| `chat_id` | `#!python3 Union[int, str]` | Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername) | +| `user_id` | `#!python3 int` | Unique identifier of the target user | + + + +## Response + +Type: `#!python3 ChatMember` + +Description: Returns a ChatMember object on success. + + +## Usage + + +### As bot method bot + +```python3 +result: ChatMember = await bot.get_chat_member(...) +``` + +### Method as object + +Imports: + +- `from aiogram.types import GetChatMember` +- `from aiogram.api.types import GetChatMember` +- `from aiogram.api.types.get_chat_member import GetChatMember` + + +#### With specific bot +```python3 +result: ChatMember = await bot.emit(GetChatMember(...)) +``` + +#### In handlers with current bot +```python3 +result: ChatMember = await GetChatMember(...) +``` + + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#getchatmember) +- [aiogram.types.ChatMember](../types/chat_member.md) diff --git a/docs/api/methods/get_chat_members_count.md b/docs/api/methods/get_chat_members_count.md new file mode 100644 index 00000000..8897955a --- /dev/null +++ b/docs/api/methods/get_chat_members_count.md @@ -0,0 +1,54 @@ +# getChatMembersCount + +## Description + +Use this method to get the number of members in a chat. Returns Int on success. + + +## Arguments + +| Name | Type | Description | +| - | - | - | +| `chat_id` | `#!python3 Union[int, str]` | Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername) | + + + +## Response + +Type: `#!python3 int` + +Description: Returns Int on success. + + +## Usage + + +### As bot method bot + +```python3 +result: int = await bot.get_chat_members_count(...) +``` + +### Method as object + +Imports: + +- `from aiogram.types import GetChatMembersCount` +- `from aiogram.api.types import GetChatMembersCount` +- `from aiogram.api.types.get_chat_members_count import GetChatMembersCount` + + +#### With specific bot +```python3 +result: int = await bot.emit(GetChatMembersCount(...)) +``` + +#### In handlers with current bot +```python3 +result: int = await GetChatMembersCount(...) +``` + + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#getchatmemberscount) diff --git a/docs/api/methods/get_file.md b/docs/api/methods/get_file.md new file mode 100644 index 00000000..6e2fd4d3 --- /dev/null +++ b/docs/api/methods/get_file.md @@ -0,0 +1,57 @@ +# getFile + +## Description + +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. + + +## Arguments + +| Name | Type | Description | +| - | - | - | +| `file_id` | `#!python3 str` | File identifier to get info about | + + + +## Response + +Type: `#!python3 File` + +Description: On success, a File object is returned. + + +## Usage + + +### As bot method bot + +```python3 +result: File = await bot.get_file(...) +``` + +### Method as object + +Imports: + +- `from aiogram.types import GetFile` +- `from aiogram.api.types import GetFile` +- `from aiogram.api.types.get_file import GetFile` + + +#### With specific bot +```python3 +result: File = await bot.emit(GetFile(...)) +``` + +#### In handlers with current bot +```python3 +result: File = await GetFile(...) +``` + + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#getfile) +- [aiogram.types.File](../types/file.md) diff --git a/docs/api/methods/get_game_high_scores.md b/docs/api/methods/get_game_high_scores.md new file mode 100644 index 00000000..3ad39a34 --- /dev/null +++ b/docs/api/methods/get_game_high_scores.md @@ -0,0 +1,60 @@ +# getGameHighScores + +## Description + +Use this method to get data for high score tables. Will return the score of the specified user and several of his 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 his 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. + + +## Arguments + +| Name | Type | Description | +| - | - | - | +| `user_id` | `#!python3 int` | Target user id | +| `chat_id` | `#!python3 Optional[int]` | Optional. Required if inline_message_id is not specified. Unique identifier for the target chat | +| `message_id` | `#!python3 Optional[int]` | Optional. Required if inline_message_id is not specified. Identifier of the sent message | +| `inline_message_id` | `#!python3 Optional[str]` | Optional. Required if chat_id and message_id are not specified. Identifier of the inline message | + + + +## Response + +Type: `#!python3 List[GameHighScore]` + +Description: Will return the score of the specified user and several of his 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 his closest neighbors on each side. Will also return the top three users if the user and his neighbors are not among them. + + +## Usage + + +### As bot method bot + +```python3 +result: List[GameHighScore] = await bot.get_game_high_scores(...) +``` + +### Method as object + +Imports: + +- `from aiogram.types import GetGameHighScores` +- `from aiogram.api.types import GetGameHighScores` +- `from aiogram.api.types.get_game_high_scores import GetGameHighScores` + + +#### With specific bot +```python3 +result: List[GameHighScore] = await bot.emit(GetGameHighScores(...)) +``` + +#### In handlers with current bot +```python3 +result: List[GameHighScore] = await GetGameHighScores(...) +``` + + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#getgamehighscores) +- [aiogram.types.GameHighScore](../types/game_high_score.md) diff --git a/docs/api/methods/get_me.md b/docs/api/methods/get_me.md new file mode 100644 index 00000000..144862f6 --- /dev/null +++ b/docs/api/methods/get_me.md @@ -0,0 +1,49 @@ +# getMe + +## Description + +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. + + + + +## Response + +Type: `#!python3 User` + +Description: Returns basic information about the bot in form of a User object. + + +## Usage + + +### As bot method bot + +```python3 +result: User = await bot.get_me(...) +``` + +### Method as object + +Imports: + +- `from aiogram.types import GetMe` +- `from aiogram.api.types import GetMe` +- `from aiogram.api.types.get_me import GetMe` + + +#### With specific bot +```python3 +result: User = await bot.emit(GetMe(...)) +``` + +#### In handlers with current bot +```python3 +result: User = await GetMe(...) +``` + + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#getme) +- [aiogram.types.User](../types/user.md) diff --git a/docs/api/methods/get_sticker_set.md b/docs/api/methods/get_sticker_set.md new file mode 100644 index 00000000..937c23c7 --- /dev/null +++ b/docs/api/methods/get_sticker_set.md @@ -0,0 +1,55 @@ +# getStickerSet + +## Description + +Use this method to get a sticker set. On success, a StickerSet object is returned. + + +## Arguments + +| Name | Type | Description | +| - | - | - | +| `name` | `#!python3 str` | Name of the sticker set | + + + +## Response + +Type: `#!python3 StickerSet` + +Description: On success, a StickerSet object is returned. + + +## Usage + + +### As bot method bot + +```python3 +result: StickerSet = await bot.get_sticker_set(...) +``` + +### Method as object + +Imports: + +- `from aiogram.types import GetStickerSet` +- `from aiogram.api.types import GetStickerSet` +- `from aiogram.api.types.get_sticker_set import GetStickerSet` + + +#### With specific bot +```python3 +result: StickerSet = await bot.emit(GetStickerSet(...)) +``` + +#### In handlers with current bot +```python3 +result: StickerSet = await GetStickerSet(...) +``` + + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#getstickerset) +- [aiogram.types.StickerSet](../types/sticker_set.md) diff --git a/docs/api/methods/get_updates.md b/docs/api/methods/get_updates.md new file mode 100644 index 00000000..531259af --- /dev/null +++ b/docs/api/methods/get_updates.md @@ -0,0 +1,64 @@ +# getUpdates + +## Description + +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. + + +## Arguments + +| Name | Type | Description | +| - | - | - | +| `offset` | `#!python3 Optional[int]` | Optional. 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. | +| `limit` | `#!python3 Optional[int]` | Optional. Limits the number of updates to be retrieved. Values between 1—100 are accepted. Defaults to 100. | +| `timeout` | `#!python3 Optional[int]` | Optional. 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` | `#!python3 Optional[List[str]]` | Optional. List the types of updates 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. | + + + +## Response + +Type: `#!python3 List[Update]` + +Description: An Array of Update objects is returned. + + +## Usage + + +### As bot method bot + +```python3 +result: List[Update] = await bot.get_updates(...) +``` + +### Method as object + +Imports: + +- `from aiogram.types import GetUpdates` +- `from aiogram.api.types import GetUpdates` +- `from aiogram.api.types.get_updates import GetUpdates` + + +#### With specific bot +```python3 +result: List[Update] = await bot.emit(GetUpdates(...)) +``` + +#### In handlers with current bot +```python3 +result: List[Update] = await GetUpdates(...) +``` + + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#getupdates) +- [aiogram.types.Update](../types/update.md) diff --git a/docs/api/methods/get_user_profile_photos.md b/docs/api/methods/get_user_profile_photos.md new file mode 100644 index 00000000..f8937696 --- /dev/null +++ b/docs/api/methods/get_user_profile_photos.md @@ -0,0 +1,57 @@ +# getUserProfilePhotos + +## Description + +Use this method to get a list of profile pictures for a user. Returns a UserProfilePhotos object. + + +## Arguments + +| Name | Type | Description | +| - | - | - | +| `user_id` | `#!python3 int` | Unique identifier of the target user | +| `offset` | `#!python3 Optional[int]` | Optional. Sequential number of the first photo to be returned. By default, all photos are returned. | +| `limit` | `#!python3 Optional[int]` | Optional. Limits the number of photos to be retrieved. Values between 1—100 are accepted. Defaults to 100. | + + + +## Response + +Type: `#!python3 UserProfilePhotos` + +Description: Returns a UserProfilePhotos object. + + +## Usage + + +### As bot method bot + +```python3 +result: UserProfilePhotos = await bot.get_user_profile_photos(...) +``` + +### Method as object + +Imports: + +- `from aiogram.types import GetUserProfilePhotos` +- `from aiogram.api.types import GetUserProfilePhotos` +- `from aiogram.api.types.get_user_profile_photos import GetUserProfilePhotos` + + +#### With specific bot +```python3 +result: UserProfilePhotos = await bot.emit(GetUserProfilePhotos(...)) +``` + +#### In handlers with current bot +```python3 +result: UserProfilePhotos = await GetUserProfilePhotos(...) +``` + + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#getuserprofilephotos) +- [aiogram.types.UserProfilePhotos](../types/user_profile_photos.md) diff --git a/docs/api/methods/get_webhook_info.md b/docs/api/methods/get_webhook_info.md new file mode 100644 index 00000000..e58b0a73 --- /dev/null +++ b/docs/api/methods/get_webhook_info.md @@ -0,0 +1,49 @@ +# getWebhookInfo + +## Description + +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. + + + + +## Response + +Type: `#!python3 WebhookInfo` + +Description: On success, returns a WebhookInfo object. If the bot is using getUpdates, will return an object with the url field empty. + + +## Usage + + +### As bot method bot + +```python3 +result: WebhookInfo = await bot.get_webhook_info(...) +``` + +### Method as object + +Imports: + +- `from aiogram.types import GetWebhookInfo` +- `from aiogram.api.types import GetWebhookInfo` +- `from aiogram.api.types.get_webhook_info import GetWebhookInfo` + + +#### With specific bot +```python3 +result: WebhookInfo = await bot.emit(GetWebhookInfo(...)) +``` + +#### In handlers with current bot +```python3 +result: WebhookInfo = await GetWebhookInfo(...) +``` + + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#getwebhookinfo) +- [aiogram.types.WebhookInfo](../types/webhook_info.md) diff --git a/docs/api/methods/kick_chat_member.md b/docs/api/methods/kick_chat_member.md new file mode 100644 index 00000000..b13a56db --- /dev/null +++ b/docs/api/methods/kick_chat_member.md @@ -0,0 +1,60 @@ +# kickChatMember + +## Description + +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. + + +## Arguments + +| Name | Type | Description | +| - | - | - | +| `chat_id` | `#!python3 Union[int, str]` | Unique identifier for the target group or username of the target supergroup or channel (in the format @channelusername) | +| `user_id` | `#!python3 int` | Unique identifier of the target user | +| `until_date` | `#!python3 Optional[Union[int, datetime.datetime, datetime.timedelta]]` | Optional. Date when the user will be unbanned, unix time. If user is banned for more than 366 days or less than 30 seconds from the current time they are considered to be banned forever | + + + +## Response + +Type: `#!python3 bool` + +Description: 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. Returns True on success. + + +## Usage + + +### As bot method bot + +```python3 +result: bool = await bot.kick_chat_member(...) +``` + +### Method as object + +Imports: + +- `from aiogram.types import KickChatMember` +- `from aiogram.api.types import KickChatMember` +- `from aiogram.api.types.kick_chat_member import KickChatMember` + +#### As reply into Webhook +```python3 +return KickChatMember(...) +``` + +#### With specific bot +```python3 +result: bool = await bot.emit(KickChatMember(...)) +``` + +#### In handlers with current bot +```python3 +result: bool = await KickChatMember(...) +``` + + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#kickchatmember) diff --git a/docs/api/methods/leave_chat.md b/docs/api/methods/leave_chat.md new file mode 100644 index 00000000..444baa22 --- /dev/null +++ b/docs/api/methods/leave_chat.md @@ -0,0 +1,58 @@ +# leaveChat + +## Description + +Use this method for your bot to leave a group, supergroup or channel. Returns True on success. + + +## Arguments + +| Name | Type | Description | +| - | - | - | +| `chat_id` | `#!python3 Union[int, str]` | Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername) | + + + +## Response + +Type: `#!python3 bool` + +Description: Returns True on success. + + +## Usage + + +### As bot method bot + +```python3 +result: bool = await bot.leave_chat(...) +``` + +### Method as object + +Imports: + +- `from aiogram.types import LeaveChat` +- `from aiogram.api.types import LeaveChat` +- `from aiogram.api.types.leave_chat import LeaveChat` + +#### As reply into Webhook +```python3 +return LeaveChat(...) +``` + +#### With specific bot +```python3 +result: bool = await bot.emit(LeaveChat(...)) +``` + +#### In handlers with current bot +```python3 +result: bool = await LeaveChat(...) +``` + + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#leavechat) diff --git a/docs/api/methods/pin_chat_message.md b/docs/api/methods/pin_chat_message.md new file mode 100644 index 00000000..cefc24b5 --- /dev/null +++ b/docs/api/methods/pin_chat_message.md @@ -0,0 +1,60 @@ +# pinChatMessage + +## Description + +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. + + +## Arguments + +| Name | Type | Description | +| - | - | - | +| `chat_id` | `#!python3 Union[int, str]` | Unique identifier for the target chat or username of the target channel (in the format @channelusername) | +| `message_id` | `#!python3 int` | Identifier of a message to pin | +| `disable_notification` | `#!python3 Optional[bool]` | Optional. 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. | + + + +## Response + +Type: `#!python3 bool` + +Description: Returns True on success. + + +## Usage + + +### As bot method bot + +```python3 +result: bool = await bot.pin_chat_message(...) +``` + +### Method as object + +Imports: + +- `from aiogram.types import PinChatMessage` +- `from aiogram.api.types import PinChatMessage` +- `from aiogram.api.types.pin_chat_message import PinChatMessage` + +#### As reply into Webhook +```python3 +return PinChatMessage(...) +``` + +#### With specific bot +```python3 +result: bool = await bot.emit(PinChatMessage(...)) +``` + +#### In handlers with current bot +```python3 +result: bool = await PinChatMessage(...) +``` + + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#pinchatmessage) diff --git a/docs/api/methods/promote_chat_member.md b/docs/api/methods/promote_chat_member.md new file mode 100644 index 00000000..9011dd22 --- /dev/null +++ b/docs/api/methods/promote_chat_member.md @@ -0,0 +1,67 @@ +# promoteChatMember + +## Description + +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. + + +## Arguments + +| Name | Type | Description | +| - | - | - | +| `chat_id` | `#!python3 Union[int, str]` | Unique identifier for the target chat or username of the target channel (in the format @channelusername) | +| `user_id` | `#!python3 int` | Unique identifier of the target user | +| `can_change_info` | `#!python3 Optional[bool]` | Optional. Pass True, if the administrator can change chat title, photo and other settings | +| `can_post_messages` | `#!python3 Optional[bool]` | Optional. Pass True, if the administrator can create channel posts, channels only | +| `can_edit_messages` | `#!python3 Optional[bool]` | Optional. Pass True, if the administrator can edit messages of other users and can pin messages, channels only | +| `can_delete_messages` | `#!python3 Optional[bool]` | Optional. Pass True, if the administrator can delete messages of other users | +| `can_invite_users` | `#!python3 Optional[bool]` | Optional. Pass True, if the administrator can invite new users to the chat | +| `can_restrict_members` | `#!python3 Optional[bool]` | Optional. Pass True, if the administrator can restrict, ban or unban chat members | +| `can_pin_messages` | `#!python3 Optional[bool]` | Optional. Pass True, if the administrator can pin messages, supergroups only | +| `can_promote_members` | `#!python3 Optional[bool]` | Optional. Pass True, if the administrator can add new administrators with a subset of his own privileges or demote administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by him) | + + + +## Response + +Type: `#!python3 bool` + +Description: Returns True on success. + + +## Usage + + +### As bot method bot + +```python3 +result: bool = await bot.promote_chat_member(...) +``` + +### Method as object + +Imports: + +- `from aiogram.types import PromoteChatMember` +- `from aiogram.api.types import PromoteChatMember` +- `from aiogram.api.types.promote_chat_member import PromoteChatMember` + +#### As reply into Webhook +```python3 +return PromoteChatMember(...) +``` + +#### With specific bot +```python3 +result: bool = await bot.emit(PromoteChatMember(...)) +``` + +#### In handlers with current bot +```python3 +result: bool = await PromoteChatMember(...) +``` + + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#promotechatmember) diff --git a/docs/api/methods/restrict_chat_member.md b/docs/api/methods/restrict_chat_member.md new file mode 100644 index 00000000..7aa605b3 --- /dev/null +++ b/docs/api/methods/restrict_chat_member.md @@ -0,0 +1,62 @@ +# restrictChatMember + +## Description + +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. + + +## Arguments + +| Name | Type | Description | +| - | - | - | +| `chat_id` | `#!python3 Union[int, str]` | Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) | +| `user_id` | `#!python3 int` | Unique identifier of the target user | +| `permissions` | `#!python3 ChatPermissions` | New user permissions | +| `until_date` | `#!python3 Optional[Union[int, datetime.datetime, datetime.timedelta]]` | Optional. Date when restrictions will be lifted for the user, unix time. If user is restricted for more than 366 days or less than 30 seconds from the current time, they are considered to be restricted forever | + + + +## Response + +Type: `#!python3 bool` + +Description: Returns True on success. + + +## Usage + + +### As bot method bot + +```python3 +result: bool = await bot.restrict_chat_member(...) +``` + +### Method as object + +Imports: + +- `from aiogram.types import RestrictChatMember` +- `from aiogram.api.types import RestrictChatMember` +- `from aiogram.api.types.restrict_chat_member import RestrictChatMember` + +#### As reply into Webhook +```python3 +return RestrictChatMember(...) +``` + +#### With specific bot +```python3 +result: bool = await bot.emit(RestrictChatMember(...)) +``` + +#### In handlers with current bot +```python3 +result: bool = await RestrictChatMember(...) +``` + + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#restrictchatmember) +- [aiogram.types.ChatPermissions](../types/chat_permissions.md) diff --git a/docs/api/methods/send_animation.md b/docs/api/methods/send_animation.md new file mode 100644 index 00000000..a83e3f4c --- /dev/null +++ b/docs/api/methods/send_animation.md @@ -0,0 +1,74 @@ +# sendAnimation + +## Description + +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. + + +## Arguments + +| Name | Type | Description | +| - | - | - | +| `chat_id` | `#!python3 Union[int, str]` | Unique identifier for the target chat or username of the target channel (in the format @channelusername) | +| `animation` | `#!python3 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. | +| `duration` | `#!python3 Optional[int]` | Optional. Duration of sent animation in seconds | +| `width` | `#!python3 Optional[int]` | Optional. Animation width | +| `height` | `#!python3 Optional[int]` | Optional. Animation height | +| `thumb` | `#!python3 Optional[Union[InputFile, str]]` | 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 . | +| `caption` | `#!python3 Optional[str]` | Optional. Animation caption (may also be used when resending animation by file_id), 0-1024 characters | +| `parse_mode` | `#!python3 Optional[str]` | Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption. | +| `disable_notification` | `#!python3 Optional[bool]` | Optional. Sends the message silently. Users will receive a notification with no sound. | +| `reply_to_message_id` | `#!python3 Optional[int]` | Optional. If the message is a reply, ID of the original message | +| `reply_markup` | `#!python3 Optional[Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]]` | Optional. 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. | + + + +## Response + +Type: `#!python3 Message` + +Description: On success, the sent Message is returned. + + +## Usage + + +### As bot method bot + +```python3 +result: Message = await bot.send_animation(...) +``` + +### Method as object + +Imports: + +- `from aiogram.types import SendAnimation` +- `from aiogram.api.types import SendAnimation` +- `from aiogram.api.types.send_animation import SendAnimation` + +#### As reply into Webhook +```python3 +return SendAnimation(...) +``` + +#### With specific bot +```python3 +result: Message = await bot.emit(SendAnimation(...)) +``` + +#### In handlers with current bot +```python3 +result: Message = await SendAnimation(...) +``` + + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#sendanimation) +- [aiogram.types.ForceReply](../types/force_reply.md) +- [aiogram.types.ReplyKeyboardMarkup](../types/reply_keyboard_markup.md) +- [aiogram.types.Message](../types/message.md) +- [aiogram.types.ReplyKeyboardRemove](../types/reply_keyboard_remove.md) +- [aiogram.types.InputFile](../types/input_file.md) +- [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md) diff --git a/docs/api/methods/send_audio.md b/docs/api/methods/send_audio.md new file mode 100644 index 00000000..ad16e845 --- /dev/null +++ b/docs/api/methods/send_audio.md @@ -0,0 +1,76 @@ +# sendAudio + +## Description + +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. + + +## Arguments + +| Name | Type | Description | +| - | - | - | +| `chat_id` | `#!python3 Union[int, str]` | Unique identifier for the target chat or username of the target channel (in the format @channelusername) | +| `audio` | `#!python3 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. | +| `caption` | `#!python3 Optional[str]` | Optional. Audio caption, 0-1024 characters | +| `parse_mode` | `#!python3 Optional[str]` | Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption. | +| `duration` | `#!python3 Optional[int]` | Optional. Duration of the audio in seconds | +| `performer` | `#!python3 Optional[str]` | Optional. Performer | +| `title` | `#!python3 Optional[str]` | Optional. Track name | +| `thumb` | `#!python3 Optional[Union[InputFile, str]]` | 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 . | +| `disable_notification` | `#!python3 Optional[bool]` | Optional. Sends the message silently. Users will receive a notification with no sound. | +| `reply_to_message_id` | `#!python3 Optional[int]` | Optional. If the message is a reply, ID of the original message | +| `reply_markup` | `#!python3 Optional[Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]]` | Optional. 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. | + + + +## Response + +Type: `#!python3 Message` + +Description: On success, the sent Message is returned. + + +## Usage + + +### As bot method bot + +```python3 +result: Message = await bot.send_audio(...) +``` + +### Method as object + +Imports: + +- `from aiogram.types import SendAudio` +- `from aiogram.api.types import SendAudio` +- `from aiogram.api.types.send_audio import SendAudio` + +#### As reply into Webhook +```python3 +return SendAudio(...) +``` + +#### With specific bot +```python3 +result: Message = await bot.emit(SendAudio(...)) +``` + +#### In handlers with current bot +```python3 +result: Message = await SendAudio(...) +``` + + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#sendaudio) +- [aiogram.types.ForceReply](../types/force_reply.md) +- [aiogram.types.ReplyKeyboardMarkup](../types/reply_keyboard_markup.md) +- [aiogram.types.Message](../types/message.md) +- [aiogram.types.ReplyKeyboardRemove](../types/reply_keyboard_remove.md) +- [aiogram.types.InputFile](../types/input_file.md) +- [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md) diff --git a/docs/api/methods/send_chat_action.md b/docs/api/methods/send_chat_action.md new file mode 100644 index 00000000..6694df80 --- /dev/null +++ b/docs/api/methods/send_chat_action.md @@ -0,0 +1,63 @@ +# sendChatAction + +## Description + +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. + + +## Arguments + +| Name | Type | Description | +| - | - | - | +| `chat_id` | `#!python3 Union[int, str]` | Unique identifier for the target chat or username of the target channel (in the format @channelusername) | +| `action` | `#!python3 str` | Type of action to broadcast. Choose one, depending on what the user is about to receive: typing for text messages, upload_photo for photos, record_video or upload_video for videos, record_audio or upload_audio for audio files, upload_document for general files, find_location for location data, record_video_note or upload_video_note for video notes. | + + + +## Response + +Type: `#!python3 bool` + +Description: Returns True on success. + + +## Usage + + +### As bot method bot + +```python3 +result: bool = await bot.send_chat_action(...) +``` + +### Method as object + +Imports: + +- `from aiogram.types import SendChatAction` +- `from aiogram.api.types import SendChatAction` +- `from aiogram.api.types.send_chat_action import SendChatAction` + +#### As reply into Webhook +```python3 +return SendChatAction(...) +``` + +#### With specific bot +```python3 +result: bool = await bot.emit(SendChatAction(...)) +``` + +#### In handlers with current bot +```python3 +result: bool = await SendChatAction(...) +``` + + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#sendchataction) diff --git a/docs/api/methods/send_contact.md b/docs/api/methods/send_contact.md new file mode 100644 index 00000000..2b625aeb --- /dev/null +++ b/docs/api/methods/send_contact.md @@ -0,0 +1,70 @@ +# sendContact + +## Description + +Use this method to send phone contacts. On success, the sent Message is returned. + + +## Arguments + +| Name | Type | Description | +| - | - | - | +| `chat_id` | `#!python3 Union[int, str]` | Unique identifier for the target chat or username of the target channel (in the format @channelusername) | +| `phone_number` | `#!python3 str` | Contact's phone number | +| `first_name` | `#!python3 str` | Contact's first name | +| `last_name` | `#!python3 Optional[str]` | Optional. Contact's last name | +| `vcard` | `#!python3 Optional[str]` | Optional. Additional data about the contact in the form of a vCard, 0-2048 bytes | +| `disable_notification` | `#!python3 Optional[bool]` | Optional. Sends the message silently. Users will receive a notification with no sound. | +| `reply_to_message_id` | `#!python3 Optional[int]` | Optional. If the message is a reply, ID of the original message | +| `reply_markup` | `#!python3 Optional[Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]]` | Optional. 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. | + + + +## Response + +Type: `#!python3 Message` + +Description: On success, the sent Message is returned. + + +## Usage + + +### As bot method bot + +```python3 +result: Message = await bot.send_contact(...) +``` + +### Method as object + +Imports: + +- `from aiogram.types import SendContact` +- `from aiogram.api.types import SendContact` +- `from aiogram.api.types.send_contact import SendContact` + +#### As reply into Webhook +```python3 +return SendContact(...) +``` + +#### With specific bot +```python3 +result: Message = await bot.emit(SendContact(...)) +``` + +#### In handlers with current bot +```python3 +result: Message = await SendContact(...) +``` + + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#sendcontact) +- [aiogram.types.ForceReply](../types/force_reply.md) +- [aiogram.types.ReplyKeyboardMarkup](../types/reply_keyboard_markup.md) +- [aiogram.types.Message](../types/message.md) +- [aiogram.types.ReplyKeyboardRemove](../types/reply_keyboard_remove.md) +- [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md) diff --git a/docs/api/methods/send_document.md b/docs/api/methods/send_document.md new file mode 100644 index 00000000..06213ceb --- /dev/null +++ b/docs/api/methods/send_document.md @@ -0,0 +1,71 @@ +# sendDocument + +## Description + +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. + + +## Arguments + +| Name | Type | Description | +| - | - | - | +| `chat_id` | `#!python3 Union[int, str]` | Unique identifier for the target chat or username of the target channel (in the format @channelusername) | +| `document` | `#!python3 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. | +| `thumb` | `#!python3 Optional[Union[InputFile, str]]` | 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 . | +| `caption` | `#!python3 Optional[str]` | Optional. Document caption (may also be used when resending documents by file_id), 0-1024 characters | +| `parse_mode` | `#!python3 Optional[str]` | Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption. | +| `disable_notification` | `#!python3 Optional[bool]` | Optional. Sends the message silently. Users will receive a notification with no sound. | +| `reply_to_message_id` | `#!python3 Optional[int]` | Optional. If the message is a reply, ID of the original message | +| `reply_markup` | `#!python3 Optional[Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]]` | Optional. 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. | + + + +## Response + +Type: `#!python3 Message` + +Description: On success, the sent Message is returned. + + +## Usage + + +### As bot method bot + +```python3 +result: Message = await bot.send_document(...) +``` + +### Method as object + +Imports: + +- `from aiogram.types import SendDocument` +- `from aiogram.api.types import SendDocument` +- `from aiogram.api.types.send_document import SendDocument` + +#### As reply into Webhook +```python3 +return SendDocument(...) +``` + +#### With specific bot +```python3 +result: Message = await bot.emit(SendDocument(...)) +``` + +#### In handlers with current bot +```python3 +result: Message = await SendDocument(...) +``` + + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#senddocument) +- [aiogram.types.ForceReply](../types/force_reply.md) +- [aiogram.types.ReplyKeyboardMarkup](../types/reply_keyboard_markup.md) +- [aiogram.types.Message](../types/message.md) +- [aiogram.types.ReplyKeyboardRemove](../types/reply_keyboard_remove.md) +- [aiogram.types.InputFile](../types/input_file.md) +- [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md) diff --git a/docs/api/methods/send_game.md b/docs/api/methods/send_game.md new file mode 100644 index 00000000..76e99eef --- /dev/null +++ b/docs/api/methods/send_game.md @@ -0,0 +1,64 @@ +# sendGame + +## Description + +Use this method to send a game. On success, the sent Message is returned. + + +## Arguments + +| Name | Type | Description | +| - | - | - | +| `chat_id` | `#!python3 int` | Unique identifier for the target chat | +| `game_short_name` | `#!python3 str` | Short name of the game, serves as the unique identifier for the game. Set up your games via Botfather. | +| `disable_notification` | `#!python3 Optional[bool]` | Optional. Sends the message silently. Users will receive a notification with no sound. | +| `reply_to_message_id` | `#!python3 Optional[int]` | Optional. If the message is a reply, ID of the original message | +| `reply_markup` | `#!python3 Optional[InlineKeyboardMarkup]` | Optional. 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. | + + + +## Response + +Type: `#!python3 Message` + +Description: On success, the sent Message is returned. + + +## Usage + + +### As bot method bot + +```python3 +result: Message = await bot.send_game(...) +``` + +### Method as object + +Imports: + +- `from aiogram.types import SendGame` +- `from aiogram.api.types import SendGame` +- `from aiogram.api.types.send_game import SendGame` + +#### As reply into Webhook +```python3 +return SendGame(...) +``` + +#### With specific bot +```python3 +result: Message = await bot.emit(SendGame(...)) +``` + +#### In handlers with current bot +```python3 +result: Message = await SendGame(...) +``` + + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#sendgame) +- [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md) +- [aiogram.types.Message](../types/message.md) diff --git a/docs/api/methods/send_invoice.md b/docs/api/methods/send_invoice.md new file mode 100644 index 00000000..8191c34a --- /dev/null +++ b/docs/api/methods/send_invoice.md @@ -0,0 +1,83 @@ +# sendInvoice + +## Description + +Use this method to send invoices. On success, the sent Message is returned. + + +## Arguments + +| Name | Type | Description | +| - | - | - | +| `chat_id` | `#!python3 int` | Unique identifier for the target private chat | +| `title` | `#!python3 str` | Product name, 1-32 characters | +| `description` | `#!python3 str` | Product description, 1-255 characters | +| `payload` | `#!python3 str` | Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes. | +| `provider_token` | `#!python3 str` | Payments provider token, obtained via Botfather | +| `start_parameter` | `#!python3 str` | Unique deep-linking parameter that can be used to generate this invoice when used as a start parameter | +| `currency` | `#!python3 str` | Three-letter ISO 4217 currency code, see more on currencies | +| `prices` | `#!python3 List[LabeledPrice]` | Price breakdown, a list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.) | +| `provider_data` | `#!python3 Optional[str]` | Optional. JSON-encoded data about the invoice, which will be shared with the payment provider. A detailed description of required fields should be provided by the payment provider. | +| `photo_url` | `#!python3 Optional[str]` | Optional. URL of the product photo for the invoice. Can be a photo of the goods or a marketing image for a service. People like it better when they see what they are paying for. | +| `photo_size` | `#!python3 Optional[int]` | Optional. Photo size | +| `photo_width` | `#!python3 Optional[int]` | Optional. Photo width | +| `photo_height` | `#!python3 Optional[int]` | Optional. Photo height | +| `need_name` | `#!python3 Optional[bool]` | Optional. Pass True, if you require the user's full name to complete the order | +| `need_phone_number` | `#!python3 Optional[bool]` | Optional. Pass True, if you require the user's phone number to complete the order | +| `need_email` | `#!python3 Optional[bool]` | Optional. Pass True, if you require the user's email address to complete the order | +| `need_shipping_address` | `#!python3 Optional[bool]` | Optional. Pass True, if you require the user's shipping address to complete the order | +| `send_phone_number_to_provider` | `#!python3 Optional[bool]` | Optional. Pass True, if user's phone number should be sent to provider | +| `send_email_to_provider` | `#!python3 Optional[bool]` | Optional. Pass True, if user's email address should be sent to provider | +| `is_flexible` | `#!python3 Optional[bool]` | Optional. Pass True, if the final price depends on the shipping method | +| `disable_notification` | `#!python3 Optional[bool]` | Optional. Sends the message silently. Users will receive a notification with no sound. | +| `reply_to_message_id` | `#!python3 Optional[int]` | Optional. If the message is a reply, ID of the original message | +| `reply_markup` | `#!python3 Optional[InlineKeyboardMarkup]` | Optional. A JSON-serialized object for an inline keyboard. If empty, one 'Pay total price' button will be shown. If not empty, the first button must be a Pay button. | + + + +## Response + +Type: `#!python3 Message` + +Description: On success, the sent Message is returned. + + +## Usage + + +### As bot method bot + +```python3 +result: Message = await bot.send_invoice(...) +``` + +### Method as object + +Imports: + +- `from aiogram.types import SendInvoice` +- `from aiogram.api.types import SendInvoice` +- `from aiogram.api.types.send_invoice import SendInvoice` + +#### As reply into Webhook +```python3 +return SendInvoice(...) +``` + +#### With specific bot +```python3 +result: Message = await bot.emit(SendInvoice(...)) +``` + +#### In handlers with current bot +```python3 +result: Message = await SendInvoice(...) +``` + + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#sendinvoice) +- [aiogram.types.LabeledPrice](../types/labeled_price.md) +- [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md) +- [aiogram.types.Message](../types/message.md) diff --git a/docs/api/methods/send_location.md b/docs/api/methods/send_location.md new file mode 100644 index 00000000..68e945d7 --- /dev/null +++ b/docs/api/methods/send_location.md @@ -0,0 +1,69 @@ +# sendLocation + +## Description + +Use this method to send point on the map. On success, the sent Message is returned. + + +## Arguments + +| Name | Type | Description | +| - | - | - | +| `chat_id` | `#!python3 Union[int, str]` | Unique identifier for the target chat or username of the target channel (in the format @channelusername) | +| `latitude` | `#!python3 float` | Latitude of the location | +| `longitude` | `#!python3 float` | Longitude of the location | +| `live_period` | `#!python3 Optional[int]` | Optional. Period in seconds for which the location will be updated (see Live Locations, should be between 60 and 86400. | +| `disable_notification` | `#!python3 Optional[bool]` | Optional. Sends the message silently. Users will receive a notification with no sound. | +| `reply_to_message_id` | `#!python3 Optional[int]` | Optional. If the message is a reply, ID of the original message | +| `reply_markup` | `#!python3 Optional[Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]]` | Optional. 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. | + + + +## Response + +Type: `#!python3 Message` + +Description: On success, the sent Message is returned. + + +## Usage + + +### As bot method bot + +```python3 +result: Message = await bot.send_location(...) +``` + +### Method as object + +Imports: + +- `from aiogram.types import SendLocation` +- `from aiogram.api.types import SendLocation` +- `from aiogram.api.types.send_location import SendLocation` + +#### As reply into Webhook +```python3 +return SendLocation(...) +``` + +#### With specific bot +```python3 +result: Message = await bot.emit(SendLocation(...)) +``` + +#### In handlers with current bot +```python3 +result: Message = await SendLocation(...) +``` + + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#sendlocation) +- [aiogram.types.ForceReply](../types/force_reply.md) +- [aiogram.types.ReplyKeyboardMarkup](../types/reply_keyboard_markup.md) +- [aiogram.types.Message](../types/message.md) +- [aiogram.types.ReplyKeyboardRemove](../types/reply_keyboard_remove.md) +- [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md) diff --git a/docs/api/methods/send_media_group.md b/docs/api/methods/send_media_group.md new file mode 100644 index 00000000..5b2e2569 --- /dev/null +++ b/docs/api/methods/send_media_group.md @@ -0,0 +1,64 @@ +# sendMediaGroup + +## Description + +Use this method to send a group of photos or videos as an album. On success, an array of the sent Messages is returned. + + +## Arguments + +| Name | Type | Description | +| - | - | - | +| `chat_id` | `#!python3 Union[int, str]` | Unique identifier for the target chat or username of the target channel (in the format @channelusername) | +| `media` | `#!python3 List[Union[InputMediaPhoto, InputMediaVideo]]` | A JSON-serialized array describing photos and videos to be sent, must include 2–10 items | +| `disable_notification` | `#!python3 Optional[bool]` | Optional. Sends the messages silently. Users will receive a notification with no sound. | +| `reply_to_message_id` | `#!python3 Optional[int]` | Optional. If the messages are a reply, ID of the original message | + + + +## Response + +Type: `#!python3 List[Message]` + +Description: On success, an array of the sent Messages is returned. + + +## Usage + + +### As bot method bot + +```python3 +result: List[Message] = await bot.send_media_group(...) +``` + +### Method as object + +Imports: + +- `from aiogram.types import SendMediaGroup` +- `from aiogram.api.types import SendMediaGroup` +- `from aiogram.api.types.send_media_group import SendMediaGroup` + +#### As reply into Webhook +```python3 +return SendMediaGroup(...) +``` + +#### With specific bot +```python3 +result: List[Message] = await bot.emit(SendMediaGroup(...)) +``` + +#### In handlers with current bot +```python3 +result: List[Message] = await SendMediaGroup(...) +``` + + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#sendmediagroup) +- [aiogram.types.InputMediaPhoto](../types/input_media_photo.md) +- [aiogram.types.InputMediaVideo](../types/input_media_video.md) +- [aiogram.types.Message](../types/message.md) diff --git a/docs/api/methods/send_message.md b/docs/api/methods/send_message.md new file mode 100644 index 00000000..00176b19 --- /dev/null +++ b/docs/api/methods/send_message.md @@ -0,0 +1,69 @@ +# sendMessage + +## Description + +Use this method to send text messages. On success, the sent Message is returned. + + +## Arguments + +| Name | Type | Description | +| - | - | - | +| `chat_id` | `#!python3 Union[int, str]` | Unique identifier for the target chat or username of the target channel (in the format @channelusername) | +| `text` | `#!python3 str` | Text of the message to be sent | +| `parse_mode` | `#!python3 Optional[str]` | Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in your bot's message. | +| `disable_web_page_preview` | `#!python3 Optional[bool]` | Optional. Disables link previews for links in this message | +| `disable_notification` | `#!python3 Optional[bool]` | Optional. Sends the message silently. Users will receive a notification with no sound. | +| `reply_to_message_id` | `#!python3 Optional[int]` | Optional. If the message is a reply, ID of the original message | +| `reply_markup` | `#!python3 Optional[Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]]` | Optional. 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. | + + + +## Response + +Type: `#!python3 Message` + +Description: On success, the sent Message is returned. + + +## Usage + + +### As bot method bot + +```python3 +result: Message = await bot.send_message(...) +``` + +### Method as object + +Imports: + +- `from aiogram.types import SendMessage` +- `from aiogram.api.types import SendMessage` +- `from aiogram.api.types.send_message import SendMessage` + +#### As reply into Webhook +```python3 +return SendMessage(...) +``` + +#### With specific bot +```python3 +result: Message = await bot.emit(SendMessage(...)) +``` + +#### In handlers with current bot +```python3 +result: Message = await SendMessage(...) +``` + + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#sendmessage) +- [aiogram.types.ForceReply](../types/force_reply.md) +- [aiogram.types.ReplyKeyboardMarkup](../types/reply_keyboard_markup.md) +- [aiogram.types.Message](../types/message.md) +- [aiogram.types.ReplyKeyboardRemove](../types/reply_keyboard_remove.md) +- [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md) diff --git a/docs/api/methods/send_photo.md b/docs/api/methods/send_photo.md new file mode 100644 index 00000000..029379f4 --- /dev/null +++ b/docs/api/methods/send_photo.md @@ -0,0 +1,70 @@ +# sendPhoto + +## Description + +Use this method to send photos. On success, the sent Message is returned. + + +## Arguments + +| Name | Type | Description | +| - | - | - | +| `chat_id` | `#!python3 Union[int, str]` | Unique identifier for the target chat or username of the target channel (in the format @channelusername) | +| `photo` | `#!python3 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. | +| `caption` | `#!python3 Optional[str]` | Optional. Photo caption (may also be used when resending photos by file_id), 0-1024 characters | +| `parse_mode` | `#!python3 Optional[str]` | Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption. | +| `disable_notification` | `#!python3 Optional[bool]` | Optional. Sends the message silently. Users will receive a notification with no sound. | +| `reply_to_message_id` | `#!python3 Optional[int]` | Optional. If the message is a reply, ID of the original message | +| `reply_markup` | `#!python3 Optional[Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]]` | Optional. 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. | + + + +## Response + +Type: `#!python3 Message` + +Description: On success, the sent Message is returned. + + +## Usage + + +### As bot method bot + +```python3 +result: Message = await bot.send_photo(...) +``` + +### Method as object + +Imports: + +- `from aiogram.types import SendPhoto` +- `from aiogram.api.types import SendPhoto` +- `from aiogram.api.types.send_photo import SendPhoto` + +#### As reply into Webhook +```python3 +return SendPhoto(...) +``` + +#### With specific bot +```python3 +result: Message = await bot.emit(SendPhoto(...)) +``` + +#### In handlers with current bot +```python3 +result: Message = await SendPhoto(...) +``` + + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#sendphoto) +- [aiogram.types.ForceReply](../types/force_reply.md) +- [aiogram.types.ReplyKeyboardMarkup](../types/reply_keyboard_markup.md) +- [aiogram.types.Message](../types/message.md) +- [aiogram.types.ReplyKeyboardRemove](../types/reply_keyboard_remove.md) +- [aiogram.types.InputFile](../types/input_file.md) +- [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md) diff --git a/docs/api/methods/send_poll.md b/docs/api/methods/send_poll.md new file mode 100644 index 00000000..3f1c1b39 --- /dev/null +++ b/docs/api/methods/send_poll.md @@ -0,0 +1,68 @@ +# sendPoll + +## Description + +Use this method to send a native poll. A native poll can't be sent to a private chat. On success, the sent Message is returned. + + +## Arguments + +| Name | Type | Description | +| - | - | - | +| `chat_id` | `#!python3 Union[int, str]` | Unique identifier for the target chat or username of the target channel (in the format @channelusername). A native poll can't be sent to a private chat. | +| `question` | `#!python3 str` | Poll question, 1-255 characters | +| `options` | `#!python3 List[str]` | List of answer options, 2-10 strings 1-100 characters each | +| `disable_notification` | `#!python3 Optional[bool]` | Optional. Sends the message silently. Users will receive a notification with no sound. | +| `reply_to_message_id` | `#!python3 Optional[int]` | Optional. If the message is a reply, ID of the original message | +| `reply_markup` | `#!python3 Optional[Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]]` | Optional. 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. | + + + +## Response + +Type: `#!python3 Message` + +Description: On success, the sent Message is returned. + + +## Usage + + +### As bot method bot + +```python3 +result: Message = await bot.send_poll(...) +``` + +### Method as object + +Imports: + +- `from aiogram.types import SendPoll` +- `from aiogram.api.types import SendPoll` +- `from aiogram.api.types.send_poll import SendPoll` + +#### As reply into Webhook +```python3 +return SendPoll(...) +``` + +#### With specific bot +```python3 +result: Message = await bot.emit(SendPoll(...)) +``` + +#### In handlers with current bot +```python3 +result: Message = await SendPoll(...) +``` + + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#sendpoll) +- [aiogram.types.ForceReply](../types/force_reply.md) +- [aiogram.types.ReplyKeyboardMarkup](../types/reply_keyboard_markup.md) +- [aiogram.types.Message](../types/message.md) +- [aiogram.types.ReplyKeyboardRemove](../types/reply_keyboard_remove.md) +- [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md) diff --git a/docs/api/methods/send_sticker.md b/docs/api/methods/send_sticker.md new file mode 100644 index 00000000..314fab95 --- /dev/null +++ b/docs/api/methods/send_sticker.md @@ -0,0 +1,68 @@ +# sendSticker + +## Description + +Use this method to send static .WEBP or animated .TGS stickers. On success, the sent Message is returned. + + +## Arguments + +| Name | Type | Description | +| - | - | - | +| `chat_id` | `#!python3 Union[int, str]` | Unique identifier for the target chat or username of the target channel (in the format @channelusername) | +| `sticker` | `#!python3 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. | +| `disable_notification` | `#!python3 Optional[bool]` | Optional. Sends the message silently. Users will receive a notification with no sound. | +| `reply_to_message_id` | `#!python3 Optional[int]` | Optional. If the message is a reply, ID of the original message | +| `reply_markup` | `#!python3 Optional[Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]]` | Optional. 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. | + + + +## Response + +Type: `#!python3 Message` + +Description: On success, the sent Message is returned. + + +## Usage + + +### As bot method bot + +```python3 +result: Message = await bot.send_sticker(...) +``` + +### Method as object + +Imports: + +- `from aiogram.types import SendSticker` +- `from aiogram.api.types import SendSticker` +- `from aiogram.api.types.send_sticker import SendSticker` + +#### As reply into Webhook +```python3 +return SendSticker(...) +``` + +#### With specific bot +```python3 +result: Message = await bot.emit(SendSticker(...)) +``` + +#### In handlers with current bot +```python3 +result: Message = await SendSticker(...) +``` + + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#sendsticker) +- [aiogram.types.ForceReply](../types/force_reply.md) +- [aiogram.types.ReplyKeyboardMarkup](../types/reply_keyboard_markup.md) +- [aiogram.types.Message](../types/message.md) +- [aiogram.types.ReplyKeyboardRemove](../types/reply_keyboard_remove.md) +- [aiogram.types.InputFile](../types/input_file.md) +- [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md) diff --git a/docs/api/methods/send_venue.md b/docs/api/methods/send_venue.md new file mode 100644 index 00000000..87d1fe22 --- /dev/null +++ b/docs/api/methods/send_venue.md @@ -0,0 +1,72 @@ +# sendVenue + +## Description + +Use this method to send information about a venue. On success, the sent Message is returned. + + +## Arguments + +| Name | Type | Description | +| - | - | - | +| `chat_id` | `#!python3 Union[int, str]` | Unique identifier for the target chat or username of the target channel (in the format @channelusername) | +| `latitude` | `#!python3 float` | Latitude of the venue | +| `longitude` | `#!python3 float` | Longitude of the venue | +| `title` | `#!python3 str` | Name of the venue | +| `address` | `#!python3 str` | Address of the venue | +| `foursquare_id` | `#!python3 Optional[str]` | Optional. Foursquare identifier of the venue | +| `foursquare_type` | `#!python3 Optional[str]` | Optional. Foursquare type of the venue, if known. (For example, 'arts_entertainment/default', 'arts_entertainment/aquarium' or 'food/icecream'.) | +| `disable_notification` | `#!python3 Optional[bool]` | Optional. Sends the message silently. Users will receive a notification with no sound. | +| `reply_to_message_id` | `#!python3 Optional[int]` | Optional. If the message is a reply, ID of the original message | +| `reply_markup` | `#!python3 Optional[Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]]` | Optional. 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. | + + + +## Response + +Type: `#!python3 Message` + +Description: On success, the sent Message is returned. + + +## Usage + + +### As bot method bot + +```python3 +result: Message = await bot.send_venue(...) +``` + +### Method as object + +Imports: + +- `from aiogram.types import SendVenue` +- `from aiogram.api.types import SendVenue` +- `from aiogram.api.types.send_venue import SendVenue` + +#### As reply into Webhook +```python3 +return SendVenue(...) +``` + +#### With specific bot +```python3 +result: Message = await bot.emit(SendVenue(...)) +``` + +#### In handlers with current bot +```python3 +result: Message = await SendVenue(...) +``` + + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#sendvenue) +- [aiogram.types.ForceReply](../types/force_reply.md) +- [aiogram.types.ReplyKeyboardMarkup](../types/reply_keyboard_markup.md) +- [aiogram.types.Message](../types/message.md) +- [aiogram.types.ReplyKeyboardRemove](../types/reply_keyboard_remove.md) +- [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md) diff --git a/docs/api/methods/send_video.md b/docs/api/methods/send_video.md new file mode 100644 index 00000000..fa51bca9 --- /dev/null +++ b/docs/api/methods/send_video.md @@ -0,0 +1,75 @@ +# sendVideo + +## Description + +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. + + +## Arguments + +| Name | Type | Description | +| - | - | - | +| `chat_id` | `#!python3 Union[int, str]` | Unique identifier for the target chat or username of the target channel (in the format @channelusername) | +| `video` | `#!python3 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. | +| `duration` | `#!python3 Optional[int]` | Optional. Duration of sent video in seconds | +| `width` | `#!python3 Optional[int]` | Optional. Video width | +| `height` | `#!python3 Optional[int]` | Optional. Video height | +| `thumb` | `#!python3 Optional[Union[InputFile, str]]` | 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 . | +| `caption` | `#!python3 Optional[str]` | Optional. Video caption (may also be used when resending videos by file_id), 0-1024 characters | +| `parse_mode` | `#!python3 Optional[str]` | Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption. | +| `supports_streaming` | `#!python3 Optional[bool]` | Optional. Pass True, if the uploaded video is suitable for streaming | +| `disable_notification` | `#!python3 Optional[bool]` | Optional. Sends the message silently. Users will receive a notification with no sound. | +| `reply_to_message_id` | `#!python3 Optional[int]` | Optional. If the message is a reply, ID of the original message | +| `reply_markup` | `#!python3 Optional[Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]]` | Optional. 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. | + + + +## Response + +Type: `#!python3 Message` + +Description: On success, the sent Message is returned. + + +## Usage + + +### As bot method bot + +```python3 +result: Message = await bot.send_video(...) +``` + +### Method as object + +Imports: + +- `from aiogram.types import SendVideo` +- `from aiogram.api.types import SendVideo` +- `from aiogram.api.types.send_video import SendVideo` + +#### As reply into Webhook +```python3 +return SendVideo(...) +``` + +#### With specific bot +```python3 +result: Message = await bot.emit(SendVideo(...)) +``` + +#### In handlers with current bot +```python3 +result: Message = await SendVideo(...) +``` + + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#sendvideo) +- [aiogram.types.ForceReply](../types/force_reply.md) +- [aiogram.types.ReplyKeyboardMarkup](../types/reply_keyboard_markup.md) +- [aiogram.types.Message](../types/message.md) +- [aiogram.types.ReplyKeyboardRemove](../types/reply_keyboard_remove.md) +- [aiogram.types.InputFile](../types/input_file.md) +- [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md) diff --git a/docs/api/methods/send_video_note.md b/docs/api/methods/send_video_note.md new file mode 100644 index 00000000..f5e07d71 --- /dev/null +++ b/docs/api/methods/send_video_note.md @@ -0,0 +1,71 @@ +# sendVideoNote + +## Description + +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. + + +## Arguments + +| Name | Type | Description | +| - | - | - | +| `chat_id` | `#!python3 Union[int, str]` | Unique identifier for the target chat or username of the target channel (in the format @channelusername) | +| `video_note` | `#!python3 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.. Sending video notes by a URL is currently unsupported | +| `duration` | `#!python3 Optional[int]` | Optional. Duration of sent video in seconds | +| `length` | `#!python3 Optional[int]` | Optional. Video width and height, i.e. diameter of the video message | +| `thumb` | `#!python3 Optional[Union[InputFile, str]]` | 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 . | +| `disable_notification` | `#!python3 Optional[bool]` | Optional. Sends the message silently. Users will receive a notification with no sound. | +| `reply_to_message_id` | `#!python3 Optional[int]` | Optional. If the message is a reply, ID of the original message | +| `reply_markup` | `#!python3 Optional[Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]]` | Optional. 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. | + + + +## Response + +Type: `#!python3 Message` + +Description: On success, the sent Message is returned. + + +## Usage + + +### As bot method bot + +```python3 +result: Message = await bot.send_video_note(...) +``` + +### Method as object + +Imports: + +- `from aiogram.types import SendVideoNote` +- `from aiogram.api.types import SendVideoNote` +- `from aiogram.api.types.send_video_note import SendVideoNote` + +#### As reply into Webhook +```python3 +return SendVideoNote(...) +``` + +#### With specific bot +```python3 +result: Message = await bot.emit(SendVideoNote(...)) +``` + +#### In handlers with current bot +```python3 +result: Message = await SendVideoNote(...) +``` + + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#sendvideonote) +- [aiogram.types.ForceReply](../types/force_reply.md) +- [aiogram.types.ReplyKeyboardMarkup](../types/reply_keyboard_markup.md) +- [aiogram.types.Message](../types/message.md) +- [aiogram.types.ReplyKeyboardRemove](../types/reply_keyboard_remove.md) +- [aiogram.types.InputFile](../types/input_file.md) +- [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md) diff --git a/docs/api/methods/send_voice.md b/docs/api/methods/send_voice.md new file mode 100644 index 00000000..4c24c4d4 --- /dev/null +++ b/docs/api/methods/send_voice.md @@ -0,0 +1,71 @@ +# sendVoice + +## Description + +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. + + +## Arguments + +| Name | Type | Description | +| - | - | - | +| `chat_id` | `#!python3 Union[int, str]` | Unique identifier for the target chat or username of the target channel (in the format @channelusername) | +| `voice` | `#!python3 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. | +| `caption` | `#!python3 Optional[str]` | Optional. Voice message caption, 0-1024 characters | +| `parse_mode` | `#!python3 Optional[str]` | Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption. | +| `duration` | `#!python3 Optional[int]` | Optional. Duration of the voice message in seconds | +| `disable_notification` | `#!python3 Optional[bool]` | Optional. Sends the message silently. Users will receive a notification with no sound. | +| `reply_to_message_id` | `#!python3 Optional[int]` | Optional. If the message is a reply, ID of the original message | +| `reply_markup` | `#!python3 Optional[Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]]` | Optional. 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. | + + + +## Response + +Type: `#!python3 Message` + +Description: On success, the sent Message is returned. + + +## Usage + + +### As bot method bot + +```python3 +result: Message = await bot.send_voice(...) +``` + +### Method as object + +Imports: + +- `from aiogram.types import SendVoice` +- `from aiogram.api.types import SendVoice` +- `from aiogram.api.types.send_voice import SendVoice` + +#### As reply into Webhook +```python3 +return SendVoice(...) +``` + +#### With specific bot +```python3 +result: Message = await bot.emit(SendVoice(...)) +``` + +#### In handlers with current bot +```python3 +result: Message = await SendVoice(...) +``` + + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#sendvoice) +- [aiogram.types.ForceReply](../types/force_reply.md) +- [aiogram.types.ReplyKeyboardMarkup](../types/reply_keyboard_markup.md) +- [aiogram.types.Message](../types/message.md) +- [aiogram.types.ReplyKeyboardRemove](../types/reply_keyboard_remove.md) +- [aiogram.types.InputFile](../types/input_file.md) +- [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md) diff --git a/docs/api/methods/set_chat_description.md b/docs/api/methods/set_chat_description.md new file mode 100644 index 00000000..d083808f --- /dev/null +++ b/docs/api/methods/set_chat_description.md @@ -0,0 +1,59 @@ +# setChatDescription + +## Description + +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. + + +## Arguments + +| Name | Type | Description | +| - | - | - | +| `chat_id` | `#!python3 Union[int, str]` | Unique identifier for the target chat or username of the target channel (in the format @channelusername) | +| `description` | `#!python3 Optional[str]` | Optional. New chat description, 0-255 characters | + + + +## Response + +Type: `#!python3 bool` + +Description: Returns True on success. + + +## Usage + + +### As bot method bot + +```python3 +result: bool = await bot.set_chat_description(...) +``` + +### Method as object + +Imports: + +- `from aiogram.types import SetChatDescription` +- `from aiogram.api.types import SetChatDescription` +- `from aiogram.api.types.set_chat_description import SetChatDescription` + +#### As reply into Webhook +```python3 +return SetChatDescription(...) +``` + +#### With specific bot +```python3 +result: bool = await bot.emit(SetChatDescription(...)) +``` + +#### In handlers with current bot +```python3 +result: bool = await SetChatDescription(...) +``` + + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#setchatdescription) diff --git a/docs/api/methods/set_chat_permissions.md b/docs/api/methods/set_chat_permissions.md new file mode 100644 index 00000000..da8e5680 --- /dev/null +++ b/docs/api/methods/set_chat_permissions.md @@ -0,0 +1,60 @@ +# setChatPermissions + +## Description + +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. + + +## Arguments + +| Name | Type | Description | +| - | - | - | +| `chat_id` | `#!python3 Union[int, str]` | Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) | +| `permissions` | `#!python3 ChatPermissions` | New default chat permissions | + + + +## Response + +Type: `#!python3 bool` + +Description: Returns True on success. + + +## Usage + + +### As bot method bot + +```python3 +result: bool = await bot.set_chat_permissions(...) +``` + +### Method as object + +Imports: + +- `from aiogram.types import SetChatPermissions` +- `from aiogram.api.types import SetChatPermissions` +- `from aiogram.api.types.set_chat_permissions import SetChatPermissions` + +#### As reply into Webhook +```python3 +return SetChatPermissions(...) +``` + +#### With specific bot +```python3 +result: bool = await bot.emit(SetChatPermissions(...)) +``` + +#### In handlers with current bot +```python3 +result: bool = await SetChatPermissions(...) +``` + + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#setchatpermissions) +- [aiogram.types.ChatPermissions](../types/chat_permissions.md) diff --git a/docs/api/methods/set_chat_photo.md b/docs/api/methods/set_chat_photo.md new file mode 100644 index 00000000..7c2c59d6 --- /dev/null +++ b/docs/api/methods/set_chat_photo.md @@ -0,0 +1,56 @@ +# setChatPhoto + +## Description + +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. + + +## Arguments + +| Name | Type | Description | +| - | - | - | +| `chat_id` | `#!python3 Union[int, str]` | Unique identifier for the target chat or username of the target channel (in the format @channelusername) | +| `photo` | `#!python3 InputFile` | New chat photo, uploaded using multipart/form-data | + + + +## Response + +Type: `#!python3 bool` + +Description: Returns True on success. + + +## Usage + + +### As bot method bot + +```python3 +result: bool = await bot.set_chat_photo(...) +``` + +### Method as object + +Imports: + +- `from aiogram.types import SetChatPhoto` +- `from aiogram.api.types import SetChatPhoto` +- `from aiogram.api.types.set_chat_photo import SetChatPhoto` + + +#### With specific bot +```python3 +result: bool = await bot.emit(SetChatPhoto(...)) +``` + +#### In handlers with current bot +```python3 +result: bool = await SetChatPhoto(...) +``` + + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#setchatphoto) +- [aiogram.types.InputFile](../types/input_file.md) diff --git a/docs/api/methods/set_chat_sticker_set.md b/docs/api/methods/set_chat_sticker_set.md new file mode 100644 index 00000000..bc612e33 --- /dev/null +++ b/docs/api/methods/set_chat_sticker_set.md @@ -0,0 +1,59 @@ +# setChatStickerSet + +## Description + +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. + + +## Arguments + +| Name | Type | Description | +| - | - | - | +| `chat_id` | `#!python3 Union[int, str]` | Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) | +| `sticker_set_name` | `#!python3 str` | Name of the sticker set to be set as the group sticker set | + + + +## Response + +Type: `#!python3 bool` + +Description: 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. + + +## Usage + + +### As bot method bot + +```python3 +result: bool = await bot.set_chat_sticker_set(...) +``` + +### Method as object + +Imports: + +- `from aiogram.types import SetChatStickerSet` +- `from aiogram.api.types import SetChatStickerSet` +- `from aiogram.api.types.set_chat_sticker_set import SetChatStickerSet` + +#### As reply into Webhook +```python3 +return SetChatStickerSet(...) +``` + +#### With specific bot +```python3 +result: bool = await bot.emit(SetChatStickerSet(...)) +``` + +#### In handlers with current bot +```python3 +result: bool = await SetChatStickerSet(...) +``` + + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#setchatstickerset) diff --git a/docs/api/methods/set_chat_title.md b/docs/api/methods/set_chat_title.md new file mode 100644 index 00000000..a3fb45b4 --- /dev/null +++ b/docs/api/methods/set_chat_title.md @@ -0,0 +1,59 @@ +# setChatTitle + +## Description + +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. + + +## Arguments + +| Name | Type | Description | +| - | - | - | +| `chat_id` | `#!python3 Union[int, str]` | Unique identifier for the target chat or username of the target channel (in the format @channelusername) | +| `title` | `#!python3 str` | New chat title, 1-255 characters | + + + +## Response + +Type: `#!python3 bool` + +Description: Returns True on success. + + +## Usage + + +### As bot method bot + +```python3 +result: bool = await bot.set_chat_title(...) +``` + +### Method as object + +Imports: + +- `from aiogram.types import SetChatTitle` +- `from aiogram.api.types import SetChatTitle` +- `from aiogram.api.types.set_chat_title import SetChatTitle` + +#### As reply into Webhook +```python3 +return SetChatTitle(...) +``` + +#### With specific bot +```python3 +result: bool = await bot.emit(SetChatTitle(...)) +``` + +#### In handlers with current bot +```python3 +result: bool = await SetChatTitle(...) +``` + + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#setchattitle) diff --git a/docs/api/methods/set_game_score.md b/docs/api/methods/set_game_score.md new file mode 100644 index 00000000..3ad9539a --- /dev/null +++ b/docs/api/methods/set_game_score.md @@ -0,0 +1,65 @@ +# setGameScore + +## Description + +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. + + +## Arguments + +| Name | Type | Description | +| - | - | - | +| `user_id` | `#!python3 int` | User identifier | +| `score` | `#!python3 int` | New score, must be non-negative | +| `force` | `#!python3 Optional[bool]` | Optional. Pass True, if the high score is allowed to decrease. This can be useful when fixing mistakes or banning cheaters | +| `disable_edit_message` | `#!python3 Optional[bool]` | Optional. Pass True, if the game message should not be automatically edited to include the current scoreboard | +| `chat_id` | `#!python3 Optional[int]` | Optional. Required if inline_message_id is not specified. Unique identifier for the target chat | +| `message_id` | `#!python3 Optional[int]` | Optional. Required if inline_message_id is not specified. Identifier of the sent message | +| `inline_message_id` | `#!python3 Optional[str]` | Optional. Required if chat_id and message_id are not specified. Identifier of the inline message | + + + +## Response + +Type: `#!python3 Union[Message, bool]` + +Description: 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. + + +## Usage + + +### As bot method bot + +```python3 +result: Union[Message, bool] = await bot.set_game_score(...) +``` + +### Method as object + +Imports: + +- `from aiogram.types import SetGameScore` +- `from aiogram.api.types import SetGameScore` +- `from aiogram.api.types.set_game_score import SetGameScore` + +#### As reply into Webhook +```python3 +return SetGameScore(...) +``` + +#### With specific bot +```python3 +result: Union[Message, bool] = await bot.emit(SetGameScore(...)) +``` + +#### In handlers with current bot +```python3 +result: Union[Message, bool] = await SetGameScore(...) +``` + + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#setgamescore) +- [aiogram.types.Message](../types/message.md) diff --git a/docs/api/methods/set_passport_data_errors.md b/docs/api/methods/set_passport_data_errors.md new file mode 100644 index 00000000..404ef385 --- /dev/null +++ b/docs/api/methods/set_passport_data_errors.md @@ -0,0 +1,62 @@ +# setPassportDataErrors + +## Description + +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. + + +## Arguments + +| Name | Type | Description | +| - | - | - | +| `user_id` | `#!python3 int` | User identifier | +| `errors` | `#!python3 List[PassportElementError]` | A JSON-serialized array describing the errors | + + + +## Response + +Type: `#!python3 bool` + +Description: 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. + + +## Usage + + +### As bot method bot + +```python3 +result: bool = await bot.set_passport_data_errors(...) +``` + +### Method as object + +Imports: + +- `from aiogram.types import SetPassportDataErrors` +- `from aiogram.api.types import SetPassportDataErrors` +- `from aiogram.api.types.set_passport_data_errors import SetPassportDataErrors` + +#### As reply into Webhook +```python3 +return SetPassportDataErrors(...) +``` + +#### With specific bot +```python3 +result: bool = await bot.emit(SetPassportDataErrors(...)) +``` + +#### In handlers with current bot +```python3 +result: bool = await SetPassportDataErrors(...) +``` + + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#setpassportdataerrors) +- [aiogram.types.PassportElementError](../types/passport_element_error.md) diff --git a/docs/api/methods/set_sticker_position_in_set.md b/docs/api/methods/set_sticker_position_in_set.md new file mode 100644 index 00000000..3564cf54 --- /dev/null +++ b/docs/api/methods/set_sticker_position_in_set.md @@ -0,0 +1,59 @@ +# setStickerPositionInSet + +## Description + +Use this method to move a sticker in a set created by the bot to a specific position . Returns True on success. + + +## Arguments + +| Name | Type | Description | +| - | - | - | +| `sticker` | `#!python3 str` | File identifier of the sticker | +| `position` | `#!python3 int` | New sticker position in the set, zero-based | + + + +## Response + +Type: `#!python3 bool` + +Description: Returns True on success. + + +## Usage + + +### As bot method bot + +```python3 +result: bool = await bot.set_sticker_position_in_set(...) +``` + +### Method as object + +Imports: + +- `from aiogram.types import SetStickerPositionInSet` +- `from aiogram.api.types import SetStickerPositionInSet` +- `from aiogram.api.types.set_sticker_position_in_set import SetStickerPositionInSet` + +#### As reply into Webhook +```python3 +return SetStickerPositionInSet(...) +``` + +#### With specific bot +```python3 +result: bool = await bot.emit(SetStickerPositionInSet(...)) +``` + +#### In handlers with current bot +```python3 +result: bool = await SetStickerPositionInSet(...) +``` + + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#setstickerpositioninset) diff --git a/docs/api/methods/set_webhook.md b/docs/api/methods/set_webhook.md new file mode 100644 index 00000000..f4a968e4 --- /dev/null +++ b/docs/api/methods/set_webhook.md @@ -0,0 +1,74 @@ +# setWebhook + +## Description + +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. + + +## Arguments + +| Name | Type | Description | +| - | - | - | +| `url` | `#!python3 str` | HTTPS url to send updates to. Use an empty string to remove webhook integration | +| `certificate` | `#!python3 Optional[InputFile]` | Optional. Upload your public key certificate so that the root certificate in use can be checked. See our self-signed guide for details. | +| `max_connections` | `#!python3 Optional[int]` | Optional. 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` | `#!python3 Optional[List[str]]` | Optional. List the types of updates 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. | + + + +## Response + +Type: `#!python3 bool` + +Description: Returns True on success. + + +## Usage + + +### As bot method bot + +```python3 +result: bool = await bot.set_webhook(...) +``` + +### Method as object + +Imports: + +- `from aiogram.types import SetWebhook` +- `from aiogram.api.types import SetWebhook` +- `from aiogram.api.types.set_webhook import SetWebhook` + +#### As reply into Webhook +```python3 +return SetWebhook(...) +``` + +#### With specific bot +```python3 +result: bool = await bot.emit(SetWebhook(...)) +``` + +#### In handlers with current bot +```python3 +result: bool = await SetWebhook(...) +``` + + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#setwebhook) +- [aiogram.types.InputFile](../types/input_file.md) diff --git a/docs/api/methods/stop_message_live_location.md b/docs/api/methods/stop_message_live_location.md new file mode 100644 index 00000000..ded4caec --- /dev/null +++ b/docs/api/methods/stop_message_live_location.md @@ -0,0 +1,63 @@ +# stopMessageLiveLocation + +## Description + +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. + + +## Arguments + +| Name | Type | Description | +| - | - | - | +| `chat_id` | `#!python3 Optional[Union[int, str]]` | Optional. Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername) | +| `message_id` | `#!python3 Optional[int]` | Optional. Required if inline_message_id is not specified. Identifier of the message with live location to stop | +| `inline_message_id` | `#!python3 Optional[str]` | Optional. Required if chat_id and message_id are not specified. Identifier of the inline message | +| `reply_markup` | `#!python3 Optional[InlineKeyboardMarkup]` | Optional. A JSON-serialized object for a new inline keyboard. | + + + +## Response + +Type: `#!python3 Union[Message, bool]` + +Description: On success, if the message was sent by the bot, the sent Message is returned, otherwise True is returned. + + +## Usage + + +### As bot method bot + +```python3 +result: Union[Message, bool] = await bot.stop_message_live_location(...) +``` + +### Method as object + +Imports: + +- `from aiogram.types import StopMessageLiveLocation` +- `from aiogram.api.types import StopMessageLiveLocation` +- `from aiogram.api.types.stop_message_live_location import StopMessageLiveLocation` + +#### As reply into Webhook +```python3 +return StopMessageLiveLocation(...) +``` + +#### With specific bot +```python3 +result: Union[Message, bool] = await bot.emit(StopMessageLiveLocation(...)) +``` + +#### In handlers with current bot +```python3 +result: Union[Message, bool] = await StopMessageLiveLocation(...) +``` + + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#stopmessagelivelocation) +- [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md) +- [aiogram.types.Message](../types/message.md) diff --git a/docs/api/methods/stop_poll.md b/docs/api/methods/stop_poll.md new file mode 100644 index 00000000..672354c1 --- /dev/null +++ b/docs/api/methods/stop_poll.md @@ -0,0 +1,62 @@ +# stopPoll + +## Description + +Use this method to stop a poll which was sent by the bot. On success, the stopped Poll with the final results is returned. + + +## Arguments + +| Name | Type | Description | +| - | - | - | +| `chat_id` | `#!python3 Union[int, str]` | Unique identifier for the target chat or username of the target channel (in the format @channelusername) | +| `message_id` | `#!python3 int` | Identifier of the original message with the poll | +| `reply_markup` | `#!python3 Optional[InlineKeyboardMarkup]` | Optional. A JSON-serialized object for a new message inline keyboard. | + + + +## Response + +Type: `#!python3 Poll` + +Description: On success, the stopped Poll with the final results is returned. + + +## Usage + + +### As bot method bot + +```python3 +result: Poll = await bot.stop_poll(...) +``` + +### Method as object + +Imports: + +- `from aiogram.types import StopPoll` +- `from aiogram.api.types import StopPoll` +- `from aiogram.api.types.stop_poll import StopPoll` + +#### As reply into Webhook +```python3 +return StopPoll(...) +``` + +#### With specific bot +```python3 +result: Poll = await bot.emit(StopPoll(...)) +``` + +#### In handlers with current bot +```python3 +result: Poll = await StopPoll(...) +``` + + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#stoppoll) +- [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md) +- [aiogram.types.Poll](../types/poll.md) diff --git a/docs/api/methods/unban_chat_member.md b/docs/api/methods/unban_chat_member.md new file mode 100644 index 00000000..95ac83c7 --- /dev/null +++ b/docs/api/methods/unban_chat_member.md @@ -0,0 +1,59 @@ +# unbanChatMember + +## Description + +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. + + +## Arguments + +| Name | Type | Description | +| - | - | - | +| `chat_id` | `#!python3 Union[int, str]` | Unique identifier for the target group or username of the target supergroup or channel (in the format @username) | +| `user_id` | `#!python3 int` | Unique identifier of the target user | + + + +## Response + +Type: `#!python3 bool` + +Description: The user will not return to the group or channel automatically, but will be able to join via link, etc. Returns True on success. + + +## Usage + + +### As bot method bot + +```python3 +result: bool = await bot.unban_chat_member(...) +``` + +### Method as object + +Imports: + +- `from aiogram.types import UnbanChatMember` +- `from aiogram.api.types import UnbanChatMember` +- `from aiogram.api.types.unban_chat_member import UnbanChatMember` + +#### As reply into Webhook +```python3 +return UnbanChatMember(...) +``` + +#### With specific bot +```python3 +result: bool = await bot.emit(UnbanChatMember(...)) +``` + +#### In handlers with current bot +```python3 +result: bool = await UnbanChatMember(...) +``` + + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#unbanchatmember) diff --git a/docs/api/methods/unpin_chat_message.md b/docs/api/methods/unpin_chat_message.md new file mode 100644 index 00000000..48988c22 --- /dev/null +++ b/docs/api/methods/unpin_chat_message.md @@ -0,0 +1,58 @@ +# unpinChatMessage + +## Description + +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. + + +## Arguments + +| Name | Type | Description | +| - | - | - | +| `chat_id` | `#!python3 Union[int, str]` | Unique identifier for the target chat or username of the target channel (in the format @channelusername) | + + + +## Response + +Type: `#!python3 bool` + +Description: Returns True on success. + + +## Usage + + +### As bot method bot + +```python3 +result: bool = await bot.unpin_chat_message(...) +``` + +### Method as object + +Imports: + +- `from aiogram.types import UnpinChatMessage` +- `from aiogram.api.types import UnpinChatMessage` +- `from aiogram.api.types.unpin_chat_message import UnpinChatMessage` + +#### As reply into Webhook +```python3 +return UnpinChatMessage(...) +``` + +#### With specific bot +```python3 +result: bool = await bot.emit(UnpinChatMessage(...)) +``` + +#### In handlers with current bot +```python3 +result: bool = await UnpinChatMessage(...) +``` + + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#unpinchatmessage) diff --git a/docs/api/methods/upload_sticker_file.md b/docs/api/methods/upload_sticker_file.md new file mode 100644 index 00000000..6bb7cce1 --- /dev/null +++ b/docs/api/methods/upload_sticker_file.md @@ -0,0 +1,57 @@ +# uploadStickerFile + +## Description + +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. + + +## Arguments + +| Name | Type | Description | +| - | - | - | +| `user_id` | `#!python3 int` | User identifier of sticker file owner | +| `png_sticker` | `#!python3 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. | + + + +## Response + +Type: `#!python3 File` + +Description: Returns the uploaded File on success. + + +## Usage + + +### As bot method bot + +```python3 +result: File = await bot.upload_sticker_file(...) +``` + +### Method as object + +Imports: + +- `from aiogram.types import UploadStickerFile` +- `from aiogram.api.types import UploadStickerFile` +- `from aiogram.api.types.upload_sticker_file import UploadStickerFile` + + +#### With specific bot +```python3 +result: File = await bot.emit(UploadStickerFile(...)) +``` + +#### In handlers with current bot +```python3 +result: File = await UploadStickerFile(...) +``` + + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#uploadstickerfile) +- [aiogram.types.InputFile](../types/input_file.md) +- [aiogram.types.File](../types/file.md) diff --git a/docs/api/types/animation.md b/docs/api/types/animation.md new file mode 100644 index 00000000..75f57efd --- /dev/null +++ b/docs/api/types/animation.md @@ -0,0 +1,32 @@ +# Animation + +## Description + +This object represents an animation file (GIF or H.264/MPEG-4 AVC video without sound). + + +## Attributes + +| Name | Type | Description | +| - | - | - | +| `file_id` | `#!python str` | Identifier for this file | +| `width` | `#!python int` | Video width as defined by sender | +| `height` | `#!python int` | Video height as defined by sender | +| `duration` | `#!python int` | Duration of the video in seconds as defined by sender | +| `thumb` | `#!python Optional[PhotoSize]` | Optional. Animation thumbnail as defined by sender | +| `file_name` | `#!python Optional[str]` | Optional. Original animation filename as defined by sender | +| `mime_type` | `#!python Optional[str]` | Optional. MIME type of the file as defined by sender | +| `file_size` | `#!python Optional[int]` | Optional. File size | + + + +## Location + +- `from aiogram.types import Animation` +- `from aiogram.api.types import Animation` +- `from aiogram.api.types.animation import Animation` + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#animation) +- [aiogram.types.PhotoSize](../types/photo_size.md) diff --git a/docs/api/types/audio.md b/docs/api/types/audio.md new file mode 100644 index 00000000..e56505b8 --- /dev/null +++ b/docs/api/types/audio.md @@ -0,0 +1,31 @@ +# Audio + +## Description + +This object represents an audio file to be treated as music by the Telegram clients. + + +## Attributes + +| Name | Type | Description | +| - | - | - | +| `file_id` | `#!python str` | Identifier for this file | +| `duration` | `#!python int` | Duration of the audio in seconds as defined by sender | +| `performer` | `#!python Optional[str]` | Optional. Performer of the audio as defined by sender or by audio tags | +| `title` | `#!python Optional[str]` | Optional. Title of the audio as defined by sender or by audio tags | +| `mime_type` | `#!python Optional[str]` | Optional. MIME type of the file as defined by sender | +| `file_size` | `#!python Optional[int]` | Optional. File size | +| `thumb` | `#!python Optional[PhotoSize]` | Optional. Thumbnail of the album cover to which the music file belongs | + + + +## Location + +- `from aiogram.types import Audio` +- `from aiogram.api.types import Audio` +- `from aiogram.api.types.audio import Audio` + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#audio) +- [aiogram.types.PhotoSize](../types/photo_size.md) diff --git a/docs/api/types/callback_game.md b/docs/api/types/callback_game.md new file mode 100644 index 00000000..757ad2f2 --- /dev/null +++ b/docs/api/types/callback_game.md @@ -0,0 +1,18 @@ +# CallbackGame + +## Description + +A placeholder, currently holds no information. Use BotFather to set up your game. + + + + +## Location + +- `from aiogram.types import CallbackGame` +- `from aiogram.api.types import CallbackGame` +- `from aiogram.api.types.callback_game import CallbackGame` + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#callbackgame) diff --git a/docs/api/types/callback_query.md b/docs/api/types/callback_query.md new file mode 100644 index 00000000..5fc09499 --- /dev/null +++ b/docs/api/types/callback_query.md @@ -0,0 +1,34 @@ +# CallbackQuery + +## Description + +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). + + +## Attributes + +| Name | Type | Description | +| - | - | - | +| `id` | `#!python str` | Unique identifier for this query | +| `from_user` | `#!python User` | Sender | +| `chat_instance` | `#!python str` | Global identifier, uniquely corresponding to the chat to which the message with the callback button was sent. Useful for high scores in games. | +| `message` | `#!python Optional[Message]` | 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` | `#!python Optional[str]` | Optional. Identifier of the message sent via the bot in inline mode, that originated the query. | +| `data` | `#!python Optional[str]` | Optional. Data associated with the callback button. Be aware that a bad client can send arbitrary data in this field. | +| `game_short_name` | `#!python Optional[str]` | Optional. Short name of a Game to be returned, serves as the unique identifier for the game | + + + +## Location + +- `from aiogram.types import CallbackQuery` +- `from aiogram.api.types import CallbackQuery` +- `from aiogram.api.types.callback_query import CallbackQuery` + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#callbackquery) +- [aiogram.types.User](../types/user.md) +- [aiogram.types.Message](../types/message.md) diff --git a/docs/api/types/chat.md b/docs/api/types/chat.md new file mode 100644 index 00000000..b2aacbdf --- /dev/null +++ b/docs/api/types/chat.md @@ -0,0 +1,39 @@ +# Chat + +## Description + +This object represents a chat. + + +## Attributes + +| Name | Type | Description | +| - | - | - | +| `id` | `#!python 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. | +| `type` | `#!python str` | Type of chat, can be either 'private', 'group', 'supergroup' or 'channel' | +| `title` | `#!python Optional[str]` | Optional. Title, for supergroups, channels and group chats | +| `username` | `#!python Optional[str]` | Optional. Username, for private chats, supergroups and channels if available | +| `first_name` | `#!python Optional[str]` | Optional. First name of the other party in a private chat | +| `last_name` | `#!python Optional[str]` | Optional. Last name of the other party in a private chat | +| `photo` | `#!python Optional[ChatPhoto]` | Optional. Chat photo. Returned only in getChat. | +| `description` | `#!python Optional[str]` | Optional. Description, for groups, supergroups and channel chats. Returned only in getChat. | +| `invite_link` | `#!python Optional[str]` | 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 exportChatInviteLink. Returned only in getChat. | +| `pinned_message` | `#!python Optional[Message]` | Optional. Pinned message, for groups, supergroups and channels. Returned only in getChat. | +| `permissions` | `#!python Optional[ChatPermissions]` | Optional. Default chat member permissions, for groups and supergroups. Returned only in getChat. | +| `sticker_set_name` | `#!python Optional[str]` | Optional. For supergroups, name of group sticker set. Returned only in getChat. | +| `can_set_sticker_set` | `#!python Optional[bool]` | Optional. True, if the bot can change the group sticker set. Returned only in getChat. | + + + +## Location + +- `from aiogram.types import Chat` +- `from aiogram.api.types import Chat` +- `from aiogram.api.types.chat import Chat` + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#chat) +- [aiogram.types.ChatPermissions](../types/chat_permissions.md) +- [aiogram.types.ChatPhoto](../types/chat_photo.md) +- [aiogram.types.Message](../types/message.md) diff --git a/docs/api/types/chat_member.md b/docs/api/types/chat_member.md new file mode 100644 index 00000000..08b4f9a4 --- /dev/null +++ b/docs/api/types/chat_member.md @@ -0,0 +1,42 @@ +# ChatMember + +## Description + +This object contains information about one member of a chat. + + +## Attributes + +| Name | Type | Description | +| - | - | - | +| `user` | `#!python User` | Information about the user | +| `status` | `#!python str` | The member's status in the chat. Can be 'creator', 'administrator', 'member', 'restricted', 'left' or 'kicked' | +| `until_date` | `#!python Optional[Union[int, datetime.datetime, datetime.timedelta]]` | Optional. Restricted and kicked only. Date when restrictions will be lifted for this user; unix time | +| `can_be_edited` | `#!python Optional[bool]` | Optional. Administrators only. True, if the bot is allowed to edit administrator privileges of that user | +| `can_post_messages` | `#!python Optional[bool]` | Optional. Administrators only. True, if the administrator can post in the channel; channels only | +| `can_edit_messages` | `#!python Optional[bool]` | Optional. Administrators only. True, if the administrator can edit messages of other users and can pin messages; channels only | +| `can_delete_messages` | `#!python Optional[bool]` | Optional. Administrators only. True, if the administrator can delete messages of other users | +| `can_restrict_members` | `#!python Optional[bool]` | Optional. Administrators only. True, if the administrator can restrict, ban or unban chat members | +| `can_promote_members` | `#!python Optional[bool]` | Optional. Administrators only. True, if the administrator can add new administrators with a subset of his own privileges or demote administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by the user) | +| `can_change_info` | `#!python Optional[bool]` | Optional. Administrators and restricted only. True, if the user is allowed to change the chat title, photo and other settings | +| `can_invite_users` | `#!python Optional[bool]` | Optional. Administrators and restricted only. True, if the user is allowed to invite new users to the chat | +| `can_pin_messages` | `#!python Optional[bool]` | Optional. Administrators and restricted only. True, if the user is allowed to pin messages; groups and supergroups only | +| `is_member` | `#!python Optional[bool]` | Optional. Restricted only. True, if the user is a member of the chat at the moment of the request | +| `can_send_messages` | `#!python Optional[bool]` | Optional. Restricted only. True, if the user is allowed to send text messages, contacts, locations and venues | +| `can_send_media_messages` | `#!python Optional[bool]` | Optional. Restricted only. True, if the user is allowed to send audios, documents, photos, videos, video notes and voice notes | +| `can_send_polls` | `#!python Optional[bool]` | Optional. Restricted only. True, if the user is allowed to send polls | +| `can_send_other_messages` | `#!python Optional[bool]` | Optional. Restricted only. True, if the user is allowed to send animations, games, stickers and use inline bots | +| `can_add_web_page_previews` | `#!python Optional[bool]` | Optional. Restricted only. True, if the user is allowed to add web page previews to their messages | + + + +## Location + +- `from aiogram.types import ChatMember` +- `from aiogram.api.types import ChatMember` +- `from aiogram.api.types.chat_member import ChatMember` + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#chatmember) +- [aiogram.types.User](../types/user.md) diff --git a/docs/api/types/chat_permissions.md b/docs/api/types/chat_permissions.md new file mode 100644 index 00000000..aa92ef77 --- /dev/null +++ b/docs/api/types/chat_permissions.md @@ -0,0 +1,31 @@ +# ChatPermissions + +## Description + +Describes actions that a non-administrator user is allowed to take in a chat. + + +## Attributes + +| Name | Type | Description | +| - | - | - | +| `can_send_messages` | `#!python Optional[bool]` | Optional. True, if the user is allowed to send text messages, contacts, locations and venues | +| `can_send_media_messages` | `#!python Optional[bool]` | 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` | `#!python Optional[bool]` | Optional. True, if the user is allowed to send polls, implies can_send_messages | +| `can_send_other_messages` | `#!python Optional[bool]` | 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` | `#!python Optional[bool]` | Optional. True, if the user is allowed to add web page previews to their messages, implies can_send_media_messages | +| `can_change_info` | `#!python Optional[bool]` | Optional. True, if the user is allowed to change the chat title, photo and other settings. Ignored in public supergroups | +| `can_invite_users` | `#!python Optional[bool]` | Optional. True, if the user is allowed to invite new users to the chat | +| `can_pin_messages` | `#!python Optional[bool]` | Optional. True, if the user is allowed to pin messages. Ignored in public supergroups | + + + +## Location + +- `from aiogram.types import ChatPermissions` +- `from aiogram.api.types import ChatPermissions` +- `from aiogram.api.types.chat_permissions import ChatPermissions` + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#chatpermissions) diff --git a/docs/api/types/chat_photo.md b/docs/api/types/chat_photo.md new file mode 100644 index 00000000..954ceb0c --- /dev/null +++ b/docs/api/types/chat_photo.md @@ -0,0 +1,25 @@ +# ChatPhoto + +## Description + +This object represents a chat photo. + + +## Attributes + +| Name | Type | Description | +| - | - | - | +| `small_file_id` | `#!python 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. | +| `big_file_id` | `#!python 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. | + + + +## Location + +- `from aiogram.types import ChatPhoto` +- `from aiogram.api.types import ChatPhoto` +- `from aiogram.api.types.chat_photo import ChatPhoto` + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#chatphoto) diff --git a/docs/api/types/chosen_inline_result.md b/docs/api/types/chosen_inline_result.md new file mode 100644 index 00000000..a879a4b4 --- /dev/null +++ b/docs/api/types/chosen_inline_result.md @@ -0,0 +1,32 @@ +# ChosenInlineResult + +## Description + +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. + + +## Attributes + +| Name | Type | Description | +| - | - | - | +| `result_id` | `#!python str` | The unique identifier for the result that was chosen | +| `from_user` | `#!python User` | The user that chose the result | +| `query` | `#!python str` | The query that was used to obtain the result | +| `location` | `#!python Optional[Location]` | Optional. Sender location, only for bots that require user location | +| `inline_message_id` | `#!python Optional[str]` | 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. | + + + +## Location + +- `from aiogram.types import ChosenInlineResult` +- `from aiogram.api.types import ChosenInlineResult` +- `from aiogram.api.types.chosen_inline_result import ChosenInlineResult` + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#choseninlineresult) +- [aiogram.types.Location](../types/location.md) +- [aiogram.types.User](../types/user.md) diff --git a/docs/api/types/contact.md b/docs/api/types/contact.md new file mode 100644 index 00000000..0c0d2735 --- /dev/null +++ b/docs/api/types/contact.md @@ -0,0 +1,28 @@ +# Contact + +## Description + +This object represents a phone contact. + + +## Attributes + +| Name | Type | Description | +| - | - | - | +| `phone_number` | `#!python str` | Contact's phone number | +| `first_name` | `#!python str` | Contact's first name | +| `last_name` | `#!python Optional[str]` | Optional. Contact's last name | +| `user_id` | `#!python Optional[int]` | Optional. Contact's user identifier in Telegram | +| `vcard` | `#!python Optional[str]` | Optional. Additional data about the contact in the form of a vCard | + + + +## Location + +- `from aiogram.types import Contact` +- `from aiogram.api.types import Contact` +- `from aiogram.api.types.contact import Contact` + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#contact) diff --git a/docs/api/types/document.md b/docs/api/types/document.md new file mode 100644 index 00000000..316f4d19 --- /dev/null +++ b/docs/api/types/document.md @@ -0,0 +1,29 @@ +# Document + +## Description + +This object represents a general file (as opposed to photos, voice messages and audio files). + + +## Attributes + +| Name | Type | Description | +| - | - | - | +| `file_id` | `#!python str` | Identifier for this file | +| `thumb` | `#!python Optional[PhotoSize]` | Optional. Document thumbnail as defined by sender | +| `file_name` | `#!python Optional[str]` | Optional. Original filename as defined by sender | +| `mime_type` | `#!python Optional[str]` | Optional. MIME type of the file as defined by sender | +| `file_size` | `#!python Optional[int]` | Optional. File size | + + + +## Location + +- `from aiogram.types import Document` +- `from aiogram.api.types import Document` +- `from aiogram.api.types.document import Document` + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#document) +- [aiogram.types.PhotoSize](../types/photo_size.md) diff --git a/docs/api/types/encrypted_credentials.md b/docs/api/types/encrypted_credentials.md new file mode 100644 index 00000000..43a5f2f5 --- /dev/null +++ b/docs/api/types/encrypted_credentials.md @@ -0,0 +1,26 @@ +# EncryptedCredentials + +## Description + +Contains data required for decrypting and authenticating EncryptedPassportElement. See the Telegram Passport Documentation for a complete description of the data decryption and authentication processes. + + +## Attributes + +| Name | Type | Description | +| - | - | - | +| `data` | `#!python str` | Base64-encoded encrypted JSON-serialized data with unique user's payload, data hashes and secrets required for EncryptedPassportElement decryption and authentication | +| `hash` | `#!python str` | Base64-encoded data hash for data authentication | +| `secret` | `#!python str` | Base64-encoded secret, encrypted with the bot's public RSA key, required for data decryption | + + + +## Location + +- `from aiogram.types import EncryptedCredentials` +- `from aiogram.api.types import EncryptedCredentials` +- `from aiogram.api.types.encrypted_credentials import EncryptedCredentials` + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#encryptedcredentials) diff --git a/docs/api/types/encrypted_passport_element.md b/docs/api/types/encrypted_passport_element.md new file mode 100644 index 00000000..0b4083f0 --- /dev/null +++ b/docs/api/types/encrypted_passport_element.md @@ -0,0 +1,34 @@ +# EncryptedPassportElement + +## Description + +Contains information about documents or other Telegram Passport elements shared with the bot by the user. + + +## Attributes + +| Name | Type | Description | +| - | - | - | +| `type` | `#!python 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'. | +| `hash` | `#!python str` | Base64-encoded element hash for using in PassportElementErrorUnspecified | +| `data` | `#!python Optional[str]` | 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 EncryptedCredentials. | +| `phone_number` | `#!python Optional[str]` | Optional. User's verified phone number, available only for 'phone_number' type | +| `email` | `#!python Optional[str]` | Optional. User's verified email address, available only for 'email' type | +| `files` | `#!python Optional[List[PassportFile]]` | 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 EncryptedCredentials. | +| `front_side` | `#!python Optional[PassportFile]` | 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 EncryptedCredentials. | +| `reverse_side` | `#!python Optional[PassportFile]` | 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 EncryptedCredentials. | +| `selfie` | `#!python Optional[PassportFile]` | 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 EncryptedCredentials. | +| `translation` | `#!python Optional[List[PassportFile]]` | 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 EncryptedCredentials. | + + + +## Location + +- `from aiogram.types import EncryptedPassportElement` +- `from aiogram.api.types import EncryptedPassportElement` +- `from aiogram.api.types.encrypted_passport_element import EncryptedPassportElement` + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#encryptedpassportelement) +- [aiogram.types.PassportFile](../types/passport_file.md) diff --git a/docs/api/types/file.md b/docs/api/types/file.md new file mode 100644 index 00000000..32fb6cb3 --- /dev/null +++ b/docs/api/types/file.md @@ -0,0 +1,28 @@ +# File + +## Description + +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 + + +## Attributes + +| Name | Type | Description | +| - | - | - | +| `file_id` | `#!python str` | Identifier for this file | +| `file_size` | `#!python Optional[int]` | Optional. File size, if known | +| `file_path` | `#!python Optional[str]` | Optional. File path. Use https://api.telegram.org/file/bot/ to get the file. | + + + +## Location + +- `from aiogram.types import File` +- `from aiogram.api.types import File` +- `from aiogram.api.types.file import File` + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#file) diff --git a/docs/api/types/force_reply.md b/docs/api/types/force_reply.md new file mode 100644 index 00000000..427c7f99 --- /dev/null +++ b/docs/api/types/force_reply.md @@ -0,0 +1,35 @@ +# ForceReply + +## Description + +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. + + +## Attributes + +| Name | Type | Description | +| - | - | - | +| `force_reply` | `#!python bool` | Shows reply interface to the user, as if they manually selected the bot‘s message and tapped ’Reply' | +| `selective` | `#!python Optional[bool]` | 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 Message object; 2) if the bot's message is a reply (has reply_to_message_id), sender of the original message. | + + + +## Location + +- `from aiogram.types import ForceReply` +- `from aiogram.api.types import ForceReply` +- `from aiogram.api.types.force_reply import ForceReply` + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#forcereply) diff --git a/docs/api/types/game.md b/docs/api/types/game.md new file mode 100644 index 00000000..95f02332 --- /dev/null +++ b/docs/api/types/game.md @@ -0,0 +1,32 @@ +# Game + +## Description + +This object represents a game. Use BotFather to create and edit games, their short names will act as unique identifiers. + + +## Attributes + +| Name | Type | Description | +| - | - | - | +| `title` | `#!python str` | Title of the game | +| `description` | `#!python str` | Description of the game | +| `photo` | `#!python List[PhotoSize]` | Photo that will be displayed in the game message in chats. | +| `text` | `#!python Optional[str]` | 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 setGameScore, or manually edited using editMessageText. 0-4096 characters. | +| `text_entities` | `#!python Optional[List[MessageEntity]]` | Optional. Special entities that appear in text, such as usernames, URLs, bot commands, etc. | +| `animation` | `#!python Optional[Animation]` | Optional. Animation that will be displayed in the game message in chats. Upload via BotFather | + + + +## Location + +- `from aiogram.types import Game` +- `from aiogram.api.types import Game` +- `from aiogram.api.types.game import Game` + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#game) +- [aiogram.types.MessageEntity](../types/message_entity.md) +- [aiogram.types.Animation](../types/animation.md) +- [aiogram.types.PhotoSize](../types/photo_size.md) diff --git a/docs/api/types/game_high_score.md b/docs/api/types/game_high_score.md new file mode 100644 index 00000000..c8b06bea --- /dev/null +++ b/docs/api/types/game_high_score.md @@ -0,0 +1,31 @@ +# GameHighScore + +## Description + +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 + + +## Attributes + +| Name | Type | Description | +| - | - | - | +| `position` | `#!python int` | Position in high score table for the game | +| `user` | `#!python User` | User | +| `score` | `#!python int` | Score | + + + +## Location + +- `from aiogram.types import GameHighScore` +- `from aiogram.api.types import GameHighScore` +- `from aiogram.api.types.game_high_score import GameHighScore` + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#gamehighscore) +- [aiogram.types.User](../types/user.md) diff --git a/docs/api/types/inline_keyboard_button.md b/docs/api/types/inline_keyboard_button.md new file mode 100644 index 00000000..38de8c65 --- /dev/null +++ b/docs/api/types/inline_keyboard_button.md @@ -0,0 +1,33 @@ +# InlineKeyboardButton + +## Description + +This object represents one button of an inline keyboard. You must use exactly one of the optional fields. + + +## Attributes + +| Name | Type | Description | +| - | - | - | +| `text` | `#!python str` | Label text on the button | +| `url` | `#!python Optional[str]` | Optional. HTTP or tg:// url to be opened when button is pressed | +| `login_url` | `#!python Optional[LoginUrl]` | Optional. An HTTP URL used to automatically authorize the user. Can be used as a replacement for the Telegram Login Widget. | +| `callback_data` | `#!python Optional[str]` | Optional. Data to be sent in a callback query to the bot when button is pressed, 1-64 bytes | +| `switch_inline_query` | `#!python Optional[str]` | 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` | `#!python Optional[str]` | 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` | `#!python Optional[CallbackGame]` | Optional. Description of the game that will be launched when the user presses the button. | +| `pay` | `#!python Optional[bool]` | Optional. Specify True, to send a Pay button. | + + + +## Location + +- `from aiogram.types import InlineKeyboardButton` +- `from aiogram.api.types import InlineKeyboardButton` +- `from aiogram.api.types.inline_keyboard_button import InlineKeyboardButton` + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#inlinekeyboardbutton) +- [aiogram.types.LoginUrl](../types/login_url.md) +- [aiogram.types.CallbackGame](../types/callback_game.md) diff --git a/docs/api/types/inline_keyboard_markup.md b/docs/api/types/inline_keyboard_markup.md new file mode 100644 index 00000000..04dad82d --- /dev/null +++ b/docs/api/types/inline_keyboard_markup.md @@ -0,0 +1,27 @@ +# InlineKeyboardMarkup + +## Description + +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. + + +## Attributes + +| Name | Type | Description | +| - | - | - | +| `inline_keyboard` | `#!python List[List[InlineKeyboardButton]]` | Array of button rows, each represented by an Array of InlineKeyboardButton objects | + + + +## Location + +- `from aiogram.types import InlineKeyboardMarkup` +- `from aiogram.api.types import InlineKeyboardMarkup` +- `from aiogram.api.types.inline_keyboard_markup import InlineKeyboardMarkup` + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#inlinekeyboardmarkup) +- [aiogram.types.InlineKeyboardButton](../types/inline_keyboard_button.md) diff --git a/docs/api/types/inline_query.md b/docs/api/types/inline_query.md new file mode 100644 index 00000000..583d6a60 --- /dev/null +++ b/docs/api/types/inline_query.md @@ -0,0 +1,30 @@ +# InlineQuery + +## Description + +This object represents an incoming inline query. When the user sends an empty query, your bot could return some default or trending results. + + +## Attributes + +| Name | Type | Description | +| - | - | - | +| `id` | `#!python str` | Unique identifier for this query | +| `from_user` | `#!python User` | Sender | +| `query` | `#!python str` | Text of the query (up to 512 characters) | +| `offset` | `#!python str` | Offset of the results to be returned, can be controlled by the bot | +| `location` | `#!python Optional[Location]` | Optional. Sender location, only for bots that request user location | + + + +## Location + +- `from aiogram.types import InlineQuery` +- `from aiogram.api.types import InlineQuery` +- `from aiogram.api.types.inline_query import InlineQuery` + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#inlinequery) +- [aiogram.types.Location](../types/location.md) +- [aiogram.types.User](../types/user.md) diff --git a/docs/api/types/inline_query_result.md b/docs/api/types/inline_query_result.md new file mode 100644 index 00000000..ab379b82 --- /dev/null +++ b/docs/api/types/inline_query_result.md @@ -0,0 +1,58 @@ +# InlineQueryResult + +## Description + +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 + + + + +## Location + +- `from aiogram.types import InlineQueryResult` +- `from aiogram.api.types import InlineQueryResult` +- `from aiogram.api.types.inline_query_result import InlineQueryResult` + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#inlinequeryresult) diff --git a/docs/api/types/inline_query_result_article.md b/docs/api/types/inline_query_result_article.md new file mode 100644 index 00000000..3b0e6f06 --- /dev/null +++ b/docs/api/types/inline_query_result_article.md @@ -0,0 +1,36 @@ +# InlineQueryResultArticle + +## Description + +Represents a link to an article or web page. + + +## Attributes + +| Name | Type | Description | +| - | - | - | +| `type` | `#!python str` | Type of the result, must be article | +| `id` | `#!python str` | Unique identifier for this result, 1-64 Bytes | +| `title` | `#!python str` | Title of the result | +| `input_message_content` | `#!python InputMessageContent` | Content of the message to be sent | +| `reply_markup` | `#!python Optional[InlineKeyboardMarkup]` | Optional. Inline keyboard attached to the message | +| `url` | `#!python Optional[str]` | Optional. URL of the result | +| `hide_url` | `#!python Optional[bool]` | Optional. Pass True, if you don't want the URL to be shown in the message | +| `description` | `#!python Optional[str]` | Optional. Short description of the result | +| `thumb_url` | `#!python Optional[str]` | Optional. Url of the thumbnail for the result | +| `thumb_width` | `#!python Optional[int]` | Optional. Thumbnail width | +| `thumb_height` | `#!python Optional[int]` | Optional. Thumbnail height | + + + +## Location + +- `from aiogram.types import InlineQueryResultArticle` +- `from aiogram.api.types import InlineQueryResultArticle` +- `from aiogram.api.types.inline_query_result_article import InlineQueryResultArticle` + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#inlinequeryresultarticle) +- [aiogram.types.InputMessageContent](../types/input_message_content.md) +- [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md) diff --git a/docs/api/types/inline_query_result_audio.md b/docs/api/types/inline_query_result_audio.md new file mode 100644 index 00000000..93ded16e --- /dev/null +++ b/docs/api/types/inline_query_result_audio.md @@ -0,0 +1,37 @@ +# InlineQueryResultAudio + +## Description + +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. + + +## Attributes + +| Name | Type | Description | +| - | - | - | +| `type` | `#!python str` | Type of the result, must be audio | +| `id` | `#!python str` | Unique identifier for this result, 1-64 bytes | +| `audio_url` | `#!python str` | A valid URL for the audio file | +| `title` | `#!python str` | Title | +| `caption` | `#!python Optional[str]` | Optional. Caption, 0-1024 characters | +| `parse_mode` | `#!python Optional[str]` | Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption. | +| `performer` | `#!python Optional[str]` | Optional. Performer | +| `audio_duration` | `#!python Optional[int]` | Optional. Audio duration in seconds | +| `reply_markup` | `#!python Optional[InlineKeyboardMarkup]` | Optional. Inline keyboard attached to the message | +| `input_message_content` | `#!python Optional[InputMessageContent]` | Optional. Content of the message to be sent instead of the audio | + + + +## Location + +- `from aiogram.types import InlineQueryResultAudio` +- `from aiogram.api.types import InlineQueryResultAudio` +- `from aiogram.api.types.inline_query_result_audio import InlineQueryResultAudio` + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#inlinequeryresultaudio) +- [aiogram.types.InputMessageContent](../types/input_message_content.md) +- [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md) diff --git a/docs/api/types/inline_query_result_cached_audio.md b/docs/api/types/inline_query_result_cached_audio.md new file mode 100644 index 00000000..cfc938d9 --- /dev/null +++ b/docs/api/types/inline_query_result_cached_audio.md @@ -0,0 +1,34 @@ +# InlineQueryResultCachedAudio + +## Description + +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. + + +## Attributes + +| Name | Type | Description | +| - | - | - | +| `type` | `#!python str` | Type of the result, must be audio | +| `id` | `#!python str` | Unique identifier for this result, 1-64 bytes | +| `audio_file_id` | `#!python str` | A valid file identifier for the audio file | +| `caption` | `#!python Optional[str]` | Optional. Caption, 0-1024 characters | +| `parse_mode` | `#!python Optional[str]` | Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption. | +| `reply_markup` | `#!python Optional[InlineKeyboardMarkup]` | Optional. Inline keyboard attached to the message | +| `input_message_content` | `#!python Optional[InputMessageContent]` | Optional. Content of the message to be sent instead of the audio | + + + +## Location + +- `from aiogram.types import InlineQueryResultCachedAudio` +- `from aiogram.api.types import InlineQueryResultCachedAudio` +- `from aiogram.api.types.inline_query_result_cached_audio import InlineQueryResultCachedAudio` + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#inlinequeryresultcachedaudio) +- [aiogram.types.InputMessageContent](../types/input_message_content.md) +- [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md) diff --git a/docs/api/types/inline_query_result_cached_document.md b/docs/api/types/inline_query_result_cached_document.md new file mode 100644 index 00000000..3b7898c7 --- /dev/null +++ b/docs/api/types/inline_query_result_cached_document.md @@ -0,0 +1,36 @@ +# InlineQueryResultCachedDocument + +## Description + +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. + + +## Attributes + +| Name | Type | Description | +| - | - | - | +| `type` | `#!python str` | Type of the result, must be document | +| `id` | `#!python str` | Unique identifier for this result, 1-64 bytes | +| `title` | `#!python str` | Title for the result | +| `document_file_id` | `#!python str` | A valid file identifier for the file | +| `description` | `#!python Optional[str]` | Optional. Short description of the result | +| `caption` | `#!python Optional[str]` | Optional. Caption of the document to be sent, 0-1024 characters | +| `parse_mode` | `#!python Optional[str]` | Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption. | +| `reply_markup` | `#!python Optional[InlineKeyboardMarkup]` | Optional. Inline keyboard attached to the message | +| `input_message_content` | `#!python Optional[InputMessageContent]` | Optional. Content of the message to be sent instead of the file | + + + +## Location + +- `from aiogram.types import InlineQueryResultCachedDocument` +- `from aiogram.api.types import InlineQueryResultCachedDocument` +- `from aiogram.api.types.inline_query_result_cached_document import InlineQueryResultCachedDocument` + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#inlinequeryresultcacheddocument) +- [aiogram.types.InputMessageContent](../types/input_message_content.md) +- [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md) diff --git a/docs/api/types/inline_query_result_cached_gif.md b/docs/api/types/inline_query_result_cached_gif.md new file mode 100644 index 00000000..93c18449 --- /dev/null +++ b/docs/api/types/inline_query_result_cached_gif.md @@ -0,0 +1,33 @@ +# InlineQueryResultCachedGif + +## Description + +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. + + +## Attributes + +| Name | Type | Description | +| - | - | - | +| `type` | `#!python str` | Type of the result, must be gif | +| `id` | `#!python str` | Unique identifier for this result, 1-64 bytes | +| `gif_file_id` | `#!python str` | A valid file identifier for the GIF file | +| `title` | `#!python Optional[str]` | Optional. Title for the result | +| `caption` | `#!python Optional[str]` | Optional. Caption of the GIF file to be sent, 0-1024 characters | +| `parse_mode` | `#!python Optional[str]` | Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption. | +| `reply_markup` | `#!python Optional[InlineKeyboardMarkup]` | Optional. Inline keyboard attached to the message | +| `input_message_content` | `#!python Optional[InputMessageContent]` | Optional. Content of the message to be sent instead of the GIF animation | + + + +## Location + +- `from aiogram.types import InlineQueryResultCachedGif` +- `from aiogram.api.types import InlineQueryResultCachedGif` +- `from aiogram.api.types.inline_query_result_cached_gif import InlineQueryResultCachedGif` + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#inlinequeryresultcachedgif) +- [aiogram.types.InputMessageContent](../types/input_message_content.md) +- [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md) diff --git a/docs/api/types/inline_query_result_cached_mpeg4_gif.md b/docs/api/types/inline_query_result_cached_mpeg4_gif.md new file mode 100644 index 00000000..bef9c476 --- /dev/null +++ b/docs/api/types/inline_query_result_cached_mpeg4_gif.md @@ -0,0 +1,33 @@ +# InlineQueryResultCachedMpeg4Gif + +## Description + +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. + + +## Attributes + +| Name | Type | Description | +| - | - | - | +| `type` | `#!python str` | Type of the result, must be mpeg4_gif | +| `id` | `#!python str` | Unique identifier for this result, 1-64 bytes | +| `mpeg4_file_id` | `#!python str` | A valid file identifier for the MP4 file | +| `title` | `#!python Optional[str]` | Optional. Title for the result | +| `caption` | `#!python Optional[str]` | Optional. Caption of the MPEG-4 file to be sent, 0-1024 characters | +| `parse_mode` | `#!python Optional[str]` | Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption. | +| `reply_markup` | `#!python Optional[InlineKeyboardMarkup]` | Optional. Inline keyboard attached to the message | +| `input_message_content` | `#!python Optional[InputMessageContent]` | Optional. Content of the message to be sent instead of the video animation | + + + +## Location + +- `from aiogram.types import InlineQueryResultCachedMpeg4Gif` +- `from aiogram.api.types import InlineQueryResultCachedMpeg4Gif` +- `from aiogram.api.types.inline_query_result_cached_mpeg4_gif import InlineQueryResultCachedMpeg4Gif` + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#inlinequeryresultcachedmpeg4gif) +- [aiogram.types.InputMessageContent](../types/input_message_content.md) +- [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md) diff --git a/docs/api/types/inline_query_result_cached_photo.md b/docs/api/types/inline_query_result_cached_photo.md new file mode 100644 index 00000000..ed7a9331 --- /dev/null +++ b/docs/api/types/inline_query_result_cached_photo.md @@ -0,0 +1,34 @@ +# InlineQueryResultCachedPhoto + +## Description + +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. + + +## Attributes + +| Name | Type | Description | +| - | - | - | +| `type` | `#!python str` | Type of the result, must be photo | +| `id` | `#!python str` | Unique identifier for this result, 1-64 bytes | +| `photo_file_id` | `#!python str` | A valid file identifier of the photo | +| `title` | `#!python Optional[str]` | Optional. Title for the result | +| `description` | `#!python Optional[str]` | Optional. Short description of the result | +| `caption` | `#!python Optional[str]` | Optional. Caption of the photo to be sent, 0-1024 characters | +| `parse_mode` | `#!python Optional[str]` | Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption. | +| `reply_markup` | `#!python Optional[InlineKeyboardMarkup]` | Optional. Inline keyboard attached to the message | +| `input_message_content` | `#!python Optional[InputMessageContent]` | Optional. Content of the message to be sent instead of the photo | + + + +## Location + +- `from aiogram.types import InlineQueryResultCachedPhoto` +- `from aiogram.api.types import InlineQueryResultCachedPhoto` +- `from aiogram.api.types.inline_query_result_cached_photo import InlineQueryResultCachedPhoto` + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#inlinequeryresultcachedphoto) +- [aiogram.types.InputMessageContent](../types/input_message_content.md) +- [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md) diff --git a/docs/api/types/inline_query_result_cached_sticker.md b/docs/api/types/inline_query_result_cached_sticker.md new file mode 100644 index 00000000..6231bfc5 --- /dev/null +++ b/docs/api/types/inline_query_result_cached_sticker.md @@ -0,0 +1,32 @@ +# InlineQueryResultCachedSticker + +## Description + +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. + + +## Attributes + +| Name | Type | Description | +| - | - | - | +| `type` | `#!python str` | Type of the result, must be sticker | +| `id` | `#!python str` | Unique identifier for this result, 1-64 bytes | +| `sticker_file_id` | `#!python str` | A valid file identifier of the sticker | +| `reply_markup` | `#!python Optional[InlineKeyboardMarkup]` | Optional. Inline keyboard attached to the message | +| `input_message_content` | `#!python Optional[InputMessageContent]` | Optional. Content of the message to be sent instead of the sticker | + + + +## Location + +- `from aiogram.types import InlineQueryResultCachedSticker` +- `from aiogram.api.types import InlineQueryResultCachedSticker` +- `from aiogram.api.types.inline_query_result_cached_sticker import InlineQueryResultCachedSticker` + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#inlinequeryresultcachedsticker) +- [aiogram.types.InputMessageContent](../types/input_message_content.md) +- [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md) diff --git a/docs/api/types/inline_query_result_cached_video.md b/docs/api/types/inline_query_result_cached_video.md new file mode 100644 index 00000000..395a3736 --- /dev/null +++ b/docs/api/types/inline_query_result_cached_video.md @@ -0,0 +1,34 @@ +# InlineQueryResultCachedVideo + +## Description + +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. + + +## Attributes + +| Name | Type | Description | +| - | - | - | +| `type` | `#!python str` | Type of the result, must be video | +| `id` | `#!python str` | Unique identifier for this result, 1-64 bytes | +| `video_file_id` | `#!python str` | A valid file identifier for the video file | +| `title` | `#!python str` | Title for the result | +| `description` | `#!python Optional[str]` | Optional. Short description of the result | +| `caption` | `#!python Optional[str]` | Optional. Caption of the video to be sent, 0-1024 characters | +| `parse_mode` | `#!python Optional[str]` | Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption. | +| `reply_markup` | `#!python Optional[InlineKeyboardMarkup]` | Optional. Inline keyboard attached to the message | +| `input_message_content` | `#!python Optional[InputMessageContent]` | Optional. Content of the message to be sent instead of the video | + + + +## Location + +- `from aiogram.types import InlineQueryResultCachedVideo` +- `from aiogram.api.types import InlineQueryResultCachedVideo` +- `from aiogram.api.types.inline_query_result_cached_video import InlineQueryResultCachedVideo` + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#inlinequeryresultcachedvideo) +- [aiogram.types.InputMessageContent](../types/input_message_content.md) +- [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md) diff --git a/docs/api/types/inline_query_result_cached_voice.md b/docs/api/types/inline_query_result_cached_voice.md new file mode 100644 index 00000000..e809f3a6 --- /dev/null +++ b/docs/api/types/inline_query_result_cached_voice.md @@ -0,0 +1,35 @@ +# InlineQueryResultCachedVoice + +## Description + +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. + + +## Attributes + +| Name | Type | Description | +| - | - | - | +| `type` | `#!python str` | Type of the result, must be voice | +| `id` | `#!python str` | Unique identifier for this result, 1-64 bytes | +| `voice_file_id` | `#!python str` | A valid file identifier for the voice message | +| `title` | `#!python str` | Voice message title | +| `caption` | `#!python Optional[str]` | Optional. Caption, 0-1024 characters | +| `parse_mode` | `#!python Optional[str]` | Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption. | +| `reply_markup` | `#!python Optional[InlineKeyboardMarkup]` | Optional. Inline keyboard attached to the message | +| `input_message_content` | `#!python Optional[InputMessageContent]` | Optional. Content of the message to be sent instead of the voice message | + + + +## Location + +- `from aiogram.types import InlineQueryResultCachedVoice` +- `from aiogram.api.types import InlineQueryResultCachedVoice` +- `from aiogram.api.types.inline_query_result_cached_voice import InlineQueryResultCachedVoice` + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#inlinequeryresultcachedvoice) +- [aiogram.types.InputMessageContent](../types/input_message_content.md) +- [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md) diff --git a/docs/api/types/inline_query_result_contact.md b/docs/api/types/inline_query_result_contact.md new file mode 100644 index 00000000..71f9a972 --- /dev/null +++ b/docs/api/types/inline_query_result_contact.md @@ -0,0 +1,38 @@ +# InlineQueryResultContact + +## Description + +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. + + +## Attributes + +| Name | Type | Description | +| - | - | - | +| `type` | `#!python str` | Type of the result, must be contact | +| `id` | `#!python str` | Unique identifier for this result, 1-64 Bytes | +| `phone_number` | `#!python str` | Contact's phone number | +| `first_name` | `#!python str` | Contact's first name | +| `last_name` | `#!python Optional[str]` | Optional. Contact's last name | +| `vcard` | `#!python Optional[str]` | Optional. Additional data about the contact in the form of a vCard, 0-2048 bytes | +| `reply_markup` | `#!python Optional[InlineKeyboardMarkup]` | Optional. Inline keyboard attached to the message | +| `input_message_content` | `#!python Optional[InputMessageContent]` | Optional. Content of the message to be sent instead of the contact | +| `thumb_url` | `#!python Optional[str]` | Optional. Url of the thumbnail for the result | +| `thumb_width` | `#!python Optional[int]` | Optional. Thumbnail width | +| `thumb_height` | `#!python Optional[int]` | Optional. Thumbnail height | + + + +## Location + +- `from aiogram.types import InlineQueryResultContact` +- `from aiogram.api.types import InlineQueryResultContact` +- `from aiogram.api.types.inline_query_result_contact import InlineQueryResultContact` + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#inlinequeryresultcontact) +- [aiogram.types.InputMessageContent](../types/input_message_content.md) +- [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md) diff --git a/docs/api/types/inline_query_result_document.md b/docs/api/types/inline_query_result_document.md new file mode 100644 index 00000000..f71b317f --- /dev/null +++ b/docs/api/types/inline_query_result_document.md @@ -0,0 +1,40 @@ +# InlineQueryResultDocument + +## Description + +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. + + +## Attributes + +| Name | Type | Description | +| - | - | - | +| `type` | `#!python str` | Type of the result, must be document | +| `id` | `#!python str` | Unique identifier for this result, 1-64 bytes | +| `title` | `#!python str` | Title for the result | +| `document_url` | `#!python str` | A valid URL for the file | +| `mime_type` | `#!python str` | Mime type of the content of the file, either 'application/pdf' or 'application/zip' | +| `caption` | `#!python Optional[str]` | Optional. Caption of the document to be sent, 0-1024 characters | +| `parse_mode` | `#!python Optional[str]` | Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption. | +| `description` | `#!python Optional[str]` | Optional. Short description of the result | +| `reply_markup` | `#!python Optional[InlineKeyboardMarkup]` | Optional. Inline keyboard attached to the message | +| `input_message_content` | `#!python Optional[InputMessageContent]` | Optional. Content of the message to be sent instead of the file | +| `thumb_url` | `#!python Optional[str]` | Optional. URL of the thumbnail (jpeg only) for the file | +| `thumb_width` | `#!python Optional[int]` | Optional. Thumbnail width | +| `thumb_height` | `#!python Optional[int]` | Optional. Thumbnail height | + + + +## Location + +- `from aiogram.types import InlineQueryResultDocument` +- `from aiogram.api.types import InlineQueryResultDocument` +- `from aiogram.api.types.inline_query_result_document import InlineQueryResultDocument` + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#inlinequeryresultdocument) +- [aiogram.types.InputMessageContent](../types/input_message_content.md) +- [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md) diff --git a/docs/api/types/inline_query_result_game.md b/docs/api/types/inline_query_result_game.md new file mode 100644 index 00000000..1e24f88d --- /dev/null +++ b/docs/api/types/inline_query_result_game.md @@ -0,0 +1,30 @@ +# InlineQueryResultGame + +## Description + +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. + + +## Attributes + +| Name | Type | Description | +| - | - | - | +| `type` | `#!python str` | Type of the result, must be game | +| `id` | `#!python str` | Unique identifier for this result, 1-64 bytes | +| `game_short_name` | `#!python str` | Short name of the game | +| `reply_markup` | `#!python Optional[InlineKeyboardMarkup]` | Optional. Inline keyboard attached to the message | + + + +## Location + +- `from aiogram.types import InlineQueryResultGame` +- `from aiogram.api.types import InlineQueryResultGame` +- `from aiogram.api.types.inline_query_result_game import InlineQueryResultGame` + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#inlinequeryresultgame) +- [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md) diff --git a/docs/api/types/inline_query_result_gif.md b/docs/api/types/inline_query_result_gif.md new file mode 100644 index 00000000..17af669c --- /dev/null +++ b/docs/api/types/inline_query_result_gif.md @@ -0,0 +1,37 @@ +# InlineQueryResultGif + +## Description + +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. + + +## Attributes + +| Name | Type | Description | +| - | - | - | +| `type` | `#!python str` | Type of the result, must be gif | +| `id` | `#!python str` | Unique identifier for this result, 1-64 bytes | +| `gif_url` | `#!python str` | A valid URL for the GIF file. File size must not exceed 1MB | +| `thumb_url` | `#!python str` | URL of the static thumbnail for the result (jpeg or gif) | +| `gif_width` | `#!python Optional[int]` | Optional. Width of the GIF | +| `gif_height` | `#!python Optional[int]` | Optional. Height of the GIF | +| `gif_duration` | `#!python Optional[int]` | Optional. Duration of the GIF | +| `title` | `#!python Optional[str]` | Optional. Title for the result | +| `caption` | `#!python Optional[str]` | Optional. Caption of the GIF file to be sent, 0-1024 characters | +| `parse_mode` | `#!python Optional[str]` | Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption. | +| `reply_markup` | `#!python Optional[InlineKeyboardMarkup]` | Optional. Inline keyboard attached to the message | +| `input_message_content` | `#!python Optional[InputMessageContent]` | Optional. Content of the message to be sent instead of the GIF animation | + + + +## Location + +- `from aiogram.types import InlineQueryResultGif` +- `from aiogram.api.types import InlineQueryResultGif` +- `from aiogram.api.types.inline_query_result_gif import InlineQueryResultGif` + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#inlinequeryresultgif) +- [aiogram.types.InputMessageContent](../types/input_message_content.md) +- [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md) diff --git a/docs/api/types/inline_query_result_location.md b/docs/api/types/inline_query_result_location.md new file mode 100644 index 00000000..334365c1 --- /dev/null +++ b/docs/api/types/inline_query_result_location.md @@ -0,0 +1,38 @@ +# InlineQueryResultLocation + +## Description + +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. + + +## Attributes + +| Name | Type | Description | +| - | - | - | +| `type` | `#!python str` | Type of the result, must be location | +| `id` | `#!python str` | Unique identifier for this result, 1-64 Bytes | +| `latitude` | `#!python float` | Location latitude in degrees | +| `longitude` | `#!python float` | Location longitude in degrees | +| `title` | `#!python str` | Location title | +| `live_period` | `#!python Optional[int]` | Optional. Period in seconds for which the location can be updated, should be between 60 and 86400. | +| `reply_markup` | `#!python Optional[InlineKeyboardMarkup]` | Optional. Inline keyboard attached to the message | +| `input_message_content` | `#!python Optional[InputMessageContent]` | Optional. Content of the message to be sent instead of the location | +| `thumb_url` | `#!python Optional[str]` | Optional. Url of the thumbnail for the result | +| `thumb_width` | `#!python Optional[int]` | Optional. Thumbnail width | +| `thumb_height` | `#!python Optional[int]` | Optional. Thumbnail height | + + + +## Location + +- `from aiogram.types import InlineQueryResultLocation` +- `from aiogram.api.types import InlineQueryResultLocation` +- `from aiogram.api.types.inline_query_result_location import InlineQueryResultLocation` + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#inlinequeryresultlocation) +- [aiogram.types.InputMessageContent](../types/input_message_content.md) +- [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md) diff --git a/docs/api/types/inline_query_result_mpeg4_gif.md b/docs/api/types/inline_query_result_mpeg4_gif.md new file mode 100644 index 00000000..52ee96d0 --- /dev/null +++ b/docs/api/types/inline_query_result_mpeg4_gif.md @@ -0,0 +1,37 @@ +# InlineQueryResultMpeg4Gif + +## Description + +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. + + +## Attributes + +| Name | Type | Description | +| - | - | - | +| `type` | `#!python str` | Type of the result, must be mpeg4_gif | +| `id` | `#!python str` | Unique identifier for this result, 1-64 bytes | +| `mpeg4_url` | `#!python str` | A valid URL for the MP4 file. File size must not exceed 1MB | +| `thumb_url` | `#!python str` | URL of the static thumbnail (jpeg or gif) for the result | +| `mpeg4_width` | `#!python Optional[int]` | Optional. Video width | +| `mpeg4_height` | `#!python Optional[int]` | Optional. Video height | +| `mpeg4_duration` | `#!python Optional[int]` | Optional. Video duration | +| `title` | `#!python Optional[str]` | Optional. Title for the result | +| `caption` | `#!python Optional[str]` | Optional. Caption of the MPEG-4 file to be sent, 0-1024 characters | +| `parse_mode` | `#!python Optional[str]` | Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption. | +| `reply_markup` | `#!python Optional[InlineKeyboardMarkup]` | Optional. Inline keyboard attached to the message | +| `input_message_content` | `#!python Optional[InputMessageContent]` | Optional. Content of the message to be sent instead of the video animation | + + + +## Location + +- `from aiogram.types import InlineQueryResultMpeg4Gif` +- `from aiogram.api.types import InlineQueryResultMpeg4Gif` +- `from aiogram.api.types.inline_query_result_mpeg4_gif import InlineQueryResultMpeg4Gif` + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#inlinequeryresultmpeg4gif) +- [aiogram.types.InputMessageContent](../types/input_message_content.md) +- [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md) diff --git a/docs/api/types/inline_query_result_photo.md b/docs/api/types/inline_query_result_photo.md new file mode 100644 index 00000000..77b2dddc --- /dev/null +++ b/docs/api/types/inline_query_result_photo.md @@ -0,0 +1,37 @@ +# InlineQueryResultPhoto + +## Description + +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. + + +## Attributes + +| Name | Type | Description | +| - | - | - | +| `type` | `#!python str` | Type of the result, must be photo | +| `id` | `#!python str` | Unique identifier for this result, 1-64 bytes | +| `photo_url` | `#!python str` | A valid URL of the photo. Photo must be in jpeg format. Photo size must not exceed 5MB | +| `thumb_url` | `#!python str` | URL of the thumbnail for the photo | +| `photo_width` | `#!python Optional[int]` | Optional. Width of the photo | +| `photo_height` | `#!python Optional[int]` | Optional. Height of the photo | +| `title` | `#!python Optional[str]` | Optional. Title for the result | +| `description` | `#!python Optional[str]` | Optional. Short description of the result | +| `caption` | `#!python Optional[str]` | Optional. Caption of the photo to be sent, 0-1024 characters | +| `parse_mode` | `#!python Optional[str]` | Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption. | +| `reply_markup` | `#!python Optional[InlineKeyboardMarkup]` | Optional. Inline keyboard attached to the message | +| `input_message_content` | `#!python Optional[InputMessageContent]` | Optional. Content of the message to be sent instead of the photo | + + + +## Location + +- `from aiogram.types import InlineQueryResultPhoto` +- `from aiogram.api.types import InlineQueryResultPhoto` +- `from aiogram.api.types.inline_query_result_photo import InlineQueryResultPhoto` + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#inlinequeryresultphoto) +- [aiogram.types.InputMessageContent](../types/input_message_content.md) +- [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md) diff --git a/docs/api/types/inline_query_result_venue.md b/docs/api/types/inline_query_result_venue.md new file mode 100644 index 00000000..539e163a --- /dev/null +++ b/docs/api/types/inline_query_result_venue.md @@ -0,0 +1,40 @@ +# InlineQueryResultVenue + +## Description + +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. + + +## Attributes + +| Name | Type | Description | +| - | - | - | +| `type` | `#!python str` | Type of the result, must be venue | +| `id` | `#!python str` | Unique identifier for this result, 1-64 Bytes | +| `latitude` | `#!python float` | Latitude of the venue location in degrees | +| `longitude` | `#!python float` | Longitude of the venue location in degrees | +| `title` | `#!python str` | Title of the venue | +| `address` | `#!python str` | Address of the venue | +| `foursquare_id` | `#!python Optional[str]` | Optional. Foursquare identifier of the venue if known | +| `foursquare_type` | `#!python Optional[str]` | Optional. Foursquare type of the venue, if known. (For example, 'arts_entertainment/default', 'arts_entertainment/aquarium' or 'food/icecream'.) | +| `reply_markup` | `#!python Optional[InlineKeyboardMarkup]` | Optional. Inline keyboard attached to the message | +| `input_message_content` | `#!python Optional[InputMessageContent]` | Optional. Content of the message to be sent instead of the venue | +| `thumb_url` | `#!python Optional[str]` | Optional. Url of the thumbnail for the result | +| `thumb_width` | `#!python Optional[int]` | Optional. Thumbnail width | +| `thumb_height` | `#!python Optional[int]` | Optional. Thumbnail height | + + + +## Location + +- `from aiogram.types import InlineQueryResultVenue` +- `from aiogram.api.types import InlineQueryResultVenue` +- `from aiogram.api.types.inline_query_result_venue import InlineQueryResultVenue` + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#inlinequeryresultvenue) +- [aiogram.types.InputMessageContent](../types/input_message_content.md) +- [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md) diff --git a/docs/api/types/inline_query_result_video.md b/docs/api/types/inline_query_result_video.md new file mode 100644 index 00000000..e4f50f97 --- /dev/null +++ b/docs/api/types/inline_query_result_video.md @@ -0,0 +1,41 @@ +# InlineQueryResultVideo + +## Description + +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. + + +## Attributes + +| Name | Type | Description | +| - | - | - | +| `type` | `#!python str` | Type of the result, must be video | +| `id` | `#!python str` | Unique identifier for this result, 1-64 bytes | +| `video_url` | `#!python str` | A valid URL for the embedded video player or video file | +| `mime_type` | `#!python str` | Mime type of the content of video url, 'text/html' or 'video/mp4' | +| `thumb_url` | `#!python str` | URL of the thumbnail (jpeg only) for the video | +| `title` | `#!python str` | Title for the result | +| `caption` | `#!python Optional[str]` | Optional. Caption of the video to be sent, 0-1024 characters | +| `parse_mode` | `#!python Optional[str]` | Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption. | +| `video_width` | `#!python Optional[int]` | Optional. Video width | +| `video_height` | `#!python Optional[int]` | Optional. Video height | +| `video_duration` | `#!python Optional[int]` | Optional. Video duration in seconds | +| `description` | `#!python Optional[str]` | Optional. Short description of the result | +| `reply_markup` | `#!python Optional[InlineKeyboardMarkup]` | Optional. Inline keyboard attached to the message | +| `input_message_content` | `#!python Optional[InputMessageContent]` | 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). | + + + +## Location + +- `from aiogram.types import InlineQueryResultVideo` +- `from aiogram.api.types import InlineQueryResultVideo` +- `from aiogram.api.types.inline_query_result_video import InlineQueryResultVideo` + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#inlinequeryresultvideo) +- [aiogram.types.InputMessageContent](../types/input_message_content.md) +- [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md) diff --git a/docs/api/types/inline_query_result_voice.md b/docs/api/types/inline_query_result_voice.md new file mode 100644 index 00000000..f13a2bd8 --- /dev/null +++ b/docs/api/types/inline_query_result_voice.md @@ -0,0 +1,36 @@ +# InlineQueryResultVoice + +## Description + +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. + + +## Attributes + +| Name | Type | Description | +| - | - | - | +| `type` | `#!python str` | Type of the result, must be voice | +| `id` | `#!python str` | Unique identifier for this result, 1-64 bytes | +| `voice_url` | `#!python str` | A valid URL for the voice recording | +| `title` | `#!python str` | Recording title | +| `caption` | `#!python Optional[str]` | Optional. Caption, 0-1024 characters | +| `parse_mode` | `#!python Optional[str]` | Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption. | +| `voice_duration` | `#!python Optional[int]` | Optional. Recording duration in seconds | +| `reply_markup` | `#!python Optional[InlineKeyboardMarkup]` | Optional. Inline keyboard attached to the message | +| `input_message_content` | `#!python Optional[InputMessageContent]` | Optional. Content of the message to be sent instead of the voice recording | + + + +## Location + +- `from aiogram.types import InlineQueryResultVoice` +- `from aiogram.api.types import InlineQueryResultVoice` +- `from aiogram.api.types.inline_query_result_voice import InlineQueryResultVoice` + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#inlinequeryresultvoice) +- [aiogram.types.InputMessageContent](../types/input_message_content.md) +- [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md) diff --git a/docs/api/types/input_contact_message_content.md b/docs/api/types/input_contact_message_content.md new file mode 100644 index 00000000..d759fa72 --- /dev/null +++ b/docs/api/types/input_contact_message_content.md @@ -0,0 +1,27 @@ +# InputContactMessageContent + +## Description + +Represents the content of a contact message to be sent as the result of an inline query. + + +## Attributes + +| Name | Type | Description | +| - | - | - | +| `phone_number` | `#!python str` | Contact's phone number | +| `first_name` | `#!python str` | Contact's first name | +| `last_name` | `#!python Optional[str]` | Optional. Contact's last name | +| `vcard` | `#!python Optional[str]` | Optional. Additional data about the contact in the form of a vCard, 0-2048 bytes | + + + +## Location + +- `from aiogram.types import InputContactMessageContent` +- `from aiogram.api.types import InputContactMessageContent` +- `from aiogram.api.types.input_contact_message_content import InputContactMessageContent` + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#inputcontactmessagecontent) diff --git a/docs/api/types/input_file.md b/docs/api/types/input_file.md new file mode 100644 index 00000000..6df45d71 --- /dev/null +++ b/docs/api/types/input_file.md @@ -0,0 +1,18 @@ +# InputFile + +## Description + +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. + + + + +## Location + +- `from aiogram.types import InputFile` +- `from aiogram.api.types import InputFile` +- `from aiogram.api.types.input_file import InputFile` + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#inputfile) diff --git a/docs/api/types/input_location_message_content.md b/docs/api/types/input_location_message_content.md new file mode 100644 index 00000000..6f06c2ec --- /dev/null +++ b/docs/api/types/input_location_message_content.md @@ -0,0 +1,26 @@ +# InputLocationMessageContent + +## Description + +Represents the content of a location message to be sent as the result of an inline query. + + +## Attributes + +| Name | Type | Description | +| - | - | - | +| `latitude` | `#!python float` | Latitude of the location in degrees | +| `longitude` | `#!python float` | Longitude of the location in degrees | +| `live_period` | `#!python Optional[int]` | Optional. Period in seconds for which the location can be updated, should be between 60 and 86400. | + + + +## Location + +- `from aiogram.types import InputLocationMessageContent` +- `from aiogram.api.types import InputLocationMessageContent` +- `from aiogram.api.types.input_location_message_content import InputLocationMessageContent` + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#inputlocationmessagecontent) diff --git a/docs/api/types/input_media.md b/docs/api/types/input_media.md new file mode 100644 index 00000000..348f6ab5 --- /dev/null +++ b/docs/api/types/input_media.md @@ -0,0 +1,28 @@ +# InputMedia + +## Description + +This object represents the content of a media message to be sent. It should be one of + + - InputMediaAnimation + + - InputMediaDocument + + - InputMediaAudio + + - InputMediaPhoto + + - InputMediaVideo + + + + +## Location + +- `from aiogram.types import InputMedia` +- `from aiogram.api.types import InputMedia` +- `from aiogram.api.types.input_media import InputMedia` + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#inputmedia) diff --git a/docs/api/types/input_media_animation.md b/docs/api/types/input_media_animation.md new file mode 100644 index 00000000..fbf5c53b --- /dev/null +++ b/docs/api/types/input_media_animation.md @@ -0,0 +1,32 @@ +# InputMediaAnimation + +## Description + +Represents an animation file (GIF or H.264/MPEG-4 AVC video without sound) to be sent. + + +## Attributes + +| Name | Type | Description | +| - | - | - | +| `type` | `#!python str` | Type of the result, must be animation | +| `media` | `#!python 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. | +| `thumb` | `#!python Optional[Union[InputFile, str]]` | 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 . | +| `caption` | `#!python Optional[str]` | Optional. Caption of the animation to be sent, 0-1024 characters | +| `parse_mode` | `#!python Optional[str]` | Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption. | +| `width` | `#!python Optional[int]` | Optional. Animation width | +| `height` | `#!python Optional[int]` | Optional. Animation height | +| `duration` | `#!python Optional[int]` | Optional. Animation duration | + + + +## Location + +- `from aiogram.types import InputMediaAnimation` +- `from aiogram.api.types import InputMediaAnimation` +- `from aiogram.api.types.input_media_animation import InputMediaAnimation` + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#inputmediaanimation) +- [aiogram.types.InputFile](../types/input_file.md) diff --git a/docs/api/types/input_media_audio.md b/docs/api/types/input_media_audio.md new file mode 100644 index 00000000..c1f4d1a7 --- /dev/null +++ b/docs/api/types/input_media_audio.md @@ -0,0 +1,32 @@ +# InputMediaAudio + +## Description + +Represents an audio file to be treated as music to be sent. + + +## Attributes + +| Name | Type | Description | +| - | - | - | +| `type` | `#!python str` | Type of the result, must be audio | +| `media` | `#!python 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. | +| `thumb` | `#!python Optional[Union[InputFile, str]]` | 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 . | +| `caption` | `#!python Optional[str]` | Optional. Caption of the audio to be sent, 0-1024 characters | +| `parse_mode` | `#!python Optional[str]` | Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption. | +| `duration` | `#!python Optional[int]` | Optional. Duration of the audio in seconds | +| `performer` | `#!python Optional[str]` | Optional. Performer of the audio | +| `title` | `#!python Optional[str]` | Optional. Title of the audio | + + + +## Location + +- `from aiogram.types import InputMediaAudio` +- `from aiogram.api.types import InputMediaAudio` +- `from aiogram.api.types.input_media_audio import InputMediaAudio` + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#inputmediaaudio) +- [aiogram.types.InputFile](../types/input_file.md) diff --git a/docs/api/types/input_media_document.md b/docs/api/types/input_media_document.md new file mode 100644 index 00000000..e45ecd2f --- /dev/null +++ b/docs/api/types/input_media_document.md @@ -0,0 +1,29 @@ +# InputMediaDocument + +## Description + +Represents a general file to be sent. + + +## Attributes + +| Name | Type | Description | +| - | - | - | +| `type` | `#!python str` | Type of the result, must be document | +| `media` | `#!python 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. | +| `thumb` | `#!python Optional[Union[InputFile, str]]` | 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 . | +| `caption` | `#!python Optional[str]` | Optional. Caption of the document to be sent, 0-1024 characters | +| `parse_mode` | `#!python Optional[str]` | Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption. | + + + +## Location + +- `from aiogram.types import InputMediaDocument` +- `from aiogram.api.types import InputMediaDocument` +- `from aiogram.api.types.input_media_document import InputMediaDocument` + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#inputmediadocument) +- [aiogram.types.InputFile](../types/input_file.md) diff --git a/docs/api/types/input_media_photo.md b/docs/api/types/input_media_photo.md new file mode 100644 index 00000000..29559ea1 --- /dev/null +++ b/docs/api/types/input_media_photo.md @@ -0,0 +1,28 @@ +# InputMediaPhoto + +## Description + +Represents a photo to be sent. + + +## Attributes + +| Name | Type | Description | +| - | - | - | +| `type` | `#!python str` | Type of the result, must be photo | +| `media` | `#!python 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. | +| `caption` | `#!python Optional[str]` | Optional. Caption of the photo to be sent, 0-1024 characters | +| `parse_mode` | `#!python Optional[str]` | Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption. | + + + +## Location + +- `from aiogram.types import InputMediaPhoto` +- `from aiogram.api.types import InputMediaPhoto` +- `from aiogram.api.types.input_media_photo import InputMediaPhoto` + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#inputmediaphoto) +- [aiogram.types.InputFile](../types/input_file.md) diff --git a/docs/api/types/input_media_video.md b/docs/api/types/input_media_video.md new file mode 100644 index 00000000..41f47b3a --- /dev/null +++ b/docs/api/types/input_media_video.md @@ -0,0 +1,33 @@ +# InputMediaVideo + +## Description + +Represents a video to be sent. + + +## Attributes + +| Name | Type | Description | +| - | - | - | +| `type` | `#!python str` | Type of the result, must be video | +| `media` | `#!python 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. | +| `thumb` | `#!python Optional[Union[InputFile, str]]` | 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 . | +| `caption` | `#!python Optional[str]` | Optional. Caption of the video to be sent, 0-1024 characters | +| `parse_mode` | `#!python Optional[str]` | Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption. | +| `width` | `#!python Optional[int]` | Optional. Video width | +| `height` | `#!python Optional[int]` | Optional. Video height | +| `duration` | `#!python Optional[int]` | Optional. Video duration | +| `supports_streaming` | `#!python Optional[bool]` | Optional. Pass True, if the uploaded video is suitable for streaming | + + + +## Location + +- `from aiogram.types import InputMediaVideo` +- `from aiogram.api.types import InputMediaVideo` +- `from aiogram.api.types.input_media_video import InputMediaVideo` + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#inputmediavideo) +- [aiogram.types.InputFile](../types/input_file.md) diff --git a/docs/api/types/input_message_content.md b/docs/api/types/input_message_content.md new file mode 100644 index 00000000..0ba0796a --- /dev/null +++ b/docs/api/types/input_message_content.md @@ -0,0 +1,26 @@ +# InputMessageContent + +## Description + +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 + + + + +## Location + +- `from aiogram.types import InputMessageContent` +- `from aiogram.api.types import InputMessageContent` +- `from aiogram.api.types.input_message_content import InputMessageContent` + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#inputmessagecontent) diff --git a/docs/api/types/input_text_message_content.md b/docs/api/types/input_text_message_content.md new file mode 100644 index 00000000..14562070 --- /dev/null +++ b/docs/api/types/input_text_message_content.md @@ -0,0 +1,26 @@ +# InputTextMessageContent + +## Description + +Represents the content of a text message to be sent as the result of an inline query. + + +## Attributes + +| Name | Type | Description | +| - | - | - | +| `message_text` | `#!python str` | Text of the message to be sent, 1-4096 characters | +| `parse_mode` | `#!python Optional[str]` | Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in your bot's message. | +| `disable_web_page_preview` | `#!python Optional[bool]` | Optional. Disables link previews for links in the sent message | + + + +## Location + +- `from aiogram.types import InputTextMessageContent` +- `from aiogram.api.types import InputTextMessageContent` +- `from aiogram.api.types.input_text_message_content import InputTextMessageContent` + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#inputtextmessagecontent) diff --git a/docs/api/types/input_venue_message_content.md b/docs/api/types/input_venue_message_content.md new file mode 100644 index 00000000..57db449b --- /dev/null +++ b/docs/api/types/input_venue_message_content.md @@ -0,0 +1,29 @@ +# InputVenueMessageContent + +## Description + +Represents the content of a venue message to be sent as the result of an inline query. + + +## Attributes + +| Name | Type | Description | +| - | - | - | +| `latitude` | `#!python float` | Latitude of the venue in degrees | +| `longitude` | `#!python float` | Longitude of the venue in degrees | +| `title` | `#!python str` | Name of the venue | +| `address` | `#!python str` | Address of the venue | +| `foursquare_id` | `#!python Optional[str]` | Optional. Foursquare identifier of the venue, if known | +| `foursquare_type` | `#!python Optional[str]` | Optional. Foursquare type of the venue, if known. (For example, 'arts_entertainment/default', 'arts_entertainment/aquarium' or 'food/icecream'.) | + + + +## Location + +- `from aiogram.types import InputVenueMessageContent` +- `from aiogram.api.types import InputVenueMessageContent` +- `from aiogram.api.types.input_venue_message_content import InputVenueMessageContent` + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#inputvenuemessagecontent) diff --git a/docs/api/types/invoice.md b/docs/api/types/invoice.md new file mode 100644 index 00000000..d1151742 --- /dev/null +++ b/docs/api/types/invoice.md @@ -0,0 +1,28 @@ +# Invoice + +## Description + +This object contains basic information about an invoice. + + +## Attributes + +| Name | Type | Description | +| - | - | - | +| `title` | `#!python str` | Product name | +| `description` | `#!python str` | Product description | +| `start_parameter` | `#!python str` | Unique bot deep-linking parameter that can be used to generate this invoice | +| `currency` | `#!python str` | Three-letter ISO 4217 currency code | +| `total_amount` | `#!python 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). | + + + +## Location + +- `from aiogram.types import Invoice` +- `from aiogram.api.types import Invoice` +- `from aiogram.api.types.invoice import Invoice` + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#invoice) diff --git a/docs/api/types/keyboard_button.md b/docs/api/types/keyboard_button.md new file mode 100644 index 00000000..b9e4fbd3 --- /dev/null +++ b/docs/api/types/keyboard_button.md @@ -0,0 +1,28 @@ +# KeyboardButton + +## Description + +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 are mutually exclusive. + +Note: request_contact and request_location options will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them. + + +## Attributes + +| Name | Type | Description | +| - | - | - | +| `text` | `#!python 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 | +| `request_contact` | `#!python Optional[bool]` | Optional. If True, the user's phone number will be sent as a contact when the button is pressed. Available in private chats only | +| `request_location` | `#!python Optional[bool]` | Optional. If True, the user's current location will be sent when the button is pressed. Available in private chats only | + + + +## Location + +- `from aiogram.types import KeyboardButton` +- `from aiogram.api.types import KeyboardButton` +- `from aiogram.api.types.keyboard_button import KeyboardButton` + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#keyboardbutton) diff --git a/docs/api/types/labeled_price.md b/docs/api/types/labeled_price.md new file mode 100644 index 00000000..2b9b6466 --- /dev/null +++ b/docs/api/types/labeled_price.md @@ -0,0 +1,25 @@ +# LabeledPrice + +## Description + +This object represents a portion of the price for goods or services. + + +## Attributes + +| Name | Type | Description | +| - | - | - | +| `label` | `#!python str` | Portion label | +| `amount` | `#!python 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). | + + + +## Location + +- `from aiogram.types import LabeledPrice` +- `from aiogram.api.types import LabeledPrice` +- `from aiogram.api.types.labeled_price import LabeledPrice` + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#labeledprice) diff --git a/docs/api/types/location.md b/docs/api/types/location.md new file mode 100644 index 00000000..851ee60a --- /dev/null +++ b/docs/api/types/location.md @@ -0,0 +1,25 @@ +# Location + +## Description + +This object represents a point on the map. + + +## Attributes + +| Name | Type | Description | +| - | - | - | +| `longitude` | `#!python float` | Longitude as defined by sender | +| `latitude` | `#!python float` | Latitude as defined by sender | + + + +## Location + +- `from aiogram.types import Location` +- `from aiogram.api.types import Location` +- `from aiogram.api.types.location import Location` + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#location) diff --git a/docs/api/types/login_url.md b/docs/api/types/login_url.md new file mode 100644 index 00000000..3ade374a --- /dev/null +++ b/docs/api/types/login_url.md @@ -0,0 +1,31 @@ +# LoginUrl + +## Description + +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 + + +## Attributes + +| Name | Type | Description | +| - | - | - | +| `url` | `#!python 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. | +| `forward_text` | `#!python Optional[str]` | Optional. New text of the button in forwarded messages. | +| `bot_username` | `#!python Optional[str]` | 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` | `#!python Optional[bool]` | Optional. Pass True to request the permission for your bot to send messages to the user. | + + + +## Location + +- `from aiogram.types import LoginUrl` +- `from aiogram.api.types import LoginUrl` +- `from aiogram.api.types.login_url import LoginUrl` + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#loginurl) diff --git a/docs/api/types/mask_position.md b/docs/api/types/mask_position.md new file mode 100644 index 00000000..30b64ee7 --- /dev/null +++ b/docs/api/types/mask_position.md @@ -0,0 +1,27 @@ +# MaskPosition + +## Description + +This object describes the position on faces where a mask should be placed by default. + + +## Attributes + +| Name | Type | Description | +| - | - | - | +| `point` | `#!python str` | The part of the face relative to which the mask should be placed. One of 'forehead', 'eyes', 'mouth', or 'chin'. | +| `x_shift` | `#!python 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. | +| `y_shift` | `#!python 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. | +| `scale` | `#!python float` | Mask scaling coefficient. For example, 2.0 means double size. | + + + +## Location + +- `from aiogram.types import MaskPosition` +- `from aiogram.api.types import MaskPosition` +- `from aiogram.api.types.mask_position import MaskPosition` + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#maskposition) diff --git a/docs/api/types/message.md b/docs/api/types/message.md new file mode 100644 index 00000000..c12879c9 --- /dev/null +++ b/docs/api/types/message.md @@ -0,0 +1,90 @@ +# Message + +## Description + +This object represents a message. + + +## Attributes + +| Name | Type | Description | +| - | - | - | +| `message_id` | `#!python int` | Unique message identifier inside this chat | +| `date` | `#!python datetime.datetime` | Date the message was sent in Unix time | +| `chat` | `#!python Chat` | Conversation the message belongs to | +| `from_user` | `#!python Optional[User]` | Optional. Sender, empty for messages sent to channels | +| `forward_from` | `#!python Optional[User]` | Optional. For forwarded messages, sender of the original message | +| `forward_from_chat` | `#!python Optional[Chat]` | Optional. For messages forwarded from channels, information about the original channel | +| `forward_from_message_id` | `#!python Optional[int]` | Optional. For messages forwarded from channels, identifier of the original message in the channel | +| `forward_signature` | `#!python Optional[str]` | Optional. For messages forwarded from channels, signature of the post author if present | +| `forward_sender_name` | `#!python Optional[str]` | Optional. Sender's name for messages forwarded from users who disallow adding a link to their account in forwarded messages | +| `forward_date` | `#!python Optional[int]` | Optional. For forwarded messages, date the original message was sent in Unix time | +| `reply_to_message` | `#!python Optional[Message]` | 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. | +| `edit_date` | `#!python Optional[int]` | Optional. Date the message was last edited in Unix time | +| `media_group_id` | `#!python Optional[str]` | Optional. The unique identifier of a media message group this message belongs to | +| `author_signature` | `#!python Optional[str]` | Optional. Signature of the post author for messages in channels | +| `text` | `#!python Optional[str]` | Optional. For text messages, the actual UTF-8 text of the message, 0-4096 characters. | +| `entities` | `#!python Optional[List[MessageEntity]]` | Optional. For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text | +| `caption_entities` | `#!python Optional[List[MessageEntity]]` | Optional. For messages with a caption, special entities like usernames, URLs, bot commands, etc. that appear in the caption | +| `audio` | `#!python Optional[Audio]` | Optional. Message is an audio file, information about the file | +| `document` | `#!python Optional[Document]` | Optional. Message is a general file, information about the file | +| `animation` | `#!python Optional[Animation]` | Optional. Message is an animation, information about the animation. For backward compatibility, when this field is set, the document field will also be set | +| `game` | `#!python Optional[Game]` | Optional. Message is a game, information about the game. | +| `photo` | `#!python Optional[List[PhotoSize]]` | Optional. Message is a photo, available sizes of the photo | +| `sticker` | `#!python Optional[Sticker]` | Optional. Message is a sticker, information about the sticker | +| `video` | `#!python Optional[Video]` | Optional. Message is a video, information about the video | +| `voice` | `#!python Optional[Voice]` | Optional. Message is a voice message, information about the file | +| `video_note` | `#!python Optional[VideoNote]` | Optional. Message is a video note, information about the video message | +| `caption` | `#!python Optional[str]` | Optional. Caption for the animation, audio, document, photo, video or voice, 0-1024 characters | +| `contact` | `#!python Optional[Contact]` | Optional. Message is a shared contact, information about the contact | +| `location` | `#!python Optional[Location]` | Optional. Message is a shared location, information about the location | +| `venue` | `#!python Optional[Venue]` | Optional. Message is a venue, information about the venue | +| `poll` | `#!python Optional[Poll]` | Optional. Message is a native poll, information about the poll | +| `new_chat_members` | `#!python Optional[List[User]]` | 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` | `#!python Optional[User]` | Optional. A member was removed from the group, information about them (this member may be the bot itself) | +| `new_chat_title` | `#!python Optional[str]` | Optional. A chat title was changed to this value | +| `new_chat_photo` | `#!python Optional[List[PhotoSize]]` | Optional. A chat photo was change to this value | +| `delete_chat_photo` | `#!python Optional[bool]` | Optional. Service message: the chat photo was deleted | +| `group_chat_created` | `#!python Optional[bool]` | Optional. Service message: the group has been created | +| `supergroup_chat_created` | `#!python Optional[bool]` | 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` | `#!python Optional[bool]` | 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` | `#!python Optional[int]` | 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` | `#!python Optional[int]` | 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` | `#!python Optional[Message]` | 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` | `#!python Optional[Invoice]` | Optional. Message is an invoice for a payment, information about the invoice. | +| `successful_payment` | `#!python Optional[SuccessfulPayment]` | Optional. Message is a service message about a successful payment, information about the payment. | +| `connected_website` | `#!python Optional[str]` | Optional. The domain name of the website on which the user has logged in. | +| `passport_data` | `#!python Optional[PassportData]` | Optional. Telegram Passport data | +| `reply_markup` | `#!python Optional[InlineKeyboardMarkup]` | Optional. Inline keyboard attached to the message. login_url buttons are represented as ordinary url buttons. | + + + +## Location + +- `from aiogram.types import Message` +- `from aiogram.api.types import Message` +- `from aiogram.api.types.message import Message` + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#message) +- [aiogram.types.Poll](../types/poll.md) +- [aiogram.types.PassportData](../types/passport_data.md) +- [aiogram.types.Video](../types/video.md) +- [aiogram.types.MessageEntity](../types/message_entity.md) +- [aiogram.types.PhotoSize](../types/photo_size.md) +- [aiogram.types.Contact](../types/contact.md) +- [aiogram.types.Document](../types/document.md) +- [aiogram.types.Animation](../types/animation.md) +- [aiogram.types.SuccessfulPayment](../types/successful_payment.md) +- [aiogram.types.Chat](../types/chat.md) +- [aiogram.types.Audio](../types/audio.md) +- [aiogram.types.Game](../types/game.md) +- [aiogram.types.Voice](../types/voice.md) +- [aiogram.types.VideoNote](../types/video_note.md) +- [aiogram.types.Invoice](../types/invoice.md) +- [aiogram.types.Location](../types/location.md) +- [aiogram.types.Sticker](../types/sticker.md) +- [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md) +- [aiogram.types.User](../types/user.md) +- [aiogram.types.Venue](../types/venue.md) diff --git a/docs/api/types/message_entity.md b/docs/api/types/message_entity.md new file mode 100644 index 00000000..48282a71 --- /dev/null +++ b/docs/api/types/message_entity.md @@ -0,0 +1,29 @@ +# MessageEntity + +## Description + +This object represents one special entity in a text message. For example, hashtags, usernames, URLs, etc. + + +## Attributes + +| Name | Type | Description | +| - | - | - | +| `type` | `#!python str` | Type of the entity. Can be mention (@username), hashtag, cashtag, bot_command, url, email, phone_number, bold (bold text), italic (italic text), code (monowidth string), pre (monowidth block), text_link (for clickable text URLs), text_mention (for users without usernames) | +| `offset` | `#!python int` | Offset in UTF-16 code units to the start of the entity | +| `length` | `#!python int` | Length of the entity in UTF-16 code units | +| `url` | `#!python Optional[str]` | Optional. For 'text_link' only, url that will be opened after user taps on the text | +| `user` | `#!python Optional[User]` | Optional. For 'text_mention' only, the mentioned user | + + + +## Location + +- `from aiogram.types import MessageEntity` +- `from aiogram.api.types import MessageEntity` +- `from aiogram.api.types.message_entity import MessageEntity` + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#messageentity) +- [aiogram.types.User](../types/user.md) diff --git a/docs/api/types/order_info.md b/docs/api/types/order_info.md new file mode 100644 index 00000000..7138ce4d --- /dev/null +++ b/docs/api/types/order_info.md @@ -0,0 +1,28 @@ +# OrderInfo + +## Description + +This object represents information about an order. + + +## Attributes + +| Name | Type | Description | +| - | - | - | +| `name` | `#!python Optional[str]` | Optional. User name | +| `phone_number` | `#!python Optional[str]` | Optional. User's phone number | +| `email` | `#!python Optional[str]` | Optional. User email | +| `shipping_address` | `#!python Optional[ShippingAddress]` | Optional. User shipping address | + + + +## Location + +- `from aiogram.types import OrderInfo` +- `from aiogram.api.types import OrderInfo` +- `from aiogram.api.types.order_info import OrderInfo` + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#orderinfo) +- [aiogram.types.ShippingAddress](../types/shipping_address.md) diff --git a/docs/api/types/passport_data.md b/docs/api/types/passport_data.md new file mode 100644 index 00000000..5cf9694f --- /dev/null +++ b/docs/api/types/passport_data.md @@ -0,0 +1,27 @@ +# PassportData + +## Description + +Contains information about Telegram Passport data shared with the bot by the user. + + +## Attributes + +| Name | Type | Description | +| - | - | - | +| `data` | `#!python List[EncryptedPassportElement]` | Array with information about documents and other Telegram Passport elements that was shared with the bot | +| `credentials` | `#!python EncryptedCredentials` | Encrypted credentials required to decrypt the data | + + + +## Location + +- `from aiogram.types import PassportData` +- `from aiogram.api.types import PassportData` +- `from aiogram.api.types.passport_data import PassportData` + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#passportdata) +- [aiogram.types.EncryptedPassportElement](../types/encrypted_passport_element.md) +- [aiogram.types.EncryptedCredentials](../types/encrypted_credentials.md) diff --git a/docs/api/types/passport_element_error.md b/docs/api/types/passport_element_error.md new file mode 100644 index 00000000..7a195221 --- /dev/null +++ b/docs/api/types/passport_element_error.md @@ -0,0 +1,36 @@ +# PassportElementError + +## Description + +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 + + + + +## Location + +- `from aiogram.types import PassportElementError` +- `from aiogram.api.types import PassportElementError` +- `from aiogram.api.types.passport_element_error import PassportElementError` + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#passportelementerror) diff --git a/docs/api/types/passport_element_error_data_field.md b/docs/api/types/passport_element_error_data_field.md new file mode 100644 index 00000000..91fcef1e --- /dev/null +++ b/docs/api/types/passport_element_error_data_field.md @@ -0,0 +1,28 @@ +# PassportElementErrorDataField + +## Description + +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. + + +## Attributes + +| Name | Type | Description | +| - | - | - | +| `source` | `#!python str` | Error source, must be data | +| `type` | `#!python 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' | +| `field_name` | `#!python str` | Name of the data field which has the error | +| `data_hash` | `#!python str` | Base64-encoded data hash | +| `message` | `#!python str` | Error message | + + + +## Location + +- `from aiogram.types import PassportElementErrorDataField` +- `from aiogram.api.types import PassportElementErrorDataField` +- `from aiogram.api.types.passport_element_error_data_field import PassportElementErrorDataField` + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#passportelementerrordatafield) diff --git a/docs/api/types/passport_element_error_file.md b/docs/api/types/passport_element_error_file.md new file mode 100644 index 00000000..64cdb5f0 --- /dev/null +++ b/docs/api/types/passport_element_error_file.md @@ -0,0 +1,27 @@ +# PassportElementErrorFile + +## Description + +Represents an issue with a document scan. The error is considered resolved when the file with the document scan changes. + + +## Attributes + +| Name | Type | Description | +| - | - | - | +| `source` | `#!python str` | Error source, must be file | +| `type` | `#!python 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' | +| `file_hash` | `#!python str` | Base64-encoded file hash | +| `message` | `#!python str` | Error message | + + + +## Location + +- `from aiogram.types import PassportElementErrorFile` +- `from aiogram.api.types import PassportElementErrorFile` +- `from aiogram.api.types.passport_element_error_file import PassportElementErrorFile` + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#passportelementerrorfile) diff --git a/docs/api/types/passport_element_error_files.md b/docs/api/types/passport_element_error_files.md new file mode 100644 index 00000000..a1145a8d --- /dev/null +++ b/docs/api/types/passport_element_error_files.md @@ -0,0 +1,27 @@ +# PassportElementErrorFiles + +## Description + +Represents an issue with a list of scans. The error is considered resolved when the list of files containing the scans changes. + + +## Attributes + +| Name | Type | Description | +| - | - | - | +| `source` | `#!python str` | Error source, must be files | +| `type` | `#!python 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' | +| `file_hashes` | `#!python List[str]` | List of base64-encoded file hashes | +| `message` | `#!python str` | Error message | + + + +## Location + +- `from aiogram.types import PassportElementErrorFiles` +- `from aiogram.api.types import PassportElementErrorFiles` +- `from aiogram.api.types.passport_element_error_files import PassportElementErrorFiles` + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#passportelementerrorfiles) diff --git a/docs/api/types/passport_element_error_front_side.md b/docs/api/types/passport_element_error_front_side.md new file mode 100644 index 00000000..c0d50704 --- /dev/null +++ b/docs/api/types/passport_element_error_front_side.md @@ -0,0 +1,27 @@ +# PassportElementErrorFrontSide + +## Description + +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. + + +## Attributes + +| Name | Type | Description | +| - | - | - | +| `source` | `#!python str` | Error source, must be front_side | +| `type` | `#!python str` | The section of the user's Telegram Passport which has the issue, one of 'passport', 'driver_license', 'identity_card', 'internal_passport' | +| `file_hash` | `#!python str` | Base64-encoded hash of the file with the front side of the document | +| `message` | `#!python str` | Error message | + + + +## Location + +- `from aiogram.types import PassportElementErrorFrontSide` +- `from aiogram.api.types import PassportElementErrorFrontSide` +- `from aiogram.api.types.passport_element_error_front_side import PassportElementErrorFrontSide` + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#passportelementerrorfrontside) diff --git a/docs/api/types/passport_element_error_reverse_side.md b/docs/api/types/passport_element_error_reverse_side.md new file mode 100644 index 00000000..252aa690 --- /dev/null +++ b/docs/api/types/passport_element_error_reverse_side.md @@ -0,0 +1,27 @@ +# PassportElementErrorReverseSide + +## Description + +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. + + +## Attributes + +| Name | Type | Description | +| - | - | - | +| `source` | `#!python str` | Error source, must be reverse_side | +| `type` | `#!python str` | The section of the user's Telegram Passport which has the issue, one of 'driver_license', 'identity_card' | +| `file_hash` | `#!python str` | Base64-encoded hash of the file with the reverse side of the document | +| `message` | `#!python str` | Error message | + + + +## Location + +- `from aiogram.types import PassportElementErrorReverseSide` +- `from aiogram.api.types import PassportElementErrorReverseSide` +- `from aiogram.api.types.passport_element_error_reverse_side import PassportElementErrorReverseSide` + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#passportelementerrorreverseside) diff --git a/docs/api/types/passport_element_error_selfie.md b/docs/api/types/passport_element_error_selfie.md new file mode 100644 index 00000000..77bf1633 --- /dev/null +++ b/docs/api/types/passport_element_error_selfie.md @@ -0,0 +1,27 @@ +# PassportElementErrorSelfie + +## Description + +Represents an issue with the selfie with a document. The error is considered resolved when the file with the selfie changes. + + +## Attributes + +| Name | Type | Description | +| - | - | - | +| `source` | `#!python str` | Error source, must be selfie | +| `type` | `#!python str` | The section of the user's Telegram Passport which has the issue, one of 'passport', 'driver_license', 'identity_card', 'internal_passport' | +| `file_hash` | `#!python str` | Base64-encoded hash of the file with the selfie | +| `message` | `#!python str` | Error message | + + + +## Location + +- `from aiogram.types import PassportElementErrorSelfie` +- `from aiogram.api.types import PassportElementErrorSelfie` +- `from aiogram.api.types.passport_element_error_selfie import PassportElementErrorSelfie` + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#passportelementerrorselfie) diff --git a/docs/api/types/passport_element_error_translation_file.md b/docs/api/types/passport_element_error_translation_file.md new file mode 100644 index 00000000..3d4c77b8 --- /dev/null +++ b/docs/api/types/passport_element_error_translation_file.md @@ -0,0 +1,27 @@ +# PassportElementErrorTranslationFile + +## Description + +Represents an issue with one of the files that constitute the translation of a document. The error is considered resolved when the file changes. + + +## Attributes + +| Name | Type | Description | +| - | - | - | +| `source` | `#!python str` | Error source, must be translation_file | +| `type` | `#!python 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' | +| `file_hash` | `#!python str` | Base64-encoded file hash | +| `message` | `#!python str` | Error message | + + + +## Location + +- `from aiogram.types import PassportElementErrorTranslationFile` +- `from aiogram.api.types import PassportElementErrorTranslationFile` +- `from aiogram.api.types.passport_element_error_translation_file import PassportElementErrorTranslationFile` + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#passportelementerrortranslationfile) diff --git a/docs/api/types/passport_element_error_translation_files.md b/docs/api/types/passport_element_error_translation_files.md new file mode 100644 index 00000000..e379ea83 --- /dev/null +++ b/docs/api/types/passport_element_error_translation_files.md @@ -0,0 +1,27 @@ +# PassportElementErrorTranslationFiles + +## Description + +Represents an issue with the translated version of a document. The error is considered resolved when a file with the document translation change. + + +## Attributes + +| Name | Type | Description | +| - | - | - | +| `source` | `#!python str` | Error source, must be translation_files | +| `type` | `#!python 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' | +| `file_hashes` | `#!python List[str]` | List of base64-encoded file hashes | +| `message` | `#!python str` | Error message | + + + +## Location + +- `from aiogram.types import PassportElementErrorTranslationFiles` +- `from aiogram.api.types import PassportElementErrorTranslationFiles` +- `from aiogram.api.types.passport_element_error_translation_files import PassportElementErrorTranslationFiles` + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#passportelementerrortranslationfiles) diff --git a/docs/api/types/passport_element_error_unspecified.md b/docs/api/types/passport_element_error_unspecified.md new file mode 100644 index 00000000..fa632982 --- /dev/null +++ b/docs/api/types/passport_element_error_unspecified.md @@ -0,0 +1,27 @@ +# PassportElementErrorUnspecified + +## Description + +Represents an issue in an unspecified place. The error is considered resolved when new data is added. + + +## Attributes + +| Name | Type | Description | +| - | - | - | +| `source` | `#!python str` | Error source, must be unspecified | +| `type` | `#!python str` | Type of element of the user's Telegram Passport which has the issue | +| `element_hash` | `#!python str` | Base64-encoded element hash | +| `message` | `#!python str` | Error message | + + + +## Location + +- `from aiogram.types import PassportElementErrorUnspecified` +- `from aiogram.api.types import PassportElementErrorUnspecified` +- `from aiogram.api.types.passport_element_error_unspecified import PassportElementErrorUnspecified` + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#passportelementerrorunspecified) diff --git a/docs/api/types/passport_file.md b/docs/api/types/passport_file.md new file mode 100644 index 00000000..2883c6cf --- /dev/null +++ b/docs/api/types/passport_file.md @@ -0,0 +1,26 @@ +# PassportFile + +## Description + +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. + + +## Attributes + +| Name | Type | Description | +| - | - | - | +| `file_id` | `#!python str` | Identifier for this file | +| `file_size` | `#!python int` | File size | +| `file_date` | `#!python int` | Unix time when the file was uploaded | + + + +## Location + +- `from aiogram.types import PassportFile` +- `from aiogram.api.types import PassportFile` +- `from aiogram.api.types.passport_file import PassportFile` + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#passportfile) diff --git a/docs/api/types/photo_size.md b/docs/api/types/photo_size.md new file mode 100644 index 00000000..42f5fe14 --- /dev/null +++ b/docs/api/types/photo_size.md @@ -0,0 +1,27 @@ +# PhotoSize + +## Description + +This object represents one size of a photo or a file / sticker thumbnail. + + +## Attributes + +| Name | Type | Description | +| - | - | - | +| `file_id` | `#!python str` | Identifier for this file | +| `width` | `#!python int` | Photo width | +| `height` | `#!python int` | Photo height | +| `file_size` | `#!python Optional[int]` | Optional. File size | + + + +## Location + +- `from aiogram.types import PhotoSize` +- `from aiogram.api.types import PhotoSize` +- `from aiogram.api.types.photo_size import PhotoSize` + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#photosize) diff --git a/docs/api/types/poll.md b/docs/api/types/poll.md new file mode 100644 index 00000000..0a518622 --- /dev/null +++ b/docs/api/types/poll.md @@ -0,0 +1,28 @@ +# Poll + +## Description + +This object contains information about a poll. + + +## Attributes + +| Name | Type | Description | +| - | - | - | +| `id` | `#!python str` | Unique poll identifier | +| `question` | `#!python str` | Poll question, 1-255 characters | +| `options` | `#!python List[PollOption]` | List of poll options | +| `is_closed` | `#!python bool` | True, if the poll is closed | + + + +## Location + +- `from aiogram.types import Poll` +- `from aiogram.api.types import Poll` +- `from aiogram.api.types.poll import Poll` + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#poll) +- [aiogram.types.PollOption](../types/poll_option.md) diff --git a/docs/api/types/poll_option.md b/docs/api/types/poll_option.md new file mode 100644 index 00000000..f6a622dc --- /dev/null +++ b/docs/api/types/poll_option.md @@ -0,0 +1,25 @@ +# PollOption + +## Description + +This object contains information about one answer option in a poll. + + +## Attributes + +| Name | Type | Description | +| - | - | - | +| `text` | `#!python str` | Option text, 1-100 characters | +| `voter_count` | `#!python int` | Number of users that voted for this option | + + + +## Location + +- `from aiogram.types import PollOption` +- `from aiogram.api.types import PollOption` +- `from aiogram.api.types.poll_option import PollOption` + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#polloption) diff --git a/docs/api/types/pre_checkout_query.md b/docs/api/types/pre_checkout_query.md new file mode 100644 index 00000000..3b6d105b --- /dev/null +++ b/docs/api/types/pre_checkout_query.md @@ -0,0 +1,32 @@ +# PreCheckoutQuery + +## Description + +This object contains information about an incoming pre-checkout query. + + +## Attributes + +| Name | Type | Description | +| - | - | - | +| `id` | `#!python str` | Unique query identifier | +| `from_user` | `#!python User` | User who sent the query | +| `currency` | `#!python str` | Three-letter ISO 4217 currency code | +| `total_amount` | `#!python 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). | +| `invoice_payload` | `#!python str` | Bot specified invoice payload | +| `shipping_option_id` | `#!python Optional[str]` | Optional. Identifier of the shipping option chosen by the user | +| `order_info` | `#!python Optional[OrderInfo]` | Optional. Order info provided by the user | + + + +## Location + +- `from aiogram.types import PreCheckoutQuery` +- `from aiogram.api.types import PreCheckoutQuery` +- `from aiogram.api.types.pre_checkout_query import PreCheckoutQuery` + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#precheckoutquery) +- [aiogram.types.OrderInfo](../types/order_info.md) +- [aiogram.types.User](../types/user.md) diff --git a/docs/api/types/reply_keyboard_markup.md b/docs/api/types/reply_keyboard_markup.md new file mode 100644 index 00000000..3977d88c --- /dev/null +++ b/docs/api/types/reply_keyboard_markup.md @@ -0,0 +1,28 @@ +# ReplyKeyboardMarkup + +## Description + +This object represents a custom keyboard with reply options (see Introduction to bots for details and examples). + + +## Attributes + +| Name | Type | Description | +| - | - | - | +| `keyboard` | `#!python List[List[KeyboardButton]]` | Array of button rows, each represented by an Array of KeyboardButton objects | +| `resize_keyboard` | `#!python Optional[bool]` | 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` | `#!python Optional[bool]` | 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` | `#!python Optional[bool]` | 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 Message object; 2) if the bot's message is a reply (has reply_to_message_id), sender of the original message. | + + + +## Location + +- `from aiogram.types import ReplyKeyboardMarkup` +- `from aiogram.api.types import ReplyKeyboardMarkup` +- `from aiogram.api.types.reply_keyboard_markup import ReplyKeyboardMarkup` + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#replykeyboardmarkup) +- [aiogram.types.KeyboardButton](../types/keyboard_button.md) diff --git a/docs/api/types/reply_keyboard_remove.md b/docs/api/types/reply_keyboard_remove.md new file mode 100644 index 00000000..d15a7243 --- /dev/null +++ b/docs/api/types/reply_keyboard_remove.md @@ -0,0 +1,25 @@ +# ReplyKeyboardRemove + +## Description + +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). + + +## Attributes + +| Name | Type | Description | +| - | - | - | +| `remove_keyboard` | `#!python 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 ReplyKeyboardMarkup) | +| `selective` | `#!python Optional[bool]` | 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 Message object; 2) if the bot's message is a reply (has reply_to_message_id), sender of the original message. | + + + +## Location + +- `from aiogram.types import ReplyKeyboardRemove` +- `from aiogram.api.types import ReplyKeyboardRemove` +- `from aiogram.api.types.reply_keyboard_remove import ReplyKeyboardRemove` + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#replykeyboardremove) diff --git a/docs/api/types/response_parameters.md b/docs/api/types/response_parameters.md new file mode 100644 index 00000000..0b035922 --- /dev/null +++ b/docs/api/types/response_parameters.md @@ -0,0 +1,25 @@ +# ResponseParameters + +## Description + +Contains information about why a request was unsuccessful. + + +## Attributes + +| Name | Type | Description | +| - | - | - | +| `migrate_to_chat_id` | `#!python Optional[int]` | 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` | `#!python Optional[int]` | Optional. In case of exceeding flood control, the number of seconds left to wait before the request can be repeated | + + + +## Location + +- `from aiogram.types import ResponseParameters` +- `from aiogram.api.types import ResponseParameters` +- `from aiogram.api.types.response_parameters import ResponseParameters` + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#responseparameters) diff --git a/docs/api/types/shipping_address.md b/docs/api/types/shipping_address.md new file mode 100644 index 00000000..92d9ca18 --- /dev/null +++ b/docs/api/types/shipping_address.md @@ -0,0 +1,29 @@ +# ShippingAddress + +## Description + +This object represents a shipping address. + + +## Attributes + +| Name | Type | Description | +| - | - | - | +| `country_code` | `#!python str` | ISO 3166-1 alpha-2 country code | +| `state` | `#!python str` | State, if applicable | +| `city` | `#!python str` | City | +| `street_line1` | `#!python str` | First line for the address | +| `street_line2` | `#!python str` | Second line for the address | +| `post_code` | `#!python str` | Address post code | + + + +## Location + +- `from aiogram.types import ShippingAddress` +- `from aiogram.api.types import ShippingAddress` +- `from aiogram.api.types.shipping_address import ShippingAddress` + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#shippingaddress) diff --git a/docs/api/types/shipping_option.md b/docs/api/types/shipping_option.md new file mode 100644 index 00000000..a2120252 --- /dev/null +++ b/docs/api/types/shipping_option.md @@ -0,0 +1,27 @@ +# ShippingOption + +## Description + +This object represents one shipping option. + + +## Attributes + +| Name | Type | Description | +| - | - | - | +| `id` | `#!python str` | Shipping option identifier | +| `title` | `#!python str` | Option title | +| `prices` | `#!python List[LabeledPrice]` | List of price portions | + + + +## Location + +- `from aiogram.types import ShippingOption` +- `from aiogram.api.types import ShippingOption` +- `from aiogram.api.types.shipping_option import ShippingOption` + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#shippingoption) +- [aiogram.types.LabeledPrice](../types/labeled_price.md) diff --git a/docs/api/types/shipping_query.md b/docs/api/types/shipping_query.md new file mode 100644 index 00000000..5b65a13d --- /dev/null +++ b/docs/api/types/shipping_query.md @@ -0,0 +1,29 @@ +# ShippingQuery + +## Description + +This object contains information about an incoming shipping query. + + +## Attributes + +| Name | Type | Description | +| - | - | - | +| `id` | `#!python str` | Unique query identifier | +| `from_user` | `#!python User` | User who sent the query | +| `invoice_payload` | `#!python str` | Bot specified invoice payload | +| `shipping_address` | `#!python ShippingAddress` | User specified shipping address | + + + +## Location + +- `from aiogram.types import ShippingQuery` +- `from aiogram.api.types import ShippingQuery` +- `from aiogram.api.types.shipping_query import ShippingQuery` + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#shippingquery) +- [aiogram.types.ShippingAddress](../types/shipping_address.md) +- [aiogram.types.User](../types/user.md) diff --git a/docs/api/types/sticker.md b/docs/api/types/sticker.md new file mode 100644 index 00000000..ff945b24 --- /dev/null +++ b/docs/api/types/sticker.md @@ -0,0 +1,34 @@ +# Sticker + +## Description + +This object represents a sticker. + + +## Attributes + +| Name | Type | Description | +| - | - | - | +| `file_id` | `#!python str` | Identifier for this file | +| `width` | `#!python int` | Sticker width | +| `height` | `#!python int` | Sticker height | +| `is_animated` | `#!python bool` | True, if the sticker is animated | +| `thumb` | `#!python Optional[PhotoSize]` | Optional. Sticker thumbnail in the .webp or .jpg format | +| `emoji` | `#!python Optional[str]` | Optional. Emoji associated with the sticker | +| `set_name` | `#!python Optional[str]` | Optional. Name of the sticker set to which the sticker belongs | +| `mask_position` | `#!python Optional[MaskPosition]` | Optional. For mask stickers, the position where the mask should be placed | +| `file_size` | `#!python Optional[int]` | Optional. File size | + + + +## Location + +- `from aiogram.types import Sticker` +- `from aiogram.api.types import Sticker` +- `from aiogram.api.types.sticker import Sticker` + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#sticker) +- [aiogram.types.MaskPosition](../types/mask_position.md) +- [aiogram.types.PhotoSize](../types/photo_size.md) diff --git a/docs/api/types/sticker_set.md b/docs/api/types/sticker_set.md new file mode 100644 index 00000000..91f4909a --- /dev/null +++ b/docs/api/types/sticker_set.md @@ -0,0 +1,29 @@ +# StickerSet + +## Description + +This object represents a sticker set. + + +## Attributes + +| Name | Type | Description | +| - | - | - | +| `name` | `#!python str` | Sticker set name | +| `title` | `#!python str` | Sticker set title | +| `is_animated` | `#!python bool` | True, if the sticker set contains animated stickers | +| `contains_masks` | `#!python bool` | True, if the sticker set contains masks | +| `stickers` | `#!python List[Sticker]` | List of all set stickers | + + + +## Location + +- `from aiogram.types import StickerSet` +- `from aiogram.api.types import StickerSet` +- `from aiogram.api.types.sticker_set import StickerSet` + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#stickerset) +- [aiogram.types.Sticker](../types/sticker.md) diff --git a/docs/api/types/successful_payment.md b/docs/api/types/successful_payment.md new file mode 100644 index 00000000..21cb5609 --- /dev/null +++ b/docs/api/types/successful_payment.md @@ -0,0 +1,31 @@ +# SuccessfulPayment + +## Description + +This object contains basic information about a successful payment. + + +## Attributes + +| Name | Type | Description | +| - | - | - | +| `currency` | `#!python str` | Three-letter ISO 4217 currency code | +| `total_amount` | `#!python 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). | +| `invoice_payload` | `#!python str` | Bot specified invoice payload | +| `telegram_payment_charge_id` | `#!python str` | Telegram payment identifier | +| `provider_payment_charge_id` | `#!python str` | Provider payment identifier | +| `shipping_option_id` | `#!python Optional[str]` | Optional. Identifier of the shipping option chosen by the user | +| `order_info` | `#!python Optional[OrderInfo]` | Optional. Order info provided by the user | + + + +## Location + +- `from aiogram.types import SuccessfulPayment` +- `from aiogram.api.types import SuccessfulPayment` +- `from aiogram.api.types.successful_payment import SuccessfulPayment` + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#successfulpayment) +- [aiogram.types.OrderInfo](../types/order_info.md) diff --git a/docs/api/types/update.md b/docs/api/types/update.md new file mode 100644 index 00000000..b1f95eba --- /dev/null +++ b/docs/api/types/update.md @@ -0,0 +1,43 @@ +# Update + +## Description + +This object represents an incoming update. + +At most one of the optional parameters can be present in any given update. + + +## Attributes + +| Name | Type | Description | +| - | - | - | +| `update_id` | `#!python 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. | +| `message` | `#!python Optional[Message]` | Optional. New incoming message of any kind — text, photo, sticker, etc. | +| `edited_message` | `#!python Optional[Message]` | Optional. New version of a message that is known to the bot and was edited | +| `channel_post` | `#!python Optional[Message]` | Optional. New incoming channel post of any kind — text, photo, sticker, etc. | +| `edited_channel_post` | `#!python Optional[Message]` | Optional. New version of a channel post that is known to the bot and was edited | +| `inline_query` | `#!python Optional[InlineQuery]` | Optional. New incoming inline query | +| `chosen_inline_result` | `#!python Optional[ChosenInlineResult]` | 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` | `#!python Optional[CallbackQuery]` | Optional. New incoming callback query | +| `shipping_query` | `#!python Optional[ShippingQuery]` | Optional. New incoming shipping query. Only for invoices with flexible price | +| `pre_checkout_query` | `#!python Optional[PreCheckoutQuery]` | Optional. New incoming pre-checkout query. Contains full information about checkout | +| `poll` | `#!python Optional[Poll]` | Optional. New poll state. Bots receive only updates about stopped polls and polls, which are sent by the bot | + + + +## Location + +- `from aiogram.types import Update` +- `from aiogram.api.types import Update` +- `from aiogram.api.types.update import Update` + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#update) +- [aiogram.types.Poll](../types/poll.md) +- [aiogram.types.CallbackQuery](../types/callback_query.md) +- [aiogram.types.InlineQuery](../types/inline_query.md) +- [aiogram.types.ChosenInlineResult](../types/chosen_inline_result.md) +- [aiogram.types.Message](../types/message.md) +- [aiogram.types.ShippingQuery](../types/shipping_query.md) +- [aiogram.types.PreCheckoutQuery](../types/pre_checkout_query.md) diff --git a/docs/api/types/user.md b/docs/api/types/user.md new file mode 100644 index 00000000..5925fb14 --- /dev/null +++ b/docs/api/types/user.md @@ -0,0 +1,29 @@ +# User + +## Description + +This object represents a Telegram user or bot. + + +## Attributes + +| Name | Type | Description | +| - | - | - | +| `id` | `#!python int` | Unique identifier for this user or bot | +| `is_bot` | `#!python bool` | True, if this user is a bot | +| `first_name` | `#!python str` | User‘s or bot’s first name | +| `last_name` | `#!python Optional[str]` | Optional. User‘s or bot’s last name | +| `username` | `#!python Optional[str]` | Optional. User‘s or bot’s username | +| `language_code` | `#!python Optional[str]` | Optional. IETF language tag of the user's language | + + + +## Location + +- `from aiogram.types import User` +- `from aiogram.api.types import User` +- `from aiogram.api.types.user import User` + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#user) diff --git a/docs/api/types/user_profile_photos.md b/docs/api/types/user_profile_photos.md new file mode 100644 index 00000000..a62a2ed9 --- /dev/null +++ b/docs/api/types/user_profile_photos.md @@ -0,0 +1,26 @@ +# UserProfilePhotos + +## Description + +This object represent a user's profile pictures. + + +## Attributes + +| Name | Type | Description | +| - | - | - | +| `total_count` | `#!python int` | Total number of profile pictures the target user has | +| `photos` | `#!python List[List[PhotoSize]]` | Requested profile pictures (in up to 4 sizes each) | + + + +## Location + +- `from aiogram.types import UserProfilePhotos` +- `from aiogram.api.types import UserProfilePhotos` +- `from aiogram.api.types.user_profile_photos import UserProfilePhotos` + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#userprofilephotos) +- [aiogram.types.PhotoSize](../types/photo_size.md) diff --git a/docs/api/types/venue.md b/docs/api/types/venue.md new file mode 100644 index 00000000..5d0b9f09 --- /dev/null +++ b/docs/api/types/venue.md @@ -0,0 +1,29 @@ +# Venue + +## Description + +This object represents a venue. + + +## Attributes + +| Name | Type | Description | +| - | - | - | +| `location` | `#!python Location` | Venue location | +| `title` | `#!python str` | Name of the venue | +| `address` | `#!python str` | Address of the venue | +| `foursquare_id` | `#!python Optional[str]` | Optional. Foursquare identifier of the venue | +| `foursquare_type` | `#!python Optional[str]` | Optional. Foursquare type of the venue. (For example, 'arts_entertainment/default', 'arts_entertainment/aquarium' or 'food/icecream'.) | + + + +## Location + +- `from aiogram.types import Venue` +- `from aiogram.api.types import Venue` +- `from aiogram.api.types.venue import Venue` + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#venue) +- [aiogram.types.Location](../types/location.md) diff --git a/docs/api/types/video.md b/docs/api/types/video.md new file mode 100644 index 00000000..9e368de2 --- /dev/null +++ b/docs/api/types/video.md @@ -0,0 +1,31 @@ +# Video + +## Description + +This object represents a video file. + + +## Attributes + +| Name | Type | Description | +| - | - | - | +| `file_id` | `#!python str` | Identifier for this file | +| `width` | `#!python int` | Video width as defined by sender | +| `height` | `#!python int` | Video height as defined by sender | +| `duration` | `#!python int` | Duration of the video in seconds as defined by sender | +| `thumb` | `#!python Optional[PhotoSize]` | Optional. Video thumbnail | +| `mime_type` | `#!python Optional[str]` | Optional. Mime type of a file as defined by sender | +| `file_size` | `#!python Optional[int]` | Optional. File size | + + + +## Location + +- `from aiogram.types import Video` +- `from aiogram.api.types import Video` +- `from aiogram.api.types.video import Video` + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#video) +- [aiogram.types.PhotoSize](../types/photo_size.md) diff --git a/docs/api/types/video_note.md b/docs/api/types/video_note.md new file mode 100644 index 00000000..9222b6be --- /dev/null +++ b/docs/api/types/video_note.md @@ -0,0 +1,29 @@ +# VideoNote + +## Description + +This object represents a video message (available in Telegram apps as of v.4.0). + + +## Attributes + +| Name | Type | Description | +| - | - | - | +| `file_id` | `#!python str` | Identifier for this file | +| `length` | `#!python int` | Video width and height (diameter of the video message) as defined by sender | +| `duration` | `#!python int` | Duration of the video in seconds as defined by sender | +| `thumb` | `#!python Optional[PhotoSize]` | Optional. Video thumbnail | +| `file_size` | `#!python Optional[int]` | Optional. File size | + + + +## Location + +- `from aiogram.types import VideoNote` +- `from aiogram.api.types import VideoNote` +- `from aiogram.api.types.video_note import VideoNote` + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#videonote) +- [aiogram.types.PhotoSize](../types/photo_size.md) diff --git a/docs/api/types/voice.md b/docs/api/types/voice.md new file mode 100644 index 00000000..776e920b --- /dev/null +++ b/docs/api/types/voice.md @@ -0,0 +1,27 @@ +# Voice + +## Description + +This object represents a voice note. + + +## Attributes + +| Name | Type | Description | +| - | - | - | +| `file_id` | `#!python str` | Identifier for this file | +| `duration` | `#!python int` | Duration of the audio in seconds as defined by sender | +| `mime_type` | `#!python Optional[str]` | Optional. MIME type of the file as defined by sender | +| `file_size` | `#!python Optional[int]` | Optional. File size | + + + +## Location + +- `from aiogram.types import Voice` +- `from aiogram.api.types import Voice` +- `from aiogram.api.types.voice import Voice` + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#voice) diff --git a/docs/api/types/webhook_info.md b/docs/api/types/webhook_info.md new file mode 100644 index 00000000..ffa81148 --- /dev/null +++ b/docs/api/types/webhook_info.md @@ -0,0 +1,30 @@ +# WebhookInfo + +## Description + +Contains information about the current status of a webhook. + + +## Attributes + +| Name | Type | Description | +| - | - | - | +| `url` | `#!python str` | Webhook URL, may be empty if webhook is not set up | +| `has_custom_certificate` | `#!python bool` | True, if a custom certificate was provided for webhook certificate checks | +| `pending_update_count` | `#!python int` | Number of updates awaiting delivery | +| `last_error_date` | `#!python Optional[int]` | Optional. Unix time for the most recent error that happened when trying to deliver an update via webhook | +| `last_error_message` | `#!python Optional[str]` | Optional. Error message in human-readable format for the most recent error that happened when trying to deliver an update via webhook | +| `max_connections` | `#!python Optional[int]` | Optional. Maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery | +| `allowed_updates` | `#!python Optional[List[str]]` | Optional. A list of update types the bot is subscribed to. Defaults to all update types | + + + +## Location + +- `from aiogram.types import WebhookInfo` +- `from aiogram.api.types import WebhookInfo` +- `from aiogram.api.types.webhook_info import WebhookInfo` + +## Related pages: + +- [Official documentation](https://core.telegram.org/bots/api#webhookinfo) diff --git a/docs/index.md b/docs/index.md index b4106a9a..1a370fa3 100644 --- a/docs/index.md +++ b/docs/index.md @@ -11,3 +11,53 @@ Documentation for version 3.0 [![\[Telegram\] aiogram live](https://img.shields.io/badge/telegram-aiogram-blue.svg?style=flat-square)](https://t.me/aiogram_live) **aiogram** modern and fully asynchronous framework for [Telegram Bot API](https://core.telegram.org/bots/api) written in Python 3.7 with [asyncio](https://docs.python.org/3/library/asyncio.html) and [aiohttp](https://github.com/aio-libs/aiohttp). It helps you to make your bots faster and simpler. + + +## Features + +- Asynchronous +- Finite State Machine +- Middlewares +- [Replies into Webhook](https://core.telegram.org/bots/faq#how-can-i-make-requests-in-response-to-updates) +- Updates router (Blueprints) + + +!!! note + Before start using **aiogram** is highly recommend to know how to work with [asyncio](https://docs.python.org/3/library/asyncio.html). + + Also if you has questions you can go to uor community chat s in Telegram: + + - [English language](https://t.me/aiogram) + - [Russian language](https://t.me/aiogram_ru) + + +## Task list for 3.0 + +- [ ] Telegram API features + - [x] Rewrite Telegram types using **pydantic** + - [x] Rewrite Telegram methods using **pydantic** + - [x] Rewrite bot class + - [ ] ... +- [ ] Dispatcher features + - [ ] Blueprints/Routers + - [ ] Refactor FSM + - [ ] Refactor filters +- [ ] Tests + - [ ] API + - [ ] Sessions + - [ ] Types + - [ ] Methods + - [ ] Client + - [ ] Dispatcher + - [ ] ... + - [ ] Utils + - [x] Helper + - [ ] ... +- [ ] CI/CD + - [ ] Publish to PyPi on tag + - [ ] Build docs on push + - [ ] Code style + - [ ] Test with coverage on pull-request + - [ ] Test with coverage on push + - [ ] mypy on pull-request + - [ ] Flake8 on pull-request diff --git a/docs/install.md b/docs/install.md index ed908e2a..332f7688 100644 --- a/docs/install.md +++ b/docs/install.md @@ -10,5 +10,10 @@ pip install -U aiogram pipenv install aiogram ``` +## Using poetry +```bash +poetry add aiogram +``` + ## Using AUR *aiogram* is also available in Arch User Repository, so you can install this library on any Arch-based distribution like ArchLinux, Antergos, Manjaro, etc. To do this, use your favorite AUR-helper and install [python-aiogram](https://aur.archlinux.org/packages/python-aiogram/) package. diff --git a/mkdocs.yml b/mkdocs.yml index 35b80efe..b19306fd 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -16,13 +16,198 @@ theme: plugins: - search + markdown_extensions: - admonition - codehilite + - mkautodoc - footnotes - toc: permalink: true + - pymdownx.emoji: + emoji_generator: !!python/name:pymdownx.emoji.to_svg + - pymdownx.tasklist + - pymdownx.inlinehilite nav: - index.md - install.md + - Bot API: + - api/index.md + - Methods: + - Getting updates: + - api/methods/get_updates.md + - api/methods/set_webhook.md + - api/methods/delete_webhook.md + - api/methods/get_webhook_info.md + - Available methods: + - api/methods/get_me.md + - api/methods/send_message.md + - api/methods/forward_message.md + - api/methods/send_photo.md + - api/methods/send_audio.md + - api/methods/send_document.md + - api/methods/send_video.md + - api/methods/send_animation.md + - api/methods/send_voice.md + - api/methods/send_video_note.md + - api/methods/send_media_group.md + - api/methods/send_location.md + - api/methods/edit_message_live_location.md + - api/methods/stop_message_live_location.md + - api/methods/send_venue.md + - api/methods/send_contact.md + - api/methods/send_poll.md + - api/methods/send_chat_action.md + - api/methods/get_user_profile_photos.md + - api/methods/get_file.md + - api/methods/kick_chat_member.md + - api/methods/unban_chat_member.md + - api/methods/restrict_chat_member.md + - api/methods/promote_chat_member.md + - api/methods/set_chat_permissions.md + - api/methods/export_chat_invite_link.md + - api/methods/set_chat_photo.md + - api/methods/delete_chat_photo.md + - api/methods/set_chat_title.md + - api/methods/set_chat_description.md + - api/methods/pin_chat_message.md + - api/methods/unpin_chat_message.md + - api/methods/leave_chat.md + - api/methods/get_chat.md + - api/methods/get_chat_administrators.md + - api/methods/get_chat_members_count.md + - api/methods/get_chat_member.md + - api/methods/set_chat_sticker_set.md + - api/methods/delete_chat_sticker_set.md + - api/methods/answer_callback_query.md + - Updating messages: + - api/methods/edit_message_text.md + - api/methods/edit_message_caption.md + - api/methods/edit_message_media.md + - api/methods/edit_message_reply_markup.md + - api/methods/stop_poll.md + - api/methods/delete_message.md + - Stickers: + - api/methods/send_sticker.md + - api/methods/get_sticker_set.md + - api/methods/upload_sticker_file.md + - api/methods/create_new_sticker_set.md + - api/methods/add_sticker_to_set.md + - api/methods/set_sticker_position_in_set.md + - api/methods/delete_sticker_from_set.md + - Inline mode: + - api/methods/answer_inline_query.md + - Payments: + - api/methods/send_invoice.md + - api/methods/answer_shipping_query.md + - api/methods/answer_pre_checkout_query.md + - Telegram Passport: + - api/methods/set_passport_data_errors.md + - Games: + - api/methods/send_game.md + - api/methods/set_game_score.md + - api/methods/get_game_high_scores.md + - Types: + - Getting updates: + - api/types/update.md + - api/types/webhook_info.md + - Available types: + - api/types/user.md + - api/types/chat.md + - api/types/message.md + - api/types/message_entity.md + - api/types/photo_size.md + - api/types/audio.md + - api/types/document.md + - api/types/video.md + - api/types/animation.md + - api/types/voice.md + - api/types/video_note.md + - api/types/contact.md + - api/types/location.md + - api/types/venue.md + - api/types/poll_option.md + - api/types/poll.md + - api/types/user_profile_photos.md + - api/types/file.md + - api/types/reply_keyboard_markup.md + - api/types/keyboard_button.md + - api/types/reply_keyboard_remove.md + - api/types/inline_keyboard_markup.md + - api/types/inline_keyboard_button.md + - api/types/login_url.md + - api/types/callback_query.md + - api/types/force_reply.md + - api/types/chat_photo.md + - api/types/chat_member.md + - api/types/chat_permissions.md + - api/types/response_parameters.md + - api/types/input_media.md + - api/types/input_media_photo.md + - api/types/input_media_video.md + - api/types/input_media_animation.md + - api/types/input_media_audio.md + - api/types/input_media_document.md + - api/types/input_file.md + - Stickers: + - api/types/sticker.md + - api/types/sticker_set.md + - api/types/mask_position.md + - Inline mode: + - api/types/inline_query.md + - api/types/inline_query_result.md + - api/types/inline_query_result_article.md + - api/types/inline_query_result_photo.md + - api/types/inline_query_result_gif.md + - api/types/inline_query_result_mpeg4_gif.md + - api/types/inline_query_result_video.md + - api/types/inline_query_result_audio.md + - api/types/inline_query_result_voice.md + - api/types/inline_query_result_document.md + - api/types/inline_query_result_location.md + - api/types/inline_query_result_venue.md + - api/types/inline_query_result_contact.md + - api/types/inline_query_result_game.md + - api/types/inline_query_result_cached_photo.md + - api/types/inline_query_result_cached_gif.md + - api/types/inline_query_result_cached_mpeg4_gif.md + - api/types/inline_query_result_cached_sticker.md + - api/types/inline_query_result_cached_document.md + - api/types/inline_query_result_cached_video.md + - api/types/inline_query_result_cached_voice.md + - api/types/inline_query_result_cached_audio.md + - api/types/input_message_content.md + - api/types/input_text_message_content.md + - api/types/input_location_message_content.md + - api/types/input_venue_message_content.md + - api/types/input_contact_message_content.md + - api/types/chosen_inline_result.md + - Payments: + - api/types/labeled_price.md + - api/types/invoice.md + - api/types/shipping_address.md + - api/types/order_info.md + - api/types/shipping_option.md + - api/types/successful_payment.md + - api/types/shipping_query.md + - api/types/pre_checkout_query.md + - Telegram Passport: + - api/types/passport_data.md + - api/types/passport_file.md + - api/types/encrypted_passport_element.md + - api/types/encrypted_credentials.md + - api/types/passport_element_error.md + - api/types/passport_element_error_data_field.md + - api/types/passport_element_error_front_side.md + - api/types/passport_element_error_reverse_side.md + - api/types/passport_element_error_selfie.md + - api/types/passport_element_error_file.md + - api/types/passport_element_error_files.md + - api/types/passport_element_error_translation_file.md + - api/types/passport_element_error_translation_files.md + - api/types/passport_element_error_unspecified.md + - Games: + - api/types/game.md + - api/types/callback_game.md + - api/types/game_high_score.md diff --git a/poetry.lock b/poetry.lock index a04eb8c9..011a77a8 100644 --- a/poetry.lock +++ b/poetry.lock @@ -221,7 +221,7 @@ six = "*" tornado = "*" [[package]] -category = "dev" +category = "main" description = "Python implementation of Markdown." name = "markdown" optional = false @@ -247,6 +247,14 @@ optional = false python-versions = "*" version = "0.6.1" +[[package]] +category = "main" +description = "AutoDoc for MarkDown" +name = "mkautodoc" +optional = false +python-versions = ">=3.6" +version = "0.1.0" + [[package]] category = "dev" description = "Project documentation with Markdown." @@ -340,7 +348,7 @@ pyparsing = ">=2.0.2" six = "*" [[package]] -category = "dev" +category = "main" description = "Backport of PEP 562." name = "pep562" optional = false @@ -401,7 +409,7 @@ python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" version = "2.4.2" [[package]] -category = "dev" +category = "main" description = "Extension pack for Python Markdown." name = "pymdown-extensions" optional = false @@ -594,7 +602,7 @@ version = "0.6.0" more-itertools = "*" [metadata] -content-hash = "36e7679dedd3bcc50c24575b35da90a64bd33ef54d7862db94159dfc7ecaf28a" +content-hash = "d474927e760afc0dee66f6dc3a9f1b1a9faae032353b01cb739509e34938d414" python-versions = "^3.7" [metadata.hashes] @@ -624,6 +632,7 @@ livereload = ["78d55f2c268a8823ba499305dcac64e28ddeb9a92571e12d543cd304faf5817b" markdown = ["2e50876bcdd74517e7b71f3e7a76102050edec255b3983403f1a63e7c8a41e7a", "56a46ac655704b91e5b7e6326ce43d5ef72411376588afa1dd90e881b83c7e8c"] markupsafe = ["00bc623926325b26bb9605ae9eae8a215691f33cae5df11ca5424f06f2d1f473", "09027a7803a62ca78792ad89403b1b7a73a01c8cb65909cd876f7fcebd79b161", "09c4b7f37d6c648cb13f9230d847adf22f8171b1ccc4d5682398e77f40309235", "1027c282dad077d0bae18be6794e6b6b8c91d58ed8a8d89a89d59693b9131db5", "24982cc2533820871eba85ba648cd53d8623687ff11cbb805be4ff7b4c971aff", "29872e92839765e546828bb7754a68c418d927cd064fd4708fab9fe9c8bb116b", "43a55c2930bbc139570ac2452adf3d70cdbb3cfe5912c71cdce1c2c6bbd9c5d1", "46c99d2de99945ec5cb54f23c8cd5689f6d7177305ebff350a58ce5f8de1669e", "500d4957e52ddc3351cabf489e79c91c17f6e0899158447047588650b5e69183", "535f6fc4d397c1563d08b88e485c3496cf5784e927af890fb3c3aac7f933ec66", "62fe6c95e3ec8a7fad637b7f3d372c15ec1caa01ab47926cfdf7a75b40e0eac1", "6dd73240d2af64df90aa7c4e7481e23825ea70af4b4922f8ede5b9e35f78a3b1", "717ba8fe3ae9cc0006d7c451f0bb265ee07739daf76355d06366154ee68d221e", "79855e1c5b8da654cf486b830bd42c06e8780cea587384cf6545b7d9ac013a0b", "7c1699dfe0cf8ff607dbdcc1e9b9af1755371f92a68f706051cc8c37d447c905", "88e5fcfb52ee7b911e8bb6d6aa2fd21fbecc674eadd44118a9cc3863f938e735", "8defac2f2ccd6805ebf65f5eeb132adcf2ab57aa11fdf4c0dd5169a004710e7d", "98c7086708b163d425c67c7a91bad6e466bb99d797aa64f965e9d25c12111a5e", "9add70b36c5666a2ed02b43b335fe19002ee5235efd4b8a89bfcf9005bebac0d", "9bf40443012702a1d2070043cb6291650a0841ece432556f784f004937f0f32c", "ade5e387d2ad0d7ebf59146cc00c8044acbd863725f887353a10df825fc8ae21", "b00c1de48212e4cc9603895652c5c410df699856a2853135b3967591e4beebc2", "b1282f8c00509d99fef04d8ba936b156d419be841854fe901d8ae224c59f0be5", "b2051432115498d3562c084a49bba65d97cf251f5a331c64a12ee7e04dacc51b", "ba59edeaa2fc6114428f1637ffff42da1e311e29382d81b339c1817d37ec93c6", "c8716a48d94b06bb3b2524c2b77e055fb313aeb4ea620c8dd03a105574ba704f", "cd5df75523866410809ca100dc9681e301e3c27567cf498077e8551b6d20e42f", "e249096428b3ae81b08327a63a485ad0878de3fb939049038579ac0ef61e17e7"] mccabe = ["ab8a6258860da4b6677da4bd2fe5dc2c659cff31b3ee4f7f5d64e79735b80d42", "dd8d182285a0fe56bace7f45b5e7d1a6ebcbf524e8f3bd87eb0f125271b8831f"] +mkautodoc = ["7c2595f40276b356e576ce7e343338f8b4fa1e02ea904edf33fadf82b68ca67c"] mkdocs = ["17d34329aad75d5de604b9ed4e31df3a4d235afefdc46ce7b1964fddb2e1e939", "8cc8b38325456b9e942c981a209eaeb1e9f3f77b493ad755bfef889b9c8d356a"] mkdocs-material = ["a5246b550299d00a135a3f739e70ac6db73d7127480f0fecbda113d0095a674a", "e4a9ac73db7c65fdae1dbd248091e4b0a3f5db3e6bf87a46bb457db013a045e4"] mkdocs-minify-plugin = ["3000a5069dd0f42f56a8aaf7fd5ea1222c67487949617e39585d6b6434b074b6", "d54fdd5be6843dd29fd7af2f7fdd20a9eb4db46f1f6bed914e03b2f58d2d488e"] diff --git a/pyproject.toml b/pyproject.toml index 16ae3445..81399c96 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -17,6 +17,8 @@ Babel = "^2.7" pytest-cov = "^2.8" aiofiles = "^0.4.0" pytest-mock = "^1.11" +pymdown-extensions = "^6.1" +mkautodoc = "^0.1.0" [tool.poetry.dev-dependencies] black = {version = "^18.3-alpha.0", allows-prereleases = true}