mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-11 01:54:53 +00:00
Add autogenerated docs for types and methods
This commit is contained in:
parent
a24708d589
commit
65331e1fda
166 changed files with 7361 additions and 4 deletions
26
docs/api/index.md
Normal file
26
docs/api/index.md
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
# Overview
|
||||
|
||||
**aiogram** now is fully support of [Telegram Bot API v4.4](https://core.telegram.org/bots/api)
|
||||
|
||||
All API methods and types is fully autogenerated from Telegram Bot API docs by parser with code-generator
|
||||
|
||||
Package: `aiogram.api`
|
||||
|
||||
## Methods
|
||||
|
||||
All API methods is wrapped as **pydantic** models and placed in `aiogram.api.methods` package so that's mean all values which you pass as arguments to the methods will be validated.
|
||||
Here is all methods is classes and in due to Python standards all classes named in upper camel case, for example methods `sendMessage` has the name `SendMessage`
|
||||
Also in places where you can send
|
||||
|
||||
## Types
|
||||
|
||||
All types is also wrapped with **pydantic** and placed in `aiogram.api.types` package.
|
||||
In this place makes some more differences with official documentations:
|
||||
|
||||
- name `from` was renamed to `from_user` in due to `from` is an keyword in python
|
||||
- timestamps has `datetime.datetime` type instead of `int`
|
||||
- InputFile is used for sending files and is not use `pydantic.BaseModel` as base class
|
||||
|
||||
## Client
|
||||
|
||||
...
|
||||
64
docs/api/methods/add_sticker_to_set.md
Normal file
64
docs/api/methods/add_sticker_to_set.md
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
# addStickerToSet
|
||||
|
||||
## Description
|
||||
|
||||
Use this method to add a new sticker to a set created by the bot. Returns True on success.
|
||||
|
||||
|
||||
## Arguments
|
||||
|
||||
| Name | Type | Description |
|
||||
| - | - | - |
|
||||
| `user_id` | `#!python3 int` | User identifier of sticker set owner |
|
||||
| `name` | `#!python3 str` | Sticker set name |
|
||||
| `png_sticker` | `#!python3 Union[InputFile, str]` | Png image with the sticker, must be up to 512 kilobytes in size, dimensions must not exceed 512px, and either width or height must be exactly 512px. Pass a file_id as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. |
|
||||
| `emojis` | `#!python3 str` | One or more emoji corresponding to the sticker |
|
||||
| `mask_position` | `#!python3 Optional[MaskPosition]` | Optional. A JSON-serialized object for position where the mask should be placed on faces |
|
||||
|
||||
|
||||
|
||||
## Response
|
||||
|
||||
Type: `#!python3 bool`
|
||||
|
||||
Description: Returns True on success.
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
|
||||
### As bot method bot
|
||||
|
||||
```python3
|
||||
result: bool = await bot.add_sticker_to_set(...)
|
||||
```
|
||||
|
||||
### Method as object
|
||||
|
||||
Imports:
|
||||
|
||||
- `from aiogram.types import AddStickerToSet`
|
||||
- `from aiogram.api.types import AddStickerToSet`
|
||||
- `from aiogram.api.types.add_sticker_to_set import AddStickerToSet`
|
||||
|
||||
#### As reply into Webhook
|
||||
```python3
|
||||
return AddStickerToSet(...)
|
||||
```
|
||||
|
||||
#### With specific bot
|
||||
```python3
|
||||
result: bool = await bot.emit(AddStickerToSet(...))
|
||||
```
|
||||
|
||||
#### In handlers with current bot
|
||||
```python3
|
||||
result: bool = await AddStickerToSet(...)
|
||||
```
|
||||
|
||||
|
||||
## Related pages:
|
||||
|
||||
- [Official documentation](https://core.telegram.org/bots/api#addstickertoset)
|
||||
- [aiogram.types.InputFile](../types/input_file.md)
|
||||
- [aiogram.types.MaskPosition](../types/mask_position.md)
|
||||
64
docs/api/methods/answer_callback_query.md
Normal file
64
docs/api/methods/answer_callback_query.md
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
# answerCallbackQuery
|
||||
|
||||
## Description
|
||||
|
||||
Use this method to send answers to callback queries sent from inline keyboards. The answer will be displayed to the user as a notification at the top of the chat screen or as an alert. On success, True is returned.
|
||||
|
||||
Alternatively, the user can be redirected to the specified Game URL. For this option to work, you must first create a game for your bot via @Botfather and accept the terms. Otherwise, you may use links like t.me/your_bot?start=XXXX that open your bot with a parameter.
|
||||
|
||||
|
||||
## Arguments
|
||||
|
||||
| Name | Type | Description |
|
||||
| - | - | - |
|
||||
| `callback_query_id` | `#!python3 str` | Unique identifier for the query to be answered |
|
||||
| `text` | `#!python3 Optional[str]` | Optional. Text of the notification. If not specified, nothing will be shown to the user, 0-200 characters |
|
||||
| `show_alert` | `#!python3 Optional[bool]` | Optional. If true, an alert will be shown by the client instead of a notification at the top of the chat screen. Defaults to false. |
|
||||
| `url` | `#!python3 Optional[str]` | Optional. URL that will be opened by the user's client. If you have created a Game and accepted the conditions via @Botfather, specify the URL that opens your game – note that this will only work if the query comes from a callback_game button. |
|
||||
| `cache_time` | `#!python3 Optional[int]` | Optional. The maximum amount of time in seconds that the result of the callback query may be cached client-side. Telegram apps will support caching starting in version 3.14. Defaults to 0. |
|
||||
|
||||
|
||||
|
||||
## Response
|
||||
|
||||
Type: `#!python3 bool`
|
||||
|
||||
Description: On success, True is returned.
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
|
||||
### As bot method bot
|
||||
|
||||
```python3
|
||||
result: bool = await bot.answer_callback_query(...)
|
||||
```
|
||||
|
||||
### Method as object
|
||||
|
||||
Imports:
|
||||
|
||||
- `from aiogram.types import AnswerCallbackQuery`
|
||||
- `from aiogram.api.types import AnswerCallbackQuery`
|
||||
- `from aiogram.api.types.answer_callback_query import AnswerCallbackQuery`
|
||||
|
||||
#### As reply into Webhook
|
||||
```python3
|
||||
return AnswerCallbackQuery(...)
|
||||
```
|
||||
|
||||
#### With specific bot
|
||||
```python3
|
||||
result: bool = await bot.emit(AnswerCallbackQuery(...))
|
||||
```
|
||||
|
||||
#### In handlers with current bot
|
||||
```python3
|
||||
result: bool = await AnswerCallbackQuery(...)
|
||||
```
|
||||
|
||||
|
||||
## Related pages:
|
||||
|
||||
- [Official documentation](https://core.telegram.org/bots/api#answercallbackquery)
|
||||
67
docs/api/methods/answer_inline_query.md
Normal file
67
docs/api/methods/answer_inline_query.md
Normal file
|
|
@ -0,0 +1,67 @@
|
|||
# answerInlineQuery
|
||||
|
||||
## Description
|
||||
|
||||
Use this method to send answers to an inline query. On success, True is returned.
|
||||
|
||||
No more than 50 results per query are allowed.
|
||||
|
||||
|
||||
## Arguments
|
||||
|
||||
| Name | Type | Description |
|
||||
| - | - | - |
|
||||
| `inline_query_id` | `#!python3 str` | Unique identifier for the answered query |
|
||||
| `results` | `#!python3 List[InlineQueryResult]` | A JSON-serialized array of results for the inline query |
|
||||
| `cache_time` | `#!python3 Optional[int]` | Optional. The maximum amount of time in seconds that the result of the inline query may be cached on the server. Defaults to 300. |
|
||||
| `is_personal` | `#!python3 Optional[bool]` | Optional. Pass True, if results may be cached on the server side only for the user that sent the query. By default, results may be returned to any user who sends the same query |
|
||||
| `next_offset` | `#!python3 Optional[str]` | Optional. Pass the offset that a client should send in the next query with the same text to receive more results. Pass an empty string if there are no more results or if you don‘t support pagination. Offset length can’t exceed 64 bytes. |
|
||||
| `switch_pm_text` | `#!python3 Optional[str]` | Optional. If passed, clients will display a button with specified text that switches the user to a private chat with the bot and sends the bot a start message with the parameter switch_pm_parameter |
|
||||
| `switch_pm_parameter` | `#!python3 Optional[str]` | Optional. Deep-linking parameter for the /start message sent to the bot when user presses the switch button. 1-64 characters, only A-Z, a-z, 0-9, _ and - are allowed. |
|
||||
|
||||
|
||||
|
||||
## Response
|
||||
|
||||
Type: `#!python3 bool`
|
||||
|
||||
Description: On success, True is returned.
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
|
||||
### As bot method bot
|
||||
|
||||
```python3
|
||||
result: bool = await bot.answer_inline_query(...)
|
||||
```
|
||||
|
||||
### Method as object
|
||||
|
||||
Imports:
|
||||
|
||||
- `from aiogram.types import AnswerInlineQuery`
|
||||
- `from aiogram.api.types import AnswerInlineQuery`
|
||||
- `from aiogram.api.types.answer_inline_query import AnswerInlineQuery`
|
||||
|
||||
#### As reply into Webhook
|
||||
```python3
|
||||
return AnswerInlineQuery(...)
|
||||
```
|
||||
|
||||
#### With specific bot
|
||||
```python3
|
||||
result: bool = await bot.emit(AnswerInlineQuery(...))
|
||||
```
|
||||
|
||||
#### In handlers with current bot
|
||||
```python3
|
||||
result: bool = await AnswerInlineQuery(...)
|
||||
```
|
||||
|
||||
|
||||
## Related pages:
|
||||
|
||||
- [Official documentation](https://core.telegram.org/bots/api#answerinlinequery)
|
||||
- [aiogram.types.InlineQueryResult](../types/inline_query_result.md)
|
||||
60
docs/api/methods/answer_pre_checkout_query.md
Normal file
60
docs/api/methods/answer_pre_checkout_query.md
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
# answerPreCheckoutQuery
|
||||
|
||||
## Description
|
||||
|
||||
Once the user has confirmed their payment and shipping details, the Bot API sends the final confirmation in the form of an Update with the field pre_checkout_query. Use this method to respond to such pre-checkout queries. On success, True is returned. Note: The Bot API must receive an answer within 10 seconds after the pre-checkout query was sent.
|
||||
|
||||
|
||||
## Arguments
|
||||
|
||||
| Name | Type | Description |
|
||||
| - | - | - |
|
||||
| `pre_checkout_query_id` | `#!python3 str` | Unique identifier for the query to be answered |
|
||||
| `ok` | `#!python3 bool` | Specify True if everything is alright (goods are available, etc.) and the bot is ready to proceed with the order. Use False if there are any problems. |
|
||||
| `error_message` | `#!python3 Optional[str]` | Optional. Required if ok is False. Error message in human readable form that explains the reason for failure to proceed with the checkout (e.g. "Sorry, somebody just bought the last of our amazing black T-shirts while you were busy filling out your payment details. Please choose a different color or garment!"). Telegram will display this message to the user. |
|
||||
|
||||
|
||||
|
||||
## Response
|
||||
|
||||
Type: `#!python3 bool`
|
||||
|
||||
Description: On success, True is returned.
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
|
||||
### As bot method bot
|
||||
|
||||
```python3
|
||||
result: bool = await bot.answer_pre_checkout_query(...)
|
||||
```
|
||||
|
||||
### Method as object
|
||||
|
||||
Imports:
|
||||
|
||||
- `from aiogram.types import AnswerPreCheckoutQuery`
|
||||
- `from aiogram.api.types import AnswerPreCheckoutQuery`
|
||||
- `from aiogram.api.types.answer_pre_checkout_query import AnswerPreCheckoutQuery`
|
||||
|
||||
#### As reply into Webhook
|
||||
```python3
|
||||
return AnswerPreCheckoutQuery(...)
|
||||
```
|
||||
|
||||
#### With specific bot
|
||||
```python3
|
||||
result: bool = await bot.emit(AnswerPreCheckoutQuery(...))
|
||||
```
|
||||
|
||||
#### In handlers with current bot
|
||||
```python3
|
||||
result: bool = await AnswerPreCheckoutQuery(...)
|
||||
```
|
||||
|
||||
|
||||
## Related pages:
|
||||
|
||||
- [Official documentation](https://core.telegram.org/bots/api#answerprecheckoutquery)
|
||||
62
docs/api/methods/answer_shipping_query.md
Normal file
62
docs/api/methods/answer_shipping_query.md
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
# answerShippingQuery
|
||||
|
||||
## Description
|
||||
|
||||
If you sent an invoice requesting a shipping address and the parameter is_flexible was specified, the Bot API will send an Update with a shipping_query field to the bot. Use this method to reply to shipping queries. On success, True is returned.
|
||||
|
||||
|
||||
## Arguments
|
||||
|
||||
| Name | Type | Description |
|
||||
| - | - | - |
|
||||
| `shipping_query_id` | `#!python3 str` | Unique identifier for the query to be answered |
|
||||
| `ok` | `#!python3 bool` | Specify True if delivery to the specified address is possible and False if there are any problems (for example, if delivery to the specified address is not possible) |
|
||||
| `shipping_options` | `#!python3 Optional[List[ShippingOption]]` | Optional. Required if ok is True. A JSON-serialized array of available shipping options. |
|
||||
| `error_message` | `#!python3 Optional[str]` | Optional. Required if ok is False. Error message in human readable form that explains why it is impossible to complete the order (e.g. "Sorry, delivery to your desired address is unavailable'). Telegram will display this message to the user. |
|
||||
|
||||
|
||||
|
||||
## Response
|
||||
|
||||
Type: `#!python3 bool`
|
||||
|
||||
Description: On success, True is returned.
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
|
||||
### As bot method bot
|
||||
|
||||
```python3
|
||||
result: bool = await bot.answer_shipping_query(...)
|
||||
```
|
||||
|
||||
### Method as object
|
||||
|
||||
Imports:
|
||||
|
||||
- `from aiogram.types import AnswerShippingQuery`
|
||||
- `from aiogram.api.types import AnswerShippingQuery`
|
||||
- `from aiogram.api.types.answer_shipping_query import AnswerShippingQuery`
|
||||
|
||||
#### As reply into Webhook
|
||||
```python3
|
||||
return AnswerShippingQuery(...)
|
||||
```
|
||||
|
||||
#### With specific bot
|
||||
```python3
|
||||
result: bool = await bot.emit(AnswerShippingQuery(...))
|
||||
```
|
||||
|
||||
#### In handlers with current bot
|
||||
```python3
|
||||
result: bool = await AnswerShippingQuery(...)
|
||||
```
|
||||
|
||||
|
||||
## Related pages:
|
||||
|
||||
- [Official documentation](https://core.telegram.org/bots/api#answershippingquery)
|
||||
- [aiogram.types.ShippingOption](../types/shipping_option.md)
|
||||
66
docs/api/methods/create_new_sticker_set.md
Normal file
66
docs/api/methods/create_new_sticker_set.md
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
# createNewStickerSet
|
||||
|
||||
## Description
|
||||
|
||||
Use this method to create new sticker set owned by a user. The bot will be able to edit the created sticker set. Returns True on success.
|
||||
|
||||
|
||||
## Arguments
|
||||
|
||||
| Name | Type | Description |
|
||||
| - | - | - |
|
||||
| `user_id` | `#!python3 int` | User identifier of created sticker set owner |
|
||||
| `name` | `#!python3 str` | Short name of sticker set, to be used in t.me/addstickers/ URLs (e.g., animals). Can contain only english letters, digits and underscores. Must begin with a letter, can't contain consecutive underscores and must end in '_by_<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 |
|
||||
| `contains_masks` | `#!python3 Optional[bool]` | Optional. Pass True, if a set of mask stickers should be created |
|
||||
| `mask_position` | `#!python3 Optional[MaskPosition]` | Optional. A JSON-serialized object for position where the mask should be placed on faces |
|
||||
|
||||
|
||||
|
||||
## Response
|
||||
|
||||
Type: `#!python3 bool`
|
||||
|
||||
Description: Returns True on success.
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
|
||||
### As bot method bot
|
||||
|
||||
```python3
|
||||
result: bool = await bot.create_new_sticker_set(...)
|
||||
```
|
||||
|
||||
### Method as object
|
||||
|
||||
Imports:
|
||||
|
||||
- `from aiogram.types import CreateNewStickerSet`
|
||||
- `from aiogram.api.types import CreateNewStickerSet`
|
||||
- `from aiogram.api.types.create_new_sticker_set import CreateNewStickerSet`
|
||||
|
||||
#### As reply into Webhook
|
||||
```python3
|
||||
return CreateNewStickerSet(...)
|
||||
```
|
||||
|
||||
#### With specific bot
|
||||
```python3
|
||||
result: bool = await bot.emit(CreateNewStickerSet(...))
|
||||
```
|
||||
|
||||
#### In handlers with current bot
|
||||
```python3
|
||||
result: bool = await CreateNewStickerSet(...)
|
||||
```
|
||||
|
||||
|
||||
## Related pages:
|
||||
|
||||
- [Official documentation](https://core.telegram.org/bots/api#createnewstickerset)
|
||||
- [aiogram.types.InputFile](../types/input_file.md)
|
||||
- [aiogram.types.MaskPosition](../types/mask_position.md)
|
||||
58
docs/api/methods/delete_chat_photo.md
Normal file
58
docs/api/methods/delete_chat_photo.md
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
# deleteChatPhoto
|
||||
|
||||
## Description
|
||||
|
||||
Use this method to delete a chat photo. Photos can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Returns True on success.
|
||||
|
||||
|
||||
## Arguments
|
||||
|
||||
| Name | Type | Description |
|
||||
| - | - | - |
|
||||
| `chat_id` | `#!python3 Union[int, str]` | Unique identifier for the target chat or username of the target channel (in the format @channelusername) |
|
||||
|
||||
|
||||
|
||||
## Response
|
||||
|
||||
Type: `#!python3 bool`
|
||||
|
||||
Description: Returns True on success.
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
|
||||
### As bot method bot
|
||||
|
||||
```python3
|
||||
result: bool = await bot.delete_chat_photo(...)
|
||||
```
|
||||
|
||||
### Method as object
|
||||
|
||||
Imports:
|
||||
|
||||
- `from aiogram.types import DeleteChatPhoto`
|
||||
- `from aiogram.api.types import DeleteChatPhoto`
|
||||
- `from aiogram.api.types.delete_chat_photo import DeleteChatPhoto`
|
||||
|
||||
#### As reply into Webhook
|
||||
```python3
|
||||
return DeleteChatPhoto(...)
|
||||
```
|
||||
|
||||
#### With specific bot
|
||||
```python3
|
||||
result: bool = await bot.emit(DeleteChatPhoto(...))
|
||||
```
|
||||
|
||||
#### In handlers with current bot
|
||||
```python3
|
||||
result: bool = await DeleteChatPhoto(...)
|
||||
```
|
||||
|
||||
|
||||
## Related pages:
|
||||
|
||||
- [Official documentation](https://core.telegram.org/bots/api#deletechatphoto)
|
||||
58
docs/api/methods/delete_chat_sticker_set.md
Normal file
58
docs/api/methods/delete_chat_sticker_set.md
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
# deleteChatStickerSet
|
||||
|
||||
## Description
|
||||
|
||||
Use this method to delete a group sticker set from a supergroup. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Use the field can_set_sticker_set optionally returned in getChat requests to check if the bot can use this method. Returns True on success.
|
||||
|
||||
|
||||
## Arguments
|
||||
|
||||
| Name | Type | Description |
|
||||
| - | - | - |
|
||||
| `chat_id` | `#!python3 Union[int, str]` | Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) |
|
||||
|
||||
|
||||
|
||||
## Response
|
||||
|
||||
Type: `#!python3 bool`
|
||||
|
||||
Description: Use the field can_set_sticker_set optionally returned in getChat requests to check if the bot can use this method. Returns True on success.
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
|
||||
### As bot method bot
|
||||
|
||||
```python3
|
||||
result: bool = await bot.delete_chat_sticker_set(...)
|
||||
```
|
||||
|
||||
### Method as object
|
||||
|
||||
Imports:
|
||||
|
||||
- `from aiogram.types import DeleteChatStickerSet`
|
||||
- `from aiogram.api.types import DeleteChatStickerSet`
|
||||
- `from aiogram.api.types.delete_chat_sticker_set import DeleteChatStickerSet`
|
||||
|
||||
#### As reply into Webhook
|
||||
```python3
|
||||
return DeleteChatStickerSet(...)
|
||||
```
|
||||
|
||||
#### With specific bot
|
||||
```python3
|
||||
result: bool = await bot.emit(DeleteChatStickerSet(...))
|
||||
```
|
||||
|
||||
#### In handlers with current bot
|
||||
```python3
|
||||
result: bool = await DeleteChatStickerSet(...)
|
||||
```
|
||||
|
||||
|
||||
## Related pages:
|
||||
|
||||
- [Official documentation](https://core.telegram.org/bots/api#deletechatstickerset)
|
||||
73
docs/api/methods/delete_message.md
Normal file
73
docs/api/methods/delete_message.md
Normal file
|
|
@ -0,0 +1,73 @@
|
|||
# deleteMessage
|
||||
|
||||
## Description
|
||||
|
||||
Use this method to delete a message, including service messages, with the following limitations:
|
||||
|
||||
- A message can only be deleted if it was sent less than 48 hours ago.
|
||||
|
||||
- Bots can delete outgoing messages in private chats, groups, and supergroups.
|
||||
|
||||
- Bots can delete incoming messages in private chats.
|
||||
|
||||
- Bots granted can_post_messages permissions can delete outgoing messages in channels.
|
||||
|
||||
- If the bot is an administrator of a group, it can delete any message there.
|
||||
|
||||
- If the bot has can_delete_messages permission in a supergroup or a channel, it can delete any message there.
|
||||
|
||||
Returns True on success.
|
||||
|
||||
|
||||
## Arguments
|
||||
|
||||
| Name | Type | Description |
|
||||
| - | - | - |
|
||||
| `chat_id` | `#!python3 Union[int, str]` | Unique identifier for the target chat or username of the target channel (in the format @channelusername) |
|
||||
| `message_id` | `#!python3 int` | Identifier of the message to delete |
|
||||
|
||||
|
||||
|
||||
## Response
|
||||
|
||||
Type: `#!python3 bool`
|
||||
|
||||
Description: Returns True on success.
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
|
||||
### As bot method bot
|
||||
|
||||
```python3
|
||||
result: bool = await bot.delete_message(...)
|
||||
```
|
||||
|
||||
### Method as object
|
||||
|
||||
Imports:
|
||||
|
||||
- `from aiogram.types import DeleteMessage`
|
||||
- `from aiogram.api.types import DeleteMessage`
|
||||
- `from aiogram.api.types.delete_message import DeleteMessage`
|
||||
|
||||
#### As reply into Webhook
|
||||
```python3
|
||||
return DeleteMessage(...)
|
||||
```
|
||||
|
||||
#### With specific bot
|
||||
```python3
|
||||
result: bool = await bot.emit(DeleteMessage(...))
|
||||
```
|
||||
|
||||
#### In handlers with current bot
|
||||
```python3
|
||||
result: bool = await DeleteMessage(...)
|
||||
```
|
||||
|
||||
|
||||
## Related pages:
|
||||
|
||||
- [Official documentation](https://core.telegram.org/bots/api#deletemessage)
|
||||
58
docs/api/methods/delete_sticker_from_set.md
Normal file
58
docs/api/methods/delete_sticker_from_set.md
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
# deleteStickerFromSet
|
||||
|
||||
## Description
|
||||
|
||||
Use this method to delete a sticker from a set created by the bot. Returns True on success.
|
||||
|
||||
|
||||
## Arguments
|
||||
|
||||
| Name | Type | Description |
|
||||
| - | - | - |
|
||||
| `sticker` | `#!python3 str` | File identifier of the sticker |
|
||||
|
||||
|
||||
|
||||
## Response
|
||||
|
||||
Type: `#!python3 bool`
|
||||
|
||||
Description: Returns True on success.
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
|
||||
### As bot method bot
|
||||
|
||||
```python3
|
||||
result: bool = await bot.delete_sticker_from_set(...)
|
||||
```
|
||||
|
||||
### Method as object
|
||||
|
||||
Imports:
|
||||
|
||||
- `from aiogram.types import DeleteStickerFromSet`
|
||||
- `from aiogram.api.types import DeleteStickerFromSet`
|
||||
- `from aiogram.api.types.delete_sticker_from_set import DeleteStickerFromSet`
|
||||
|
||||
#### As reply into Webhook
|
||||
```python3
|
||||
return DeleteStickerFromSet(...)
|
||||
```
|
||||
|
||||
#### With specific bot
|
||||
```python3
|
||||
result: bool = await bot.emit(DeleteStickerFromSet(...))
|
||||
```
|
||||
|
||||
#### In handlers with current bot
|
||||
```python3
|
||||
result: bool = await DeleteStickerFromSet(...)
|
||||
```
|
||||
|
||||
|
||||
## Related pages:
|
||||
|
||||
- [Official documentation](https://core.telegram.org/bots/api#deletestickerfromset)
|
||||
52
docs/api/methods/delete_webhook.md
Normal file
52
docs/api/methods/delete_webhook.md
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
# deleteWebhook
|
||||
|
||||
## Description
|
||||
|
||||
Use this method to remove webhook integration if you decide to switch back to getUpdates. Returns True on success. Requires no parameters.
|
||||
|
||||
|
||||
|
||||
|
||||
## Response
|
||||
|
||||
Type: `#!python3 bool`
|
||||
|
||||
Description: Returns True on success.
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
|
||||
### As bot method bot
|
||||
|
||||
```python3
|
||||
result: bool = await bot.delete_webhook(...)
|
||||
```
|
||||
|
||||
### Method as object
|
||||
|
||||
Imports:
|
||||
|
||||
- `from aiogram.types import DeleteWebhook`
|
||||
- `from aiogram.api.types import DeleteWebhook`
|
||||
- `from aiogram.api.types.delete_webhook import DeleteWebhook`
|
||||
|
||||
#### As reply into Webhook
|
||||
```python3
|
||||
return DeleteWebhook(...)
|
||||
```
|
||||
|
||||
#### With specific bot
|
||||
```python3
|
||||
result: bool = await bot.emit(DeleteWebhook(...))
|
||||
```
|
||||
|
||||
#### In handlers with current bot
|
||||
```python3
|
||||
result: bool = await DeleteWebhook(...)
|
||||
```
|
||||
|
||||
|
||||
## Related pages:
|
||||
|
||||
- [Official documentation](https://core.telegram.org/bots/api#deletewebhook)
|
||||
65
docs/api/methods/edit_message_caption.md
Normal file
65
docs/api/methods/edit_message_caption.md
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
# editMessageCaption
|
||||
|
||||
## Description
|
||||
|
||||
Use this method to edit captions of messages. On success, if edited message is sent by the bot, the edited Message is returned, otherwise True is returned.
|
||||
|
||||
|
||||
## Arguments
|
||||
|
||||
| Name | Type | Description |
|
||||
| - | - | - |
|
||||
| `chat_id` | `#!python3 Optional[Union[int, str]]` | Optional. Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername) |
|
||||
| `message_id` | `#!python3 Optional[int]` | Optional. Required if inline_message_id is not specified. Identifier of the message to edit |
|
||||
| `inline_message_id` | `#!python3 Optional[str]` | Optional. Required if chat_id and message_id are not specified. Identifier of the inline message |
|
||||
| `caption` | `#!python3 Optional[str]` | Optional. New caption of the message |
|
||||
| `parse_mode` | `#!python3 Optional[str]` | Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption. |
|
||||
| `reply_markup` | `#!python3 Optional[InlineKeyboardMarkup]` | Optional. A JSON-serialized object for an inline keyboard. |
|
||||
|
||||
|
||||
|
||||
## Response
|
||||
|
||||
Type: `#!python3 Union[Message, bool]`
|
||||
|
||||
Description: On success, if edited message is sent by the bot, the edited Message is returned, otherwise True is returned.
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
|
||||
### As bot method bot
|
||||
|
||||
```python3
|
||||
result: Union[Message, bool] = await bot.edit_message_caption(...)
|
||||
```
|
||||
|
||||
### Method as object
|
||||
|
||||
Imports:
|
||||
|
||||
- `from aiogram.types import EditMessageCaption`
|
||||
- `from aiogram.api.types import EditMessageCaption`
|
||||
- `from aiogram.api.types.edit_message_caption import EditMessageCaption`
|
||||
|
||||
#### As reply into Webhook
|
||||
```python3
|
||||
return EditMessageCaption(...)
|
||||
```
|
||||
|
||||
#### With specific bot
|
||||
```python3
|
||||
result: Union[Message, bool] = await bot.emit(EditMessageCaption(...))
|
||||
```
|
||||
|
||||
#### In handlers with current bot
|
||||
```python3
|
||||
result: Union[Message, bool] = await EditMessageCaption(...)
|
||||
```
|
||||
|
||||
|
||||
## Related pages:
|
||||
|
||||
- [Official documentation](https://core.telegram.org/bots/api#editmessagecaption)
|
||||
- [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md)
|
||||
- [aiogram.types.Message](../types/message.md)
|
||||
65
docs/api/methods/edit_message_live_location.md
Normal file
65
docs/api/methods/edit_message_live_location.md
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
# editMessageLiveLocation
|
||||
|
||||
## Description
|
||||
|
||||
Use this method to edit live location messages. A location can be edited until its live_period expires or editing is explicitly disabled by a call to stopMessageLiveLocation. On success, if the edited message was sent by the bot, the edited Message is returned, otherwise True is returned.
|
||||
|
||||
|
||||
## Arguments
|
||||
|
||||
| Name | Type | Description |
|
||||
| - | - | - |
|
||||
| `latitude` | `#!python3 float` | Latitude of new location |
|
||||
| `longitude` | `#!python3 float` | Longitude of new location |
|
||||
| `chat_id` | `#!python3 Optional[Union[int, str]]` | Optional. Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername) |
|
||||
| `message_id` | `#!python3 Optional[int]` | Optional. Required if inline_message_id is not specified. Identifier of the message to edit |
|
||||
| `inline_message_id` | `#!python3 Optional[str]` | Optional. Required if chat_id and message_id are not specified. Identifier of the inline message |
|
||||
| `reply_markup` | `#!python3 Optional[InlineKeyboardMarkup]` | Optional. A JSON-serialized object for a new inline keyboard. |
|
||||
|
||||
|
||||
|
||||
## Response
|
||||
|
||||
Type: `#!python3 Union[Message, bool]`
|
||||
|
||||
Description: On success, if the edited message was sent by the bot, the edited Message is returned, otherwise True is returned.
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
|
||||
### As bot method bot
|
||||
|
||||
```python3
|
||||
result: Union[Message, bool] = await bot.edit_message_live_location(...)
|
||||
```
|
||||
|
||||
### Method as object
|
||||
|
||||
Imports:
|
||||
|
||||
- `from aiogram.types import EditMessageLiveLocation`
|
||||
- `from aiogram.api.types import EditMessageLiveLocation`
|
||||
- `from aiogram.api.types.edit_message_live_location import EditMessageLiveLocation`
|
||||
|
||||
#### As reply into Webhook
|
||||
```python3
|
||||
return EditMessageLiveLocation(...)
|
||||
```
|
||||
|
||||
#### With specific bot
|
||||
```python3
|
||||
result: Union[Message, bool] = await bot.emit(EditMessageLiveLocation(...))
|
||||
```
|
||||
|
||||
#### In handlers with current bot
|
||||
```python3
|
||||
result: Union[Message, bool] = await EditMessageLiveLocation(...)
|
||||
```
|
||||
|
||||
|
||||
## Related pages:
|
||||
|
||||
- [Official documentation](https://core.telegram.org/bots/api#editmessagelivelocation)
|
||||
- [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md)
|
||||
- [aiogram.types.Message](../types/message.md)
|
||||
65
docs/api/methods/edit_message_media.md
Normal file
65
docs/api/methods/edit_message_media.md
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
# editMessageMedia
|
||||
|
||||
## Description
|
||||
|
||||
Use this method to edit animation, audio, document, photo, or video messages. If a message is a part of a message album, then it can be edited only to a photo or a video. Otherwise, message type can be changed arbitrarily. When inline message is edited, new file can't be uploaded. Use previously uploaded file via its file_id or specify a URL. On success, if the edited message was sent by the bot, the edited Message is returned, otherwise True is returned.
|
||||
|
||||
|
||||
## Arguments
|
||||
|
||||
| Name | Type | Description |
|
||||
| - | - | - |
|
||||
| `media` | `#!python3 InputMedia` | A JSON-serialized object for a new media content of the message |
|
||||
| `chat_id` | `#!python3 Optional[Union[int, str]]` | Optional. Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername) |
|
||||
| `message_id` | `#!python3 Optional[int]` | Optional. Required if inline_message_id is not specified. Identifier of the message to edit |
|
||||
| `inline_message_id` | `#!python3 Optional[str]` | Optional. Required if chat_id and message_id are not specified. Identifier of the inline message |
|
||||
| `reply_markup` | `#!python3 Optional[InlineKeyboardMarkup]` | Optional. A JSON-serialized object for a new inline keyboard. |
|
||||
|
||||
|
||||
|
||||
## Response
|
||||
|
||||
Type: `#!python3 Union[Message, bool]`
|
||||
|
||||
Description: On success, if the edited message was sent by the bot, the edited Message is returned, otherwise True is returned.
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
|
||||
### As bot method bot
|
||||
|
||||
```python3
|
||||
result: Union[Message, bool] = await bot.edit_message_media(...)
|
||||
```
|
||||
|
||||
### Method as object
|
||||
|
||||
Imports:
|
||||
|
||||
- `from aiogram.types import EditMessageMedia`
|
||||
- `from aiogram.api.types import EditMessageMedia`
|
||||
- `from aiogram.api.types.edit_message_media import EditMessageMedia`
|
||||
|
||||
#### As reply into Webhook
|
||||
```python3
|
||||
return EditMessageMedia(...)
|
||||
```
|
||||
|
||||
#### With specific bot
|
||||
```python3
|
||||
result: Union[Message, bool] = await bot.emit(EditMessageMedia(...))
|
||||
```
|
||||
|
||||
#### In handlers with current bot
|
||||
```python3
|
||||
result: Union[Message, bool] = await EditMessageMedia(...)
|
||||
```
|
||||
|
||||
|
||||
## Related pages:
|
||||
|
||||
- [Official documentation](https://core.telegram.org/bots/api#editmessagemedia)
|
||||
- [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md)
|
||||
- [aiogram.types.InputMedia](../types/input_media.md)
|
||||
- [aiogram.types.Message](../types/message.md)
|
||||
63
docs/api/methods/edit_message_reply_markup.md
Normal file
63
docs/api/methods/edit_message_reply_markup.md
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
# editMessageReplyMarkup
|
||||
|
||||
## Description
|
||||
|
||||
Use this method to edit only the reply markup of messages. On success, if edited message is sent by the bot, the edited Message is returned, otherwise True is returned.
|
||||
|
||||
|
||||
## Arguments
|
||||
|
||||
| Name | Type | Description |
|
||||
| - | - | - |
|
||||
| `chat_id` | `#!python3 Optional[Union[int, str]]` | Optional. Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername) |
|
||||
| `message_id` | `#!python3 Optional[int]` | Optional. Required if inline_message_id is not specified. Identifier of the message to edit |
|
||||
| `inline_message_id` | `#!python3 Optional[str]` | Optional. Required if chat_id and message_id are not specified. Identifier of the inline message |
|
||||
| `reply_markup` | `#!python3 Optional[InlineKeyboardMarkup]` | Optional. A JSON-serialized object for an inline keyboard. |
|
||||
|
||||
|
||||
|
||||
## Response
|
||||
|
||||
Type: `#!python3 Union[Message, bool]`
|
||||
|
||||
Description: On success, if edited message is sent by the bot, the edited Message is returned, otherwise True is returned.
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
|
||||
### As bot method bot
|
||||
|
||||
```python3
|
||||
result: Union[Message, bool] = await bot.edit_message_reply_markup(...)
|
||||
```
|
||||
|
||||
### Method as object
|
||||
|
||||
Imports:
|
||||
|
||||
- `from aiogram.types import EditMessageReplyMarkup`
|
||||
- `from aiogram.api.types import EditMessageReplyMarkup`
|
||||
- `from aiogram.api.types.edit_message_reply_markup import EditMessageReplyMarkup`
|
||||
|
||||
#### As reply into Webhook
|
||||
```python3
|
||||
return EditMessageReplyMarkup(...)
|
||||
```
|
||||
|
||||
#### With specific bot
|
||||
```python3
|
||||
result: Union[Message, bool] = await bot.emit(EditMessageReplyMarkup(...))
|
||||
```
|
||||
|
||||
#### In handlers with current bot
|
||||
```python3
|
||||
result: Union[Message, bool] = await EditMessageReplyMarkup(...)
|
||||
```
|
||||
|
||||
|
||||
## Related pages:
|
||||
|
||||
- [Official documentation](https://core.telegram.org/bots/api#editmessagereplymarkup)
|
||||
- [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md)
|
||||
- [aiogram.types.Message](../types/message.md)
|
||||
66
docs/api/methods/edit_message_text.md
Normal file
66
docs/api/methods/edit_message_text.md
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
# editMessageText
|
||||
|
||||
## Description
|
||||
|
||||
Use this method to edit text and game messages. On success, if edited message is sent by the bot, the edited Message is returned, otherwise True is returned.
|
||||
|
||||
|
||||
## Arguments
|
||||
|
||||
| Name | Type | Description |
|
||||
| - | - | - |
|
||||
| `text` | `#!python3 str` | New text of the message |
|
||||
| `chat_id` | `#!python3 Optional[Union[int, str]]` | Optional. Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername) |
|
||||
| `message_id` | `#!python3 Optional[int]` | Optional. Required if inline_message_id is not specified. Identifier of the message to edit |
|
||||
| `inline_message_id` | `#!python3 Optional[str]` | Optional. Required if chat_id and message_id are not specified. Identifier of the inline message |
|
||||
| `parse_mode` | `#!python3 Optional[str]` | Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in your bot's message. |
|
||||
| `disable_web_page_preview` | `#!python3 Optional[bool]` | Optional. Disables link previews for links in this message |
|
||||
| `reply_markup` | `#!python3 Optional[InlineKeyboardMarkup]` | Optional. A JSON-serialized object for an inline keyboard. |
|
||||
|
||||
|
||||
|
||||
## Response
|
||||
|
||||
Type: `#!python3 Union[Message, bool]`
|
||||
|
||||
Description: On success, if edited message is sent by the bot, the edited Message is returned, otherwise True is returned.
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
|
||||
### As bot method bot
|
||||
|
||||
```python3
|
||||
result: Union[Message, bool] = await bot.edit_message_text(...)
|
||||
```
|
||||
|
||||
### Method as object
|
||||
|
||||
Imports:
|
||||
|
||||
- `from aiogram.types import EditMessageText`
|
||||
- `from aiogram.api.types import EditMessageText`
|
||||
- `from aiogram.api.types.edit_message_text import EditMessageText`
|
||||
|
||||
#### As reply into Webhook
|
||||
```python3
|
||||
return EditMessageText(...)
|
||||
```
|
||||
|
||||
#### With specific bot
|
||||
```python3
|
||||
result: Union[Message, bool] = await bot.emit(EditMessageText(...))
|
||||
```
|
||||
|
||||
#### In handlers with current bot
|
||||
```python3
|
||||
result: Union[Message, bool] = await EditMessageText(...)
|
||||
```
|
||||
|
||||
|
||||
## Related pages:
|
||||
|
||||
- [Official documentation](https://core.telegram.org/bots/api#editmessagetext)
|
||||
- [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md)
|
||||
- [aiogram.types.Message](../types/message.md)
|
||||
60
docs/api/methods/export_chat_invite_link.md
Normal file
60
docs/api/methods/export_chat_invite_link.md
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
# exportChatInviteLink
|
||||
|
||||
## Description
|
||||
|
||||
Use this method to generate a new invite link for a chat; any previously generated link is revoked. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Returns the new invite link as String on success.
|
||||
|
||||
Note: Each administrator in a chat generates their own invite links. Bots can't use invite links generated by other administrators. If you want your bot to work with invite links, it will need to generate its own link using exportChatInviteLink – after this the link will become available to the bot via the getChat method. If your bot needs to generate a new invite link replacing its previous one, use exportChatInviteLink again.
|
||||
|
||||
|
||||
## Arguments
|
||||
|
||||
| Name | Type | Description |
|
||||
| - | - | - |
|
||||
| `chat_id` | `#!python3 Union[int, str]` | Unique identifier for the target chat or username of the target channel (in the format @channelusername) |
|
||||
|
||||
|
||||
|
||||
## Response
|
||||
|
||||
Type: `#!python3 str`
|
||||
|
||||
Description: Returns the new invite link as String on success.
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
|
||||
### As bot method bot
|
||||
|
||||
```python3
|
||||
result: str = await bot.export_chat_invite_link(...)
|
||||
```
|
||||
|
||||
### Method as object
|
||||
|
||||
Imports:
|
||||
|
||||
- `from aiogram.types import ExportChatInviteLink`
|
||||
- `from aiogram.api.types import ExportChatInviteLink`
|
||||
- `from aiogram.api.types.export_chat_invite_link import ExportChatInviteLink`
|
||||
|
||||
#### As reply into Webhook
|
||||
```python3
|
||||
return ExportChatInviteLink(...)
|
||||
```
|
||||
|
||||
#### With specific bot
|
||||
```python3
|
||||
result: str = await bot.emit(ExportChatInviteLink(...))
|
||||
```
|
||||
|
||||
#### In handlers with current bot
|
||||
```python3
|
||||
result: str = await ExportChatInviteLink(...)
|
||||
```
|
||||
|
||||
|
||||
## Related pages:
|
||||
|
||||
- [Official documentation](https://core.telegram.org/bots/api#exportchatinvitelink)
|
||||
62
docs/api/methods/forward_message.md
Normal file
62
docs/api/methods/forward_message.md
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
# forwardMessage
|
||||
|
||||
## Description
|
||||
|
||||
Use this method to forward messages of any kind. On success, the sent Message is returned.
|
||||
|
||||
|
||||
## Arguments
|
||||
|
||||
| Name | Type | Description |
|
||||
| - | - | - |
|
||||
| `chat_id` | `#!python3 Union[int, str]` | Unique identifier for the target chat or username of the target channel (in the format @channelusername) |
|
||||
| `from_chat_id` | `#!python3 Union[int, str]` | Unique identifier for the chat where the original message was sent (or channel username in the format @channelusername) |
|
||||
| `message_id` | `#!python3 int` | Message identifier in the chat specified in from_chat_id |
|
||||
| `disable_notification` | `#!python3 Optional[bool]` | Optional. Sends the message silently. Users will receive a notification with no sound. |
|
||||
|
||||
|
||||
|
||||
## Response
|
||||
|
||||
Type: `#!python3 Message`
|
||||
|
||||
Description: On success, the sent Message is returned.
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
|
||||
### As bot method bot
|
||||
|
||||
```python3
|
||||
result: Message = await bot.forward_message(...)
|
||||
```
|
||||
|
||||
### Method as object
|
||||
|
||||
Imports:
|
||||
|
||||
- `from aiogram.types import ForwardMessage`
|
||||
- `from aiogram.api.types import ForwardMessage`
|
||||
- `from aiogram.api.types.forward_message import ForwardMessage`
|
||||
|
||||
#### As reply into Webhook
|
||||
```python3
|
||||
return ForwardMessage(...)
|
||||
```
|
||||
|
||||
#### With specific bot
|
||||
```python3
|
||||
result: Message = await bot.emit(ForwardMessage(...))
|
||||
```
|
||||
|
||||
#### In handlers with current bot
|
||||
```python3
|
||||
result: Message = await ForwardMessage(...)
|
||||
```
|
||||
|
||||
|
||||
## Related pages:
|
||||
|
||||
- [Official documentation](https://core.telegram.org/bots/api#forwardmessage)
|
||||
- [aiogram.types.Message](../types/message.md)
|
||||
55
docs/api/methods/get_chat.md
Normal file
55
docs/api/methods/get_chat.md
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
# getChat
|
||||
|
||||
## Description
|
||||
|
||||
Use this method to get up to date information about the chat (current name of the user for one-on-one conversations, current username of a user, group or channel, etc.). Returns a Chat object on success.
|
||||
|
||||
|
||||
## Arguments
|
||||
|
||||
| Name | Type | Description |
|
||||
| - | - | - |
|
||||
| `chat_id` | `#!python3 Union[int, str]` | Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername) |
|
||||
|
||||
|
||||
|
||||
## Response
|
||||
|
||||
Type: `#!python3 Chat`
|
||||
|
||||
Description: Returns a Chat object on success.
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
|
||||
### As bot method bot
|
||||
|
||||
```python3
|
||||
result: Chat = await bot.get_chat(...)
|
||||
```
|
||||
|
||||
### Method as object
|
||||
|
||||
Imports:
|
||||
|
||||
- `from aiogram.types import GetChat`
|
||||
- `from aiogram.api.types import GetChat`
|
||||
- `from aiogram.api.types.get_chat import GetChat`
|
||||
|
||||
|
||||
#### With specific bot
|
||||
```python3
|
||||
result: Chat = await bot.emit(GetChat(...))
|
||||
```
|
||||
|
||||
#### In handlers with current bot
|
||||
```python3
|
||||
result: Chat = await GetChat(...)
|
||||
```
|
||||
|
||||
|
||||
## Related pages:
|
||||
|
||||
- [Official documentation](https://core.telegram.org/bots/api#getchat)
|
||||
- [aiogram.types.Chat](../types/chat.md)
|
||||
55
docs/api/methods/get_chat_administrators.md
Normal file
55
docs/api/methods/get_chat_administrators.md
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
# getChatAdministrators
|
||||
|
||||
## Description
|
||||
|
||||
Use this method to get a list of administrators in a chat. On success, returns an Array of ChatMember objects that contains information about all chat administrators except other bots. If the chat is a group or a supergroup and no administrators were appointed, only the creator will be returned.
|
||||
|
||||
|
||||
## Arguments
|
||||
|
||||
| Name | Type | Description |
|
||||
| - | - | - |
|
||||
| `chat_id` | `#!python3 Union[int, str]` | Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername) |
|
||||
|
||||
|
||||
|
||||
## Response
|
||||
|
||||
Type: `#!python3 List[ChatMember]`
|
||||
|
||||
Description: On success, returns an Array of ChatMember objects that contains information about all chat administrators except other bots. If the chat is a group or a supergroup and no administrators were appointed, only the creator will be returned.
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
|
||||
### As bot method bot
|
||||
|
||||
```python3
|
||||
result: List[ChatMember] = await bot.get_chat_administrators(...)
|
||||
```
|
||||
|
||||
### Method as object
|
||||
|
||||
Imports:
|
||||
|
||||
- `from aiogram.types import GetChatAdministrators`
|
||||
- `from aiogram.api.types import GetChatAdministrators`
|
||||
- `from aiogram.api.types.get_chat_administrators import GetChatAdministrators`
|
||||
|
||||
|
||||
#### With specific bot
|
||||
```python3
|
||||
result: List[ChatMember] = await bot.emit(GetChatAdministrators(...))
|
||||
```
|
||||
|
||||
#### In handlers with current bot
|
||||
```python3
|
||||
result: List[ChatMember] = await GetChatAdministrators(...)
|
||||
```
|
||||
|
||||
|
||||
## Related pages:
|
||||
|
||||
- [Official documentation](https://core.telegram.org/bots/api#getchatadministrators)
|
||||
- [aiogram.types.ChatMember](../types/chat_member.md)
|
||||
56
docs/api/methods/get_chat_member.md
Normal file
56
docs/api/methods/get_chat_member.md
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
# getChatMember
|
||||
|
||||
## Description
|
||||
|
||||
Use this method to get information about a member of a chat. Returns a ChatMember object on success.
|
||||
|
||||
|
||||
## Arguments
|
||||
|
||||
| Name | Type | Description |
|
||||
| - | - | - |
|
||||
| `chat_id` | `#!python3 Union[int, str]` | Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername) |
|
||||
| `user_id` | `#!python3 int` | Unique identifier of the target user |
|
||||
|
||||
|
||||
|
||||
## Response
|
||||
|
||||
Type: `#!python3 ChatMember`
|
||||
|
||||
Description: Returns a ChatMember object on success.
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
|
||||
### As bot method bot
|
||||
|
||||
```python3
|
||||
result: ChatMember = await bot.get_chat_member(...)
|
||||
```
|
||||
|
||||
### Method as object
|
||||
|
||||
Imports:
|
||||
|
||||
- `from aiogram.types import GetChatMember`
|
||||
- `from aiogram.api.types import GetChatMember`
|
||||
- `from aiogram.api.types.get_chat_member import GetChatMember`
|
||||
|
||||
|
||||
#### With specific bot
|
||||
```python3
|
||||
result: ChatMember = await bot.emit(GetChatMember(...))
|
||||
```
|
||||
|
||||
#### In handlers with current bot
|
||||
```python3
|
||||
result: ChatMember = await GetChatMember(...)
|
||||
```
|
||||
|
||||
|
||||
## Related pages:
|
||||
|
||||
- [Official documentation](https://core.telegram.org/bots/api#getchatmember)
|
||||
- [aiogram.types.ChatMember](../types/chat_member.md)
|
||||
54
docs/api/methods/get_chat_members_count.md
Normal file
54
docs/api/methods/get_chat_members_count.md
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
# getChatMembersCount
|
||||
|
||||
## Description
|
||||
|
||||
Use this method to get the number of members in a chat. Returns Int on success.
|
||||
|
||||
|
||||
## Arguments
|
||||
|
||||
| Name | Type | Description |
|
||||
| - | - | - |
|
||||
| `chat_id` | `#!python3 Union[int, str]` | Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername) |
|
||||
|
||||
|
||||
|
||||
## Response
|
||||
|
||||
Type: `#!python3 int`
|
||||
|
||||
Description: Returns Int on success.
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
|
||||
### As bot method bot
|
||||
|
||||
```python3
|
||||
result: int = await bot.get_chat_members_count(...)
|
||||
```
|
||||
|
||||
### Method as object
|
||||
|
||||
Imports:
|
||||
|
||||
- `from aiogram.types import GetChatMembersCount`
|
||||
- `from aiogram.api.types import GetChatMembersCount`
|
||||
- `from aiogram.api.types.get_chat_members_count import GetChatMembersCount`
|
||||
|
||||
|
||||
#### With specific bot
|
||||
```python3
|
||||
result: int = await bot.emit(GetChatMembersCount(...))
|
||||
```
|
||||
|
||||
#### In handlers with current bot
|
||||
```python3
|
||||
result: int = await GetChatMembersCount(...)
|
||||
```
|
||||
|
||||
|
||||
## Related pages:
|
||||
|
||||
- [Official documentation](https://core.telegram.org/bots/api#getchatmemberscount)
|
||||
57
docs/api/methods/get_file.md
Normal file
57
docs/api/methods/get_file.md
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
# getFile
|
||||
|
||||
## Description
|
||||
|
||||
Use this method to get basic info about a file and prepare it for downloading. For the moment, bots can download files of up to 20MB in size. On success, a File object is returned. The file can then be downloaded via the link https://api.telegram.org/file/bot<token>/<file_path>, where <file_path> is taken from the response. It is guaranteed that the link will be valid for at least 1 hour. When the link expires, a new one can be requested by calling getFile again.
|
||||
|
||||
Note: This function may not preserve the original file name and MIME type. You should save the file's MIME type and name (if available) when the File object is received.
|
||||
|
||||
|
||||
## Arguments
|
||||
|
||||
| Name | Type | Description |
|
||||
| - | - | - |
|
||||
| `file_id` | `#!python3 str` | File identifier to get info about |
|
||||
|
||||
|
||||
|
||||
## Response
|
||||
|
||||
Type: `#!python3 File`
|
||||
|
||||
Description: On success, a File object is returned.
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
|
||||
### As bot method bot
|
||||
|
||||
```python3
|
||||
result: File = await bot.get_file(...)
|
||||
```
|
||||
|
||||
### Method as object
|
||||
|
||||
Imports:
|
||||
|
||||
- `from aiogram.types import GetFile`
|
||||
- `from aiogram.api.types import GetFile`
|
||||
- `from aiogram.api.types.get_file import GetFile`
|
||||
|
||||
|
||||
#### With specific bot
|
||||
```python3
|
||||
result: File = await bot.emit(GetFile(...))
|
||||
```
|
||||
|
||||
#### In handlers with current bot
|
||||
```python3
|
||||
result: File = await GetFile(...)
|
||||
```
|
||||
|
||||
|
||||
## Related pages:
|
||||
|
||||
- [Official documentation](https://core.telegram.org/bots/api#getfile)
|
||||
- [aiogram.types.File](../types/file.md)
|
||||
60
docs/api/methods/get_game_high_scores.md
Normal file
60
docs/api/methods/get_game_high_scores.md
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
# getGameHighScores
|
||||
|
||||
## Description
|
||||
|
||||
Use this method to get data for high score tables. Will return the score of the specified user and several of his neighbors in a game. On success, returns an Array of GameHighScore objects.
|
||||
|
||||
This method will currently return scores for the target user, plus two of his closest neighbors on each side. Will also return the top three users if the user and his neighbors are not among them. Please note that this behavior is subject to change.
|
||||
|
||||
|
||||
## Arguments
|
||||
|
||||
| Name | Type | Description |
|
||||
| - | - | - |
|
||||
| `user_id` | `#!python3 int` | Target user id |
|
||||
| `chat_id` | `#!python3 Optional[int]` | Optional. Required if inline_message_id is not specified. Unique identifier for the target chat |
|
||||
| `message_id` | `#!python3 Optional[int]` | Optional. Required if inline_message_id is not specified. Identifier of the sent message |
|
||||
| `inline_message_id` | `#!python3 Optional[str]` | Optional. Required if chat_id and message_id are not specified. Identifier of the inline message |
|
||||
|
||||
|
||||
|
||||
## Response
|
||||
|
||||
Type: `#!python3 List[GameHighScore]`
|
||||
|
||||
Description: Will return the score of the specified user and several of his neighbors in a game. On success, returns an Array of GameHighScore objects. This method will currently return scores for the target user, plus two of his closest neighbors on each side. Will also return the top three users if the user and his neighbors are not among them.
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
|
||||
### As bot method bot
|
||||
|
||||
```python3
|
||||
result: List[GameHighScore] = await bot.get_game_high_scores(...)
|
||||
```
|
||||
|
||||
### Method as object
|
||||
|
||||
Imports:
|
||||
|
||||
- `from aiogram.types import GetGameHighScores`
|
||||
- `from aiogram.api.types import GetGameHighScores`
|
||||
- `from aiogram.api.types.get_game_high_scores import GetGameHighScores`
|
||||
|
||||
|
||||
#### With specific bot
|
||||
```python3
|
||||
result: List[GameHighScore] = await bot.emit(GetGameHighScores(...))
|
||||
```
|
||||
|
||||
#### In handlers with current bot
|
||||
```python3
|
||||
result: List[GameHighScore] = await GetGameHighScores(...)
|
||||
```
|
||||
|
||||
|
||||
## Related pages:
|
||||
|
||||
- [Official documentation](https://core.telegram.org/bots/api#getgamehighscores)
|
||||
- [aiogram.types.GameHighScore](../types/game_high_score.md)
|
||||
49
docs/api/methods/get_me.md
Normal file
49
docs/api/methods/get_me.md
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
# getMe
|
||||
|
||||
## Description
|
||||
|
||||
A simple method for testing your bot's auth token. Requires no parameters. Returns basic information about the bot in form of a User object.
|
||||
|
||||
|
||||
|
||||
|
||||
## Response
|
||||
|
||||
Type: `#!python3 User`
|
||||
|
||||
Description: Returns basic information about the bot in form of a User object.
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
|
||||
### As bot method bot
|
||||
|
||||
```python3
|
||||
result: User = await bot.get_me(...)
|
||||
```
|
||||
|
||||
### Method as object
|
||||
|
||||
Imports:
|
||||
|
||||
- `from aiogram.types import GetMe`
|
||||
- `from aiogram.api.types import GetMe`
|
||||
- `from aiogram.api.types.get_me import GetMe`
|
||||
|
||||
|
||||
#### With specific bot
|
||||
```python3
|
||||
result: User = await bot.emit(GetMe(...))
|
||||
```
|
||||
|
||||
#### In handlers with current bot
|
||||
```python3
|
||||
result: User = await GetMe(...)
|
||||
```
|
||||
|
||||
|
||||
## Related pages:
|
||||
|
||||
- [Official documentation](https://core.telegram.org/bots/api#getme)
|
||||
- [aiogram.types.User](../types/user.md)
|
||||
55
docs/api/methods/get_sticker_set.md
Normal file
55
docs/api/methods/get_sticker_set.md
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
# getStickerSet
|
||||
|
||||
## Description
|
||||
|
||||
Use this method to get a sticker set. On success, a StickerSet object is returned.
|
||||
|
||||
|
||||
## Arguments
|
||||
|
||||
| Name | Type | Description |
|
||||
| - | - | - |
|
||||
| `name` | `#!python3 str` | Name of the sticker set |
|
||||
|
||||
|
||||
|
||||
## Response
|
||||
|
||||
Type: `#!python3 StickerSet`
|
||||
|
||||
Description: On success, a StickerSet object is returned.
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
|
||||
### As bot method bot
|
||||
|
||||
```python3
|
||||
result: StickerSet = await bot.get_sticker_set(...)
|
||||
```
|
||||
|
||||
### Method as object
|
||||
|
||||
Imports:
|
||||
|
||||
- `from aiogram.types import GetStickerSet`
|
||||
- `from aiogram.api.types import GetStickerSet`
|
||||
- `from aiogram.api.types.get_sticker_set import GetStickerSet`
|
||||
|
||||
|
||||
#### With specific bot
|
||||
```python3
|
||||
result: StickerSet = await bot.emit(GetStickerSet(...))
|
||||
```
|
||||
|
||||
#### In handlers with current bot
|
||||
```python3
|
||||
result: StickerSet = await GetStickerSet(...)
|
||||
```
|
||||
|
||||
|
||||
## Related pages:
|
||||
|
||||
- [Official documentation](https://core.telegram.org/bots/api#getstickerset)
|
||||
- [aiogram.types.StickerSet](../types/sticker_set.md)
|
||||
64
docs/api/methods/get_updates.md
Normal file
64
docs/api/methods/get_updates.md
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
# getUpdates
|
||||
|
||||
## Description
|
||||
|
||||
Use this method to receive incoming updates using long polling (wiki). An Array of Update objects is returned.
|
||||
|
||||
Notes
|
||||
|
||||
1. This method will not work if an outgoing webhook is set up.
|
||||
|
||||
2. In order to avoid getting duplicate updates, recalculate offset after each server response.
|
||||
|
||||
|
||||
## Arguments
|
||||
|
||||
| Name | Type | Description |
|
||||
| - | - | - |
|
||||
| `offset` | `#!python3 Optional[int]` | Optional. Identifier of the first update to be returned. Must be greater by one than the highest among the identifiers of previously received updates. By default, updates starting with the earliest unconfirmed update are returned. An update is considered confirmed as soon as getUpdates is called with an offset higher than its update_id. The negative offset can be specified to retrieve updates starting from -offset update from the end of the updates queue. All previous updates will forgotten. |
|
||||
| `limit` | `#!python3 Optional[int]` | Optional. Limits the number of updates to be retrieved. Values between 1—100 are accepted. Defaults to 100. |
|
||||
| `timeout` | `#!python3 Optional[int]` | Optional. Timeout in seconds for long polling. Defaults to 0, i.e. usual short polling. Should be positive, short polling should be used for testing purposes only. |
|
||||
| `allowed_updates` | `#!python3 Optional[List[str]]` | Optional. List the types of updates you want your bot to receive. For example, specify ['message', 'edited_channel_post', 'callback_query'] to only receive updates of these types. See Update for a complete list of available update types. Specify an empty list to receive all updates regardless of type (default). If not specified, the previous setting will be used. |
|
||||
|
||||
|
||||
|
||||
## Response
|
||||
|
||||
Type: `#!python3 List[Update]`
|
||||
|
||||
Description: An Array of Update objects is returned.
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
|
||||
### As bot method bot
|
||||
|
||||
```python3
|
||||
result: List[Update] = await bot.get_updates(...)
|
||||
```
|
||||
|
||||
### Method as object
|
||||
|
||||
Imports:
|
||||
|
||||
- `from aiogram.types import GetUpdates`
|
||||
- `from aiogram.api.types import GetUpdates`
|
||||
- `from aiogram.api.types.get_updates import GetUpdates`
|
||||
|
||||
|
||||
#### With specific bot
|
||||
```python3
|
||||
result: List[Update] = await bot.emit(GetUpdates(...))
|
||||
```
|
||||
|
||||
#### In handlers with current bot
|
||||
```python3
|
||||
result: List[Update] = await GetUpdates(...)
|
||||
```
|
||||
|
||||
|
||||
## Related pages:
|
||||
|
||||
- [Official documentation](https://core.telegram.org/bots/api#getupdates)
|
||||
- [aiogram.types.Update](../types/update.md)
|
||||
57
docs/api/methods/get_user_profile_photos.md
Normal file
57
docs/api/methods/get_user_profile_photos.md
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
# getUserProfilePhotos
|
||||
|
||||
## Description
|
||||
|
||||
Use this method to get a list of profile pictures for a user. Returns a UserProfilePhotos object.
|
||||
|
||||
|
||||
## Arguments
|
||||
|
||||
| Name | Type | Description |
|
||||
| - | - | - |
|
||||
| `user_id` | `#!python3 int` | Unique identifier of the target user |
|
||||
| `offset` | `#!python3 Optional[int]` | Optional. Sequential number of the first photo to be returned. By default, all photos are returned. |
|
||||
| `limit` | `#!python3 Optional[int]` | Optional. Limits the number of photos to be retrieved. Values between 1—100 are accepted. Defaults to 100. |
|
||||
|
||||
|
||||
|
||||
## Response
|
||||
|
||||
Type: `#!python3 UserProfilePhotos`
|
||||
|
||||
Description: Returns a UserProfilePhotos object.
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
|
||||
### As bot method bot
|
||||
|
||||
```python3
|
||||
result: UserProfilePhotos = await bot.get_user_profile_photos(...)
|
||||
```
|
||||
|
||||
### Method as object
|
||||
|
||||
Imports:
|
||||
|
||||
- `from aiogram.types import GetUserProfilePhotos`
|
||||
- `from aiogram.api.types import GetUserProfilePhotos`
|
||||
- `from aiogram.api.types.get_user_profile_photos import GetUserProfilePhotos`
|
||||
|
||||
|
||||
#### With specific bot
|
||||
```python3
|
||||
result: UserProfilePhotos = await bot.emit(GetUserProfilePhotos(...))
|
||||
```
|
||||
|
||||
#### In handlers with current bot
|
||||
```python3
|
||||
result: UserProfilePhotos = await GetUserProfilePhotos(...)
|
||||
```
|
||||
|
||||
|
||||
## Related pages:
|
||||
|
||||
- [Official documentation](https://core.telegram.org/bots/api#getuserprofilephotos)
|
||||
- [aiogram.types.UserProfilePhotos](../types/user_profile_photos.md)
|
||||
49
docs/api/methods/get_webhook_info.md
Normal file
49
docs/api/methods/get_webhook_info.md
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
# getWebhookInfo
|
||||
|
||||
## Description
|
||||
|
||||
Use this method to get current webhook status. Requires no parameters. On success, returns a WebhookInfo object. If the bot is using getUpdates, will return an object with the url field empty.
|
||||
|
||||
|
||||
|
||||
|
||||
## Response
|
||||
|
||||
Type: `#!python3 WebhookInfo`
|
||||
|
||||
Description: On success, returns a WebhookInfo object. If the bot is using getUpdates, will return an object with the url field empty.
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
|
||||
### As bot method bot
|
||||
|
||||
```python3
|
||||
result: WebhookInfo = await bot.get_webhook_info(...)
|
||||
```
|
||||
|
||||
### Method as object
|
||||
|
||||
Imports:
|
||||
|
||||
- `from aiogram.types import GetWebhookInfo`
|
||||
- `from aiogram.api.types import GetWebhookInfo`
|
||||
- `from aiogram.api.types.get_webhook_info import GetWebhookInfo`
|
||||
|
||||
|
||||
#### With specific bot
|
||||
```python3
|
||||
result: WebhookInfo = await bot.emit(GetWebhookInfo(...))
|
||||
```
|
||||
|
||||
#### In handlers with current bot
|
||||
```python3
|
||||
result: WebhookInfo = await GetWebhookInfo(...)
|
||||
```
|
||||
|
||||
|
||||
## Related pages:
|
||||
|
||||
- [Official documentation](https://core.telegram.org/bots/api#getwebhookinfo)
|
||||
- [aiogram.types.WebhookInfo](../types/webhook_info.md)
|
||||
60
docs/api/methods/kick_chat_member.md
Normal file
60
docs/api/methods/kick_chat_member.md
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
# kickChatMember
|
||||
|
||||
## Description
|
||||
|
||||
Use this method to kick a user from a group, a supergroup or a channel. In the case of supergroups and channels, the user will not be able to return to the group on their own using invite links, etc., unless unbanned first. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Returns True on success.
|
||||
|
||||
|
||||
## Arguments
|
||||
|
||||
| Name | Type | Description |
|
||||
| - | - | - |
|
||||
| `chat_id` | `#!python3 Union[int, str]` | Unique identifier for the target group or username of the target supergroup or channel (in the format @channelusername) |
|
||||
| `user_id` | `#!python3 int` | Unique identifier of the target user |
|
||||
| `until_date` | `#!python3 Optional[Union[int, datetime.datetime, datetime.timedelta]]` | Optional. Date when the user will be unbanned, unix time. If user is banned for more than 366 days or less than 30 seconds from the current time they are considered to be banned forever |
|
||||
|
||||
|
||||
|
||||
## Response
|
||||
|
||||
Type: `#!python3 bool`
|
||||
|
||||
Description: In the case of supergroups and channels, the user will not be able to return to the group on their own using invite links, etc. Returns True on success.
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
|
||||
### As bot method bot
|
||||
|
||||
```python3
|
||||
result: bool = await bot.kick_chat_member(...)
|
||||
```
|
||||
|
||||
### Method as object
|
||||
|
||||
Imports:
|
||||
|
||||
- `from aiogram.types import KickChatMember`
|
||||
- `from aiogram.api.types import KickChatMember`
|
||||
- `from aiogram.api.types.kick_chat_member import KickChatMember`
|
||||
|
||||
#### As reply into Webhook
|
||||
```python3
|
||||
return KickChatMember(...)
|
||||
```
|
||||
|
||||
#### With specific bot
|
||||
```python3
|
||||
result: bool = await bot.emit(KickChatMember(...))
|
||||
```
|
||||
|
||||
#### In handlers with current bot
|
||||
```python3
|
||||
result: bool = await KickChatMember(...)
|
||||
```
|
||||
|
||||
|
||||
## Related pages:
|
||||
|
||||
- [Official documentation](https://core.telegram.org/bots/api#kickchatmember)
|
||||
58
docs/api/methods/leave_chat.md
Normal file
58
docs/api/methods/leave_chat.md
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
# leaveChat
|
||||
|
||||
## Description
|
||||
|
||||
Use this method for your bot to leave a group, supergroup or channel. Returns True on success.
|
||||
|
||||
|
||||
## Arguments
|
||||
|
||||
| Name | Type | Description |
|
||||
| - | - | - |
|
||||
| `chat_id` | `#!python3 Union[int, str]` | Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername) |
|
||||
|
||||
|
||||
|
||||
## Response
|
||||
|
||||
Type: `#!python3 bool`
|
||||
|
||||
Description: Returns True on success.
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
|
||||
### As bot method bot
|
||||
|
||||
```python3
|
||||
result: bool = await bot.leave_chat(...)
|
||||
```
|
||||
|
||||
### Method as object
|
||||
|
||||
Imports:
|
||||
|
||||
- `from aiogram.types import LeaveChat`
|
||||
- `from aiogram.api.types import LeaveChat`
|
||||
- `from aiogram.api.types.leave_chat import LeaveChat`
|
||||
|
||||
#### As reply into Webhook
|
||||
```python3
|
||||
return LeaveChat(...)
|
||||
```
|
||||
|
||||
#### With specific bot
|
||||
```python3
|
||||
result: bool = await bot.emit(LeaveChat(...))
|
||||
```
|
||||
|
||||
#### In handlers with current bot
|
||||
```python3
|
||||
result: bool = await LeaveChat(...)
|
||||
```
|
||||
|
||||
|
||||
## Related pages:
|
||||
|
||||
- [Official documentation](https://core.telegram.org/bots/api#leavechat)
|
||||
60
docs/api/methods/pin_chat_message.md
Normal file
60
docs/api/methods/pin_chat_message.md
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
# pinChatMessage
|
||||
|
||||
## Description
|
||||
|
||||
Use this method to pin a message in a group, a supergroup, or a channel. The bot must be an administrator in the chat for this to work and must have the ‘can_pin_messages’ admin right in the supergroup or ‘can_edit_messages’ admin right in the channel. Returns True on success.
|
||||
|
||||
|
||||
## Arguments
|
||||
|
||||
| Name | Type | Description |
|
||||
| - | - | - |
|
||||
| `chat_id` | `#!python3 Union[int, str]` | Unique identifier for the target chat or username of the target channel (in the format @channelusername) |
|
||||
| `message_id` | `#!python3 int` | Identifier of a message to pin |
|
||||
| `disable_notification` | `#!python3 Optional[bool]` | Optional. Pass True, if it is not necessary to send a notification to all chat members about the new pinned message. Notifications are always disabled in channels. |
|
||||
|
||||
|
||||
|
||||
## Response
|
||||
|
||||
Type: `#!python3 bool`
|
||||
|
||||
Description: Returns True on success.
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
|
||||
### As bot method bot
|
||||
|
||||
```python3
|
||||
result: bool = await bot.pin_chat_message(...)
|
||||
```
|
||||
|
||||
### Method as object
|
||||
|
||||
Imports:
|
||||
|
||||
- `from aiogram.types import PinChatMessage`
|
||||
- `from aiogram.api.types import PinChatMessage`
|
||||
- `from aiogram.api.types.pin_chat_message import PinChatMessage`
|
||||
|
||||
#### As reply into Webhook
|
||||
```python3
|
||||
return PinChatMessage(...)
|
||||
```
|
||||
|
||||
#### With specific bot
|
||||
```python3
|
||||
result: bool = await bot.emit(PinChatMessage(...))
|
||||
```
|
||||
|
||||
#### In handlers with current bot
|
||||
```python3
|
||||
result: bool = await PinChatMessage(...)
|
||||
```
|
||||
|
||||
|
||||
## Related pages:
|
||||
|
||||
- [Official documentation](https://core.telegram.org/bots/api#pinchatmessage)
|
||||
67
docs/api/methods/promote_chat_member.md
Normal file
67
docs/api/methods/promote_chat_member.md
Normal file
|
|
@ -0,0 +1,67 @@
|
|||
# promoteChatMember
|
||||
|
||||
## Description
|
||||
|
||||
Use this method to promote or demote a user in a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Pass False for all boolean parameters to demote a user. Returns True on success.
|
||||
|
||||
|
||||
## Arguments
|
||||
|
||||
| Name | Type | Description |
|
||||
| - | - | - |
|
||||
| `chat_id` | `#!python3 Union[int, str]` | Unique identifier for the target chat or username of the target channel (in the format @channelusername) |
|
||||
| `user_id` | `#!python3 int` | Unique identifier of the target user |
|
||||
| `can_change_info` | `#!python3 Optional[bool]` | Optional. Pass True, if the administrator can change chat title, photo and other settings |
|
||||
| `can_post_messages` | `#!python3 Optional[bool]` | Optional. Pass True, if the administrator can create channel posts, channels only |
|
||||
| `can_edit_messages` | `#!python3 Optional[bool]` | Optional. Pass True, if the administrator can edit messages of other users and can pin messages, channels only |
|
||||
| `can_delete_messages` | `#!python3 Optional[bool]` | Optional. Pass True, if the administrator can delete messages of other users |
|
||||
| `can_invite_users` | `#!python3 Optional[bool]` | Optional. Pass True, if the administrator can invite new users to the chat |
|
||||
| `can_restrict_members` | `#!python3 Optional[bool]` | Optional. Pass True, if the administrator can restrict, ban or unban chat members |
|
||||
| `can_pin_messages` | `#!python3 Optional[bool]` | Optional. Pass True, if the administrator can pin messages, supergroups only |
|
||||
| `can_promote_members` | `#!python3 Optional[bool]` | Optional. Pass True, if the administrator can add new administrators with a subset of his own privileges or demote administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by him) |
|
||||
|
||||
|
||||
|
||||
## Response
|
||||
|
||||
Type: `#!python3 bool`
|
||||
|
||||
Description: Returns True on success.
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
|
||||
### As bot method bot
|
||||
|
||||
```python3
|
||||
result: bool = await bot.promote_chat_member(...)
|
||||
```
|
||||
|
||||
### Method as object
|
||||
|
||||
Imports:
|
||||
|
||||
- `from aiogram.types import PromoteChatMember`
|
||||
- `from aiogram.api.types import PromoteChatMember`
|
||||
- `from aiogram.api.types.promote_chat_member import PromoteChatMember`
|
||||
|
||||
#### As reply into Webhook
|
||||
```python3
|
||||
return PromoteChatMember(...)
|
||||
```
|
||||
|
||||
#### With specific bot
|
||||
```python3
|
||||
result: bool = await bot.emit(PromoteChatMember(...))
|
||||
```
|
||||
|
||||
#### In handlers with current bot
|
||||
```python3
|
||||
result: bool = await PromoteChatMember(...)
|
||||
```
|
||||
|
||||
|
||||
## Related pages:
|
||||
|
||||
- [Official documentation](https://core.telegram.org/bots/api#promotechatmember)
|
||||
62
docs/api/methods/restrict_chat_member.md
Normal file
62
docs/api/methods/restrict_chat_member.md
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
# restrictChatMember
|
||||
|
||||
## Description
|
||||
|
||||
Use this method to restrict a user in a supergroup. The bot must be an administrator in the supergroup for this to work and must have the appropriate admin rights. Pass True for all permissions to lift restrictions from a user. Returns True on success.
|
||||
|
||||
|
||||
## Arguments
|
||||
|
||||
| Name | Type | Description |
|
||||
| - | - | - |
|
||||
| `chat_id` | `#!python3 Union[int, str]` | Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) |
|
||||
| `user_id` | `#!python3 int` | Unique identifier of the target user |
|
||||
| `permissions` | `#!python3 ChatPermissions` | New user permissions |
|
||||
| `until_date` | `#!python3 Optional[Union[int, datetime.datetime, datetime.timedelta]]` | Optional. Date when restrictions will be lifted for the user, unix time. If user is restricted for more than 366 days or less than 30 seconds from the current time, they are considered to be restricted forever |
|
||||
|
||||
|
||||
|
||||
## Response
|
||||
|
||||
Type: `#!python3 bool`
|
||||
|
||||
Description: Returns True on success.
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
|
||||
### As bot method bot
|
||||
|
||||
```python3
|
||||
result: bool = await bot.restrict_chat_member(...)
|
||||
```
|
||||
|
||||
### Method as object
|
||||
|
||||
Imports:
|
||||
|
||||
- `from aiogram.types import RestrictChatMember`
|
||||
- `from aiogram.api.types import RestrictChatMember`
|
||||
- `from aiogram.api.types.restrict_chat_member import RestrictChatMember`
|
||||
|
||||
#### As reply into Webhook
|
||||
```python3
|
||||
return RestrictChatMember(...)
|
||||
```
|
||||
|
||||
#### With specific bot
|
||||
```python3
|
||||
result: bool = await bot.emit(RestrictChatMember(...))
|
||||
```
|
||||
|
||||
#### In handlers with current bot
|
||||
```python3
|
||||
result: bool = await RestrictChatMember(...)
|
||||
```
|
||||
|
||||
|
||||
## Related pages:
|
||||
|
||||
- [Official documentation](https://core.telegram.org/bots/api#restrictchatmember)
|
||||
- [aiogram.types.ChatPermissions](../types/chat_permissions.md)
|
||||
74
docs/api/methods/send_animation.md
Normal file
74
docs/api/methods/send_animation.md
Normal file
|
|
@ -0,0 +1,74 @@
|
|||
# sendAnimation
|
||||
|
||||
## Description
|
||||
|
||||
Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without sound). On success, the sent Message is returned. Bots can currently send animation files of up to 50 MB in size, this limit may be changed in the future.
|
||||
|
||||
|
||||
## Arguments
|
||||
|
||||
| Name | Type | Description |
|
||||
| - | - | - |
|
||||
| `chat_id` | `#!python3 Union[int, str]` | Unique identifier for the target chat or username of the target channel (in the format @channelusername) |
|
||||
| `animation` | `#!python3 Union[InputFile, str]` | Animation to send. Pass a file_id as String to send an animation that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an animation from the Internet, or upload a new animation using multipart/form-data. |
|
||||
| `duration` | `#!python3 Optional[int]` | Optional. Duration of sent animation in seconds |
|
||||
| `width` | `#!python3 Optional[int]` | Optional. Animation width |
|
||||
| `height` | `#!python3 Optional[int]` | Optional. Animation height |
|
||||
| `thumb` | `#!python3 Optional[Union[InputFile, str]]` | Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail‘s width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can’t be reused and can be only uploaded as a new file, so you can pass 'attach://<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 |
|
||||
| `parse_mode` | `#!python3 Optional[str]` | Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption. |
|
||||
| `disable_notification` | `#!python3 Optional[bool]` | Optional. Sends the message silently. Users will receive a notification with no sound. |
|
||||
| `reply_to_message_id` | `#!python3 Optional[int]` | Optional. If the message is a reply, ID of the original message |
|
||||
| `reply_markup` | `#!python3 Optional[Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]]` | Optional. Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user. |
|
||||
|
||||
|
||||
|
||||
## Response
|
||||
|
||||
Type: `#!python3 Message`
|
||||
|
||||
Description: On success, the sent Message is returned.
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
|
||||
### As bot method bot
|
||||
|
||||
```python3
|
||||
result: Message = await bot.send_animation(...)
|
||||
```
|
||||
|
||||
### Method as object
|
||||
|
||||
Imports:
|
||||
|
||||
- `from aiogram.types import SendAnimation`
|
||||
- `from aiogram.api.types import SendAnimation`
|
||||
- `from aiogram.api.types.send_animation import SendAnimation`
|
||||
|
||||
#### As reply into Webhook
|
||||
```python3
|
||||
return SendAnimation(...)
|
||||
```
|
||||
|
||||
#### With specific bot
|
||||
```python3
|
||||
result: Message = await bot.emit(SendAnimation(...))
|
||||
```
|
||||
|
||||
#### In handlers with current bot
|
||||
```python3
|
||||
result: Message = await SendAnimation(...)
|
||||
```
|
||||
|
||||
|
||||
## Related pages:
|
||||
|
||||
- [Official documentation](https://core.telegram.org/bots/api#sendanimation)
|
||||
- [aiogram.types.ForceReply](../types/force_reply.md)
|
||||
- [aiogram.types.ReplyKeyboardMarkup](../types/reply_keyboard_markup.md)
|
||||
- [aiogram.types.Message](../types/message.md)
|
||||
- [aiogram.types.ReplyKeyboardRemove](../types/reply_keyboard_remove.md)
|
||||
- [aiogram.types.InputFile](../types/input_file.md)
|
||||
- [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md)
|
||||
76
docs/api/methods/send_audio.md
Normal file
76
docs/api/methods/send_audio.md
Normal file
|
|
@ -0,0 +1,76 @@
|
|||
# sendAudio
|
||||
|
||||
## Description
|
||||
|
||||
Use this method to send audio files, if you want Telegram clients to display them in the music player. Your audio must be in the .MP3 or .M4A format. On success, the sent Message is returned. Bots can currently send audio files of up to 50 MB in size, this limit may be changed in the future.
|
||||
|
||||
For sending voice messages, use the sendVoice method instead.
|
||||
|
||||
|
||||
## Arguments
|
||||
|
||||
| Name | Type | Description |
|
||||
| - | - | - |
|
||||
| `chat_id` | `#!python3 Union[int, str]` | Unique identifier for the target chat or username of the target channel (in the format @channelusername) |
|
||||
| `audio` | `#!python3 Union[InputFile, str]` | Audio file to send. Pass a file_id as String to send an audio file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an audio file from the Internet, or upload a new one using multipart/form-data. |
|
||||
| `caption` | `#!python3 Optional[str]` | Optional. Audio caption, 0-1024 characters |
|
||||
| `parse_mode` | `#!python3 Optional[str]` | Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption. |
|
||||
| `duration` | `#!python3 Optional[int]` | Optional. Duration of the audio in seconds |
|
||||
| `performer` | `#!python3 Optional[str]` | Optional. Performer |
|
||||
| `title` | `#!python3 Optional[str]` | Optional. Track name |
|
||||
| `thumb` | `#!python3 Optional[Union[InputFile, str]]` | Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail‘s width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can’t be reused and can be only uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. |
|
||||
| `disable_notification` | `#!python3 Optional[bool]` | Optional. Sends the message silently. Users will receive a notification with no sound. |
|
||||
| `reply_to_message_id` | `#!python3 Optional[int]` | Optional. If the message is a reply, ID of the original message |
|
||||
| `reply_markup` | `#!python3 Optional[Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]]` | Optional. Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user. |
|
||||
|
||||
|
||||
|
||||
## Response
|
||||
|
||||
Type: `#!python3 Message`
|
||||
|
||||
Description: On success, the sent Message is returned.
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
|
||||
### As bot method bot
|
||||
|
||||
```python3
|
||||
result: Message = await bot.send_audio(...)
|
||||
```
|
||||
|
||||
### Method as object
|
||||
|
||||
Imports:
|
||||
|
||||
- `from aiogram.types import SendAudio`
|
||||
- `from aiogram.api.types import SendAudio`
|
||||
- `from aiogram.api.types.send_audio import SendAudio`
|
||||
|
||||
#### As reply into Webhook
|
||||
```python3
|
||||
return SendAudio(...)
|
||||
```
|
||||
|
||||
#### With specific bot
|
||||
```python3
|
||||
result: Message = await bot.emit(SendAudio(...))
|
||||
```
|
||||
|
||||
#### In handlers with current bot
|
||||
```python3
|
||||
result: Message = await SendAudio(...)
|
||||
```
|
||||
|
||||
|
||||
## Related pages:
|
||||
|
||||
- [Official documentation](https://core.telegram.org/bots/api#sendaudio)
|
||||
- [aiogram.types.ForceReply](../types/force_reply.md)
|
||||
- [aiogram.types.ReplyKeyboardMarkup](../types/reply_keyboard_markup.md)
|
||||
- [aiogram.types.Message](../types/message.md)
|
||||
- [aiogram.types.ReplyKeyboardRemove](../types/reply_keyboard_remove.md)
|
||||
- [aiogram.types.InputFile](../types/input_file.md)
|
||||
- [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md)
|
||||
63
docs/api/methods/send_chat_action.md
Normal file
63
docs/api/methods/send_chat_action.md
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
# sendChatAction
|
||||
|
||||
## Description
|
||||
|
||||
Use this method when you need to tell the user that something is happening on the bot's side. The status is set for 5 seconds or less (when a message arrives from your bot, Telegram clients clear its typing status). Returns True on success.
|
||||
|
||||
Example: The ImageBot needs some time to process a request and upload the image. Instead of sending a text message along the lines of 'Retrieving image, please wait…', the bot may use sendChatAction with action = upload_photo. The user will see a 'sending photo' status for the bot.
|
||||
|
||||
We only recommend using this method when a response from the bot will take a noticeable amount of time to arrive.
|
||||
|
||||
|
||||
## Arguments
|
||||
|
||||
| Name | Type | Description |
|
||||
| - | - | - |
|
||||
| `chat_id` | `#!python3 Union[int, str]` | Unique identifier for the target chat or username of the target channel (in the format @channelusername) |
|
||||
| `action` | `#!python3 str` | Type of action to broadcast. Choose one, depending on what the user is about to receive: typing for text messages, upload_photo for photos, record_video or upload_video for videos, record_audio or upload_audio for audio files, upload_document for general files, find_location for location data, record_video_note or upload_video_note for video notes. |
|
||||
|
||||
|
||||
|
||||
## Response
|
||||
|
||||
Type: `#!python3 bool`
|
||||
|
||||
Description: Returns True on success.
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
|
||||
### As bot method bot
|
||||
|
||||
```python3
|
||||
result: bool = await bot.send_chat_action(...)
|
||||
```
|
||||
|
||||
### Method as object
|
||||
|
||||
Imports:
|
||||
|
||||
- `from aiogram.types import SendChatAction`
|
||||
- `from aiogram.api.types import SendChatAction`
|
||||
- `from aiogram.api.types.send_chat_action import SendChatAction`
|
||||
|
||||
#### As reply into Webhook
|
||||
```python3
|
||||
return SendChatAction(...)
|
||||
```
|
||||
|
||||
#### With specific bot
|
||||
```python3
|
||||
result: bool = await bot.emit(SendChatAction(...))
|
||||
```
|
||||
|
||||
#### In handlers with current bot
|
||||
```python3
|
||||
result: bool = await SendChatAction(...)
|
||||
```
|
||||
|
||||
|
||||
## Related pages:
|
||||
|
||||
- [Official documentation](https://core.telegram.org/bots/api#sendchataction)
|
||||
70
docs/api/methods/send_contact.md
Normal file
70
docs/api/methods/send_contact.md
Normal file
|
|
@ -0,0 +1,70 @@
|
|||
# sendContact
|
||||
|
||||
## Description
|
||||
|
||||
Use this method to send phone contacts. On success, the sent Message is returned.
|
||||
|
||||
|
||||
## Arguments
|
||||
|
||||
| Name | Type | Description |
|
||||
| - | - | - |
|
||||
| `chat_id` | `#!python3 Union[int, str]` | Unique identifier for the target chat or username of the target channel (in the format @channelusername) |
|
||||
| `phone_number` | `#!python3 str` | Contact's phone number |
|
||||
| `first_name` | `#!python3 str` | Contact's first name |
|
||||
| `last_name` | `#!python3 Optional[str]` | Optional. Contact's last name |
|
||||
| `vcard` | `#!python3 Optional[str]` | Optional. Additional data about the contact in the form of a vCard, 0-2048 bytes |
|
||||
| `disable_notification` | `#!python3 Optional[bool]` | Optional. Sends the message silently. Users will receive a notification with no sound. |
|
||||
| `reply_to_message_id` | `#!python3 Optional[int]` | Optional. If the message is a reply, ID of the original message |
|
||||
| `reply_markup` | `#!python3 Optional[Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]]` | Optional. Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove keyboard or to force a reply from the user. |
|
||||
|
||||
|
||||
|
||||
## Response
|
||||
|
||||
Type: `#!python3 Message`
|
||||
|
||||
Description: On success, the sent Message is returned.
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
|
||||
### As bot method bot
|
||||
|
||||
```python3
|
||||
result: Message = await bot.send_contact(...)
|
||||
```
|
||||
|
||||
### Method as object
|
||||
|
||||
Imports:
|
||||
|
||||
- `from aiogram.types import SendContact`
|
||||
- `from aiogram.api.types import SendContact`
|
||||
- `from aiogram.api.types.send_contact import SendContact`
|
||||
|
||||
#### As reply into Webhook
|
||||
```python3
|
||||
return SendContact(...)
|
||||
```
|
||||
|
||||
#### With specific bot
|
||||
```python3
|
||||
result: Message = await bot.emit(SendContact(...))
|
||||
```
|
||||
|
||||
#### In handlers with current bot
|
||||
```python3
|
||||
result: Message = await SendContact(...)
|
||||
```
|
||||
|
||||
|
||||
## Related pages:
|
||||
|
||||
- [Official documentation](https://core.telegram.org/bots/api#sendcontact)
|
||||
- [aiogram.types.ForceReply](../types/force_reply.md)
|
||||
- [aiogram.types.ReplyKeyboardMarkup](../types/reply_keyboard_markup.md)
|
||||
- [aiogram.types.Message](../types/message.md)
|
||||
- [aiogram.types.ReplyKeyboardRemove](../types/reply_keyboard_remove.md)
|
||||
- [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md)
|
||||
71
docs/api/methods/send_document.md
Normal file
71
docs/api/methods/send_document.md
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
# sendDocument
|
||||
|
||||
## Description
|
||||
|
||||
Use this method to send general files. On success, the sent Message is returned. Bots can currently send files of any type of up to 50 MB in size, this limit may be changed in the future.
|
||||
|
||||
|
||||
## Arguments
|
||||
|
||||
| Name | Type | Description |
|
||||
| - | - | - |
|
||||
| `chat_id` | `#!python3 Union[int, str]` | Unique identifier for the target chat or username of the target channel (in the format @channelusername) |
|
||||
| `document` | `#!python3 Union[InputFile, str]` | File to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. |
|
||||
| `thumb` | `#!python3 Optional[Union[InputFile, str]]` | Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail‘s width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can’t be reused and can be only uploaded as a new file, so you can pass 'attach://<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 |
|
||||
| `parse_mode` | `#!python3 Optional[str]` | Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption. |
|
||||
| `disable_notification` | `#!python3 Optional[bool]` | Optional. Sends the message silently. Users will receive a notification with no sound. |
|
||||
| `reply_to_message_id` | `#!python3 Optional[int]` | Optional. If the message is a reply, ID of the original message |
|
||||
| `reply_markup` | `#!python3 Optional[Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]]` | Optional. Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user. |
|
||||
|
||||
|
||||
|
||||
## Response
|
||||
|
||||
Type: `#!python3 Message`
|
||||
|
||||
Description: On success, the sent Message is returned.
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
|
||||
### As bot method bot
|
||||
|
||||
```python3
|
||||
result: Message = await bot.send_document(...)
|
||||
```
|
||||
|
||||
### Method as object
|
||||
|
||||
Imports:
|
||||
|
||||
- `from aiogram.types import SendDocument`
|
||||
- `from aiogram.api.types import SendDocument`
|
||||
- `from aiogram.api.types.send_document import SendDocument`
|
||||
|
||||
#### As reply into Webhook
|
||||
```python3
|
||||
return SendDocument(...)
|
||||
```
|
||||
|
||||
#### With specific bot
|
||||
```python3
|
||||
result: Message = await bot.emit(SendDocument(...))
|
||||
```
|
||||
|
||||
#### In handlers with current bot
|
||||
```python3
|
||||
result: Message = await SendDocument(...)
|
||||
```
|
||||
|
||||
|
||||
## Related pages:
|
||||
|
||||
- [Official documentation](https://core.telegram.org/bots/api#senddocument)
|
||||
- [aiogram.types.ForceReply](../types/force_reply.md)
|
||||
- [aiogram.types.ReplyKeyboardMarkup](../types/reply_keyboard_markup.md)
|
||||
- [aiogram.types.Message](../types/message.md)
|
||||
- [aiogram.types.ReplyKeyboardRemove](../types/reply_keyboard_remove.md)
|
||||
- [aiogram.types.InputFile](../types/input_file.md)
|
||||
- [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md)
|
||||
64
docs/api/methods/send_game.md
Normal file
64
docs/api/methods/send_game.md
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
# sendGame
|
||||
|
||||
## Description
|
||||
|
||||
Use this method to send a game. On success, the sent Message is returned.
|
||||
|
||||
|
||||
## Arguments
|
||||
|
||||
| Name | Type | Description |
|
||||
| - | - | - |
|
||||
| `chat_id` | `#!python3 int` | Unique identifier for the target chat |
|
||||
| `game_short_name` | `#!python3 str` | Short name of the game, serves as the unique identifier for the game. Set up your games via Botfather. |
|
||||
| `disable_notification` | `#!python3 Optional[bool]` | Optional. Sends the message silently. Users will receive a notification with no sound. |
|
||||
| `reply_to_message_id` | `#!python3 Optional[int]` | Optional. If the message is a reply, ID of the original message |
|
||||
| `reply_markup` | `#!python3 Optional[InlineKeyboardMarkup]` | Optional. A JSON-serialized object for an inline keyboard. If empty, one ‘Play game_title’ button will be shown. If not empty, the first button must launch the game. |
|
||||
|
||||
|
||||
|
||||
## Response
|
||||
|
||||
Type: `#!python3 Message`
|
||||
|
||||
Description: On success, the sent Message is returned.
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
|
||||
### As bot method bot
|
||||
|
||||
```python3
|
||||
result: Message = await bot.send_game(...)
|
||||
```
|
||||
|
||||
### Method as object
|
||||
|
||||
Imports:
|
||||
|
||||
- `from aiogram.types import SendGame`
|
||||
- `from aiogram.api.types import SendGame`
|
||||
- `from aiogram.api.types.send_game import SendGame`
|
||||
|
||||
#### As reply into Webhook
|
||||
```python3
|
||||
return SendGame(...)
|
||||
```
|
||||
|
||||
#### With specific bot
|
||||
```python3
|
||||
result: Message = await bot.emit(SendGame(...))
|
||||
```
|
||||
|
||||
#### In handlers with current bot
|
||||
```python3
|
||||
result: Message = await SendGame(...)
|
||||
```
|
||||
|
||||
|
||||
## Related pages:
|
||||
|
||||
- [Official documentation](https://core.telegram.org/bots/api#sendgame)
|
||||
- [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md)
|
||||
- [aiogram.types.Message](../types/message.md)
|
||||
83
docs/api/methods/send_invoice.md
Normal file
83
docs/api/methods/send_invoice.md
Normal file
|
|
@ -0,0 +1,83 @@
|
|||
# sendInvoice
|
||||
|
||||
## Description
|
||||
|
||||
Use this method to send invoices. On success, the sent Message is returned.
|
||||
|
||||
|
||||
## Arguments
|
||||
|
||||
| Name | Type | Description |
|
||||
| - | - | - |
|
||||
| `chat_id` | `#!python3 int` | Unique identifier for the target private chat |
|
||||
| `title` | `#!python3 str` | Product name, 1-32 characters |
|
||||
| `description` | `#!python3 str` | Product description, 1-255 characters |
|
||||
| `payload` | `#!python3 str` | Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes. |
|
||||
| `provider_token` | `#!python3 str` | Payments provider token, obtained via Botfather |
|
||||
| `start_parameter` | `#!python3 str` | Unique deep-linking parameter that can be used to generate this invoice when used as a start parameter |
|
||||
| `currency` | `#!python3 str` | Three-letter ISO 4217 currency code, see more on currencies |
|
||||
| `prices` | `#!python3 List[LabeledPrice]` | Price breakdown, a list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.) |
|
||||
| `provider_data` | `#!python3 Optional[str]` | Optional. JSON-encoded data about the invoice, which will be shared with the payment provider. A detailed description of required fields should be provided by the payment provider. |
|
||||
| `photo_url` | `#!python3 Optional[str]` | Optional. URL of the product photo for the invoice. Can be a photo of the goods or a marketing image for a service. People like it better when they see what they are paying for. |
|
||||
| `photo_size` | `#!python3 Optional[int]` | Optional. Photo size |
|
||||
| `photo_width` | `#!python3 Optional[int]` | Optional. Photo width |
|
||||
| `photo_height` | `#!python3 Optional[int]` | Optional. Photo height |
|
||||
| `need_name` | `#!python3 Optional[bool]` | Optional. Pass True, if you require the user's full name to complete the order |
|
||||
| `need_phone_number` | `#!python3 Optional[bool]` | Optional. Pass True, if you require the user's phone number to complete the order |
|
||||
| `need_email` | `#!python3 Optional[bool]` | Optional. Pass True, if you require the user's email address to complete the order |
|
||||
| `need_shipping_address` | `#!python3 Optional[bool]` | Optional. Pass True, if you require the user's shipping address to complete the order |
|
||||
| `send_phone_number_to_provider` | `#!python3 Optional[bool]` | Optional. Pass True, if user's phone number should be sent to provider |
|
||||
| `send_email_to_provider` | `#!python3 Optional[bool]` | Optional. Pass True, if user's email address should be sent to provider |
|
||||
| `is_flexible` | `#!python3 Optional[bool]` | Optional. Pass True, if the final price depends on the shipping method |
|
||||
| `disable_notification` | `#!python3 Optional[bool]` | Optional. Sends the message silently. Users will receive a notification with no sound. |
|
||||
| `reply_to_message_id` | `#!python3 Optional[int]` | Optional. If the message is a reply, ID of the original message |
|
||||
| `reply_markup` | `#!python3 Optional[InlineKeyboardMarkup]` | Optional. A JSON-serialized object for an inline keyboard. If empty, one 'Pay total price' button will be shown. If not empty, the first button must be a Pay button. |
|
||||
|
||||
|
||||
|
||||
## Response
|
||||
|
||||
Type: `#!python3 Message`
|
||||
|
||||
Description: On success, the sent Message is returned.
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
|
||||
### As bot method bot
|
||||
|
||||
```python3
|
||||
result: Message = await bot.send_invoice(...)
|
||||
```
|
||||
|
||||
### Method as object
|
||||
|
||||
Imports:
|
||||
|
||||
- `from aiogram.types import SendInvoice`
|
||||
- `from aiogram.api.types import SendInvoice`
|
||||
- `from aiogram.api.types.send_invoice import SendInvoice`
|
||||
|
||||
#### As reply into Webhook
|
||||
```python3
|
||||
return SendInvoice(...)
|
||||
```
|
||||
|
||||
#### With specific bot
|
||||
```python3
|
||||
result: Message = await bot.emit(SendInvoice(...))
|
||||
```
|
||||
|
||||
#### In handlers with current bot
|
||||
```python3
|
||||
result: Message = await SendInvoice(...)
|
||||
```
|
||||
|
||||
|
||||
## Related pages:
|
||||
|
||||
- [Official documentation](https://core.telegram.org/bots/api#sendinvoice)
|
||||
- [aiogram.types.LabeledPrice](../types/labeled_price.md)
|
||||
- [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md)
|
||||
- [aiogram.types.Message](../types/message.md)
|
||||
69
docs/api/methods/send_location.md
Normal file
69
docs/api/methods/send_location.md
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
# sendLocation
|
||||
|
||||
## Description
|
||||
|
||||
Use this method to send point on the map. On success, the sent Message is returned.
|
||||
|
||||
|
||||
## Arguments
|
||||
|
||||
| Name | Type | Description |
|
||||
| - | - | - |
|
||||
| `chat_id` | `#!python3 Union[int, str]` | Unique identifier for the target chat or username of the target channel (in the format @channelusername) |
|
||||
| `latitude` | `#!python3 float` | Latitude of the location |
|
||||
| `longitude` | `#!python3 float` | Longitude of the location |
|
||||
| `live_period` | `#!python3 Optional[int]` | Optional. Period in seconds for which the location will be updated (see Live Locations, should be between 60 and 86400. |
|
||||
| `disable_notification` | `#!python3 Optional[bool]` | Optional. Sends the message silently. Users will receive a notification with no sound. |
|
||||
| `reply_to_message_id` | `#!python3 Optional[int]` | Optional. If the message is a reply, ID of the original message |
|
||||
| `reply_markup` | `#!python3 Optional[Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]]` | Optional. Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user. |
|
||||
|
||||
|
||||
|
||||
## Response
|
||||
|
||||
Type: `#!python3 Message`
|
||||
|
||||
Description: On success, the sent Message is returned.
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
|
||||
### As bot method bot
|
||||
|
||||
```python3
|
||||
result: Message = await bot.send_location(...)
|
||||
```
|
||||
|
||||
### Method as object
|
||||
|
||||
Imports:
|
||||
|
||||
- `from aiogram.types import SendLocation`
|
||||
- `from aiogram.api.types import SendLocation`
|
||||
- `from aiogram.api.types.send_location import SendLocation`
|
||||
|
||||
#### As reply into Webhook
|
||||
```python3
|
||||
return SendLocation(...)
|
||||
```
|
||||
|
||||
#### With specific bot
|
||||
```python3
|
||||
result: Message = await bot.emit(SendLocation(...))
|
||||
```
|
||||
|
||||
#### In handlers with current bot
|
||||
```python3
|
||||
result: Message = await SendLocation(...)
|
||||
```
|
||||
|
||||
|
||||
## Related pages:
|
||||
|
||||
- [Official documentation](https://core.telegram.org/bots/api#sendlocation)
|
||||
- [aiogram.types.ForceReply](../types/force_reply.md)
|
||||
- [aiogram.types.ReplyKeyboardMarkup](../types/reply_keyboard_markup.md)
|
||||
- [aiogram.types.Message](../types/message.md)
|
||||
- [aiogram.types.ReplyKeyboardRemove](../types/reply_keyboard_remove.md)
|
||||
- [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md)
|
||||
64
docs/api/methods/send_media_group.md
Normal file
64
docs/api/methods/send_media_group.md
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
# sendMediaGroup
|
||||
|
||||
## Description
|
||||
|
||||
Use this method to send a group of photos or videos as an album. On success, an array of the sent Messages is returned.
|
||||
|
||||
|
||||
## Arguments
|
||||
|
||||
| Name | Type | Description |
|
||||
| - | - | - |
|
||||
| `chat_id` | `#!python3 Union[int, str]` | Unique identifier for the target chat or username of the target channel (in the format @channelusername) |
|
||||
| `media` | `#!python3 List[Union[InputMediaPhoto, InputMediaVideo]]` | A JSON-serialized array describing photos and videos to be sent, must include 2–10 items |
|
||||
| `disable_notification` | `#!python3 Optional[bool]` | Optional. Sends the messages silently. Users will receive a notification with no sound. |
|
||||
| `reply_to_message_id` | `#!python3 Optional[int]` | Optional. If the messages are a reply, ID of the original message |
|
||||
|
||||
|
||||
|
||||
## Response
|
||||
|
||||
Type: `#!python3 List[Message]`
|
||||
|
||||
Description: On success, an array of the sent Messages is returned.
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
|
||||
### As bot method bot
|
||||
|
||||
```python3
|
||||
result: List[Message] = await bot.send_media_group(...)
|
||||
```
|
||||
|
||||
### Method as object
|
||||
|
||||
Imports:
|
||||
|
||||
- `from aiogram.types import SendMediaGroup`
|
||||
- `from aiogram.api.types import SendMediaGroup`
|
||||
- `from aiogram.api.types.send_media_group import SendMediaGroup`
|
||||
|
||||
#### As reply into Webhook
|
||||
```python3
|
||||
return SendMediaGroup(...)
|
||||
```
|
||||
|
||||
#### With specific bot
|
||||
```python3
|
||||
result: List[Message] = await bot.emit(SendMediaGroup(...))
|
||||
```
|
||||
|
||||
#### In handlers with current bot
|
||||
```python3
|
||||
result: List[Message] = await SendMediaGroup(...)
|
||||
```
|
||||
|
||||
|
||||
## Related pages:
|
||||
|
||||
- [Official documentation](https://core.telegram.org/bots/api#sendmediagroup)
|
||||
- [aiogram.types.InputMediaPhoto](../types/input_media_photo.md)
|
||||
- [aiogram.types.InputMediaVideo](../types/input_media_video.md)
|
||||
- [aiogram.types.Message](../types/message.md)
|
||||
69
docs/api/methods/send_message.md
Normal file
69
docs/api/methods/send_message.md
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
# sendMessage
|
||||
|
||||
## Description
|
||||
|
||||
Use this method to send text messages. On success, the sent Message is returned.
|
||||
|
||||
|
||||
## Arguments
|
||||
|
||||
| Name | Type | Description |
|
||||
| - | - | - |
|
||||
| `chat_id` | `#!python3 Union[int, str]` | Unique identifier for the target chat or username of the target channel (in the format @channelusername) |
|
||||
| `text` | `#!python3 str` | Text of the message to be sent |
|
||||
| `parse_mode` | `#!python3 Optional[str]` | Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in your bot's message. |
|
||||
| `disable_web_page_preview` | `#!python3 Optional[bool]` | Optional. Disables link previews for links in this message |
|
||||
| `disable_notification` | `#!python3 Optional[bool]` | Optional. Sends the message silently. Users will receive a notification with no sound. |
|
||||
| `reply_to_message_id` | `#!python3 Optional[int]` | Optional. If the message is a reply, ID of the original message |
|
||||
| `reply_markup` | `#!python3 Optional[Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]]` | Optional. Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user. |
|
||||
|
||||
|
||||
|
||||
## Response
|
||||
|
||||
Type: `#!python3 Message`
|
||||
|
||||
Description: On success, the sent Message is returned.
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
|
||||
### As bot method bot
|
||||
|
||||
```python3
|
||||
result: Message = await bot.send_message(...)
|
||||
```
|
||||
|
||||
### Method as object
|
||||
|
||||
Imports:
|
||||
|
||||
- `from aiogram.types import SendMessage`
|
||||
- `from aiogram.api.types import SendMessage`
|
||||
- `from aiogram.api.types.send_message import SendMessage`
|
||||
|
||||
#### As reply into Webhook
|
||||
```python3
|
||||
return SendMessage(...)
|
||||
```
|
||||
|
||||
#### With specific bot
|
||||
```python3
|
||||
result: Message = await bot.emit(SendMessage(...))
|
||||
```
|
||||
|
||||
#### In handlers with current bot
|
||||
```python3
|
||||
result: Message = await SendMessage(...)
|
||||
```
|
||||
|
||||
|
||||
## Related pages:
|
||||
|
||||
- [Official documentation](https://core.telegram.org/bots/api#sendmessage)
|
||||
- [aiogram.types.ForceReply](../types/force_reply.md)
|
||||
- [aiogram.types.ReplyKeyboardMarkup](../types/reply_keyboard_markup.md)
|
||||
- [aiogram.types.Message](../types/message.md)
|
||||
- [aiogram.types.ReplyKeyboardRemove](../types/reply_keyboard_remove.md)
|
||||
- [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md)
|
||||
70
docs/api/methods/send_photo.md
Normal file
70
docs/api/methods/send_photo.md
Normal file
|
|
@ -0,0 +1,70 @@
|
|||
# sendPhoto
|
||||
|
||||
## Description
|
||||
|
||||
Use this method to send photos. On success, the sent Message is returned.
|
||||
|
||||
|
||||
## Arguments
|
||||
|
||||
| Name | Type | Description |
|
||||
| - | - | - |
|
||||
| `chat_id` | `#!python3 Union[int, str]` | Unique identifier for the target chat or username of the target channel (in the format @channelusername) |
|
||||
| `photo` | `#!python3 Union[InputFile, str]` | Photo to send. Pass a file_id as String to send a photo that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a photo from the Internet, or upload a new photo using multipart/form-data. |
|
||||
| `caption` | `#!python3 Optional[str]` | Optional. Photo caption (may also be used when resending photos by file_id), 0-1024 characters |
|
||||
| `parse_mode` | `#!python3 Optional[str]` | Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption. |
|
||||
| `disable_notification` | `#!python3 Optional[bool]` | Optional. Sends the message silently. Users will receive a notification with no sound. |
|
||||
| `reply_to_message_id` | `#!python3 Optional[int]` | Optional. If the message is a reply, ID of the original message |
|
||||
| `reply_markup` | `#!python3 Optional[Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]]` | Optional. Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user. |
|
||||
|
||||
|
||||
|
||||
## Response
|
||||
|
||||
Type: `#!python3 Message`
|
||||
|
||||
Description: On success, the sent Message is returned.
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
|
||||
### As bot method bot
|
||||
|
||||
```python3
|
||||
result: Message = await bot.send_photo(...)
|
||||
```
|
||||
|
||||
### Method as object
|
||||
|
||||
Imports:
|
||||
|
||||
- `from aiogram.types import SendPhoto`
|
||||
- `from aiogram.api.types import SendPhoto`
|
||||
- `from aiogram.api.types.send_photo import SendPhoto`
|
||||
|
||||
#### As reply into Webhook
|
||||
```python3
|
||||
return SendPhoto(...)
|
||||
```
|
||||
|
||||
#### With specific bot
|
||||
```python3
|
||||
result: Message = await bot.emit(SendPhoto(...))
|
||||
```
|
||||
|
||||
#### In handlers with current bot
|
||||
```python3
|
||||
result: Message = await SendPhoto(...)
|
||||
```
|
||||
|
||||
|
||||
## Related pages:
|
||||
|
||||
- [Official documentation](https://core.telegram.org/bots/api#sendphoto)
|
||||
- [aiogram.types.ForceReply](../types/force_reply.md)
|
||||
- [aiogram.types.ReplyKeyboardMarkup](../types/reply_keyboard_markup.md)
|
||||
- [aiogram.types.Message](../types/message.md)
|
||||
- [aiogram.types.ReplyKeyboardRemove](../types/reply_keyboard_remove.md)
|
||||
- [aiogram.types.InputFile](../types/input_file.md)
|
||||
- [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md)
|
||||
68
docs/api/methods/send_poll.md
Normal file
68
docs/api/methods/send_poll.md
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
# sendPoll
|
||||
|
||||
## Description
|
||||
|
||||
Use this method to send a native poll. A native poll can't be sent to a private chat. On success, the sent Message is returned.
|
||||
|
||||
|
||||
## Arguments
|
||||
|
||||
| Name | Type | Description |
|
||||
| - | - | - |
|
||||
| `chat_id` | `#!python3 Union[int, str]` | Unique identifier for the target chat or username of the target channel (in the format @channelusername). A native poll can't be sent to a private chat. |
|
||||
| `question` | `#!python3 str` | Poll question, 1-255 characters |
|
||||
| `options` | `#!python3 List[str]` | List of answer options, 2-10 strings 1-100 characters each |
|
||||
| `disable_notification` | `#!python3 Optional[bool]` | Optional. Sends the message silently. Users will receive a notification with no sound. |
|
||||
| `reply_to_message_id` | `#!python3 Optional[int]` | Optional. If the message is a reply, ID of the original message |
|
||||
| `reply_markup` | `#!python3 Optional[Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]]` | Optional. Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user. |
|
||||
|
||||
|
||||
|
||||
## Response
|
||||
|
||||
Type: `#!python3 Message`
|
||||
|
||||
Description: On success, the sent Message is returned.
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
|
||||
### As bot method bot
|
||||
|
||||
```python3
|
||||
result: Message = await bot.send_poll(...)
|
||||
```
|
||||
|
||||
### Method as object
|
||||
|
||||
Imports:
|
||||
|
||||
- `from aiogram.types import SendPoll`
|
||||
- `from aiogram.api.types import SendPoll`
|
||||
- `from aiogram.api.types.send_poll import SendPoll`
|
||||
|
||||
#### As reply into Webhook
|
||||
```python3
|
||||
return SendPoll(...)
|
||||
```
|
||||
|
||||
#### With specific bot
|
||||
```python3
|
||||
result: Message = await bot.emit(SendPoll(...))
|
||||
```
|
||||
|
||||
#### In handlers with current bot
|
||||
```python3
|
||||
result: Message = await SendPoll(...)
|
||||
```
|
||||
|
||||
|
||||
## Related pages:
|
||||
|
||||
- [Official documentation](https://core.telegram.org/bots/api#sendpoll)
|
||||
- [aiogram.types.ForceReply](../types/force_reply.md)
|
||||
- [aiogram.types.ReplyKeyboardMarkup](../types/reply_keyboard_markup.md)
|
||||
- [aiogram.types.Message](../types/message.md)
|
||||
- [aiogram.types.ReplyKeyboardRemove](../types/reply_keyboard_remove.md)
|
||||
- [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md)
|
||||
68
docs/api/methods/send_sticker.md
Normal file
68
docs/api/methods/send_sticker.md
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
# sendSticker
|
||||
|
||||
## Description
|
||||
|
||||
Use this method to send static .WEBP or animated .TGS stickers. On success, the sent Message is returned.
|
||||
|
||||
|
||||
## Arguments
|
||||
|
||||
| Name | Type | Description |
|
||||
| - | - | - |
|
||||
| `chat_id` | `#!python3 Union[int, str]` | Unique identifier for the target chat or username of the target channel (in the format @channelusername) |
|
||||
| `sticker` | `#!python3 Union[InputFile, str]` | Sticker to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a .webp file from the Internet, or upload a new one using multipart/form-data. |
|
||||
| `disable_notification` | `#!python3 Optional[bool]` | Optional. Sends the message silently. Users will receive a notification with no sound. |
|
||||
| `reply_to_message_id` | `#!python3 Optional[int]` | Optional. If the message is a reply, ID of the original message |
|
||||
| `reply_markup` | `#!python3 Optional[Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]]` | Optional. Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user. |
|
||||
|
||||
|
||||
|
||||
## Response
|
||||
|
||||
Type: `#!python3 Message`
|
||||
|
||||
Description: On success, the sent Message is returned.
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
|
||||
### As bot method bot
|
||||
|
||||
```python3
|
||||
result: Message = await bot.send_sticker(...)
|
||||
```
|
||||
|
||||
### Method as object
|
||||
|
||||
Imports:
|
||||
|
||||
- `from aiogram.types import SendSticker`
|
||||
- `from aiogram.api.types import SendSticker`
|
||||
- `from aiogram.api.types.send_sticker import SendSticker`
|
||||
|
||||
#### As reply into Webhook
|
||||
```python3
|
||||
return SendSticker(...)
|
||||
```
|
||||
|
||||
#### With specific bot
|
||||
```python3
|
||||
result: Message = await bot.emit(SendSticker(...))
|
||||
```
|
||||
|
||||
#### In handlers with current bot
|
||||
```python3
|
||||
result: Message = await SendSticker(...)
|
||||
```
|
||||
|
||||
|
||||
## Related pages:
|
||||
|
||||
- [Official documentation](https://core.telegram.org/bots/api#sendsticker)
|
||||
- [aiogram.types.ForceReply](../types/force_reply.md)
|
||||
- [aiogram.types.ReplyKeyboardMarkup](../types/reply_keyboard_markup.md)
|
||||
- [aiogram.types.Message](../types/message.md)
|
||||
- [aiogram.types.ReplyKeyboardRemove](../types/reply_keyboard_remove.md)
|
||||
- [aiogram.types.InputFile](../types/input_file.md)
|
||||
- [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md)
|
||||
72
docs/api/methods/send_venue.md
Normal file
72
docs/api/methods/send_venue.md
Normal file
|
|
@ -0,0 +1,72 @@
|
|||
# sendVenue
|
||||
|
||||
## Description
|
||||
|
||||
Use this method to send information about a venue. On success, the sent Message is returned.
|
||||
|
||||
|
||||
## Arguments
|
||||
|
||||
| Name | Type | Description |
|
||||
| - | - | - |
|
||||
| `chat_id` | `#!python3 Union[int, str]` | Unique identifier for the target chat or username of the target channel (in the format @channelusername) |
|
||||
| `latitude` | `#!python3 float` | Latitude of the venue |
|
||||
| `longitude` | `#!python3 float` | Longitude of the venue |
|
||||
| `title` | `#!python3 str` | Name of the venue |
|
||||
| `address` | `#!python3 str` | Address of the venue |
|
||||
| `foursquare_id` | `#!python3 Optional[str]` | Optional. Foursquare identifier of the venue |
|
||||
| `foursquare_type` | `#!python3 Optional[str]` | Optional. Foursquare type of the venue, if known. (For example, 'arts_entertainment/default', 'arts_entertainment/aquarium' or 'food/icecream'.) |
|
||||
| `disable_notification` | `#!python3 Optional[bool]` | Optional. Sends the message silently. Users will receive a notification with no sound. |
|
||||
| `reply_to_message_id` | `#!python3 Optional[int]` | Optional. If the message is a reply, ID of the original message |
|
||||
| `reply_markup` | `#!python3 Optional[Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]]` | Optional. Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user. |
|
||||
|
||||
|
||||
|
||||
## Response
|
||||
|
||||
Type: `#!python3 Message`
|
||||
|
||||
Description: On success, the sent Message is returned.
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
|
||||
### As bot method bot
|
||||
|
||||
```python3
|
||||
result: Message = await bot.send_venue(...)
|
||||
```
|
||||
|
||||
### Method as object
|
||||
|
||||
Imports:
|
||||
|
||||
- `from aiogram.types import SendVenue`
|
||||
- `from aiogram.api.types import SendVenue`
|
||||
- `from aiogram.api.types.send_venue import SendVenue`
|
||||
|
||||
#### As reply into Webhook
|
||||
```python3
|
||||
return SendVenue(...)
|
||||
```
|
||||
|
||||
#### With specific bot
|
||||
```python3
|
||||
result: Message = await bot.emit(SendVenue(...))
|
||||
```
|
||||
|
||||
#### In handlers with current bot
|
||||
```python3
|
||||
result: Message = await SendVenue(...)
|
||||
```
|
||||
|
||||
|
||||
## Related pages:
|
||||
|
||||
- [Official documentation](https://core.telegram.org/bots/api#sendvenue)
|
||||
- [aiogram.types.ForceReply](../types/force_reply.md)
|
||||
- [aiogram.types.ReplyKeyboardMarkup](../types/reply_keyboard_markup.md)
|
||||
- [aiogram.types.Message](../types/message.md)
|
||||
- [aiogram.types.ReplyKeyboardRemove](../types/reply_keyboard_remove.md)
|
||||
- [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md)
|
||||
75
docs/api/methods/send_video.md
Normal file
75
docs/api/methods/send_video.md
Normal file
|
|
@ -0,0 +1,75 @@
|
|||
# sendVideo
|
||||
|
||||
## Description
|
||||
|
||||
Use this method to send video files, Telegram clients support mp4 videos (other formats may be sent as Document). On success, the sent Message is returned. Bots can currently send video files of up to 50 MB in size, this limit may be changed in the future.
|
||||
|
||||
|
||||
## Arguments
|
||||
|
||||
| Name | Type | Description |
|
||||
| - | - | - |
|
||||
| `chat_id` | `#!python3 Union[int, str]` | Unique identifier for the target chat or username of the target channel (in the format @channelusername) |
|
||||
| `video` | `#!python3 Union[InputFile, str]` | Video to send. Pass a file_id as String to send a video that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a video from the Internet, or upload a new video using multipart/form-data. |
|
||||
| `duration` | `#!python3 Optional[int]` | Optional. Duration of sent video in seconds |
|
||||
| `width` | `#!python3 Optional[int]` | Optional. Video width |
|
||||
| `height` | `#!python3 Optional[int]` | Optional. Video height |
|
||||
| `thumb` | `#!python3 Optional[Union[InputFile, str]]` | Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail‘s width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can’t be reused and can be only uploaded as a new file, so you can pass 'attach://<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 |
|
||||
| `parse_mode` | `#!python3 Optional[str]` | Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption. |
|
||||
| `supports_streaming` | `#!python3 Optional[bool]` | Optional. Pass True, if the uploaded video is suitable for streaming |
|
||||
| `disable_notification` | `#!python3 Optional[bool]` | Optional. Sends the message silently. Users will receive a notification with no sound. |
|
||||
| `reply_to_message_id` | `#!python3 Optional[int]` | Optional. If the message is a reply, ID of the original message |
|
||||
| `reply_markup` | `#!python3 Optional[Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]]` | Optional. Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user. |
|
||||
|
||||
|
||||
|
||||
## Response
|
||||
|
||||
Type: `#!python3 Message`
|
||||
|
||||
Description: On success, the sent Message is returned.
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
|
||||
### As bot method bot
|
||||
|
||||
```python3
|
||||
result: Message = await bot.send_video(...)
|
||||
```
|
||||
|
||||
### Method as object
|
||||
|
||||
Imports:
|
||||
|
||||
- `from aiogram.types import SendVideo`
|
||||
- `from aiogram.api.types import SendVideo`
|
||||
- `from aiogram.api.types.send_video import SendVideo`
|
||||
|
||||
#### As reply into Webhook
|
||||
```python3
|
||||
return SendVideo(...)
|
||||
```
|
||||
|
||||
#### With specific bot
|
||||
```python3
|
||||
result: Message = await bot.emit(SendVideo(...))
|
||||
```
|
||||
|
||||
#### In handlers with current bot
|
||||
```python3
|
||||
result: Message = await SendVideo(...)
|
||||
```
|
||||
|
||||
|
||||
## Related pages:
|
||||
|
||||
- [Official documentation](https://core.telegram.org/bots/api#sendvideo)
|
||||
- [aiogram.types.ForceReply](../types/force_reply.md)
|
||||
- [aiogram.types.ReplyKeyboardMarkup](../types/reply_keyboard_markup.md)
|
||||
- [aiogram.types.Message](../types/message.md)
|
||||
- [aiogram.types.ReplyKeyboardRemove](../types/reply_keyboard_remove.md)
|
||||
- [aiogram.types.InputFile](../types/input_file.md)
|
||||
- [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md)
|
||||
71
docs/api/methods/send_video_note.md
Normal file
71
docs/api/methods/send_video_note.md
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
# sendVideoNote
|
||||
|
||||
## Description
|
||||
|
||||
As of v.4.0, Telegram clients support rounded square mp4 videos of up to 1 minute long. Use this method to send video messages. On success, the sent Message is returned.
|
||||
|
||||
|
||||
## Arguments
|
||||
|
||||
| Name | Type | Description |
|
||||
| - | - | - |
|
||||
| `chat_id` | `#!python3 Union[int, str]` | Unique identifier for the target chat or username of the target channel (in the format @channelusername) |
|
||||
| `video_note` | `#!python3 Union[InputFile, str]` | Video note to send. Pass a file_id as String to send a video note that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data.. Sending video notes by a URL is currently unsupported |
|
||||
| `duration` | `#!python3 Optional[int]` | Optional. Duration of sent video in seconds |
|
||||
| `length` | `#!python3 Optional[int]` | Optional. Video width and height, i.e. diameter of the video message |
|
||||
| `thumb` | `#!python3 Optional[Union[InputFile, str]]` | Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail‘s width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can’t be reused and can be only uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. |
|
||||
| `disable_notification` | `#!python3 Optional[bool]` | Optional. Sends the message silently. Users will receive a notification with no sound. |
|
||||
| `reply_to_message_id` | `#!python3 Optional[int]` | Optional. If the message is a reply, ID of the original message |
|
||||
| `reply_markup` | `#!python3 Optional[Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]]` | Optional. Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user. |
|
||||
|
||||
|
||||
|
||||
## Response
|
||||
|
||||
Type: `#!python3 Message`
|
||||
|
||||
Description: On success, the sent Message is returned.
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
|
||||
### As bot method bot
|
||||
|
||||
```python3
|
||||
result: Message = await bot.send_video_note(...)
|
||||
```
|
||||
|
||||
### Method as object
|
||||
|
||||
Imports:
|
||||
|
||||
- `from aiogram.types import SendVideoNote`
|
||||
- `from aiogram.api.types import SendVideoNote`
|
||||
- `from aiogram.api.types.send_video_note import SendVideoNote`
|
||||
|
||||
#### As reply into Webhook
|
||||
```python3
|
||||
return SendVideoNote(...)
|
||||
```
|
||||
|
||||
#### With specific bot
|
||||
```python3
|
||||
result: Message = await bot.emit(SendVideoNote(...))
|
||||
```
|
||||
|
||||
#### In handlers with current bot
|
||||
```python3
|
||||
result: Message = await SendVideoNote(...)
|
||||
```
|
||||
|
||||
|
||||
## Related pages:
|
||||
|
||||
- [Official documentation](https://core.telegram.org/bots/api#sendvideonote)
|
||||
- [aiogram.types.ForceReply](../types/force_reply.md)
|
||||
- [aiogram.types.ReplyKeyboardMarkup](../types/reply_keyboard_markup.md)
|
||||
- [aiogram.types.Message](../types/message.md)
|
||||
- [aiogram.types.ReplyKeyboardRemove](../types/reply_keyboard_remove.md)
|
||||
- [aiogram.types.InputFile](../types/input_file.md)
|
||||
- [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md)
|
||||
71
docs/api/methods/send_voice.md
Normal file
71
docs/api/methods/send_voice.md
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
# sendVoice
|
||||
|
||||
## Description
|
||||
|
||||
Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .ogg file encoded with OPUS (other formats may be sent as Audio or Document). On success, the sent Message is returned. Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future.
|
||||
|
||||
|
||||
## Arguments
|
||||
|
||||
| Name | Type | Description |
|
||||
| - | - | - |
|
||||
| `chat_id` | `#!python3 Union[int, str]` | Unique identifier for the target chat or username of the target channel (in the format @channelusername) |
|
||||
| `voice` | `#!python3 Union[InputFile, str]` | Audio file to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. |
|
||||
| `caption` | `#!python3 Optional[str]` | Optional. Voice message caption, 0-1024 characters |
|
||||
| `parse_mode` | `#!python3 Optional[str]` | Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption. |
|
||||
| `duration` | `#!python3 Optional[int]` | Optional. Duration of the voice message in seconds |
|
||||
| `disable_notification` | `#!python3 Optional[bool]` | Optional. Sends the message silently. Users will receive a notification with no sound. |
|
||||
| `reply_to_message_id` | `#!python3 Optional[int]` | Optional. If the message is a reply, ID of the original message |
|
||||
| `reply_markup` | `#!python3 Optional[Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]]` | Optional. Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user. |
|
||||
|
||||
|
||||
|
||||
## Response
|
||||
|
||||
Type: `#!python3 Message`
|
||||
|
||||
Description: On success, the sent Message is returned.
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
|
||||
### As bot method bot
|
||||
|
||||
```python3
|
||||
result: Message = await bot.send_voice(...)
|
||||
```
|
||||
|
||||
### Method as object
|
||||
|
||||
Imports:
|
||||
|
||||
- `from aiogram.types import SendVoice`
|
||||
- `from aiogram.api.types import SendVoice`
|
||||
- `from aiogram.api.types.send_voice import SendVoice`
|
||||
|
||||
#### As reply into Webhook
|
||||
```python3
|
||||
return SendVoice(...)
|
||||
```
|
||||
|
||||
#### With specific bot
|
||||
```python3
|
||||
result: Message = await bot.emit(SendVoice(...))
|
||||
```
|
||||
|
||||
#### In handlers with current bot
|
||||
```python3
|
||||
result: Message = await SendVoice(...)
|
||||
```
|
||||
|
||||
|
||||
## Related pages:
|
||||
|
||||
- [Official documentation](https://core.telegram.org/bots/api#sendvoice)
|
||||
- [aiogram.types.ForceReply](../types/force_reply.md)
|
||||
- [aiogram.types.ReplyKeyboardMarkup](../types/reply_keyboard_markup.md)
|
||||
- [aiogram.types.Message](../types/message.md)
|
||||
- [aiogram.types.ReplyKeyboardRemove](../types/reply_keyboard_remove.md)
|
||||
- [aiogram.types.InputFile](../types/input_file.md)
|
||||
- [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md)
|
||||
59
docs/api/methods/set_chat_description.md
Normal file
59
docs/api/methods/set_chat_description.md
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
# setChatDescription
|
||||
|
||||
## Description
|
||||
|
||||
Use this method to change the description of a group, a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Returns True on success.
|
||||
|
||||
|
||||
## Arguments
|
||||
|
||||
| Name | Type | Description |
|
||||
| - | - | - |
|
||||
| `chat_id` | `#!python3 Union[int, str]` | Unique identifier for the target chat or username of the target channel (in the format @channelusername) |
|
||||
| `description` | `#!python3 Optional[str]` | Optional. New chat description, 0-255 characters |
|
||||
|
||||
|
||||
|
||||
## Response
|
||||
|
||||
Type: `#!python3 bool`
|
||||
|
||||
Description: Returns True on success.
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
|
||||
### As bot method bot
|
||||
|
||||
```python3
|
||||
result: bool = await bot.set_chat_description(...)
|
||||
```
|
||||
|
||||
### Method as object
|
||||
|
||||
Imports:
|
||||
|
||||
- `from aiogram.types import SetChatDescription`
|
||||
- `from aiogram.api.types import SetChatDescription`
|
||||
- `from aiogram.api.types.set_chat_description import SetChatDescription`
|
||||
|
||||
#### As reply into Webhook
|
||||
```python3
|
||||
return SetChatDescription(...)
|
||||
```
|
||||
|
||||
#### With specific bot
|
||||
```python3
|
||||
result: bool = await bot.emit(SetChatDescription(...))
|
||||
```
|
||||
|
||||
#### In handlers with current bot
|
||||
```python3
|
||||
result: bool = await SetChatDescription(...)
|
||||
```
|
||||
|
||||
|
||||
## Related pages:
|
||||
|
||||
- [Official documentation](https://core.telegram.org/bots/api#setchatdescription)
|
||||
60
docs/api/methods/set_chat_permissions.md
Normal file
60
docs/api/methods/set_chat_permissions.md
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
# setChatPermissions
|
||||
|
||||
## Description
|
||||
|
||||
Use this method to set default chat permissions for all members. The bot must be an administrator in the group or a supergroup for this to work and must have the can_restrict_members admin rights. Returns True on success.
|
||||
|
||||
|
||||
## Arguments
|
||||
|
||||
| Name | Type | Description |
|
||||
| - | - | - |
|
||||
| `chat_id` | `#!python3 Union[int, str]` | Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) |
|
||||
| `permissions` | `#!python3 ChatPermissions` | New default chat permissions |
|
||||
|
||||
|
||||
|
||||
## Response
|
||||
|
||||
Type: `#!python3 bool`
|
||||
|
||||
Description: Returns True on success.
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
|
||||
### As bot method bot
|
||||
|
||||
```python3
|
||||
result: bool = await bot.set_chat_permissions(...)
|
||||
```
|
||||
|
||||
### Method as object
|
||||
|
||||
Imports:
|
||||
|
||||
- `from aiogram.types import SetChatPermissions`
|
||||
- `from aiogram.api.types import SetChatPermissions`
|
||||
- `from aiogram.api.types.set_chat_permissions import SetChatPermissions`
|
||||
|
||||
#### As reply into Webhook
|
||||
```python3
|
||||
return SetChatPermissions(...)
|
||||
```
|
||||
|
||||
#### With specific bot
|
||||
```python3
|
||||
result: bool = await bot.emit(SetChatPermissions(...))
|
||||
```
|
||||
|
||||
#### In handlers with current bot
|
||||
```python3
|
||||
result: bool = await SetChatPermissions(...)
|
||||
```
|
||||
|
||||
|
||||
## Related pages:
|
||||
|
||||
- [Official documentation](https://core.telegram.org/bots/api#setchatpermissions)
|
||||
- [aiogram.types.ChatPermissions](../types/chat_permissions.md)
|
||||
56
docs/api/methods/set_chat_photo.md
Normal file
56
docs/api/methods/set_chat_photo.md
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
# setChatPhoto
|
||||
|
||||
## Description
|
||||
|
||||
Use this method to set a new profile photo for the chat. Photos can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Returns True on success.
|
||||
|
||||
|
||||
## Arguments
|
||||
|
||||
| Name | Type | Description |
|
||||
| - | - | - |
|
||||
| `chat_id` | `#!python3 Union[int, str]` | Unique identifier for the target chat or username of the target channel (in the format @channelusername) |
|
||||
| `photo` | `#!python3 InputFile` | New chat photo, uploaded using multipart/form-data |
|
||||
|
||||
|
||||
|
||||
## Response
|
||||
|
||||
Type: `#!python3 bool`
|
||||
|
||||
Description: Returns True on success.
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
|
||||
### As bot method bot
|
||||
|
||||
```python3
|
||||
result: bool = await bot.set_chat_photo(...)
|
||||
```
|
||||
|
||||
### Method as object
|
||||
|
||||
Imports:
|
||||
|
||||
- `from aiogram.types import SetChatPhoto`
|
||||
- `from aiogram.api.types import SetChatPhoto`
|
||||
- `from aiogram.api.types.set_chat_photo import SetChatPhoto`
|
||||
|
||||
|
||||
#### With specific bot
|
||||
```python3
|
||||
result: bool = await bot.emit(SetChatPhoto(...))
|
||||
```
|
||||
|
||||
#### In handlers with current bot
|
||||
```python3
|
||||
result: bool = await SetChatPhoto(...)
|
||||
```
|
||||
|
||||
|
||||
## Related pages:
|
||||
|
||||
- [Official documentation](https://core.telegram.org/bots/api#setchatphoto)
|
||||
- [aiogram.types.InputFile](../types/input_file.md)
|
||||
59
docs/api/methods/set_chat_sticker_set.md
Normal file
59
docs/api/methods/set_chat_sticker_set.md
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
# setChatStickerSet
|
||||
|
||||
## Description
|
||||
|
||||
Use this method to set a new group sticker set for a supergroup. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Use the field can_set_sticker_set optionally returned in getChat requests to check if the bot can use this method. Returns True on success.
|
||||
|
||||
|
||||
## Arguments
|
||||
|
||||
| Name | Type | Description |
|
||||
| - | - | - |
|
||||
| `chat_id` | `#!python3 Union[int, str]` | Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) |
|
||||
| `sticker_set_name` | `#!python3 str` | Name of the sticker set to be set as the group sticker set |
|
||||
|
||||
|
||||
|
||||
## Response
|
||||
|
||||
Type: `#!python3 bool`
|
||||
|
||||
Description: Use the field can_set_sticker_set optionally returned in getChat requests to check if the bot can use this method. Returns True on success.
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
|
||||
### As bot method bot
|
||||
|
||||
```python3
|
||||
result: bool = await bot.set_chat_sticker_set(...)
|
||||
```
|
||||
|
||||
### Method as object
|
||||
|
||||
Imports:
|
||||
|
||||
- `from aiogram.types import SetChatStickerSet`
|
||||
- `from aiogram.api.types import SetChatStickerSet`
|
||||
- `from aiogram.api.types.set_chat_sticker_set import SetChatStickerSet`
|
||||
|
||||
#### As reply into Webhook
|
||||
```python3
|
||||
return SetChatStickerSet(...)
|
||||
```
|
||||
|
||||
#### With specific bot
|
||||
```python3
|
||||
result: bool = await bot.emit(SetChatStickerSet(...))
|
||||
```
|
||||
|
||||
#### In handlers with current bot
|
||||
```python3
|
||||
result: bool = await SetChatStickerSet(...)
|
||||
```
|
||||
|
||||
|
||||
## Related pages:
|
||||
|
||||
- [Official documentation](https://core.telegram.org/bots/api#setchatstickerset)
|
||||
59
docs/api/methods/set_chat_title.md
Normal file
59
docs/api/methods/set_chat_title.md
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
# setChatTitle
|
||||
|
||||
## Description
|
||||
|
||||
Use this method to change the title of a chat. Titles can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Returns True on success.
|
||||
|
||||
|
||||
## Arguments
|
||||
|
||||
| Name | Type | Description |
|
||||
| - | - | - |
|
||||
| `chat_id` | `#!python3 Union[int, str]` | Unique identifier for the target chat or username of the target channel (in the format @channelusername) |
|
||||
| `title` | `#!python3 str` | New chat title, 1-255 characters |
|
||||
|
||||
|
||||
|
||||
## Response
|
||||
|
||||
Type: `#!python3 bool`
|
||||
|
||||
Description: Returns True on success.
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
|
||||
### As bot method bot
|
||||
|
||||
```python3
|
||||
result: bool = await bot.set_chat_title(...)
|
||||
```
|
||||
|
||||
### Method as object
|
||||
|
||||
Imports:
|
||||
|
||||
- `from aiogram.types import SetChatTitle`
|
||||
- `from aiogram.api.types import SetChatTitle`
|
||||
- `from aiogram.api.types.set_chat_title import SetChatTitle`
|
||||
|
||||
#### As reply into Webhook
|
||||
```python3
|
||||
return SetChatTitle(...)
|
||||
```
|
||||
|
||||
#### With specific bot
|
||||
```python3
|
||||
result: bool = await bot.emit(SetChatTitle(...))
|
||||
```
|
||||
|
||||
#### In handlers with current bot
|
||||
```python3
|
||||
result: bool = await SetChatTitle(...)
|
||||
```
|
||||
|
||||
|
||||
## Related pages:
|
||||
|
||||
- [Official documentation](https://core.telegram.org/bots/api#setchattitle)
|
||||
65
docs/api/methods/set_game_score.md
Normal file
65
docs/api/methods/set_game_score.md
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
# setGameScore
|
||||
|
||||
## Description
|
||||
|
||||
Use this method to set the score of the specified user in a game. On success, if the message was sent by the bot, returns the edited Message, otherwise returns True. Returns an error, if the new score is not greater than the user's current score in the chat and force is False.
|
||||
|
||||
|
||||
## Arguments
|
||||
|
||||
| Name | Type | Description |
|
||||
| - | - | - |
|
||||
| `user_id` | `#!python3 int` | User identifier |
|
||||
| `score` | `#!python3 int` | New score, must be non-negative |
|
||||
| `force` | `#!python3 Optional[bool]` | Optional. Pass True, if the high score is allowed to decrease. This can be useful when fixing mistakes or banning cheaters |
|
||||
| `disable_edit_message` | `#!python3 Optional[bool]` | Optional. Pass True, if the game message should not be automatically edited to include the current scoreboard |
|
||||
| `chat_id` | `#!python3 Optional[int]` | Optional. Required if inline_message_id is not specified. Unique identifier for the target chat |
|
||||
| `message_id` | `#!python3 Optional[int]` | Optional. Required if inline_message_id is not specified. Identifier of the sent message |
|
||||
| `inline_message_id` | `#!python3 Optional[str]` | Optional. Required if chat_id and message_id are not specified. Identifier of the inline message |
|
||||
|
||||
|
||||
|
||||
## Response
|
||||
|
||||
Type: `#!python3 Union[Message, bool]`
|
||||
|
||||
Description: On success, if the message was sent by the bot, returns the edited Message, otherwise returns True. Returns an error, if the new score is not greater than the user's current score in the chat and force is False.
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
|
||||
### As bot method bot
|
||||
|
||||
```python3
|
||||
result: Union[Message, bool] = await bot.set_game_score(...)
|
||||
```
|
||||
|
||||
### Method as object
|
||||
|
||||
Imports:
|
||||
|
||||
- `from aiogram.types import SetGameScore`
|
||||
- `from aiogram.api.types import SetGameScore`
|
||||
- `from aiogram.api.types.set_game_score import SetGameScore`
|
||||
|
||||
#### As reply into Webhook
|
||||
```python3
|
||||
return SetGameScore(...)
|
||||
```
|
||||
|
||||
#### With specific bot
|
||||
```python3
|
||||
result: Union[Message, bool] = await bot.emit(SetGameScore(...))
|
||||
```
|
||||
|
||||
#### In handlers with current bot
|
||||
```python3
|
||||
result: Union[Message, bool] = await SetGameScore(...)
|
||||
```
|
||||
|
||||
|
||||
## Related pages:
|
||||
|
||||
- [Official documentation](https://core.telegram.org/bots/api#setgamescore)
|
||||
- [aiogram.types.Message](../types/message.md)
|
||||
62
docs/api/methods/set_passport_data_errors.md
Normal file
62
docs/api/methods/set_passport_data_errors.md
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
# setPassportDataErrors
|
||||
|
||||
## Description
|
||||
|
||||
Informs a user that some of the Telegram Passport elements they provided contains errors. The user will not be able to re-submit their Passport to you until the errors are fixed (the contents of the field for which you returned the error must change). Returns True on success.
|
||||
|
||||
Use this if the data submitted by the user doesn't satisfy the standards your service requires for any reason. For example, if a birthday date seems invalid, a submitted document is blurry, a scan shows evidence of tampering, etc. Supply some details in the error message to make sure the user knows how to correct the issues.
|
||||
|
||||
|
||||
## Arguments
|
||||
|
||||
| Name | Type | Description |
|
||||
| - | - | - |
|
||||
| `user_id` | `#!python3 int` | User identifier |
|
||||
| `errors` | `#!python3 List[PassportElementError]` | A JSON-serialized array describing the errors |
|
||||
|
||||
|
||||
|
||||
## Response
|
||||
|
||||
Type: `#!python3 bool`
|
||||
|
||||
Description: The user will not be able to re-submit their Passport to you until the errors are fixed (the contents of the field for which you returned the error must change). Returns True on success.
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
|
||||
### As bot method bot
|
||||
|
||||
```python3
|
||||
result: bool = await bot.set_passport_data_errors(...)
|
||||
```
|
||||
|
||||
### Method as object
|
||||
|
||||
Imports:
|
||||
|
||||
- `from aiogram.types import SetPassportDataErrors`
|
||||
- `from aiogram.api.types import SetPassportDataErrors`
|
||||
- `from aiogram.api.types.set_passport_data_errors import SetPassportDataErrors`
|
||||
|
||||
#### As reply into Webhook
|
||||
```python3
|
||||
return SetPassportDataErrors(...)
|
||||
```
|
||||
|
||||
#### With specific bot
|
||||
```python3
|
||||
result: bool = await bot.emit(SetPassportDataErrors(...))
|
||||
```
|
||||
|
||||
#### In handlers with current bot
|
||||
```python3
|
||||
result: bool = await SetPassportDataErrors(...)
|
||||
```
|
||||
|
||||
|
||||
## Related pages:
|
||||
|
||||
- [Official documentation](https://core.telegram.org/bots/api#setpassportdataerrors)
|
||||
- [aiogram.types.PassportElementError](../types/passport_element_error.md)
|
||||
59
docs/api/methods/set_sticker_position_in_set.md
Normal file
59
docs/api/methods/set_sticker_position_in_set.md
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
# setStickerPositionInSet
|
||||
|
||||
## Description
|
||||
|
||||
Use this method to move a sticker in a set created by the bot to a specific position . Returns True on success.
|
||||
|
||||
|
||||
## Arguments
|
||||
|
||||
| Name | Type | Description |
|
||||
| - | - | - |
|
||||
| `sticker` | `#!python3 str` | File identifier of the sticker |
|
||||
| `position` | `#!python3 int` | New sticker position in the set, zero-based |
|
||||
|
||||
|
||||
|
||||
## Response
|
||||
|
||||
Type: `#!python3 bool`
|
||||
|
||||
Description: Returns True on success.
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
|
||||
### As bot method bot
|
||||
|
||||
```python3
|
||||
result: bool = await bot.set_sticker_position_in_set(...)
|
||||
```
|
||||
|
||||
### Method as object
|
||||
|
||||
Imports:
|
||||
|
||||
- `from aiogram.types import SetStickerPositionInSet`
|
||||
- `from aiogram.api.types import SetStickerPositionInSet`
|
||||
- `from aiogram.api.types.set_sticker_position_in_set import SetStickerPositionInSet`
|
||||
|
||||
#### As reply into Webhook
|
||||
```python3
|
||||
return SetStickerPositionInSet(...)
|
||||
```
|
||||
|
||||
#### With specific bot
|
||||
```python3
|
||||
result: bool = await bot.emit(SetStickerPositionInSet(...))
|
||||
```
|
||||
|
||||
#### In handlers with current bot
|
||||
```python3
|
||||
result: bool = await SetStickerPositionInSet(...)
|
||||
```
|
||||
|
||||
|
||||
## Related pages:
|
||||
|
||||
- [Official documentation](https://core.telegram.org/bots/api#setstickerpositioninset)
|
||||
74
docs/api/methods/set_webhook.md
Normal file
74
docs/api/methods/set_webhook.md
Normal file
|
|
@ -0,0 +1,74 @@
|
|||
# setWebhook
|
||||
|
||||
## Description
|
||||
|
||||
Use this method to specify a url and receive incoming updates via an outgoing webhook. Whenever there is an update for the bot, we will send an HTTPS POST request to the specified url, containing a JSON-serialized Update. In case of an unsuccessful request, we will give up after a reasonable amount of attempts. Returns True on success.
|
||||
|
||||
If you'd like to make sure that the Webhook request comes from Telegram, we recommend using a secret path in the URL, e.g. https://www.example.com/<token>. Since nobody else knows your bot‘s token, you can be pretty sure it’s us.
|
||||
|
||||
Notes
|
||||
|
||||
1. You will not be able to receive updates using getUpdates for as long as an outgoing webhook is set up.
|
||||
|
||||
2. To use a self-signed certificate, you need to upload your public key certificate using certificate parameter. Please upload as InputFile, sending a String will not work.
|
||||
|
||||
3. Ports currently supported for Webhooks: 443, 80, 88, 8443.
|
||||
|
||||
NEW! If you're having any trouble setting up webhooks, please check out this amazing guide to Webhooks.
|
||||
|
||||
|
||||
## Arguments
|
||||
|
||||
| Name | Type | Description |
|
||||
| - | - | - |
|
||||
| `url` | `#!python3 str` | HTTPS url to send updates to. Use an empty string to remove webhook integration |
|
||||
| `certificate` | `#!python3 Optional[InputFile]` | Optional. Upload your public key certificate so that the root certificate in use can be checked. See our self-signed guide for details. |
|
||||
| `max_connections` | `#!python3 Optional[int]` | Optional. Maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery, 1-100. Defaults to 40. Use lower values to limit the load on your bot‘s server, and higher values to increase your bot’s throughput. |
|
||||
| `allowed_updates` | `#!python3 Optional[List[str]]` | Optional. List the types of updates you want your bot to receive. For example, specify ['message', 'edited_channel_post', 'callback_query'] to only receive updates of these types. See Update for a complete list of available update types. Specify an empty list to receive all updates regardless of type (default). If not specified, the previous setting will be used. |
|
||||
|
||||
|
||||
|
||||
## Response
|
||||
|
||||
Type: `#!python3 bool`
|
||||
|
||||
Description: Returns True on success.
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
|
||||
### As bot method bot
|
||||
|
||||
```python3
|
||||
result: bool = await bot.set_webhook(...)
|
||||
```
|
||||
|
||||
### Method as object
|
||||
|
||||
Imports:
|
||||
|
||||
- `from aiogram.types import SetWebhook`
|
||||
- `from aiogram.api.types import SetWebhook`
|
||||
- `from aiogram.api.types.set_webhook import SetWebhook`
|
||||
|
||||
#### As reply into Webhook
|
||||
```python3
|
||||
return SetWebhook(...)
|
||||
```
|
||||
|
||||
#### With specific bot
|
||||
```python3
|
||||
result: bool = await bot.emit(SetWebhook(...))
|
||||
```
|
||||
|
||||
#### In handlers with current bot
|
||||
```python3
|
||||
result: bool = await SetWebhook(...)
|
||||
```
|
||||
|
||||
|
||||
## Related pages:
|
||||
|
||||
- [Official documentation](https://core.telegram.org/bots/api#setwebhook)
|
||||
- [aiogram.types.InputFile](../types/input_file.md)
|
||||
63
docs/api/methods/stop_message_live_location.md
Normal file
63
docs/api/methods/stop_message_live_location.md
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
# stopMessageLiveLocation
|
||||
|
||||
## Description
|
||||
|
||||
Use this method to stop updating a live location message before live_period expires. On success, if the message was sent by the bot, the sent Message is returned, otherwise True is returned.
|
||||
|
||||
|
||||
## Arguments
|
||||
|
||||
| Name | Type | Description |
|
||||
| - | - | - |
|
||||
| `chat_id` | `#!python3 Optional[Union[int, str]]` | Optional. Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername) |
|
||||
| `message_id` | `#!python3 Optional[int]` | Optional. Required if inline_message_id is not specified. Identifier of the message with live location to stop |
|
||||
| `inline_message_id` | `#!python3 Optional[str]` | Optional. Required if chat_id and message_id are not specified. Identifier of the inline message |
|
||||
| `reply_markup` | `#!python3 Optional[InlineKeyboardMarkup]` | Optional. A JSON-serialized object for a new inline keyboard. |
|
||||
|
||||
|
||||
|
||||
## Response
|
||||
|
||||
Type: `#!python3 Union[Message, bool]`
|
||||
|
||||
Description: On success, if the message was sent by the bot, the sent Message is returned, otherwise True is returned.
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
|
||||
### As bot method bot
|
||||
|
||||
```python3
|
||||
result: Union[Message, bool] = await bot.stop_message_live_location(...)
|
||||
```
|
||||
|
||||
### Method as object
|
||||
|
||||
Imports:
|
||||
|
||||
- `from aiogram.types import StopMessageLiveLocation`
|
||||
- `from aiogram.api.types import StopMessageLiveLocation`
|
||||
- `from aiogram.api.types.stop_message_live_location import StopMessageLiveLocation`
|
||||
|
||||
#### As reply into Webhook
|
||||
```python3
|
||||
return StopMessageLiveLocation(...)
|
||||
```
|
||||
|
||||
#### With specific bot
|
||||
```python3
|
||||
result: Union[Message, bool] = await bot.emit(StopMessageLiveLocation(...))
|
||||
```
|
||||
|
||||
#### In handlers with current bot
|
||||
```python3
|
||||
result: Union[Message, bool] = await StopMessageLiveLocation(...)
|
||||
```
|
||||
|
||||
|
||||
## Related pages:
|
||||
|
||||
- [Official documentation](https://core.telegram.org/bots/api#stopmessagelivelocation)
|
||||
- [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md)
|
||||
- [aiogram.types.Message](../types/message.md)
|
||||
62
docs/api/methods/stop_poll.md
Normal file
62
docs/api/methods/stop_poll.md
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
# stopPoll
|
||||
|
||||
## Description
|
||||
|
||||
Use this method to stop a poll which was sent by the bot. On success, the stopped Poll with the final results is returned.
|
||||
|
||||
|
||||
## Arguments
|
||||
|
||||
| Name | Type | Description |
|
||||
| - | - | - |
|
||||
| `chat_id` | `#!python3 Union[int, str]` | Unique identifier for the target chat or username of the target channel (in the format @channelusername) |
|
||||
| `message_id` | `#!python3 int` | Identifier of the original message with the poll |
|
||||
| `reply_markup` | `#!python3 Optional[InlineKeyboardMarkup]` | Optional. A JSON-serialized object for a new message inline keyboard. |
|
||||
|
||||
|
||||
|
||||
## Response
|
||||
|
||||
Type: `#!python3 Poll`
|
||||
|
||||
Description: On success, the stopped Poll with the final results is returned.
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
|
||||
### As bot method bot
|
||||
|
||||
```python3
|
||||
result: Poll = await bot.stop_poll(...)
|
||||
```
|
||||
|
||||
### Method as object
|
||||
|
||||
Imports:
|
||||
|
||||
- `from aiogram.types import StopPoll`
|
||||
- `from aiogram.api.types import StopPoll`
|
||||
- `from aiogram.api.types.stop_poll import StopPoll`
|
||||
|
||||
#### As reply into Webhook
|
||||
```python3
|
||||
return StopPoll(...)
|
||||
```
|
||||
|
||||
#### With specific bot
|
||||
```python3
|
||||
result: Poll = await bot.emit(StopPoll(...))
|
||||
```
|
||||
|
||||
#### In handlers with current bot
|
||||
```python3
|
||||
result: Poll = await StopPoll(...)
|
||||
```
|
||||
|
||||
|
||||
## Related pages:
|
||||
|
||||
- [Official documentation](https://core.telegram.org/bots/api#stoppoll)
|
||||
- [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md)
|
||||
- [aiogram.types.Poll](../types/poll.md)
|
||||
59
docs/api/methods/unban_chat_member.md
Normal file
59
docs/api/methods/unban_chat_member.md
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
# unbanChatMember
|
||||
|
||||
## Description
|
||||
|
||||
Use this method to unban a previously kicked user in a supergroup or channel. The user will not return to the group or channel automatically, but will be able to join via link, etc. The bot must be an administrator for this to work. Returns True on success.
|
||||
|
||||
|
||||
## Arguments
|
||||
|
||||
| Name | Type | Description |
|
||||
| - | - | - |
|
||||
| `chat_id` | `#!python3 Union[int, str]` | Unique identifier for the target group or username of the target supergroup or channel (in the format @username) |
|
||||
| `user_id` | `#!python3 int` | Unique identifier of the target user |
|
||||
|
||||
|
||||
|
||||
## Response
|
||||
|
||||
Type: `#!python3 bool`
|
||||
|
||||
Description: The user will not return to the group or channel automatically, but will be able to join via link, etc. Returns True on success.
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
|
||||
### As bot method bot
|
||||
|
||||
```python3
|
||||
result: bool = await bot.unban_chat_member(...)
|
||||
```
|
||||
|
||||
### Method as object
|
||||
|
||||
Imports:
|
||||
|
||||
- `from aiogram.types import UnbanChatMember`
|
||||
- `from aiogram.api.types import UnbanChatMember`
|
||||
- `from aiogram.api.types.unban_chat_member import UnbanChatMember`
|
||||
|
||||
#### As reply into Webhook
|
||||
```python3
|
||||
return UnbanChatMember(...)
|
||||
```
|
||||
|
||||
#### With specific bot
|
||||
```python3
|
||||
result: bool = await bot.emit(UnbanChatMember(...))
|
||||
```
|
||||
|
||||
#### In handlers with current bot
|
||||
```python3
|
||||
result: bool = await UnbanChatMember(...)
|
||||
```
|
||||
|
||||
|
||||
## Related pages:
|
||||
|
||||
- [Official documentation](https://core.telegram.org/bots/api#unbanchatmember)
|
||||
58
docs/api/methods/unpin_chat_message.md
Normal file
58
docs/api/methods/unpin_chat_message.md
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
# unpinChatMessage
|
||||
|
||||
## Description
|
||||
|
||||
Use this method to unpin a message in a group, a supergroup, or a channel. The bot must be an administrator in the chat for this to work and must have the ‘can_pin_messages’ admin right in the supergroup or ‘can_edit_messages’ admin right in the channel. Returns True on success.
|
||||
|
||||
|
||||
## Arguments
|
||||
|
||||
| Name | Type | Description |
|
||||
| - | - | - |
|
||||
| `chat_id` | `#!python3 Union[int, str]` | Unique identifier for the target chat or username of the target channel (in the format @channelusername) |
|
||||
|
||||
|
||||
|
||||
## Response
|
||||
|
||||
Type: `#!python3 bool`
|
||||
|
||||
Description: Returns True on success.
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
|
||||
### As bot method bot
|
||||
|
||||
```python3
|
||||
result: bool = await bot.unpin_chat_message(...)
|
||||
```
|
||||
|
||||
### Method as object
|
||||
|
||||
Imports:
|
||||
|
||||
- `from aiogram.types import UnpinChatMessage`
|
||||
- `from aiogram.api.types import UnpinChatMessage`
|
||||
- `from aiogram.api.types.unpin_chat_message import UnpinChatMessage`
|
||||
|
||||
#### As reply into Webhook
|
||||
```python3
|
||||
return UnpinChatMessage(...)
|
||||
```
|
||||
|
||||
#### With specific bot
|
||||
```python3
|
||||
result: bool = await bot.emit(UnpinChatMessage(...))
|
||||
```
|
||||
|
||||
#### In handlers with current bot
|
||||
```python3
|
||||
result: bool = await UnpinChatMessage(...)
|
||||
```
|
||||
|
||||
|
||||
## Related pages:
|
||||
|
||||
- [Official documentation](https://core.telegram.org/bots/api#unpinchatmessage)
|
||||
57
docs/api/methods/upload_sticker_file.md
Normal file
57
docs/api/methods/upload_sticker_file.md
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
# uploadStickerFile
|
||||
|
||||
## Description
|
||||
|
||||
Use this method to upload a .png file with a sticker for later use in createNewStickerSet and addStickerToSet methods (can be used multiple times). Returns the uploaded File on success.
|
||||
|
||||
|
||||
## Arguments
|
||||
|
||||
| Name | Type | Description |
|
||||
| - | - | - |
|
||||
| `user_id` | `#!python3 int` | User identifier of sticker file owner |
|
||||
| `png_sticker` | `#!python3 InputFile` | Png image with the sticker, must be up to 512 kilobytes in size, dimensions must not exceed 512px, and either width or height must be exactly 512px. |
|
||||
|
||||
|
||||
|
||||
## Response
|
||||
|
||||
Type: `#!python3 File`
|
||||
|
||||
Description: Returns the uploaded File on success.
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
|
||||
### As bot method bot
|
||||
|
||||
```python3
|
||||
result: File = await bot.upload_sticker_file(...)
|
||||
```
|
||||
|
||||
### Method as object
|
||||
|
||||
Imports:
|
||||
|
||||
- `from aiogram.types import UploadStickerFile`
|
||||
- `from aiogram.api.types import UploadStickerFile`
|
||||
- `from aiogram.api.types.upload_sticker_file import UploadStickerFile`
|
||||
|
||||
|
||||
#### With specific bot
|
||||
```python3
|
||||
result: File = await bot.emit(UploadStickerFile(...))
|
||||
```
|
||||
|
||||
#### In handlers with current bot
|
||||
```python3
|
||||
result: File = await UploadStickerFile(...)
|
||||
```
|
||||
|
||||
|
||||
## Related pages:
|
||||
|
||||
- [Official documentation](https://core.telegram.org/bots/api#uploadstickerfile)
|
||||
- [aiogram.types.InputFile](../types/input_file.md)
|
||||
- [aiogram.types.File](../types/file.md)
|
||||
32
docs/api/types/animation.md
Normal file
32
docs/api/types/animation.md
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
# Animation
|
||||
|
||||
## Description
|
||||
|
||||
This object represents an animation file (GIF or H.264/MPEG-4 AVC video without sound).
|
||||
|
||||
|
||||
## Attributes
|
||||
|
||||
| Name | Type | Description |
|
||||
| - | - | - |
|
||||
| `file_id` | `#!python str` | Identifier for this file |
|
||||
| `width` | `#!python int` | Video width as defined by sender |
|
||||
| `height` | `#!python int` | Video height as defined by sender |
|
||||
| `duration` | `#!python int` | Duration of the video in seconds as defined by sender |
|
||||
| `thumb` | `#!python Optional[PhotoSize]` | Optional. Animation thumbnail as defined by sender |
|
||||
| `file_name` | `#!python Optional[str]` | Optional. Original animation filename as defined by sender |
|
||||
| `mime_type` | `#!python Optional[str]` | Optional. MIME type of the file as defined by sender |
|
||||
| `file_size` | `#!python Optional[int]` | Optional. File size |
|
||||
|
||||
|
||||
|
||||
## Location
|
||||
|
||||
- `from aiogram.types import Animation`
|
||||
- `from aiogram.api.types import Animation`
|
||||
- `from aiogram.api.types.animation import Animation`
|
||||
|
||||
## Related pages:
|
||||
|
||||
- [Official documentation](https://core.telegram.org/bots/api#animation)
|
||||
- [aiogram.types.PhotoSize](../types/photo_size.md)
|
||||
31
docs/api/types/audio.md
Normal file
31
docs/api/types/audio.md
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
# Audio
|
||||
|
||||
## Description
|
||||
|
||||
This object represents an audio file to be treated as music by the Telegram clients.
|
||||
|
||||
|
||||
## Attributes
|
||||
|
||||
| Name | Type | Description |
|
||||
| - | - | - |
|
||||
| `file_id` | `#!python str` | Identifier for this file |
|
||||
| `duration` | `#!python int` | Duration of the audio in seconds as defined by sender |
|
||||
| `performer` | `#!python Optional[str]` | Optional. Performer of the audio as defined by sender or by audio tags |
|
||||
| `title` | `#!python Optional[str]` | Optional. Title of the audio as defined by sender or by audio tags |
|
||||
| `mime_type` | `#!python Optional[str]` | Optional. MIME type of the file as defined by sender |
|
||||
| `file_size` | `#!python Optional[int]` | Optional. File size |
|
||||
| `thumb` | `#!python Optional[PhotoSize]` | Optional. Thumbnail of the album cover to which the music file belongs |
|
||||
|
||||
|
||||
|
||||
## Location
|
||||
|
||||
- `from aiogram.types import Audio`
|
||||
- `from aiogram.api.types import Audio`
|
||||
- `from aiogram.api.types.audio import Audio`
|
||||
|
||||
## Related pages:
|
||||
|
||||
- [Official documentation](https://core.telegram.org/bots/api#audio)
|
||||
- [aiogram.types.PhotoSize](../types/photo_size.md)
|
||||
18
docs/api/types/callback_game.md
Normal file
18
docs/api/types/callback_game.md
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
# CallbackGame
|
||||
|
||||
## Description
|
||||
|
||||
A placeholder, currently holds no information. Use BotFather to set up your game.
|
||||
|
||||
|
||||
|
||||
|
||||
## Location
|
||||
|
||||
- `from aiogram.types import CallbackGame`
|
||||
- `from aiogram.api.types import CallbackGame`
|
||||
- `from aiogram.api.types.callback_game import CallbackGame`
|
||||
|
||||
## Related pages:
|
||||
|
||||
- [Official documentation](https://core.telegram.org/bots/api#callbackgame)
|
||||
34
docs/api/types/callback_query.md
Normal file
34
docs/api/types/callback_query.md
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
# CallbackQuery
|
||||
|
||||
## Description
|
||||
|
||||
This object represents an incoming callback query from a callback button in an inline keyboard. If the button that originated the query was attached to a message sent by the bot, the field message will be present. If the button was attached to a message sent via the bot (in inline mode), the field inline_message_id will be present. Exactly one of the fields data or game_short_name will be present.
|
||||
|
||||
NOTE: After the user presses a callback button, Telegram clients will display a progress bar until you call answerCallbackQuery. It is, therefore, necessary to react by calling answerCallbackQuery even if no notification to the user is needed (e.g., without specifying any of the optional parameters).
|
||||
|
||||
|
||||
## Attributes
|
||||
|
||||
| Name | Type | Description |
|
||||
| - | - | - |
|
||||
| `id` | `#!python str` | Unique identifier for this query |
|
||||
| `from_user` | `#!python User` | Sender |
|
||||
| `chat_instance` | `#!python str` | Global identifier, uniquely corresponding to the chat to which the message with the callback button was sent. Useful for high scores in games. |
|
||||
| `message` | `#!python Optional[Message]` | Optional. Message with the callback button that originated the query. Note that message content and message date will not be available if the message is too old |
|
||||
| `inline_message_id` | `#!python Optional[str]` | Optional. Identifier of the message sent via the bot in inline mode, that originated the query. |
|
||||
| `data` | `#!python Optional[str]` | Optional. Data associated with the callback button. Be aware that a bad client can send arbitrary data in this field. |
|
||||
| `game_short_name` | `#!python Optional[str]` | Optional. Short name of a Game to be returned, serves as the unique identifier for the game |
|
||||
|
||||
|
||||
|
||||
## Location
|
||||
|
||||
- `from aiogram.types import CallbackQuery`
|
||||
- `from aiogram.api.types import CallbackQuery`
|
||||
- `from aiogram.api.types.callback_query import CallbackQuery`
|
||||
|
||||
## Related pages:
|
||||
|
||||
- [Official documentation](https://core.telegram.org/bots/api#callbackquery)
|
||||
- [aiogram.types.User](../types/user.md)
|
||||
- [aiogram.types.Message](../types/message.md)
|
||||
39
docs/api/types/chat.md
Normal file
39
docs/api/types/chat.md
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
# Chat
|
||||
|
||||
## Description
|
||||
|
||||
This object represents a chat.
|
||||
|
||||
|
||||
## Attributes
|
||||
|
||||
| Name | Type | Description |
|
||||
| - | - | - |
|
||||
| `id` | `#!python int` | Unique identifier for this chat. This number may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier. |
|
||||
| `type` | `#!python str` | Type of chat, can be either 'private', 'group', 'supergroup' or 'channel' |
|
||||
| `title` | `#!python Optional[str]` | Optional. Title, for supergroups, channels and group chats |
|
||||
| `username` | `#!python Optional[str]` | Optional. Username, for private chats, supergroups and channels if available |
|
||||
| `first_name` | `#!python Optional[str]` | Optional. First name of the other party in a private chat |
|
||||
| `last_name` | `#!python Optional[str]` | Optional. Last name of the other party in a private chat |
|
||||
| `photo` | `#!python Optional[ChatPhoto]` | Optional. Chat photo. Returned only in getChat. |
|
||||
| `description` | `#!python Optional[str]` | Optional. Description, for groups, supergroups and channel chats. Returned only in getChat. |
|
||||
| `invite_link` | `#!python Optional[str]` | Optional. Chat invite link, for groups, supergroups and channel chats. Each administrator in a chat generates their own invite links, so the bot must first generate the link using exportChatInviteLink. Returned only in getChat. |
|
||||
| `pinned_message` | `#!python Optional[Message]` | Optional. Pinned message, for groups, supergroups and channels. Returned only in getChat. |
|
||||
| `permissions` | `#!python Optional[ChatPermissions]` | Optional. Default chat member permissions, for groups and supergroups. Returned only in getChat. |
|
||||
| `sticker_set_name` | `#!python Optional[str]` | Optional. For supergroups, name of group sticker set. Returned only in getChat. |
|
||||
| `can_set_sticker_set` | `#!python Optional[bool]` | Optional. True, if the bot can change the group sticker set. Returned only in getChat. |
|
||||
|
||||
|
||||
|
||||
## Location
|
||||
|
||||
- `from aiogram.types import Chat`
|
||||
- `from aiogram.api.types import Chat`
|
||||
- `from aiogram.api.types.chat import Chat`
|
||||
|
||||
## Related pages:
|
||||
|
||||
- [Official documentation](https://core.telegram.org/bots/api#chat)
|
||||
- [aiogram.types.ChatPermissions](../types/chat_permissions.md)
|
||||
- [aiogram.types.ChatPhoto](../types/chat_photo.md)
|
||||
- [aiogram.types.Message](../types/message.md)
|
||||
42
docs/api/types/chat_member.md
Normal file
42
docs/api/types/chat_member.md
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
# ChatMember
|
||||
|
||||
## Description
|
||||
|
||||
This object contains information about one member of a chat.
|
||||
|
||||
|
||||
## Attributes
|
||||
|
||||
| Name | Type | Description |
|
||||
| - | - | - |
|
||||
| `user` | `#!python User` | Information about the user |
|
||||
| `status` | `#!python str` | The member's status in the chat. Can be 'creator', 'administrator', 'member', 'restricted', 'left' or 'kicked' |
|
||||
| `until_date` | `#!python Optional[Union[int, datetime.datetime, datetime.timedelta]]` | Optional. Restricted and kicked only. Date when restrictions will be lifted for this user; unix time |
|
||||
| `can_be_edited` | `#!python Optional[bool]` | Optional. Administrators only. True, if the bot is allowed to edit administrator privileges of that user |
|
||||
| `can_post_messages` | `#!python Optional[bool]` | Optional. Administrators only. True, if the administrator can post in the channel; channels only |
|
||||
| `can_edit_messages` | `#!python Optional[bool]` | Optional. Administrators only. True, if the administrator can edit messages of other users and can pin messages; channels only |
|
||||
| `can_delete_messages` | `#!python Optional[bool]` | Optional. Administrators only. True, if the administrator can delete messages of other users |
|
||||
| `can_restrict_members` | `#!python Optional[bool]` | Optional. Administrators only. True, if the administrator can restrict, ban or unban chat members |
|
||||
| `can_promote_members` | `#!python Optional[bool]` | Optional. Administrators only. True, if the administrator can add new administrators with a subset of his own privileges or demote administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by the user) |
|
||||
| `can_change_info` | `#!python Optional[bool]` | Optional. Administrators and restricted only. True, if the user is allowed to change the chat title, photo and other settings |
|
||||
| `can_invite_users` | `#!python Optional[bool]` | Optional. Administrators and restricted only. True, if the user is allowed to invite new users to the chat |
|
||||
| `can_pin_messages` | `#!python Optional[bool]` | Optional. Administrators and restricted only. True, if the user is allowed to pin messages; groups and supergroups only |
|
||||
| `is_member` | `#!python Optional[bool]` | Optional. Restricted only. True, if the user is a member of the chat at the moment of the request |
|
||||
| `can_send_messages` | `#!python Optional[bool]` | Optional. Restricted only. True, if the user is allowed to send text messages, contacts, locations and venues |
|
||||
| `can_send_media_messages` | `#!python Optional[bool]` | Optional. Restricted only. True, if the user is allowed to send audios, documents, photos, videos, video notes and voice notes |
|
||||
| `can_send_polls` | `#!python Optional[bool]` | Optional. Restricted only. True, if the user is allowed to send polls |
|
||||
| `can_send_other_messages` | `#!python Optional[bool]` | Optional. Restricted only. True, if the user is allowed to send animations, games, stickers and use inline bots |
|
||||
| `can_add_web_page_previews` | `#!python Optional[bool]` | Optional. Restricted only. True, if the user is allowed to add web page previews to their messages |
|
||||
|
||||
|
||||
|
||||
## Location
|
||||
|
||||
- `from aiogram.types import ChatMember`
|
||||
- `from aiogram.api.types import ChatMember`
|
||||
- `from aiogram.api.types.chat_member import ChatMember`
|
||||
|
||||
## Related pages:
|
||||
|
||||
- [Official documentation](https://core.telegram.org/bots/api#chatmember)
|
||||
- [aiogram.types.User](../types/user.md)
|
||||
31
docs/api/types/chat_permissions.md
Normal file
31
docs/api/types/chat_permissions.md
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
# ChatPermissions
|
||||
|
||||
## Description
|
||||
|
||||
Describes actions that a non-administrator user is allowed to take in a chat.
|
||||
|
||||
|
||||
## Attributes
|
||||
|
||||
| Name | Type | Description |
|
||||
| - | - | - |
|
||||
| `can_send_messages` | `#!python Optional[bool]` | Optional. True, if the user is allowed to send text messages, contacts, locations and venues |
|
||||
| `can_send_media_messages` | `#!python Optional[bool]` | Optional. True, if the user is allowed to send audios, documents, photos, videos, video notes and voice notes, implies can_send_messages |
|
||||
| `can_send_polls` | `#!python Optional[bool]` | Optional. True, if the user is allowed to send polls, implies can_send_messages |
|
||||
| `can_send_other_messages` | `#!python Optional[bool]` | Optional. True, if the user is allowed to send animations, games, stickers and use inline bots, implies can_send_media_messages |
|
||||
| `can_add_web_page_previews` | `#!python Optional[bool]` | Optional. True, if the user is allowed to add web page previews to their messages, implies can_send_media_messages |
|
||||
| `can_change_info` | `#!python Optional[bool]` | Optional. True, if the user is allowed to change the chat title, photo and other settings. Ignored in public supergroups |
|
||||
| `can_invite_users` | `#!python Optional[bool]` | Optional. True, if the user is allowed to invite new users to the chat |
|
||||
| `can_pin_messages` | `#!python Optional[bool]` | Optional. True, if the user is allowed to pin messages. Ignored in public supergroups |
|
||||
|
||||
|
||||
|
||||
## Location
|
||||
|
||||
- `from aiogram.types import ChatPermissions`
|
||||
- `from aiogram.api.types import ChatPermissions`
|
||||
- `from aiogram.api.types.chat_permissions import ChatPermissions`
|
||||
|
||||
## Related pages:
|
||||
|
||||
- [Official documentation](https://core.telegram.org/bots/api#chatpermissions)
|
||||
25
docs/api/types/chat_photo.md
Normal file
25
docs/api/types/chat_photo.md
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
# ChatPhoto
|
||||
|
||||
## Description
|
||||
|
||||
This object represents a chat photo.
|
||||
|
||||
|
||||
## Attributes
|
||||
|
||||
| Name | Type | Description |
|
||||
| - | - | - |
|
||||
| `small_file_id` | `#!python str` | File identifier of small (160x160) chat photo. This file_id can be used only for photo download and only for as long as the photo is not changed. |
|
||||
| `big_file_id` | `#!python str` | File identifier of big (640x640) chat photo. This file_id can be used only for photo download and only for as long as the photo is not changed. |
|
||||
|
||||
|
||||
|
||||
## Location
|
||||
|
||||
- `from aiogram.types import ChatPhoto`
|
||||
- `from aiogram.api.types import ChatPhoto`
|
||||
- `from aiogram.api.types.chat_photo import ChatPhoto`
|
||||
|
||||
## Related pages:
|
||||
|
||||
- [Official documentation](https://core.telegram.org/bots/api#chatphoto)
|
||||
32
docs/api/types/chosen_inline_result.md
Normal file
32
docs/api/types/chosen_inline_result.md
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
# ChosenInlineResult
|
||||
|
||||
## Description
|
||||
|
||||
Represents a result of an inline query that was chosen by the user and sent to their chat partner.
|
||||
|
||||
Note: It is necessary to enable inline feedback via @Botfather in order to receive these objects in updates.
|
||||
|
||||
|
||||
## Attributes
|
||||
|
||||
| Name | Type | Description |
|
||||
| - | - | - |
|
||||
| `result_id` | `#!python str` | The unique identifier for the result that was chosen |
|
||||
| `from_user` | `#!python User` | The user that chose the result |
|
||||
| `query` | `#!python str` | The query that was used to obtain the result |
|
||||
| `location` | `#!python Optional[Location]` | Optional. Sender location, only for bots that require user location |
|
||||
| `inline_message_id` | `#!python Optional[str]` | Optional. Identifier of the sent inline message. Available only if there is an inline keyboard attached to the message. Will be also received in callback queries and can be used to edit the message. |
|
||||
|
||||
|
||||
|
||||
## Location
|
||||
|
||||
- `from aiogram.types import ChosenInlineResult`
|
||||
- `from aiogram.api.types import ChosenInlineResult`
|
||||
- `from aiogram.api.types.chosen_inline_result import ChosenInlineResult`
|
||||
|
||||
## Related pages:
|
||||
|
||||
- [Official documentation](https://core.telegram.org/bots/api#choseninlineresult)
|
||||
- [aiogram.types.Location](../types/location.md)
|
||||
- [aiogram.types.User](../types/user.md)
|
||||
28
docs/api/types/contact.md
Normal file
28
docs/api/types/contact.md
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
# Contact
|
||||
|
||||
## Description
|
||||
|
||||
This object represents a phone contact.
|
||||
|
||||
|
||||
## Attributes
|
||||
|
||||
| Name | Type | Description |
|
||||
| - | - | - |
|
||||
| `phone_number` | `#!python str` | Contact's phone number |
|
||||
| `first_name` | `#!python str` | Contact's first name |
|
||||
| `last_name` | `#!python Optional[str]` | Optional. Contact's last name |
|
||||
| `user_id` | `#!python Optional[int]` | Optional. Contact's user identifier in Telegram |
|
||||
| `vcard` | `#!python Optional[str]` | Optional. Additional data about the contact in the form of a vCard |
|
||||
|
||||
|
||||
|
||||
## Location
|
||||
|
||||
- `from aiogram.types import Contact`
|
||||
- `from aiogram.api.types import Contact`
|
||||
- `from aiogram.api.types.contact import Contact`
|
||||
|
||||
## Related pages:
|
||||
|
||||
- [Official documentation](https://core.telegram.org/bots/api#contact)
|
||||
29
docs/api/types/document.md
Normal file
29
docs/api/types/document.md
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
# Document
|
||||
|
||||
## Description
|
||||
|
||||
This object represents a general file (as opposed to photos, voice messages and audio files).
|
||||
|
||||
|
||||
## Attributes
|
||||
|
||||
| Name | Type | Description |
|
||||
| - | - | - |
|
||||
| `file_id` | `#!python str` | Identifier for this file |
|
||||
| `thumb` | `#!python Optional[PhotoSize]` | Optional. Document thumbnail as defined by sender |
|
||||
| `file_name` | `#!python Optional[str]` | Optional. Original filename as defined by sender |
|
||||
| `mime_type` | `#!python Optional[str]` | Optional. MIME type of the file as defined by sender |
|
||||
| `file_size` | `#!python Optional[int]` | Optional. File size |
|
||||
|
||||
|
||||
|
||||
## Location
|
||||
|
||||
- `from aiogram.types import Document`
|
||||
- `from aiogram.api.types import Document`
|
||||
- `from aiogram.api.types.document import Document`
|
||||
|
||||
## Related pages:
|
||||
|
||||
- [Official documentation](https://core.telegram.org/bots/api#document)
|
||||
- [aiogram.types.PhotoSize](../types/photo_size.md)
|
||||
26
docs/api/types/encrypted_credentials.md
Normal file
26
docs/api/types/encrypted_credentials.md
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
# EncryptedCredentials
|
||||
|
||||
## Description
|
||||
|
||||
Contains data required for decrypting and authenticating EncryptedPassportElement. See the Telegram Passport Documentation for a complete description of the data decryption and authentication processes.
|
||||
|
||||
|
||||
## Attributes
|
||||
|
||||
| Name | Type | Description |
|
||||
| - | - | - |
|
||||
| `data` | `#!python str` | Base64-encoded encrypted JSON-serialized data with unique user's payload, data hashes and secrets required for EncryptedPassportElement decryption and authentication |
|
||||
| `hash` | `#!python str` | Base64-encoded data hash for data authentication |
|
||||
| `secret` | `#!python str` | Base64-encoded secret, encrypted with the bot's public RSA key, required for data decryption |
|
||||
|
||||
|
||||
|
||||
## Location
|
||||
|
||||
- `from aiogram.types import EncryptedCredentials`
|
||||
- `from aiogram.api.types import EncryptedCredentials`
|
||||
- `from aiogram.api.types.encrypted_credentials import EncryptedCredentials`
|
||||
|
||||
## Related pages:
|
||||
|
||||
- [Official documentation](https://core.telegram.org/bots/api#encryptedcredentials)
|
||||
34
docs/api/types/encrypted_passport_element.md
Normal file
34
docs/api/types/encrypted_passport_element.md
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
# EncryptedPassportElement
|
||||
|
||||
## Description
|
||||
|
||||
Contains information about documents or other Telegram Passport elements shared with the bot by the user.
|
||||
|
||||
|
||||
## Attributes
|
||||
|
||||
| Name | Type | Description |
|
||||
| - | - | - |
|
||||
| `type` | `#!python str` | Element type. One of 'personal_details', 'passport', 'driver_license', 'identity_card', 'internal_passport', 'address', 'utility_bill', 'bank_statement', 'rental_agreement', 'passport_registration', 'temporary_registration', 'phone_number', 'email'. |
|
||||
| `hash` | `#!python str` | Base64-encoded element hash for using in PassportElementErrorUnspecified |
|
||||
| `data` | `#!python Optional[str]` | Optional. Base64-encoded encrypted Telegram Passport element data provided by the user, available for 'personal_details', 'passport', 'driver_license', 'identity_card', 'internal_passport' and 'address' types. Can be decrypted and verified using the accompanying EncryptedCredentials. |
|
||||
| `phone_number` | `#!python Optional[str]` | Optional. User's verified phone number, available only for 'phone_number' type |
|
||||
| `email` | `#!python Optional[str]` | Optional. User's verified email address, available only for 'email' type |
|
||||
| `files` | `#!python Optional[List[PassportFile]]` | Optional. Array of encrypted files with documents provided by the user, available for 'utility_bill', 'bank_statement', 'rental_agreement', 'passport_registration' and 'temporary_registration' types. Files can be decrypted and verified using the accompanying EncryptedCredentials. |
|
||||
| `front_side` | `#!python Optional[PassportFile]` | Optional. Encrypted file with the front side of the document, provided by the user. Available for 'passport', 'driver_license', 'identity_card' and 'internal_passport'. The file can be decrypted and verified using the accompanying EncryptedCredentials. |
|
||||
| `reverse_side` | `#!python Optional[PassportFile]` | Optional. Encrypted file with the reverse side of the document, provided by the user. Available for 'driver_license' and 'identity_card'. The file can be decrypted and verified using the accompanying EncryptedCredentials. |
|
||||
| `selfie` | `#!python Optional[PassportFile]` | Optional. Encrypted file with the selfie of the user holding a document, provided by the user; available for 'passport', 'driver_license', 'identity_card' and 'internal_passport'. The file can be decrypted and verified using the accompanying EncryptedCredentials. |
|
||||
| `translation` | `#!python Optional[List[PassportFile]]` | Optional. Array of encrypted files with translated versions of documents provided by the user. Available if requested for 'passport', 'driver_license', 'identity_card', 'internal_passport', 'utility_bill', 'bank_statement', 'rental_agreement', 'passport_registration' and 'temporary_registration' types. Files can be decrypted and verified using the accompanying EncryptedCredentials. |
|
||||
|
||||
|
||||
|
||||
## Location
|
||||
|
||||
- `from aiogram.types import EncryptedPassportElement`
|
||||
- `from aiogram.api.types import EncryptedPassportElement`
|
||||
- `from aiogram.api.types.encrypted_passport_element import EncryptedPassportElement`
|
||||
|
||||
## Related pages:
|
||||
|
||||
- [Official documentation](https://core.telegram.org/bots/api#encryptedpassportelement)
|
||||
- [aiogram.types.PassportFile](../types/passport_file.md)
|
||||
28
docs/api/types/file.md
Normal file
28
docs/api/types/file.md
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
# File
|
||||
|
||||
## Description
|
||||
|
||||
This object represents a file ready to be downloaded. The file can be downloaded via the link https://api.telegram.org/file/bot<token>/<file_path>. It is guaranteed that the link will be valid for at least 1 hour. When the link expires, a new one can be requested by calling getFile.
|
||||
|
||||
Maximum file size to download is 20 MB
|
||||
|
||||
|
||||
## Attributes
|
||||
|
||||
| Name | Type | Description |
|
||||
| - | - | - |
|
||||
| `file_id` | `#!python str` | Identifier for this file |
|
||||
| `file_size` | `#!python Optional[int]` | Optional. File size, if known |
|
||||
| `file_path` | `#!python Optional[str]` | Optional. File path. Use https://api.telegram.org/file/bot<token>/<file_path> to get the file. |
|
||||
|
||||
|
||||
|
||||
## Location
|
||||
|
||||
- `from aiogram.types import File`
|
||||
- `from aiogram.api.types import File`
|
||||
- `from aiogram.api.types.file import File`
|
||||
|
||||
## Related pages:
|
||||
|
||||
- [Official documentation](https://core.telegram.org/bots/api#file)
|
||||
35
docs/api/types/force_reply.md
Normal file
35
docs/api/types/force_reply.md
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
# ForceReply
|
||||
|
||||
## Description
|
||||
|
||||
Upon receiving a message with this object, Telegram clients will display a reply interface to the user (act as if the user has selected the bot‘s message and tapped ’Reply'). This can be extremely useful if you want to create user-friendly step-by-step interfaces without having to sacrifice privacy mode.
|
||||
|
||||
Example: A poll bot for groups runs in privacy mode (only receives commands, replies to its messages and mentions). There could be two ways to create a new poll:
|
||||
|
||||
|
||||
|
||||
Explain the user how to send a command with parameters (e.g. /newpoll question answer1 answer2). May be appealing for hardcore users but lacks modern day polish.
|
||||
|
||||
Guide the user through a step-by-step process. ‘Please send me your question’, ‘Cool, now let’s add the first answer option‘, ’Great. Keep adding answer options, then send /done when you‘re ready’.
|
||||
|
||||
The last option is definitely more attractive. And if you use ForceReply in your bot‘s questions, it will receive the user’s answers even if it only receives replies, commands and mentions — without any extra work for the user.
|
||||
|
||||
|
||||
## Attributes
|
||||
|
||||
| Name | Type | Description |
|
||||
| - | - | - |
|
||||
| `force_reply` | `#!python bool` | Shows reply interface to the user, as if they manually selected the bot‘s message and tapped ’Reply' |
|
||||
| `selective` | `#!python Optional[bool]` | Optional. Use this parameter if you want to force reply from specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply (has reply_to_message_id), sender of the original message. |
|
||||
|
||||
|
||||
|
||||
## Location
|
||||
|
||||
- `from aiogram.types import ForceReply`
|
||||
- `from aiogram.api.types import ForceReply`
|
||||
- `from aiogram.api.types.force_reply import ForceReply`
|
||||
|
||||
## Related pages:
|
||||
|
||||
- [Official documentation](https://core.telegram.org/bots/api#forcereply)
|
||||
32
docs/api/types/game.md
Normal file
32
docs/api/types/game.md
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
# Game
|
||||
|
||||
## Description
|
||||
|
||||
This object represents a game. Use BotFather to create and edit games, their short names will act as unique identifiers.
|
||||
|
||||
|
||||
## Attributes
|
||||
|
||||
| Name | Type | Description |
|
||||
| - | - | - |
|
||||
| `title` | `#!python str` | Title of the game |
|
||||
| `description` | `#!python str` | Description of the game |
|
||||
| `photo` | `#!python List[PhotoSize]` | Photo that will be displayed in the game message in chats. |
|
||||
| `text` | `#!python Optional[str]` | Optional. Brief description of the game or high scores included in the game message. Can be automatically edited to include current high scores for the game when the bot calls setGameScore, or manually edited using editMessageText. 0-4096 characters. |
|
||||
| `text_entities` | `#!python Optional[List[MessageEntity]]` | Optional. Special entities that appear in text, such as usernames, URLs, bot commands, etc. |
|
||||
| `animation` | `#!python Optional[Animation]` | Optional. Animation that will be displayed in the game message in chats. Upload via BotFather |
|
||||
|
||||
|
||||
|
||||
## Location
|
||||
|
||||
- `from aiogram.types import Game`
|
||||
- `from aiogram.api.types import Game`
|
||||
- `from aiogram.api.types.game import Game`
|
||||
|
||||
## Related pages:
|
||||
|
||||
- [Official documentation](https://core.telegram.org/bots/api#game)
|
||||
- [aiogram.types.MessageEntity](../types/message_entity.md)
|
||||
- [aiogram.types.Animation](../types/animation.md)
|
||||
- [aiogram.types.PhotoSize](../types/photo_size.md)
|
||||
31
docs/api/types/game_high_score.md
Normal file
31
docs/api/types/game_high_score.md
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
# GameHighScore
|
||||
|
||||
## Description
|
||||
|
||||
This object represents one row of the high scores table for a game.
|
||||
|
||||
And that‘s about all we’ve got for now.
|
||||
|
||||
If you've got any questions, please check out our Bot FAQ
|
||||
|
||||
|
||||
## Attributes
|
||||
|
||||
| Name | Type | Description |
|
||||
| - | - | - |
|
||||
| `position` | `#!python int` | Position in high score table for the game |
|
||||
| `user` | `#!python User` | User |
|
||||
| `score` | `#!python int` | Score |
|
||||
|
||||
|
||||
|
||||
## Location
|
||||
|
||||
- `from aiogram.types import GameHighScore`
|
||||
- `from aiogram.api.types import GameHighScore`
|
||||
- `from aiogram.api.types.game_high_score import GameHighScore`
|
||||
|
||||
## Related pages:
|
||||
|
||||
- [Official documentation](https://core.telegram.org/bots/api#gamehighscore)
|
||||
- [aiogram.types.User](../types/user.md)
|
||||
33
docs/api/types/inline_keyboard_button.md
Normal file
33
docs/api/types/inline_keyboard_button.md
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
# InlineKeyboardButton
|
||||
|
||||
## Description
|
||||
|
||||
This object represents one button of an inline keyboard. You must use exactly one of the optional fields.
|
||||
|
||||
|
||||
## Attributes
|
||||
|
||||
| Name | Type | Description |
|
||||
| - | - | - |
|
||||
| `text` | `#!python str` | Label text on the button |
|
||||
| `url` | `#!python Optional[str]` | Optional. HTTP or tg:// url to be opened when button is pressed |
|
||||
| `login_url` | `#!python Optional[LoginUrl]` | Optional. An HTTP URL used to automatically authorize the user. Can be used as a replacement for the Telegram Login Widget. |
|
||||
| `callback_data` | `#!python Optional[str]` | Optional. Data to be sent in a callback query to the bot when button is pressed, 1-64 bytes |
|
||||
| `switch_inline_query` | `#!python Optional[str]` | Optional. If set, pressing the button will prompt the user to select one of their chats, open that chat and insert the bot‘s username and the specified inline query in the input field. Can be empty, in which case just the bot’s username will be inserted. |
|
||||
| `switch_inline_query_current_chat` | `#!python Optional[str]` | Optional. If set, pressing the button will insert the bot‘s username and the specified inline query in the current chat's input field. Can be empty, in which case only the bot’s username will be inserted. |
|
||||
| `callback_game` | `#!python Optional[CallbackGame]` | Optional. Description of the game that will be launched when the user presses the button. |
|
||||
| `pay` | `#!python Optional[bool]` | Optional. Specify True, to send a Pay button. |
|
||||
|
||||
|
||||
|
||||
## Location
|
||||
|
||||
- `from aiogram.types import InlineKeyboardButton`
|
||||
- `from aiogram.api.types import InlineKeyboardButton`
|
||||
- `from aiogram.api.types.inline_keyboard_button import InlineKeyboardButton`
|
||||
|
||||
## Related pages:
|
||||
|
||||
- [Official documentation](https://core.telegram.org/bots/api#inlinekeyboardbutton)
|
||||
- [aiogram.types.LoginUrl](../types/login_url.md)
|
||||
- [aiogram.types.CallbackGame](../types/callback_game.md)
|
||||
27
docs/api/types/inline_keyboard_markup.md
Normal file
27
docs/api/types/inline_keyboard_markup.md
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
# InlineKeyboardMarkup
|
||||
|
||||
## Description
|
||||
|
||||
This object represents an inline keyboard that appears right next to the message it belongs to.
|
||||
|
||||
Note: This will only work in Telegram versions released after 9 April, 2016. Older clients will display unsupported message.
|
||||
|
||||
|
||||
## Attributes
|
||||
|
||||
| Name | Type | Description |
|
||||
| - | - | - |
|
||||
| `inline_keyboard` | `#!python List[List[InlineKeyboardButton]]` | Array of button rows, each represented by an Array of InlineKeyboardButton objects |
|
||||
|
||||
|
||||
|
||||
## Location
|
||||
|
||||
- `from aiogram.types import InlineKeyboardMarkup`
|
||||
- `from aiogram.api.types import InlineKeyboardMarkup`
|
||||
- `from aiogram.api.types.inline_keyboard_markup import InlineKeyboardMarkup`
|
||||
|
||||
## Related pages:
|
||||
|
||||
- [Official documentation](https://core.telegram.org/bots/api#inlinekeyboardmarkup)
|
||||
- [aiogram.types.InlineKeyboardButton](../types/inline_keyboard_button.md)
|
||||
30
docs/api/types/inline_query.md
Normal file
30
docs/api/types/inline_query.md
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
# InlineQuery
|
||||
|
||||
## Description
|
||||
|
||||
This object represents an incoming inline query. When the user sends an empty query, your bot could return some default or trending results.
|
||||
|
||||
|
||||
## Attributes
|
||||
|
||||
| Name | Type | Description |
|
||||
| - | - | - |
|
||||
| `id` | `#!python str` | Unique identifier for this query |
|
||||
| `from_user` | `#!python User` | Sender |
|
||||
| `query` | `#!python str` | Text of the query (up to 512 characters) |
|
||||
| `offset` | `#!python str` | Offset of the results to be returned, can be controlled by the bot |
|
||||
| `location` | `#!python Optional[Location]` | Optional. Sender location, only for bots that request user location |
|
||||
|
||||
|
||||
|
||||
## Location
|
||||
|
||||
- `from aiogram.types import InlineQuery`
|
||||
- `from aiogram.api.types import InlineQuery`
|
||||
- `from aiogram.api.types.inline_query import InlineQuery`
|
||||
|
||||
## Related pages:
|
||||
|
||||
- [Official documentation](https://core.telegram.org/bots/api#inlinequery)
|
||||
- [aiogram.types.Location](../types/location.md)
|
||||
- [aiogram.types.User](../types/user.md)
|
||||
58
docs/api/types/inline_query_result.md
Normal file
58
docs/api/types/inline_query_result.md
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
# InlineQueryResult
|
||||
|
||||
## Description
|
||||
|
||||
This object represents one result of an inline query. Telegram clients currently support results of the following 20 types:
|
||||
|
||||
- InlineQueryResultCachedAudio
|
||||
|
||||
- InlineQueryResultCachedDocument
|
||||
|
||||
- InlineQueryResultCachedGif
|
||||
|
||||
- InlineQueryResultCachedMpeg4Gif
|
||||
|
||||
- InlineQueryResultCachedPhoto
|
||||
|
||||
- InlineQueryResultCachedSticker
|
||||
|
||||
- InlineQueryResultCachedVideo
|
||||
|
||||
- InlineQueryResultCachedVoice
|
||||
|
||||
- InlineQueryResultArticle
|
||||
|
||||
- InlineQueryResultAudio
|
||||
|
||||
- InlineQueryResultContact
|
||||
|
||||
- InlineQueryResultGame
|
||||
|
||||
- InlineQueryResultDocument
|
||||
|
||||
- InlineQueryResultGif
|
||||
|
||||
- InlineQueryResultLocation
|
||||
|
||||
- InlineQueryResultMpeg4Gif
|
||||
|
||||
- InlineQueryResultPhoto
|
||||
|
||||
- InlineQueryResultVenue
|
||||
|
||||
- InlineQueryResultVideo
|
||||
|
||||
- InlineQueryResultVoice
|
||||
|
||||
|
||||
|
||||
|
||||
## Location
|
||||
|
||||
- `from aiogram.types import InlineQueryResult`
|
||||
- `from aiogram.api.types import InlineQueryResult`
|
||||
- `from aiogram.api.types.inline_query_result import InlineQueryResult`
|
||||
|
||||
## Related pages:
|
||||
|
||||
- [Official documentation](https://core.telegram.org/bots/api#inlinequeryresult)
|
||||
36
docs/api/types/inline_query_result_article.md
Normal file
36
docs/api/types/inline_query_result_article.md
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
# InlineQueryResultArticle
|
||||
|
||||
## Description
|
||||
|
||||
Represents a link to an article or web page.
|
||||
|
||||
|
||||
## Attributes
|
||||
|
||||
| Name | Type | Description |
|
||||
| - | - | - |
|
||||
| `type` | `#!python str` | Type of the result, must be article |
|
||||
| `id` | `#!python str` | Unique identifier for this result, 1-64 Bytes |
|
||||
| `title` | `#!python str` | Title of the result |
|
||||
| `input_message_content` | `#!python InputMessageContent` | Content of the message to be sent |
|
||||
| `reply_markup` | `#!python Optional[InlineKeyboardMarkup]` | Optional. Inline keyboard attached to the message |
|
||||
| `url` | `#!python Optional[str]` | Optional. URL of the result |
|
||||
| `hide_url` | `#!python Optional[bool]` | Optional. Pass True, if you don't want the URL to be shown in the message |
|
||||
| `description` | `#!python Optional[str]` | Optional. Short description of the result |
|
||||
| `thumb_url` | `#!python Optional[str]` | Optional. Url of the thumbnail for the result |
|
||||
| `thumb_width` | `#!python Optional[int]` | Optional. Thumbnail width |
|
||||
| `thumb_height` | `#!python Optional[int]` | Optional. Thumbnail height |
|
||||
|
||||
|
||||
|
||||
## Location
|
||||
|
||||
- `from aiogram.types import InlineQueryResultArticle`
|
||||
- `from aiogram.api.types import InlineQueryResultArticle`
|
||||
- `from aiogram.api.types.inline_query_result_article import InlineQueryResultArticle`
|
||||
|
||||
## Related pages:
|
||||
|
||||
- [Official documentation](https://core.telegram.org/bots/api#inlinequeryresultarticle)
|
||||
- [aiogram.types.InputMessageContent](../types/input_message_content.md)
|
||||
- [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md)
|
||||
37
docs/api/types/inline_query_result_audio.md
Normal file
37
docs/api/types/inline_query_result_audio.md
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
# InlineQueryResultAudio
|
||||
|
||||
## Description
|
||||
|
||||
Represents a link to an MP3 audio file. By default, this audio file will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the audio.
|
||||
|
||||
Note: This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them.
|
||||
|
||||
|
||||
## Attributes
|
||||
|
||||
| Name | Type | Description |
|
||||
| - | - | - |
|
||||
| `type` | `#!python str` | Type of the result, must be audio |
|
||||
| `id` | `#!python str` | Unique identifier for this result, 1-64 bytes |
|
||||
| `audio_url` | `#!python str` | A valid URL for the audio file |
|
||||
| `title` | `#!python str` | Title |
|
||||
| `caption` | `#!python Optional[str]` | Optional. Caption, 0-1024 characters |
|
||||
| `parse_mode` | `#!python Optional[str]` | Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption. |
|
||||
| `performer` | `#!python Optional[str]` | Optional. Performer |
|
||||
| `audio_duration` | `#!python Optional[int]` | Optional. Audio duration in seconds |
|
||||
| `reply_markup` | `#!python Optional[InlineKeyboardMarkup]` | Optional. Inline keyboard attached to the message |
|
||||
| `input_message_content` | `#!python Optional[InputMessageContent]` | Optional. Content of the message to be sent instead of the audio |
|
||||
|
||||
|
||||
|
||||
## Location
|
||||
|
||||
- `from aiogram.types import InlineQueryResultAudio`
|
||||
- `from aiogram.api.types import InlineQueryResultAudio`
|
||||
- `from aiogram.api.types.inline_query_result_audio import InlineQueryResultAudio`
|
||||
|
||||
## Related pages:
|
||||
|
||||
- [Official documentation](https://core.telegram.org/bots/api#inlinequeryresultaudio)
|
||||
- [aiogram.types.InputMessageContent](../types/input_message_content.md)
|
||||
- [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md)
|
||||
34
docs/api/types/inline_query_result_cached_audio.md
Normal file
34
docs/api/types/inline_query_result_cached_audio.md
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
# InlineQueryResultCachedAudio
|
||||
|
||||
## Description
|
||||
|
||||
Represents a link to an MP3 audio file stored on the Telegram servers. By default, this audio file will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the audio.
|
||||
|
||||
Note: This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them.
|
||||
|
||||
|
||||
## Attributes
|
||||
|
||||
| Name | Type | Description |
|
||||
| - | - | - |
|
||||
| `type` | `#!python str` | Type of the result, must be audio |
|
||||
| `id` | `#!python str` | Unique identifier for this result, 1-64 bytes |
|
||||
| `audio_file_id` | `#!python str` | A valid file identifier for the audio file |
|
||||
| `caption` | `#!python Optional[str]` | Optional. Caption, 0-1024 characters |
|
||||
| `parse_mode` | `#!python Optional[str]` | Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption. |
|
||||
| `reply_markup` | `#!python Optional[InlineKeyboardMarkup]` | Optional. Inline keyboard attached to the message |
|
||||
| `input_message_content` | `#!python Optional[InputMessageContent]` | Optional. Content of the message to be sent instead of the audio |
|
||||
|
||||
|
||||
|
||||
## Location
|
||||
|
||||
- `from aiogram.types import InlineQueryResultCachedAudio`
|
||||
- `from aiogram.api.types import InlineQueryResultCachedAudio`
|
||||
- `from aiogram.api.types.inline_query_result_cached_audio import InlineQueryResultCachedAudio`
|
||||
|
||||
## Related pages:
|
||||
|
||||
- [Official documentation](https://core.telegram.org/bots/api#inlinequeryresultcachedaudio)
|
||||
- [aiogram.types.InputMessageContent](../types/input_message_content.md)
|
||||
- [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md)
|
||||
36
docs/api/types/inline_query_result_cached_document.md
Normal file
36
docs/api/types/inline_query_result_cached_document.md
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
# InlineQueryResultCachedDocument
|
||||
|
||||
## Description
|
||||
|
||||
Represents a link to a file stored on the Telegram servers. By default, this file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the file.
|
||||
|
||||
Note: This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them.
|
||||
|
||||
|
||||
## Attributes
|
||||
|
||||
| Name | Type | Description |
|
||||
| - | - | - |
|
||||
| `type` | `#!python str` | Type of the result, must be document |
|
||||
| `id` | `#!python str` | Unique identifier for this result, 1-64 bytes |
|
||||
| `title` | `#!python str` | Title for the result |
|
||||
| `document_file_id` | `#!python str` | A valid file identifier for the file |
|
||||
| `description` | `#!python Optional[str]` | Optional. Short description of the result |
|
||||
| `caption` | `#!python Optional[str]` | Optional. Caption of the document to be sent, 0-1024 characters |
|
||||
| `parse_mode` | `#!python Optional[str]` | Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption. |
|
||||
| `reply_markup` | `#!python Optional[InlineKeyboardMarkup]` | Optional. Inline keyboard attached to the message |
|
||||
| `input_message_content` | `#!python Optional[InputMessageContent]` | Optional. Content of the message to be sent instead of the file |
|
||||
|
||||
|
||||
|
||||
## Location
|
||||
|
||||
- `from aiogram.types import InlineQueryResultCachedDocument`
|
||||
- `from aiogram.api.types import InlineQueryResultCachedDocument`
|
||||
- `from aiogram.api.types.inline_query_result_cached_document import InlineQueryResultCachedDocument`
|
||||
|
||||
## Related pages:
|
||||
|
||||
- [Official documentation](https://core.telegram.org/bots/api#inlinequeryresultcacheddocument)
|
||||
- [aiogram.types.InputMessageContent](../types/input_message_content.md)
|
||||
- [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md)
|
||||
33
docs/api/types/inline_query_result_cached_gif.md
Normal file
33
docs/api/types/inline_query_result_cached_gif.md
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
# InlineQueryResultCachedGif
|
||||
|
||||
## Description
|
||||
|
||||
Represents a link to an animated GIF file stored on the Telegram servers. By default, this animated GIF file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with specified content instead of the animation.
|
||||
|
||||
|
||||
## Attributes
|
||||
|
||||
| Name | Type | Description |
|
||||
| - | - | - |
|
||||
| `type` | `#!python str` | Type of the result, must be gif |
|
||||
| `id` | `#!python str` | Unique identifier for this result, 1-64 bytes |
|
||||
| `gif_file_id` | `#!python str` | A valid file identifier for the GIF file |
|
||||
| `title` | `#!python Optional[str]` | Optional. Title for the result |
|
||||
| `caption` | `#!python Optional[str]` | Optional. Caption of the GIF file to be sent, 0-1024 characters |
|
||||
| `parse_mode` | `#!python Optional[str]` | Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption. |
|
||||
| `reply_markup` | `#!python Optional[InlineKeyboardMarkup]` | Optional. Inline keyboard attached to the message |
|
||||
| `input_message_content` | `#!python Optional[InputMessageContent]` | Optional. Content of the message to be sent instead of the GIF animation |
|
||||
|
||||
|
||||
|
||||
## Location
|
||||
|
||||
- `from aiogram.types import InlineQueryResultCachedGif`
|
||||
- `from aiogram.api.types import InlineQueryResultCachedGif`
|
||||
- `from aiogram.api.types.inline_query_result_cached_gif import InlineQueryResultCachedGif`
|
||||
|
||||
## Related pages:
|
||||
|
||||
- [Official documentation](https://core.telegram.org/bots/api#inlinequeryresultcachedgif)
|
||||
- [aiogram.types.InputMessageContent](../types/input_message_content.md)
|
||||
- [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md)
|
||||
33
docs/api/types/inline_query_result_cached_mpeg4_gif.md
Normal file
33
docs/api/types/inline_query_result_cached_mpeg4_gif.md
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
# InlineQueryResultCachedMpeg4Gif
|
||||
|
||||
## Description
|
||||
|
||||
Represents a link to a video animation (H.264/MPEG-4 AVC video without sound) stored on the Telegram servers. By default, this animated MPEG-4 file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the animation.
|
||||
|
||||
|
||||
## Attributes
|
||||
|
||||
| Name | Type | Description |
|
||||
| - | - | - |
|
||||
| `type` | `#!python str` | Type of the result, must be mpeg4_gif |
|
||||
| `id` | `#!python str` | Unique identifier for this result, 1-64 bytes |
|
||||
| `mpeg4_file_id` | `#!python str` | A valid file identifier for the MP4 file |
|
||||
| `title` | `#!python Optional[str]` | Optional. Title for the result |
|
||||
| `caption` | `#!python Optional[str]` | Optional. Caption of the MPEG-4 file to be sent, 0-1024 characters |
|
||||
| `parse_mode` | `#!python Optional[str]` | Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption. |
|
||||
| `reply_markup` | `#!python Optional[InlineKeyboardMarkup]` | Optional. Inline keyboard attached to the message |
|
||||
| `input_message_content` | `#!python Optional[InputMessageContent]` | Optional. Content of the message to be sent instead of the video animation |
|
||||
|
||||
|
||||
|
||||
## Location
|
||||
|
||||
- `from aiogram.types import InlineQueryResultCachedMpeg4Gif`
|
||||
- `from aiogram.api.types import InlineQueryResultCachedMpeg4Gif`
|
||||
- `from aiogram.api.types.inline_query_result_cached_mpeg4_gif import InlineQueryResultCachedMpeg4Gif`
|
||||
|
||||
## Related pages:
|
||||
|
||||
- [Official documentation](https://core.telegram.org/bots/api#inlinequeryresultcachedmpeg4gif)
|
||||
- [aiogram.types.InputMessageContent](../types/input_message_content.md)
|
||||
- [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md)
|
||||
34
docs/api/types/inline_query_result_cached_photo.md
Normal file
34
docs/api/types/inline_query_result_cached_photo.md
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
# InlineQueryResultCachedPhoto
|
||||
|
||||
## Description
|
||||
|
||||
Represents a link to a photo stored on the Telegram servers. By default, this photo will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the photo.
|
||||
|
||||
|
||||
## Attributes
|
||||
|
||||
| Name | Type | Description |
|
||||
| - | - | - |
|
||||
| `type` | `#!python str` | Type of the result, must be photo |
|
||||
| `id` | `#!python str` | Unique identifier for this result, 1-64 bytes |
|
||||
| `photo_file_id` | `#!python str` | A valid file identifier of the photo |
|
||||
| `title` | `#!python Optional[str]` | Optional. Title for the result |
|
||||
| `description` | `#!python Optional[str]` | Optional. Short description of the result |
|
||||
| `caption` | `#!python Optional[str]` | Optional. Caption of the photo to be sent, 0-1024 characters |
|
||||
| `parse_mode` | `#!python Optional[str]` | Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption. |
|
||||
| `reply_markup` | `#!python Optional[InlineKeyboardMarkup]` | Optional. Inline keyboard attached to the message |
|
||||
| `input_message_content` | `#!python Optional[InputMessageContent]` | Optional. Content of the message to be sent instead of the photo |
|
||||
|
||||
|
||||
|
||||
## Location
|
||||
|
||||
- `from aiogram.types import InlineQueryResultCachedPhoto`
|
||||
- `from aiogram.api.types import InlineQueryResultCachedPhoto`
|
||||
- `from aiogram.api.types.inline_query_result_cached_photo import InlineQueryResultCachedPhoto`
|
||||
|
||||
## Related pages:
|
||||
|
||||
- [Official documentation](https://core.telegram.org/bots/api#inlinequeryresultcachedphoto)
|
||||
- [aiogram.types.InputMessageContent](../types/input_message_content.md)
|
||||
- [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md)
|
||||
32
docs/api/types/inline_query_result_cached_sticker.md
Normal file
32
docs/api/types/inline_query_result_cached_sticker.md
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
# InlineQueryResultCachedSticker
|
||||
|
||||
## Description
|
||||
|
||||
Represents a link to a sticker stored on the Telegram servers. By default, this sticker will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the sticker.
|
||||
|
||||
Note: This will only work in Telegram versions released after 9 April, 2016 for static stickers and after 06 July, 2019 for animated stickers. Older clients will ignore them.
|
||||
|
||||
|
||||
## Attributes
|
||||
|
||||
| Name | Type | Description |
|
||||
| - | - | - |
|
||||
| `type` | `#!python str` | Type of the result, must be sticker |
|
||||
| `id` | `#!python str` | Unique identifier for this result, 1-64 bytes |
|
||||
| `sticker_file_id` | `#!python str` | A valid file identifier of the sticker |
|
||||
| `reply_markup` | `#!python Optional[InlineKeyboardMarkup]` | Optional. Inline keyboard attached to the message |
|
||||
| `input_message_content` | `#!python Optional[InputMessageContent]` | Optional. Content of the message to be sent instead of the sticker |
|
||||
|
||||
|
||||
|
||||
## Location
|
||||
|
||||
- `from aiogram.types import InlineQueryResultCachedSticker`
|
||||
- `from aiogram.api.types import InlineQueryResultCachedSticker`
|
||||
- `from aiogram.api.types.inline_query_result_cached_sticker import InlineQueryResultCachedSticker`
|
||||
|
||||
## Related pages:
|
||||
|
||||
- [Official documentation](https://core.telegram.org/bots/api#inlinequeryresultcachedsticker)
|
||||
- [aiogram.types.InputMessageContent](../types/input_message_content.md)
|
||||
- [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md)
|
||||
34
docs/api/types/inline_query_result_cached_video.md
Normal file
34
docs/api/types/inline_query_result_cached_video.md
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
# InlineQueryResultCachedVideo
|
||||
|
||||
## Description
|
||||
|
||||
Represents a link to a video file stored on the Telegram servers. By default, this video file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the video.
|
||||
|
||||
|
||||
## Attributes
|
||||
|
||||
| Name | Type | Description |
|
||||
| - | - | - |
|
||||
| `type` | `#!python str` | Type of the result, must be video |
|
||||
| `id` | `#!python str` | Unique identifier for this result, 1-64 bytes |
|
||||
| `video_file_id` | `#!python str` | A valid file identifier for the video file |
|
||||
| `title` | `#!python str` | Title for the result |
|
||||
| `description` | `#!python Optional[str]` | Optional. Short description of the result |
|
||||
| `caption` | `#!python Optional[str]` | Optional. Caption of the video to be sent, 0-1024 characters |
|
||||
| `parse_mode` | `#!python Optional[str]` | Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption. |
|
||||
| `reply_markup` | `#!python Optional[InlineKeyboardMarkup]` | Optional. Inline keyboard attached to the message |
|
||||
| `input_message_content` | `#!python Optional[InputMessageContent]` | Optional. Content of the message to be sent instead of the video |
|
||||
|
||||
|
||||
|
||||
## Location
|
||||
|
||||
- `from aiogram.types import InlineQueryResultCachedVideo`
|
||||
- `from aiogram.api.types import InlineQueryResultCachedVideo`
|
||||
- `from aiogram.api.types.inline_query_result_cached_video import InlineQueryResultCachedVideo`
|
||||
|
||||
## Related pages:
|
||||
|
||||
- [Official documentation](https://core.telegram.org/bots/api#inlinequeryresultcachedvideo)
|
||||
- [aiogram.types.InputMessageContent](../types/input_message_content.md)
|
||||
- [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md)
|
||||
35
docs/api/types/inline_query_result_cached_voice.md
Normal file
35
docs/api/types/inline_query_result_cached_voice.md
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
# InlineQueryResultCachedVoice
|
||||
|
||||
## Description
|
||||
|
||||
Represents a link to a voice message stored on the Telegram servers. By default, this voice message will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the voice message.
|
||||
|
||||
Note: This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them.
|
||||
|
||||
|
||||
## Attributes
|
||||
|
||||
| Name | Type | Description |
|
||||
| - | - | - |
|
||||
| `type` | `#!python str` | Type of the result, must be voice |
|
||||
| `id` | `#!python str` | Unique identifier for this result, 1-64 bytes |
|
||||
| `voice_file_id` | `#!python str` | A valid file identifier for the voice message |
|
||||
| `title` | `#!python str` | Voice message title |
|
||||
| `caption` | `#!python Optional[str]` | Optional. Caption, 0-1024 characters |
|
||||
| `parse_mode` | `#!python Optional[str]` | Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption. |
|
||||
| `reply_markup` | `#!python Optional[InlineKeyboardMarkup]` | Optional. Inline keyboard attached to the message |
|
||||
| `input_message_content` | `#!python Optional[InputMessageContent]` | Optional. Content of the message to be sent instead of the voice message |
|
||||
|
||||
|
||||
|
||||
## Location
|
||||
|
||||
- `from aiogram.types import InlineQueryResultCachedVoice`
|
||||
- `from aiogram.api.types import InlineQueryResultCachedVoice`
|
||||
- `from aiogram.api.types.inline_query_result_cached_voice import InlineQueryResultCachedVoice`
|
||||
|
||||
## Related pages:
|
||||
|
||||
- [Official documentation](https://core.telegram.org/bots/api#inlinequeryresultcachedvoice)
|
||||
- [aiogram.types.InputMessageContent](../types/input_message_content.md)
|
||||
- [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md)
|
||||
38
docs/api/types/inline_query_result_contact.md
Normal file
38
docs/api/types/inline_query_result_contact.md
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
# InlineQueryResultContact
|
||||
|
||||
## Description
|
||||
|
||||
Represents a contact with a phone number. By default, this contact will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the contact.
|
||||
|
||||
Note: This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them.
|
||||
|
||||
|
||||
## Attributes
|
||||
|
||||
| Name | Type | Description |
|
||||
| - | - | - |
|
||||
| `type` | `#!python str` | Type of the result, must be contact |
|
||||
| `id` | `#!python str` | Unique identifier for this result, 1-64 Bytes |
|
||||
| `phone_number` | `#!python str` | Contact's phone number |
|
||||
| `first_name` | `#!python str` | Contact's first name |
|
||||
| `last_name` | `#!python Optional[str]` | Optional. Contact's last name |
|
||||
| `vcard` | `#!python Optional[str]` | Optional. Additional data about the contact in the form of a vCard, 0-2048 bytes |
|
||||
| `reply_markup` | `#!python Optional[InlineKeyboardMarkup]` | Optional. Inline keyboard attached to the message |
|
||||
| `input_message_content` | `#!python Optional[InputMessageContent]` | Optional. Content of the message to be sent instead of the contact |
|
||||
| `thumb_url` | `#!python Optional[str]` | Optional. Url of the thumbnail for the result |
|
||||
| `thumb_width` | `#!python Optional[int]` | Optional. Thumbnail width |
|
||||
| `thumb_height` | `#!python Optional[int]` | Optional. Thumbnail height |
|
||||
|
||||
|
||||
|
||||
## Location
|
||||
|
||||
- `from aiogram.types import InlineQueryResultContact`
|
||||
- `from aiogram.api.types import InlineQueryResultContact`
|
||||
- `from aiogram.api.types.inline_query_result_contact import InlineQueryResultContact`
|
||||
|
||||
## Related pages:
|
||||
|
||||
- [Official documentation](https://core.telegram.org/bots/api#inlinequeryresultcontact)
|
||||
- [aiogram.types.InputMessageContent](../types/input_message_content.md)
|
||||
- [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md)
|
||||
40
docs/api/types/inline_query_result_document.md
Normal file
40
docs/api/types/inline_query_result_document.md
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
# InlineQueryResultDocument
|
||||
|
||||
## Description
|
||||
|
||||
Represents a link to a file. By default, this file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the file. Currently, only .PDF and .ZIP files can be sent using this method.
|
||||
|
||||
Note: This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them.
|
||||
|
||||
|
||||
## Attributes
|
||||
|
||||
| Name | Type | Description |
|
||||
| - | - | - |
|
||||
| `type` | `#!python str` | Type of the result, must be document |
|
||||
| `id` | `#!python str` | Unique identifier for this result, 1-64 bytes |
|
||||
| `title` | `#!python str` | Title for the result |
|
||||
| `document_url` | `#!python str` | A valid URL for the file |
|
||||
| `mime_type` | `#!python str` | Mime type of the content of the file, either 'application/pdf' or 'application/zip' |
|
||||
| `caption` | `#!python Optional[str]` | Optional. Caption of the document to be sent, 0-1024 characters |
|
||||
| `parse_mode` | `#!python Optional[str]` | Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption. |
|
||||
| `description` | `#!python Optional[str]` | Optional. Short description of the result |
|
||||
| `reply_markup` | `#!python Optional[InlineKeyboardMarkup]` | Optional. Inline keyboard attached to the message |
|
||||
| `input_message_content` | `#!python Optional[InputMessageContent]` | Optional. Content of the message to be sent instead of the file |
|
||||
| `thumb_url` | `#!python Optional[str]` | Optional. URL of the thumbnail (jpeg only) for the file |
|
||||
| `thumb_width` | `#!python Optional[int]` | Optional. Thumbnail width |
|
||||
| `thumb_height` | `#!python Optional[int]` | Optional. Thumbnail height |
|
||||
|
||||
|
||||
|
||||
## Location
|
||||
|
||||
- `from aiogram.types import InlineQueryResultDocument`
|
||||
- `from aiogram.api.types import InlineQueryResultDocument`
|
||||
- `from aiogram.api.types.inline_query_result_document import InlineQueryResultDocument`
|
||||
|
||||
## Related pages:
|
||||
|
||||
- [Official documentation](https://core.telegram.org/bots/api#inlinequeryresultdocument)
|
||||
- [aiogram.types.InputMessageContent](../types/input_message_content.md)
|
||||
- [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md)
|
||||
30
docs/api/types/inline_query_result_game.md
Normal file
30
docs/api/types/inline_query_result_game.md
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
# InlineQueryResultGame
|
||||
|
||||
## Description
|
||||
|
||||
Represents a Game.
|
||||
|
||||
Note: This will only work in Telegram versions released after October 1, 2016. Older clients will not display any inline results if a game result is among them.
|
||||
|
||||
|
||||
## Attributes
|
||||
|
||||
| Name | Type | Description |
|
||||
| - | - | - |
|
||||
| `type` | `#!python str` | Type of the result, must be game |
|
||||
| `id` | `#!python str` | Unique identifier for this result, 1-64 bytes |
|
||||
| `game_short_name` | `#!python str` | Short name of the game |
|
||||
| `reply_markup` | `#!python Optional[InlineKeyboardMarkup]` | Optional. Inline keyboard attached to the message |
|
||||
|
||||
|
||||
|
||||
## Location
|
||||
|
||||
- `from aiogram.types import InlineQueryResultGame`
|
||||
- `from aiogram.api.types import InlineQueryResultGame`
|
||||
- `from aiogram.api.types.inline_query_result_game import InlineQueryResultGame`
|
||||
|
||||
## Related pages:
|
||||
|
||||
- [Official documentation](https://core.telegram.org/bots/api#inlinequeryresultgame)
|
||||
- [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md)
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue