Add support of Bot API 4.7. Bump version

This commit is contained in:
Alex Root Junior 2020-04-11 20:15:03 +03:00
parent 4cb9697cb4
commit 33003f2026
167 changed files with 996 additions and 504 deletions

View file

@ -2,7 +2,7 @@
## Description
Use this method to add a new sticker to a set created by the bot. Returns True on success.
Use this method to add a new sticker to a set created by the bot. You must use exactly one of the fields png_sticker or tgs_sticker. Animated stickers can be added to animated sticker sets and only to them. Animated sticker sets can have up to 50 stickers. Static sticker sets can have up to 120 stickers. Returns True on success.
## Arguments
@ -11,8 +11,9 @@ Use this method to add a new sticker to a set created by the bot. Returns True o
| - | - | - |
| `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. |
| `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 |
| `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 |
@ -26,8 +27,7 @@ Description: Returns True on success.
## Usage
### As bot method bot
### As bot method
```python3
result: bool = await bot.add_sticker_to_set(...)
@ -56,7 +56,6 @@ return AddStickerToSet(...)
```
## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#addstickertoset)

View file

@ -28,8 +28,7 @@ Description: On success, True is returned.
## Usage
### As bot method bot
### As bot method
```python3
result: bool = await bot.answer_callback_query(...)
@ -58,7 +57,6 @@ return AnswerCallbackQuery(...)
```
## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#answercallbackquery)

View file

@ -30,8 +30,7 @@ Description: On success, True is returned.
## Usage
### As bot method bot
### As bot method
```python3
result: bool = await bot.answer_inline_query(...)
@ -60,7 +59,6 @@ return AnswerInlineQuery(...)
```
## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#answerinlinequery)

View file

@ -24,8 +24,7 @@ Description: On success, True is returned.
## Usage
### As bot method bot
### As bot method
```python3
result: bool = await bot.answer_pre_checkout_query(...)
@ -54,7 +53,6 @@ return AnswerPreCheckoutQuery(...)
```
## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#answerprecheckoutquery)

View file

@ -25,8 +25,7 @@ Description: On success, True is returned.
## Usage
### As bot method bot
### As bot method
```python3
result: bool = await bot.answer_shipping_query(...)
@ -55,7 +54,6 @@ return AnswerShippingQuery(...)
```
## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#answershippingquery)

View file

@ -2,7 +2,7 @@
## 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.
Use this method to create a new sticker set owned by a user. The bot will be able to edit the sticker set thus created. You must use exactly one of the fields png_sticker or tgs_sticker. Returns True on success.
## Arguments
@ -12,8 +12,9 @@ Use this method to create new sticker set owned by a user. The bot will be able
| `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_<bot username>'. <bot_username> 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 |
| `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 |
| `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 |
@ -28,8 +29,7 @@ Description: Returns True on success.
## Usage
### As bot method bot
### As bot method
```python3
result: bool = await bot.create_new_sticker_set(...)
@ -58,7 +58,6 @@ return CreateNewStickerSet(...)
```
## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#createnewstickerset)

View file

@ -22,8 +22,7 @@ Description: Returns True on success.
## Usage
### As bot method bot
### As bot method
```python3
result: bool = await bot.delete_chat_photo(...)
@ -52,7 +51,6 @@ return DeleteChatPhoto(...)
```
## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#deletechatphoto)

View file

@ -22,8 +22,7 @@ Description: Use the field can_set_sticker_set optionally returned in getChat re
## Usage
### As bot method bot
### As bot method
```python3
result: bool = await bot.delete_chat_sticker_set(...)
@ -52,7 +51,6 @@ return DeleteChatStickerSet(...)
```
## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#deletechatstickerset)

View file

@ -6,6 +6,8 @@ Use this method to delete a message, including service messages, with the follow
- A message can only be deleted if it was sent less than 48 hours ago.
- A dice message in a private chat can only be deleted if it was sent more than 24 hours ago.
- Bots can delete outgoing messages in private chats, groups, and supergroups.
- Bots can delete incoming messages in private chats.
@ -37,8 +39,7 @@ Description: Returns True on success.
## Usage
### As bot method bot
### As bot method
```python3
result: bool = await bot.delete_message(...)
@ -67,7 +68,6 @@ return DeleteMessage(...)
```
## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#deletemessage)

View file

@ -22,8 +22,7 @@ Description: Returns True on success.
## Usage
### As bot method bot
### As bot method
```python3
result: bool = await bot.delete_sticker_from_set(...)
@ -52,7 +51,6 @@ return DeleteStickerFromSet(...)
```
## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#deletestickerfromset)

View file

@ -16,8 +16,7 @@ Description: Returns True on success.
## Usage
### As bot method bot
### As bot method
```python3
result: bool = await bot.delete_webhook(...)
@ -46,7 +45,6 @@ return DeleteWebhook(...)
```
## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#deletewebhook)

View file

@ -12,7 +12,7 @@ Use this method to edit captions of messages. On success, if edited message is s
| `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 |
| `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. |
| `reply_markup` | `#!python3 Optional[InlineKeyboardMarkup]` | Optional. A JSON-serialized object for an inline keyboard. |
@ -27,8 +27,7 @@ Description: On success, if edited message is sent by the bot, the edited Messag
## Usage
### As bot method bot
### As bot method
```python3
result: Union[Message, bool] = await bot.edit_message_caption(...)
@ -57,7 +56,6 @@ return EditMessageCaption(...)
```
## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#editmessagecaption)

View file

@ -27,8 +27,7 @@ Description: On success, if the edited message was sent by the bot, the edited M
## Usage
### As bot method bot
### As bot method
```python3
result: Union[Message, bool] = await bot.edit_message_live_location(...)
@ -57,7 +56,6 @@ return EditMessageLiveLocation(...)
```
## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#editmessagelivelocation)

View file

@ -26,8 +26,7 @@ Description: On success, if the edited message was sent by the bot, the edited M
## Usage
### As bot method bot
### As bot method
```python3
result: Union[Message, bool] = await bot.edit_message_media(...)
@ -56,7 +55,6 @@ return EditMessageMedia(...)
```
## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#editmessagemedia)

View file

@ -25,8 +25,7 @@ Description: On success, if edited message is sent by the bot, the edited Messag
## Usage
### As bot method bot
### As bot method
```python3
result: Union[Message, bool] = await bot.edit_message_reply_markup(...)
@ -55,7 +54,6 @@ return EditMessageReplyMarkup(...)
```
## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#editmessagereplymarkup)

View file

@ -9,7 +9,7 @@ Use this method to edit text and game messages. On success, if edited message is
| Name | Type | Description |
| - | - | - |
| `text` | `#!python3 str` | New text of the message |
| `text` | `#!python3 str` | New text of the message, 1-4096 characters after entities parsing |
| `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 |
@ -28,8 +28,7 @@ Description: On success, if edited message is sent by the bot, the edited Messag
## Usage
### As bot method bot
### As bot method
```python3
result: Union[Message, bool] = await bot.edit_message_text(...)
@ -58,7 +57,6 @@ return EditMessageText(...)
```
## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#editmessagetext)

View file

@ -24,8 +24,7 @@ Description: Returns the new invite link as String on success.
## Usage
### As bot method bot
### As bot method
```python3
result: str = await bot.export_chat_invite_link(...)
@ -54,7 +53,6 @@ return ExportChatInviteLink(...)
```
## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#exportchatinvitelink)

View file

@ -25,8 +25,7 @@ Description: On success, the sent Message is returned.
## Usage
### As bot method bot
### As bot method
```python3
result: Message = await bot.forward_message(...)
@ -55,7 +54,6 @@ return ForwardMessage(...)
```
## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#forwardmessage)

View file

@ -22,8 +22,7 @@ Description: Returns a Chat object on success.
## Usage
### As bot method bot
### As bot method
```python3
result: Chat = await bot.get_chat(...)

View file

@ -22,8 +22,7 @@ Description: On success, returns an Array of ChatMember objects that contains in
## Usage
### As bot method bot
### As bot method
```python3
result: List[ChatMember] = await bot.get_chat_administrators(...)

View file

@ -23,8 +23,7 @@ Description: Returns a ChatMember object on success.
## Usage
### As bot method bot
### As bot method
```python3
result: ChatMember = await bot.get_chat_member(...)

View file

@ -22,8 +22,7 @@ Description: Returns Int on success.
## Usage
### As bot method bot
### As bot method
```python3
result: int = await bot.get_chat_members_count(...)

View file

@ -24,8 +24,7 @@ Description: On success, a File object is returned.
## Usage
### As bot method bot
### As bot method
```python3
result: File = await bot.get_file(...)

View file

@ -27,8 +27,7 @@ Description: Will return the score of the specified user and several of his neig
## Usage
### As bot method bot
### As bot method
```python3
result: List[GameHighScore] = await bot.get_game_high_scores(...)

View file

@ -16,8 +16,7 @@ Description: Returns basic information about the bot in form of a User object.
## Usage
### As bot method bot
### As bot method
```python3
result: User = await bot.get_me(...)

View file

@ -0,0 +1,48 @@
# getMyCommands
## Description
Use this method to get the current list of the bot's commands. Requires no parameters. Returns Array of BotCommand on success.
## Response
Type: `#!python3 List[BotCommand]`
Description: Returns Array of BotCommand on success.
## Usage
### As bot method
```python3
result: List[BotCommand] = await bot.get_my_commands(...)
```
### Method as object
Imports:
- `from aiogram.methods import GetMyCommands`
- `from aiogram.api.methods import GetMyCommands`
- `from aiogram.api.methods.get_my_commands import GetMyCommands`
#### In handlers with current bot
```python3
result: List[BotCommand] = await GetMyCommands(...)
```
#### With specific bot
```python3
result: List[BotCommand] = await bot(GetMyCommands(...))
```
## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#getmycommands)
- [aiogram.types.BotCommand](../types/bot_command.md)

View file

@ -22,8 +22,7 @@ Description: On success, a StickerSet object is returned.
## Usage
### As bot method bot
### As bot method
```python3
result: StickerSet = await bot.get_sticker_set(...)

View file

@ -31,8 +31,7 @@ Description: An Array of Update objects is returned.
## Usage
### As bot method bot
### As bot method
```python3
result: List[Update] = await bot.get_updates(...)

View file

@ -24,8 +24,7 @@ Description: Returns a UserProfilePhotos object.
## Usage
### As bot method bot
### As bot method
```python3
result: UserProfilePhotos = await bot.get_user_profile_photos(...)

View file

@ -16,8 +16,7 @@ Description: On success, returns a WebhookInfo object. If the bot is using getUp
## Usage
### As bot method bot
### As bot method
```python3
result: WebhookInfo = await bot.get_webhook_info(...)

View file

@ -2,7 +2,6 @@
Here is list of all available API methods:
- Getting updates
- [getUpdates](get_updates.md)
- [setWebhook](set_webhook.md)
@ -26,6 +25,7 @@ Here is list of all available API methods:
- [sendVenue](send_venue.md)
- [sendContact](send_contact.md)
- [sendPoll](send_poll.md)
- [sendDice](send_dice.md)
- [sendChatAction](send_chat_action.md)
- [getUserProfilePhotos](get_user_profile_photos.md)
- [getFile](get_file.md)
@ -50,6 +50,8 @@ Here is list of all available API methods:
- [setChatStickerSet](set_chat_sticker_set.md)
- [deleteChatStickerSet](delete_chat_sticker_set.md)
- [answerCallbackQuery](answer_callback_query.md)
- [setMyCommands](set_my_commands.md)
- [getMyCommands](get_my_commands.md)
- Updating messages
- [editMessageText](edit_message_text.md)
- [editMessageCaption](edit_message_caption.md)
@ -65,6 +67,7 @@ Here is list of all available API methods:
- [addStickerToSet](add_sticker_to_set.md)
- [setStickerPositionInSet](set_sticker_position_in_set.md)
- [deleteStickerFromSet](delete_sticker_from_set.md)
- [setStickerSetThumb](set_sticker_set_thumb.md)
- Inline mode
- [answerInlineQuery](answer_inline_query.md)
- Payments

View file

@ -24,8 +24,7 @@ Description: In the case of supergroups and channels, the user will not be able
## Usage
### As bot method bot
### As bot method
```python3
result: bool = await bot.kick_chat_member(...)
@ -54,7 +53,6 @@ return KickChatMember(...)
```
## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#kickchatmember)

View file

@ -22,8 +22,7 @@ Description: Returns True on success.
## Usage
### As bot method bot
### As bot method
```python3
result: bool = await bot.leave_chat(...)
@ -52,7 +51,6 @@ return LeaveChat(...)
```
## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#leavechat)

View file

@ -24,8 +24,7 @@ Description: Returns True on success.
## Usage
### As bot method bot
### As bot method
```python3
result: bool = await bot.pin_chat_message(...)
@ -54,7 +53,6 @@ return PinChatMessage(...)
```
## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#pinchatmessage)

View file

@ -31,8 +31,7 @@ Description: Returns True on success.
## Usage
### As bot method bot
### As bot method
```python3
result: bool = await bot.promote_chat_member(...)
@ -61,7 +60,6 @@ return PromoteChatMember(...)
```
## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#promotechatmember)

View file

@ -25,8 +25,7 @@ Description: Returns True on success.
## Usage
### As bot method bot
### As bot method
```python3
result: bool = await bot.restrict_chat_member(...)
@ -55,7 +54,6 @@ return RestrictChatMember(...)
```
## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#restrictchatmember)

View file

@ -15,7 +15,7 @@ Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without s
| `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 thumbnails width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails cant 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 |
| `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. |
| `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 |
@ -32,8 +32,7 @@ Description: On success, the sent Message is returned.
## Usage
### As bot method bot
### As bot method
```python3
result: Message = await bot.send_animation(...)
@ -62,7 +61,6 @@ return SendAnimation(...)
```
## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#sendanimation)

View file

@ -13,7 +13,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 |
| `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. |
| `duration` | `#!python3 Optional[int]` | Optional. Duration of the audio in seconds |
| `performer` | `#!python3 Optional[str]` | Optional. Performer |
@ -34,8 +34,7 @@ Description: On success, the sent Message is returned.
## Usage
### As bot method bot
### As bot method
```python3
result: Message = await bot.send_audio(...)
@ -64,7 +63,6 @@ return SendAudio(...)
```
## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#sendaudio)

View file

@ -27,8 +27,7 @@ Description: Returns True on success.
## Usage
### As bot method bot
### As bot method
```python3
result: bool = await bot.send_chat_action(...)
@ -57,7 +56,6 @@ return SendChatAction(...)
```
## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#sendchataction)

View file

@ -29,8 +29,7 @@ Description: On success, the sent Message is returned.
## Usage
### As bot method bot
### As bot method
```python3
result: Message = await bot.send_contact(...)
@ -59,7 +58,6 @@ return SendContact(...)
```
## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#sendcontact)

View file

@ -0,0 +1,64 @@
# sendDice
## Description
Use this method to send a dice, which will have a random value from 1 to 6. On success, the sent Message is returned. (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!)
## 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) |
| `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
```python3
result: Message = await bot.send_dice(...)
```
### Method as object
Imports:
- `from aiogram.methods import SendDice`
- `from aiogram.api.methods import SendDice`
- `from aiogram.api.methods.send_dice import SendDice`
#### In handlers with current bot
```python3
result: Message = await SendDice(...)
```
#### With specific bot
```python3
result: Message = await bot(SendDice(...))
```
#### As reply into Webhook in handler
```python3
return SendDice(...)
```
## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#senddice)
- [aiogram.types.ForceReply](../types/force_reply.md)
- [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md)
- [aiogram.types.Message](../types/message.md)
- [aiogram.types.ReplyKeyboardMarkup](../types/reply_keyboard_markup.md)
- [aiogram.types.ReplyKeyboardRemove](../types/reply_keyboard_remove.md)

View file

@ -12,7 +12,7 @@ Use this method to send general files. 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) |
| `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 thumbnails width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails cant 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 |
| `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. |
| `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 |
@ -29,8 +29,7 @@ Description: On success, the sent Message is returned.
## Usage
### As bot method bot
### As bot method
```python3
result: Message = await bot.send_document(...)
@ -59,7 +58,6 @@ return SendDocument(...)
```
## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#senddocument)

View file

@ -26,8 +26,7 @@ Description: On success, the sent Message is returned.
## Usage
### As bot method bot
### As bot method
```python3
result: Message = await bot.send_game(...)
@ -56,7 +55,6 @@ return SendGame(...)
```
## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#sendgame)

View file

@ -44,8 +44,7 @@ Description: On success, the sent Message is returned.
## Usage
### As bot method bot
### As bot method
```python3
result: Message = await bot.send_invoice(...)
@ -74,7 +73,6 @@ return SendInvoice(...)
```
## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#sendinvoice)

View file

@ -28,8 +28,7 @@ Description: On success, the sent Message is returned.
## Usage
### As bot method bot
### As bot method
```python3
result: Message = await bot.send_location(...)
@ -58,7 +57,6 @@ return SendLocation(...)
```
## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#sendlocation)

View file

@ -25,8 +25,7 @@ Description: On success, an array of the sent Messages is returned.
## Usage
### As bot method bot
### As bot method
```python3
result: List[Message] = await bot.send_media_group(...)
@ -55,7 +54,6 @@ return SendMediaGroup(...)
```
## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#sendmediagroup)

View file

@ -10,7 +10,7 @@ Use this method to send text messages. On success, the sent Message is returned.
| 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 |
| `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. |
| `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. |
@ -28,8 +28,7 @@ Description: On success, the sent Message is returned.
## Usage
### As bot method bot
### As bot method
```python3
result: Message = await bot.send_message(...)
@ -58,7 +57,6 @@ return SendMessage(...)
```
## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#sendmessage)

View file

@ -11,7 +11,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 |
| `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. |
| `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 |
@ -28,8 +28,7 @@ Description: On success, the sent Message is returned.
## Usage
### As bot method bot
### As bot method
```python3
result: Message = await bot.send_photo(...)
@ -58,7 +57,6 @@ return SendPhoto(...)
```
## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#sendphoto)

View file

@ -32,8 +32,7 @@ Description: On success, the sent Message is returned.
## Usage
### As bot method bot
### As bot method
```python3
result: Message = await bot.send_poll(...)
@ -62,7 +61,6 @@ return SendPoll(...)
```
## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#sendpoll)

View file

@ -10,7 +10,7 @@ Use this method to send static .WEBP or animated .TGS stickers. On success, the
| 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. |
| `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. |
@ -26,8 +26,7 @@ Description: On success, the sent Message is returned.
## Usage
### As bot method bot
### As bot method
```python3
result: Message = await bot.send_sticker(...)
@ -56,7 +55,6 @@ return SendSticker(...)
```
## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#sendsticker)

View file

@ -31,8 +31,7 @@ Description: On success, the sent Message is returned.
## Usage
### As bot method bot
### As bot method
```python3
result: Message = await bot.send_venue(...)
@ -61,7 +60,6 @@ return SendVenue(...)
```
## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#sendvenue)

View file

@ -15,7 +15,7 @@ Use this method to send video files, Telegram clients support mp4 videos (other
| `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 thumbnails width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails cant 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 |
| `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. |
| `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. |
@ -33,8 +33,7 @@ Description: On success, the sent Message is returned.
## Usage
### As bot method bot
### As bot method
```python3
result: Message = await bot.send_video(...)
@ -63,7 +62,6 @@ return SendVideo(...)
```
## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#sendvideo)

View file

@ -29,8 +29,7 @@ Description: On success, the sent Message is returned.
## Usage
### As bot method bot
### As bot method
```python3
result: Message = await bot.send_video_note(...)
@ -59,7 +58,6 @@ return SendVideoNote(...)
```
## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#sendvideonote)

View file

@ -2,7 +2,7 @@
## 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.
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
@ -11,7 +11,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 |
| `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. |
| `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. |
@ -29,8 +29,7 @@ Description: On success, the sent Message is returned.
## Usage
### As bot method bot
### As bot method
```python3
result: Message = await bot.send_voice(...)
@ -59,7 +58,6 @@ return SendVoice(...)
```
## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#sendvoice)

View file

@ -24,8 +24,7 @@ Description: Returns True on success.
## Usage
### As bot method bot
### As bot method
```python3
result: bool = await bot.set_chat_administrator_custom_title(...)
@ -54,7 +53,6 @@ return SetChatAdministratorCustomTitle(...)
```
## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#setchatadministratorcustomtitle)

View file

@ -23,8 +23,7 @@ Description: Returns True on success.
## Usage
### As bot method bot
### As bot method
```python3
result: bool = await bot.set_chat_description(...)
@ -53,7 +52,6 @@ return SetChatDescription(...)
```
## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#setchatdescription)

View file

@ -23,8 +23,7 @@ Description: Returns True on success.
## Usage
### As bot method bot
### As bot method
```python3
result: bool = await bot.set_chat_permissions(...)
@ -53,7 +52,6 @@ return SetChatPermissions(...)
```
## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#setchatpermissions)

View file

@ -23,8 +23,7 @@ Description: Returns True on success.
## Usage
### As bot method bot
### As bot method
```python3
result: bool = await bot.set_chat_photo(...)

View file

@ -23,8 +23,7 @@ Description: Use the field can_set_sticker_set optionally returned in getChat re
## Usage
### As bot method bot
### As bot method
```python3
result: bool = await bot.set_chat_sticker_set(...)
@ -53,7 +52,6 @@ return SetChatStickerSet(...)
```
## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#setchatstickerset)

View file

@ -23,8 +23,7 @@ Description: Returns True on success.
## Usage
### As bot method bot
### As bot method
```python3
result: bool = await bot.set_chat_title(...)
@ -53,7 +52,6 @@ return SetChatTitle(...)
```
## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#setchattitle)

View file

@ -28,8 +28,7 @@ Description: On success, if the message was sent by the bot, returns the edited
## Usage
### As bot method bot
### As bot method
```python3
result: Union[Message, bool] = await bot.set_game_score(...)
@ -58,7 +57,6 @@ return SetGameScore(...)
```
## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#setgamescore)

View file

@ -0,0 +1,57 @@
# setMyCommands
## Description
Use this method to change the list of the bot's commands. Returns True on success.
## Arguments
| Name | Type | Description |
| - | - | - |
| `commands` | `#!python3 List[BotCommand]` | A JSON-serialized list of bot commands to be set as the list of the bot's commands. At most 100 commands can be specified. |
## Response
Type: `#!python3 bool`
Description: Returns True on success.
## Usage
### As bot method
```python3
result: bool = await bot.set_my_commands(...)
```
### Method as object
Imports:
- `from aiogram.methods import SetMyCommands`
- `from aiogram.api.methods import SetMyCommands`
- `from aiogram.api.methods.set_my_commands import SetMyCommands`
#### In handlers with current bot
```python3
result: bool = await SetMyCommands(...)
```
#### With specific bot
```python3
result: bool = await bot(SetMyCommands(...))
```
#### As reply into Webhook in handler
```python3
return SetMyCommands(...)
```
## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#setmycommands)
- [aiogram.types.BotCommand](../types/bot_command.md)

View file

@ -25,8 +25,7 @@ Description: The user will not be able to re-submit their Passport to you until
## Usage
### As bot method bot
### As bot method
```python3
result: bool = await bot.set_passport_data_errors(...)
@ -55,7 +54,6 @@ return SetPassportDataErrors(...)
```
## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#setpassportdataerrors)

View file

@ -2,7 +2,7 @@
## Description
Use this method to move a sticker in a set created by the bot to a specific position . Returns True on success.
Use this method to move a sticker in a set created by the bot to a specific position. Returns True on success.
## Arguments
@ -23,8 +23,7 @@ Description: Returns True on success.
## Usage
### As bot method bot
### As bot method
```python3
result: bool = await bot.set_sticker_position_in_set(...)
@ -53,7 +52,6 @@ return SetStickerPositionInSet(...)
```
## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#setstickerpositioninset)

View file

@ -0,0 +1,60 @@
# setStickerSetThumb
## Description
Use this method to set the thumbnail of a sticker set. Animated thumbnails can be set for animated sticker sets only. Returns True on success.
## Arguments
| Name | Type | Description |
| - | - | - |
| `name` | `#!python3 str` | Sticker set name |
| `user_id` | `#!python3 int` | User identifier of the sticker set owner |
| `thumb` | `#!python3 Optional[Union[InputFile, str]]` | Optional. A PNG image with the thumbnail, must be up to 128 kilobytes in size and have width and height exactly 100px, or a TGS animation with the thumbnail up to 32 kilobytes in size; see https://core.telegram.org/animated_stickers#technical-requirements for animated sticker technical requirements. Pass a file_id as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data.. Animated sticker set thumbnail can't be uploaded via HTTP URL. |
## Response
Type: `#!python3 bool`
Description: Returns True on success.
## Usage
### As bot method
```python3
result: bool = await bot.set_sticker_set_thumb(...)
```
### Method as object
Imports:
- `from aiogram.methods import SetStickerSetThumb`
- `from aiogram.api.methods import SetStickerSetThumb`
- `from aiogram.api.methods.set_sticker_set_thumb import SetStickerSetThumb`
#### In handlers with current bot
```python3
result: bool = await SetStickerSetThumb(...)
```
#### With specific bot
```python3
result: bool = await bot(SetStickerSetThumb(...))
```
#### As reply into Webhook in handler
```python3
return SetStickerSetThumb(...)
```
## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#setstickersetthumb)
- [aiogram.types.InputFile](../types/input_file.md)
- [How to upload file?](../sending_files.md)

View file

@ -37,8 +37,7 @@ Description: Returns True on success.
## Usage
### As bot method bot
### As bot method
```python3
result: bool = await bot.set_webhook(...)
@ -67,7 +66,6 @@ return SetWebhook(...)
```
## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#setwebhook)

View file

@ -25,8 +25,7 @@ Description: On success, if the message was sent by the bot, the sent Message is
## Usage
### As bot method bot
### As bot method
```python3
result: Union[Message, bool] = await bot.stop_message_live_location(...)
@ -55,7 +54,6 @@ return StopMessageLiveLocation(...)
```
## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#stopmessagelivelocation)

View file

@ -24,8 +24,7 @@ Description: On success, the stopped Poll with the final results is returned.
## Usage
### As bot method bot
### As bot method
```python3
result: Poll = await bot.stop_poll(...)
@ -54,7 +53,6 @@ return StopPoll(...)
```
## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#stoppoll)

View file

@ -23,8 +23,7 @@ Description: The user will not return to the group or channel automatically, but
## Usage
### As bot method bot
### As bot method
```python3
result: bool = await bot.unban_chat_member(...)
@ -53,7 +52,6 @@ return UnbanChatMember(...)
```
## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#unbanchatmember)

View file

@ -22,8 +22,7 @@ Description: Returns True on success.
## Usage
### As bot method bot
### As bot method
```python3
result: bool = await bot.unpin_chat_message(...)
@ -52,7 +51,6 @@ return UnpinChatMessage(...)
```
## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#unpinchatmessage)

View file

@ -2,7 +2,7 @@
## 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.
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
@ -23,8 +23,7 @@ Description: Returns the uploaded File on success.
## Usage
### As bot method bot
### As bot method
```python3
result: File = await bot.upload_sticker_file(...)