mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-08 17:13:56 +00:00
Dev 3.x api 4.8 (#317)
* AIOG-T-20 Bot API 4.8 * AIOG-T-20 Update aliases * AIOG-T-20 Add parse mode passing in sendPoll method * AIOG-T-20 Small changes in docs * AIOG-T-20 Revert overriding remove keyboard default value and add tests * AIOG-T-20 Bot API 4.8
This commit is contained in:
parent
15bcc0ba9f
commit
6be0b36305
104 changed files with 312 additions and 175 deletions
|
|
@ -1 +1 @@
|
|||
4.7
|
||||
4.8
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ Full list of methods can be found in section "[Methods](methods/index.md)"
|
|||
All types is also wrapped with [pydantic](https://pydantic-docs.helpmanual.io/) 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
|
||||
- name `from` was renamed to `from_user` in due to `from` is an [keyword in python](https://docs.python.org/3/reference/lexical_analysis.html#keywords)
|
||||
- timestamps has `datetime.datetime` type instead of `int`
|
||||
- InputFile is used for sending files and is not use `pydantic.BaseModel` as base class
|
||||
|
||||
|
|
@ -37,3 +37,23 @@ Constructor specification:
|
|||
| `parse_mode` | `#!python3 Optional[str]` | Default parse mode. If specified it will be propagated into the API methods at runtime. |
|
||||
|
||||
This class has aliases for all API methods and named in `lower_camel_case`. For example `sendMessage` named `send_message` and has the same specification with all class-based methods.
|
||||
|
||||
Here you can pass default parse mode (argument `parse_mode`) and this value will be used in all API methods automatically.
|
||||
|
||||
|
||||
## Usage
|
||||
```python3
|
||||
import asyncio
|
||||
from os import getenv
|
||||
|
||||
from aiogram import Bot
|
||||
|
||||
|
||||
async def main():
|
||||
async with Bot(token=getenv("TELEGRAM_TOKEN"), parse_mode="HTML").context() as bot:
|
||||
await bot.send_message(61043901, "<b>Hello, World!</b>")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
asyncio.run(main())
|
||||
```
|
||||
|
|
|
|||
|
|
@ -11,8 +11,8 @@ Use this method to add a new sticker to a set created by the bot. You must use e
|
|||
| - | - | - |
|
||||
| `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 |
|
||||
| `png_sticker` | `#!python3 Optional[Union[InputFile, str]]` | Optional. 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. |
|
||||
| `tgs_sticker` | `#!python3 Optional[InputFile]` | Optional. TGS animation with the sticker, uploaded using multipart/form-data. See https://core.telegram.org/animated_stickers#technical-requirements for technical requirements |
|
||||
| `mask_position` | `#!python3 Optional[MaskPosition]` | Optional. A JSON-serialized object for position where the mask should be placed on faces |
|
||||
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ Alternatively, the user can be redirected to the specified Game URL. For this op
|
|||
| `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. |
|
||||
| `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. |
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ Use this method to edit captions of messages. On success, if edited message is s
|
|||
| `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, 0-1024 characters after entities parsing |
|
||||
| `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. |
|
||||
| `parse_mode` | `#!python3 Optional[str]` | Optional. Mode for parsing entities in the message caption. See formatting options for more details. |
|
||||
| `reply_markup` | `#!python3 Optional[InlineKeyboardMarkup]` | Optional. A JSON-serialized object for an inline keyboard. |
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ Use this method to edit text and game messages. On success, if edited message is
|
|||
| `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. |
|
||||
| `parse_mode` | `#!python3 Optional[str]` | Optional. Mode for parsing entities in the message text. See formatting options for more details. |
|
||||
| `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. |
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
Use this method to generate a new invite link for a chat; any previously generated link is revoked. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Returns the new invite link as String on success.
|
||||
|
||||
Note: Each administrator in a chat generates their own invite links. Bots can't use invite links generated by other administrators. If you want your bot to work with invite links, it will need to generate its own link using exportChatInviteLink – after this the link will become available to the bot via the getChat method. If your bot needs to generate a new invite link replacing its previous one, use exportChatInviteLink again.
|
||||
Note: Each administrator in a chat generates their own invite links. Bots can't use invite links generated by other administrators. If you want your bot to work with invite links, it will need to generate its own link using 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
|
||||
|
|
|
|||
|
|
@ -2,9 +2,9 @@
|
|||
|
||||
## 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.
|
||||
Use this method to get data for high score tables. Will return the score of the specified user and several of their neighbors in a game. On success, returns an Array of GameHighScore objects.
|
||||
|
||||
This method will currently return scores for the target user, plus two of 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.
|
||||
This method will currently return scores for the target user, plus two of their closest neighbors on each side. Will also return the top three users if the user and his neighbors are not among them. Please note that this behavior is subject to change.
|
||||
|
||||
|
||||
## Arguments
|
||||
|
|
@ -22,7 +22,7 @@ This method will currently return scores for the target user, plus two of his cl
|
|||
|
||||
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.
|
||||
Description: Will return the score of the specified user and several of their neighbors in a game. On success, returns an Array of GameHighScore objects. This method will currently return scores for the target user, plus two of their closest neighbors on each side. Will also return the top three users if the user and his neighbors are not among them.
|
||||
|
||||
|
||||
## Usage
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ Notes
|
|||
| 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. |
|
||||
| `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. A JSON-serialized list of the update types you want your bot to receive. For example, specify ['message', 'edited_channel_post', 'callback_query'] to only receive updates of these types. See Update for a complete list of available update types. Specify an empty list to receive all updates regardless of type (default). If not specified, the previous setting will be used. |
|
||||
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ Use this method to get a list of profile pictures for a user. Returns a UserProf
|
|||
| - | - | - |
|
||||
| `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. |
|
||||
| `limit` | `#!python3 Optional[int]` | Optional. Limits the number of photos to be retrieved. Values between 1-100 are accepted. Defaults to 100. |
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ Use this method to kick a user from a group, a supergroup or a channel. In the c
|
|||
| - | - | - |
|
||||
| `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 |
|
||||
| `until_date` | `#!python3 Optional[Union[datetime.datetime, datetime.timedelta, int]]` | 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 |
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ Use this method to promote or demote a user in a supergroup or a channel. The bo
|
|||
| `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) |
|
||||
| `can_promote_members` | `#!python3 Optional[bool]` | Optional. Pass True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by him) |
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ Use this method to restrict a user in a supergroup. The bot must be an administr
|
|||
| `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 |
|
||||
| `until_date` | `#!python3 Optional[Union[datetime.datetime, datetime.timedelta, int]]` | 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 |
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without s
|
|||
| `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://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. |
|
||||
| `caption` | `#!python3 Optional[str]` | Optional. Animation caption (may also be used when resending animation by file_id), 0-1024 characters after entities parsing |
|
||||
| `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. |
|
||||
| `parse_mode` | `#!python3 Optional[str]` | Optional. Mode for parsing entities in the animation caption. See formatting options for more details. |
|
||||
| `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. |
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ For sending voice messages, use the sendVoice method instead.
|
|||
| `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 after entities parsing |
|
||||
| `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. |
|
||||
| `parse_mode` | `#!python3 Optional[str]` | Optional. Mode for parsing entities in the audio caption. See formatting options for more details. |
|
||||
| `duration` | `#!python3 Optional[int]` | Optional. Duration of the audio in seconds |
|
||||
| `performer` | `#!python3 Optional[str]` | Optional. Performer |
|
||||
| `title` | `#!python3 Optional[str]` | Optional. Track name |
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ Use this method to send a dice, which will have a random value from 1 to 6. On s
|
|||
| 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) |
|
||||
| `emoji` | `#!python3 Optional[str]` | Optional. Emoji on which the dice throw animation is based. Currently, must be one of '' or ''. Defauts to '' |
|
||||
| `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. |
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ Use this method to send general files. On success, the sent Message is returned.
|
|||
| `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://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. |
|
||||
| `caption` | `#!python3 Optional[str]` | Optional. Document caption (may also be used when resending documents by file_id), 0-1024 characters after entities parsing |
|
||||
| `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. |
|
||||
| `parse_mode` | `#!python3 Optional[str]` | Optional. Mode for parsing entities in the document caption. See formatting options for more details. |
|
||||
| `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. |
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ Use this method to send a group of photos or videos as an album. On success, an
|
|||
| 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 |
|
||||
| `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 |
|
||||
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ Use this method to send text messages. On success, the sent Message is returned.
|
|||
| - | - | - |
|
||||
| `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, 1-4096 characters after entities parsing |
|
||||
| `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. |
|
||||
| `parse_mode` | `#!python3 Optional[str]` | Optional. Mode for parsing entities in the message text. See formatting options for more details. |
|
||||
| `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 |
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ Use this method to send photos. On success, the sent Message is returned.
|
|||
| `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 after entities parsing |
|
||||
| `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. |
|
||||
| `parse_mode` | `#!python3 Optional[str]` | Optional. Mode for parsing entities in the photo caption. See formatting options for more details. |
|
||||
| `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. |
|
||||
|
|
|
|||
|
|
@ -16,6 +16,10 @@ Use this method to send a native poll. On success, the sent Message is returned.
|
|||
| `type` | `#!python3 Optional[str]` | Optional. Poll type, 'quiz' or 'regular', defaults to 'regular' |
|
||||
| `allows_multiple_answers` | `#!python3 Optional[bool]` | Optional. True, if the poll allows multiple answers, ignored for polls in quiz mode, defaults to False |
|
||||
| `correct_option_id` | `#!python3 Optional[int]` | Optional. 0-based identifier of the correct answer option, required for polls in quiz mode |
|
||||
| `explanation` | `#!python3 Optional[str]` | Optional. Text that is shown when a user chooses an incorrect answer or taps on the lamp icon in a quiz-style poll, 0-200 characters with at most 2 line feeds after entities parsing |
|
||||
| `explanation_parse_mode` | `#!python3 Optional[str]` | Optional. Mode for parsing entities in the explanation. See formatting options for more details. |
|
||||
| `open_period` | `#!python3 Optional[int]` | Optional. Amount of time in seconds the poll will be active after creation, 5-600. Can't be used together with close_date. |
|
||||
| `close_date` | `#!python3 Optional[Union[datetime.datetime, datetime.timedelta, int]]` | Optional. Point in time (Unix timestamp) when the poll will be automatically closed. Must be at least 5 and no more than 600 seconds in the future. Can't be used together with open_period. |
|
||||
| `is_closed` | `#!python3 Optional[bool]` | Optional. Pass True, if the poll needs to be immediately closed. This can be useful for poll preview. |
|
||||
| `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 |
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ Use this method to send video files, Telegram clients support mp4 videos (other
|
|||
| `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://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. |
|
||||
| `caption` | `#!python3 Optional[str]` | Optional. Video caption (may also be used when resending videos by file_id), 0-1024 characters after entities parsing |
|
||||
| `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. |
|
||||
| `parse_mode` | `#!python3 Optional[str]` | Optional. Mode for parsing entities in the video caption. See formatting options for more details. |
|
||||
| `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 |
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ Use this method to send audio files, if you want Telegram clients to display the
|
|||
| `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 after entities parsing |
|
||||
| `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. |
|
||||
| `parse_mode` | `#!python3 Optional[str]` | Optional. Mode for parsing entities in the voice message caption. See formatting options for more details. |
|
||||
| `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 |
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ Use this method to upload a .PNG file with a sticker for later use in createNewS
|
|||
| 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. |
|
||||
| `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. |
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -12,13 +12,13 @@ This object contains information about one member of a chat.
|
|||
| `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' |
|
||||
| `custom_title` | `#!python Optional[str]` | Optional. Owner and administrators only. Custom title for this user |
|
||||
| `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 |
|
||||
| `until_date` | `#!python Optional[Union[datetime.datetime, datetime.timedelta, int]]` | 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_promote_members` | `#!python Optional[bool]` | Optional. Administrators only. True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by the user) |
|
||||
| `can_change_info` | `#!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 |
|
||||
|
|
|
|||
|
|
@ -2,14 +2,15 @@
|
|||
|
||||
## Description
|
||||
|
||||
This object represents a dice with random value from 1 to 6. (Yes, we're aware of the 'proper' singular of die. But it's awkward, and we decided to help it change. One dice at a time!)
|
||||
This object represents a dice with a random value from 1 to 6 for currently supported base emoji. (Yes, we're aware of the 'proper' singular of die. But it's awkward, and we decided to help it change. One dice at a time!)
|
||||
|
||||
|
||||
## Attributes
|
||||
|
||||
| Name | Type | Description |
|
||||
| - | - | - |
|
||||
| `value` | `#!python int` | Value of the dice, 1-6 |
|
||||
| `emoji` | `#!python str` | Emoji on which the dice throw animation is based |
|
||||
| `value` | `#!python int` | Value of the dice, 1-6 for currently supported base emoji |
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ This object represents one button of an inline keyboard. You must use exactly on
|
|||
| `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. |
|
||||
| `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. |
|
||||
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ Note: This will only work in Telegram versions released after 9 April, 2016. Old
|
|||
| `audio_url` | `#!python str` | A valid URL for the audio file |
|
||||
| `title` | `#!python str` | Title |
|
||||
| `caption` | `#!python Optional[str]` | Optional. Caption, 0-1024 characters after entities parsing |
|
||||
| `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. |
|
||||
| `parse_mode` | `#!python Optional[str]` | Optional. Mode for parsing entities in the audio caption. See formatting options for more details. |
|
||||
| `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 |
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ Note: This will only work in Telegram versions released after 9 April, 2016. Old
|
|||
| `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 after entities parsing |
|
||||
| `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. |
|
||||
| `parse_mode` | `#!python Optional[str]` | Optional. Mode for parsing entities in the audio caption. See formatting options for more details. |
|
||||
| `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 |
|
||||
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ Note: This will only work in Telegram versions released after 9 April, 2016. Old
|
|||
| `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 after entities parsing |
|
||||
| `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. |
|
||||
| `parse_mode` | `#!python Optional[str]` | Optional. Mode for parsing entities in the document caption. See formatting options for more details. |
|
||||
| `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 |
|
||||
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ Represents a link to an animated GIF file stored on the Telegram servers. By def
|
|||
| `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 after entities parsing |
|
||||
| `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. |
|
||||
| `parse_mode` | `#!python Optional[str]` | Optional. Mode for parsing entities in the caption. See formatting options for more details. |
|
||||
| `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 |
|
||||
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ Represents a link to a video animation (H.264/MPEG-4 AVC video without sound) st
|
|||
| `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 after entities parsing |
|
||||
| `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. |
|
||||
| `parse_mode` | `#!python Optional[str]` | Optional. Mode for parsing entities in the caption. See formatting options for more details. |
|
||||
| `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 |
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ Represents a link to a photo stored on the Telegram servers. By default, this ph
|
|||
| `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 after entities parsing |
|
||||
| `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. |
|
||||
| `parse_mode` | `#!python Optional[str]` | Optional. Mode for parsing entities in the photo caption. See formatting options for more details. |
|
||||
| `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 |
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ Represents a link to a video file stored on the Telegram servers. By default, th
|
|||
| `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 after entities parsing |
|
||||
| `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. |
|
||||
| `parse_mode` | `#!python Optional[str]` | Optional. Mode for parsing entities in the video caption. See formatting options for more details. |
|
||||
| `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 |
|
||||
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ Note: This will only work in Telegram versions released after 9 April, 2016. Old
|
|||
| `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 after entities parsing |
|
||||
| `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. |
|
||||
| `parse_mode` | `#!python Optional[str]` | Optional. Mode for parsing entities in the voice message caption. See formatting options for more details. |
|
||||
| `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 |
|
||||
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ Note: This will only work in Telegram versions released after 9 April, 2016. Old
|
|||
| `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 after entities parsing |
|
||||
| `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. |
|
||||
| `parse_mode` | `#!python Optional[str]` | Optional. Mode for parsing entities in the document caption. See formatting options for more details. |
|
||||
| `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 |
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ Represents a link to an animated GIF file. By default, this animated GIF file wi
|
|||
| `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 after entities parsing |
|
||||
| `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. |
|
||||
| `parse_mode` | `#!python Optional[str]` | Optional. Mode for parsing entities in the caption. See formatting options for more details. |
|
||||
| `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 |
|
||||
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ Represents a link to a video animation (H.264/MPEG-4 AVC video without sound). B
|
|||
| `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 after entities parsing |
|
||||
| `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. |
|
||||
| `parse_mode` | `#!python Optional[str]` | Optional. Mode for parsing entities in the caption. See formatting options for more details. |
|
||||
| `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 |
|
||||
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ Represents a link to a photo. By default, this photo will be sent by the user wi
|
|||
| `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 after entities parsing |
|
||||
| `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. |
|
||||
| `parse_mode` | `#!python Optional[str]` | Optional. Mode for parsing entities in the photo caption. See formatting options for more details. |
|
||||
| `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 |
|
||||
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ If an InlineQueryResultVideo message contains an embedded video (e.g., YouTube),
|
|||
| `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 after entities parsing |
|
||||
| `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. |
|
||||
| `parse_mode` | `#!python Optional[str]` | Optional. Mode for parsing entities in the video caption. See formatting options for more details. |
|
||||
| `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 |
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ Note: This will only work in Telegram versions released after 9 April, 2016. Old
|
|||
| `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 after entities parsing |
|
||||
| `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. |
|
||||
| `parse_mode` | `#!python Optional[str]` | Optional. Mode for parsing entities in the voice message caption. See formatting options for more details. |
|
||||
| `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 |
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ Represents an animation file (GIF or H.264/MPEG-4 AVC video without sound) to be
|
|||
| `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://<file_attach_name>' to upload a new one using multipart/form-data under <file_attach_name> 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://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. |
|
||||
| `caption` | `#!python Optional[str]` | Optional. Caption of the animation to be sent, 0-1024 characters after entities parsing |
|
||||
| `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. |
|
||||
| `parse_mode` | `#!python Optional[str]` | Optional. Mode for parsing entities in the animation caption. See formatting options for more details. |
|
||||
| `width` | `#!python Optional[int]` | Optional. Animation width |
|
||||
| `height` | `#!python Optional[int]` | Optional. Animation height |
|
||||
| `duration` | `#!python Optional[int]` | Optional. Animation duration |
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ Represents an audio file to be treated as music to be sent.
|
|||
| `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://<file_attach_name>' to upload a new one using multipart/form-data under <file_attach_name> 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://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. |
|
||||
| `caption` | `#!python Optional[str]` | Optional. Caption of the audio to be sent, 0-1024 characters after entities parsing |
|
||||
| `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. |
|
||||
| `parse_mode` | `#!python Optional[str]` | Optional. Mode for parsing entities in the audio caption. See formatting options for more details. |
|
||||
| `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 |
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ Represents a general file to be sent.
|
|||
| `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://<file_attach_name>' to upload a new one using multipart/form-data under <file_attach_name> 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://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. |
|
||||
| `caption` | `#!python Optional[str]` | Optional. Caption of the document to be sent, 0-1024 characters after entities parsing |
|
||||
| `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. |
|
||||
| `parse_mode` | `#!python Optional[str]` | Optional. Mode for parsing entities in the document caption. See formatting options for more details. |
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ Represents a photo to be sent.
|
|||
| `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://<file_attach_name>' to upload a new one using multipart/form-data under <file_attach_name> name. |
|
||||
| `caption` | `#!python Optional[str]` | Optional. Caption of the photo to be sent, 0-1024 characters after entities parsing |
|
||||
| `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. |
|
||||
| `parse_mode` | `#!python Optional[str]` | Optional. Mode for parsing entities in the photo caption. See formatting options for more details. |
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ Represents a video to be sent.
|
|||
| `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://<file_attach_name>' to upload a new one using multipart/form-data under <file_attach_name> 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://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. |
|
||||
| `caption` | `#!python Optional[str]` | Optional. Caption of the video to be sent, 0-1024 characters after entities parsing |
|
||||
| `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. |
|
||||
| `parse_mode` | `#!python Optional[str]` | Optional. Mode for parsing entities in the video caption. See formatting options for more details. |
|
||||
| `width` | `#!python Optional[int]` | Optional. Video width |
|
||||
| `height` | `#!python Optional[int]` | Optional. Video height |
|
||||
| `duration` | `#!python Optional[int]` | Optional. Video duration |
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ Represents the content of a text message to be sent as the result of an inline q
|
|||
| 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. |
|
||||
| `parse_mode` | `#!python Optional[str]` | Optional. Mode for parsing entities in the message text. See formatting options for more details. |
|
||||
| `disable_web_page_preview` | `#!python Optional[bool]` | Optional. Disables link previews for links in the sent message |
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -18,6 +18,10 @@ This object contains information about a poll.
|
|||
| `type` | `#!python str` | Poll type, currently can be 'regular' or 'quiz' |
|
||||
| `allows_multiple_answers` | `#!python bool` | True, if the poll allows multiple answers |
|
||||
| `correct_option_id` | `#!python Optional[int]` | Optional. 0-based identifier of the correct answer option. Available only for polls in the quiz mode, which are closed, or was sent (not forwarded) by the bot or to the private chat with the bot. |
|
||||
| `explanation` | `#!python Optional[str]` | Optional. Text that is shown when a user chooses an incorrect answer or taps on the lamp icon in a quiz-style poll, 0-200 characters |
|
||||
| `explanation_entities` | `#!python Optional[List[MessageEntity]]` | Optional. Special entities like usernames, URLs, bot commands, etc. that appear in the explanation |
|
||||
| `open_period` | `#!python Optional[int]` | Optional. Amount of time in seconds the poll will be active after creation |
|
||||
| `close_date` | `#!python Optional[Union[datetime.datetime, datetime.timedelta, int]]` | Optional. Point in time (Unix timestamp) when the poll will be automatically closed |
|
||||
|
||||
|
||||
|
||||
|
|
@ -30,4 +34,5 @@ This object contains information about a poll.
|
|||
## Related pages:
|
||||
|
||||
- [Official documentation](https://core.telegram.org/bots/api#poll)
|
||||
- [aiogram.types.MessageEntity](../types/message_entity.md)
|
||||
- [aiogram.types.PollOption](../types/poll_option.md)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue