Remove MkDocs

This commit is contained in:
Alex Root Junior 2021-05-13 00:13:09 +03:00
parent 7dd80d281f
commit e1cd7268a1
442 changed files with 4 additions and 9429 deletions

17
docs/api/bot.rst Normal file
View file

@ -0,0 +1,17 @@
###
Bot
###
Bot instance can be created from :code:`aiogram.Bot` (:code:`from aiogram import Bot`) and
you can't use methods without instance of bot with configured token.
This class has aliases for all methods and named in :code:`lower_camel_case`.
For example :code:`sendMessage` named :code:`send_message` and has the same specification with all class-based methods.
.. autoclass:: aiogram.client.bot.Bot
:members:
:show-inheritance:
:member-order: bysource
:special-members: __init__
:undoc-members: True

View file

@ -1,79 +0,0 @@
# Aiohttp session
AiohttpSession represents a wrapper-class around `ClientSession` from [aiohttp](https://pypi.org/project/aiohttp/ "PyPi repository"){target=_blank}
Currently `AiohttpSession` is a default session used in `aiogram.Bot`
## Usage example
```python
from aiogram import Bot
from aiogram.client.session.aiohttp import AiohttpSession
session = AiohttpSession()
Bot('token', session=session)
```
## Proxy requests in AiohttpSession
In order to use AiohttpSession with proxy connector you have to install [aiohttp-socks](https://pypi.org/project/aiohttp-socks/ "PyPi repository"){target=_blank}
Binding session to bot:
```python
from aiogram import Bot
from aiogram.client.session.aiohttp import AiohttpSession
session = AiohttpSession(proxy="protocol://host:port/")
Bot(token="bot token", session=session)
```
!!! note "Protocols"
Only following protocols are supported: http(tunneling), socks4(a), socks5 as aiohttp_socks documentation claims.
### Authorization
Proxy authorization credentials can be specified in proxy URL or come as an instance of `aiohttp.BasicAuth` containing
login and password.
Consider examples:
```python
from aiogram.client.session.aiohttp import BasicAuth
from aiogram.client.session.aiohttp import AiohttpSession
auth = BasicAuth(login="user", password="password")
session = AiohttpSession(proxy=("protocol://host:port", auth))
# or simply include your basic auth credential in URL
session = AiohttpSession(proxy="protocol://user:password@host:port")
```
!!! note "Credential priorities"
Aiogram prefers `BasicAuth` over username and password in URL, so
if proxy URL contains login and password and `BasicAuth` object is passed at the same time
aiogram will use login and password from `BasicAuth` instance.
### Proxy chains
Since [aiohttp-socks]('https://pypi.org/project/aiohttp-socks/') supports proxy chains, you're able to use them in aiogram
Example of chain proxies:
```python
from aiogram.client.session.aiohttp import BasicAuth
from aiogram.client.session.aiohttp import AiohttpSession
auth = BasicAuth(login="user", password="password")
session = AiohttpSession(
proxy={"protocol0://host0:port0",
"protocol1://user:password@host1:port1",
("protocol2://host2:port2", auth), } # can be any iterable if not set
)
```
## Location
- `from aiogram.api.client.session.aiohttp import AiohttpSession`

View file

@ -1,106 +0,0 @@
# How to download file?
## Download file manually
First, you must get the `file_id` of the file you want to download. Information about files sent to the bot is contained in [Message](./types/message.md).
For example, download the document that came to the bot.
```python3
file_id = message.document.file_id
```
Then use the [getFile](./methods/get_file.md) method to get `file_path`.
```python3
file = await bot.get_file(file_id)
file_path = file.file_path
```
After that, use the [download_file](#download_file) method from the bot object.
### download_file(...)
Download file by `file_path` to destination.
If you want to automatically create destination (`#!python3 io.BytesIO`) use default
value of destination and handle result of this method.
|Argument|Type|Description|
|---|---|---|
| file_path | `#!python3 str` | File path on Telegram server |
| destination | `#!python3 Optional[Union[BinaryIO, pathlib.Path, str]]` | Filename, file path or instance of `#!python3 io.IOBase`. For e.g. `#!python3 io.BytesIO` (Default: `#!python3 None`) |
| timeout | `#!python3 int` | Total timeout in seconds (Default: `30`) |
| chunk_size | `#!python3 int` | File chunks size (Default: `64 kb`) |
| seek | `#!python3 bool` | Go to start of file when downloading is finished. Used only for destination with `#!python3 typing.BinaryIO` type (Default: `#!python3 True`) |
There are two options where you can download the file: to **disk** or to **binary I/O object**.
### Download file to disk
To download file to disk, you must specify the file name or path where to download the file. In this case, the function will return nothing.
```python3
await bot.download_file(file_path, "text.txt")
```
### Download file to binary I/O object
To download file to binary I/O object, you must specify an object with the `#!python3 typing.BinaryIO` type or use the default (`#!python3 None`) value.
In the first case, the function will return your object:
```python3
my_object = MyBinaryIO()
result: MyBinaryIO = await bot.download_file(file_path, my_object)
# print(result is my_object) # True
```
If you leave the default value, an `#!python3 io.BytesIO` object will be created and returned.
```python3
result: io.BytesIO = await bot.download_file(file_path)
```
## Download file in short way
Getting `file_path` manually every time is boring, so you should use the [download](#download) method.
### download(...)
Download file by `file_id` or `Downloadable` object to destination.
If you want to automatically create destination (`#!python3 io.BytesIO`) use default
value of destination and handle result of this method.
|Argument|Type|Description|
|---|---|---|
| file | `#!python3 Union[str, Downloadable]` | file_id or Downloadable object |
| destination | `#!python3 Optional[Union[BinaryIO, pathlib.Path, str]]` | Filename, file path or instance of `#!python3 io.IOBase`. For e.g. `#!python3 io.BytesIO` (Default: `#!python3 None`) |
| timeout | `#!python3 int` | Total timeout in seconds (Default: `30`) |
| chunk_size | `#!python3 int` | File chunks size (Default: `64 kb`) |
| seek | `#!python3 bool` | Go to start of file when downloading is finished. Used only for destination with `#!python3 typing.BinaryIO` type (Default: `#!python3 True`) |
It differs from [download_file](#download_file) **only** in that it accepts `file_id` or an `Downloadable` object (object that contains the `file_id` attribute) instead of `file_path`.
!!! note
All `Downloadable` objects are listed in Related pages.
You can download a file to [disk](#download-file-to-disk) or to a [binary I/O](#download-file-to-binary-io-object) object in the same way.
Example:
```python3
document = message.document
await bot.download(document)
```
## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#getfile)
- [aiogram.types.Animation](types/animation.md)
- [aiogram.types.Audio](types/audio.md)
- [aiogram.types.Document](types/document.md)
- [aiogram.types.File](types/file.md)
- [aiogram.types.PassportFile](types/passport_file.md)
- [aiogram.types.PhotoSize](types/photo_size.md)
- [aiogram.types.Sticker](types/sticker.md)
- [aiogram.types.Video](types/video.md)
- [aiogram.types.VideoNote](types/video_note.md)
- [aiogram.types.Voice](types/voice.md)
- [How to upload file?](upload_file.md)

View file

@ -0,0 +1,98 @@
#####################
How to download file?
#####################
Download file manually
======================
First, you must get the `file_id` of the file you want to download.
Information about files sent to the bot is contained in `Message <types/message.html>`__.
For example, download the document that came to the bot.
.. code-block::
file_id = message.document.file_id
Then use the `getFile <methods/get_file.html>`__ method to get `file_path`.
.. code-block::
file = await bot.get_file(file_id)
file_path = file.file_path
After that, use the `download_file <#download-file>`__ method from the bot object.
download_file(...)
------------------
Download file by `file_path` to destination.
If you want to automatically create destination (:obj:`io.BytesIO`) use default
value of destination and handle result of this method.
.. autoclass:: aiogram.client.bot.Bot
:members: download_file
:exclude-members: __init__
There are two options where you can download the file: to **disk** or to **binary I/O object**.
Download file to disk
---------------------
To download file to disk, you must specify the file name or path where to download the file.
In this case, the function will return nothing.
.. code-block::
await bot.download_file(file_path, "text.txt")
Download file to binary I/O object
----------------------------------
To download file to binary I/O object, you must specify an object with the
:obj:`typing.BinaryIO` type or use the default (:obj:`None`) value.
In the first case, the function will return your object:
.. code-block::
my_object = MyBinaryIO()
result: MyBinaryIO = await bot.download_file(file_path, my_object)
# print(result is my_object) # True
If you leave the default value, an :obj:`io.BytesIO` object will be created and returned.
.. code-block::
result: io.BytesIO = await bot.download_file(file_path)
Download file in short way
==========================
Getting `file_path` manually every time is boring, so you should use the `download <#download>`__ method.
download(...)
-------------
Download file by `file_id` or `Downloadable` object to destination.
If you want to automatically create destination (:obj:`io.BytesIO`) use default
value of destination and handle result of this method.
.. autoclass:: aiogram.client.bot.Bot
:members: download
:exclude-members: __init__
It differs from `download_file <#download-file>`__ **only** in that it accepts `file_id`
or an `Downloadable` object (object that contains the `file_id` attribute) instead of `file_path`.
You can download a file to `disk <#download-file-to-disk>`__ or to a `binary I/O <#download-file-to-binary-io-object>`__ object in the same way.
Example:
.. code-block::
document = message.document
await bot.download(document)

View file

@ -1,59 +0,0 @@
# Overview
**aiogram** now is fully support of [Telegram Bot API v{!_api_version.md!}](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](https://pydantic-docs.helpmanual.io/) 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`
Full list of methods can be found in section "[Methods](methods/index.md)"
## Types
All types is also wrapped with [pydantic](https://pydantic-docs.helpmanual.io/) and placed in `aiogram.api.types` package.
In this place makes some more differences with official documentations:
- name `from` was renamed to `from_user` in due to `from` is an [keyword in python](https://docs.python.org/3/reference/lexical_analysis.html#keywords)
- timestamps has `datetime.datetime` type instead of `int`
- InputFile is used for sending files and is not use `pydantic.BaseModel` as base class
Full list of methods can be found in section "[Types](types/index.md)"
## Bot instance
Bot instance can be created from `aiogram.Bot` (`#!python3 from aiogram import Bot`) and you can't use API methods without instance of bot with configured token.
Constructor specification:
| Argument | Type | Description |
| --- | --- | --- |
| `token` | `#!python3 str` | Telegram Bot token (Obtained from [@BotFather](https://t.me/BotFather)). |
| `session` | `#!python3 Optional[BaseSession]` | HTTP Client session (For example AiohttpSession). If not specified it will be automatically created. |
| `parse_mode` | `#!python3 Optional[str]` | Default parse mode. If specified it will be propagated into the API methods at runtime. |
This class has aliases for all API methods and named in `lower_camel_case`. For example `sendMessage` named `send_message` and has the same specification with all class-based methods.
Here you can pass default parse mode (argument `parse_mode`) and this value will be used in all API methods automatically.
## Usage
```python3
import asyncio
from os import getenv
from aiogram import Bot
async def main():
async with Bot(token=getenv("TELEGRAM_TOKEN"), parse_mode="HTML").context() as bot:
await bot.send_message(61043901, "<b>Hello, World!</b>")
if __name__ == "__main__":
asyncio.run(main())
```

15
docs/api/index.rst Normal file
View file

@ -0,0 +1,15 @@
#######
Bot API
#######
**aiogram** now is fully support of `Telegram Bot API <https://core.telegram.org/bots/api>`_
All methods and types is fully autogenerated from Telegram Bot API docs by parser with code-generator.
.. toctree::
bot
session/index
types/index
methods/index
download_file
upload_file

View file

@ -1,64 +0,0 @@
# addStickerToSet
## Description
Use this method to add a new sticker to a set created by the bot. You must use exactly one of the fields png_sticker or tgs_sticker. Animated stickers can be added to animated sticker sets and only to them. Animated sticker sets can have up to 50 stickers. Static sticker sets can have up to 120 stickers. Returns True on success.
## Arguments
| Name | Type | Description |
| - | - | - |
| `user_id` | `#!python3 int` | User identifier of sticker set owner |
| `name` | `#!python3 str` | Sticker set name |
| `emojis` | `#!python3 str` | One or more emoji corresponding to the sticker |
| `png_sticker` | `#!python3 Optional[Union[InputFile, str]]` | Optional. PNG image with the sticker, must be up to 512 kilobytes in size, dimensions must not exceed 512px, and either width or height must be exactly 512px. Pass a file_id as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. |
| `tgs_sticker` | `#!python3 Optional[InputFile]` | Optional. TGS animation with the sticker, uploaded using multipart/form-data. See https://core.telegram.org/animated_stickers#technical-requirements for technical requirements |
| `mask_position` | `#!python3 Optional[MaskPosition]` | Optional. A JSON-serialized object for position where the mask should be placed on faces |
## Response
Type: `#!python3 bool`
Description: Returns True on success.
## Usage
### As bot method
```python3
result: bool = await bot.add_sticker_to_set(...)
```
### Method as object
Imports:
- `from aiogram.methods import AddStickerToSet`
- `from aiogram.api.methods import AddStickerToSet`
- `from aiogram.api.methods.add_sticker_to_set import AddStickerToSet`
#### In handlers with current bot
```python3
result: bool = await AddStickerToSet(...)
```
#### With specific bot
```python3
result: bool = await bot(AddStickerToSet(...))
```
#### As reply into Webhook in handler
```python3
return 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)
- [How to upload file?](../upload_file.md)

View file

@ -0,0 +1,51 @@
###############
addStickerToSet
###############
Returns: :obj:`bool`
.. automodule:: aiogram.methods.add_sticker_to_set
:members:
:member-order: bysource
:undoc-members: True
Usage
=====
As bot method
-------------
.. code-block::
result: bool = await bot.add_sticker_to_set(...)
Method as object
----------------
Imports:
- :code:`from aiogram.methods.add_sticker_to_set import AddStickerToSet`
- alias: :code:`from aiogram.methods import AddStickerToSet`
In handlers with current bot
----------------------------
.. code-block:: python
result: bool = await AddStickerToSet(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block:: python
result: bool = await bot(AddStickerToSet(...))
As reply into Webhook in handler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block:: python
return AddStickerToSet(...)

View file

@ -1,64 +0,0 @@
# 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
```python3
result: bool = await bot.answer_callback_query(...)
```
### Method as object
Imports:
- `from aiogram.methods import AnswerCallbackQuery`
- `from aiogram.api.methods import AnswerCallbackQuery`
- `from aiogram.api.methods.answer_callback_query import AnswerCallbackQuery`
#### In handlers with current bot
```python3
result: bool = await AnswerCallbackQuery(...)
```
#### With specific bot
```python3
result: bool = await bot(AnswerCallbackQuery(...))
```
#### As reply into Webhook in handler
```python3
return AnswerCallbackQuery(...)
```
## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#answercallbackquery)
- [aiogram.types.CallbackQuery](../types/callback_query.md)
- [Aliases](../types/callback_query.md#aliases)

View file

@ -0,0 +1,51 @@
###################
answerCallbackQuery
###################
Returns: :obj:`bool`
.. automodule:: aiogram.methods.answer_callback_query
:members:
:member-order: bysource
:undoc-members: True
Usage
=====
As bot method
-------------
.. code-block::
result: bool = await bot.answer_callback_query(...)
Method as object
----------------
Imports:
- :code:`from aiogram.methods.answer_callback_query import AnswerCallbackQuery`
- alias: :code:`from aiogram.methods import AnswerCallbackQuery`
In handlers with current bot
----------------------------
.. code-block:: python
result: bool = await AnswerCallbackQuery(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block:: python
result: bool = await bot(AnswerCallbackQuery(...))
As reply into Webhook in handler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block:: python
return AnswerCallbackQuery(...)

View file

@ -1,67 +0,0 @@
# 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 dont support pagination. Offset length cant 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
```python3
result: bool = await bot.answer_inline_query(...)
```
### Method as object
Imports:
- `from aiogram.methods import AnswerInlineQuery`
- `from aiogram.api.methods import AnswerInlineQuery`
- `from aiogram.api.methods.answer_inline_query import AnswerInlineQuery`
#### In handlers with current bot
```python3
result: bool = await AnswerInlineQuery(...)
```
#### With specific bot
```python3
result: bool = await bot(AnswerInlineQuery(...))
```
#### As reply into Webhook in handler
```python3
return AnswerInlineQuery(...)
```
## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#answerinlinequery)
- [aiogram.types.InlineQuery](../types/inline_query.md)
- [aiogram.types.InlineQueryResult](../types/inline_query_result.md)
- [Aliases](../types/inline_query.md#aliases)

View file

@ -0,0 +1,51 @@
#################
answerInlineQuery
#################
Returns: :obj:`bool`
.. automodule:: aiogram.methods.answer_inline_query
:members:
:member-order: bysource
:undoc-members: True
Usage
=====
As bot method
-------------
.. code-block::
result: bool = await bot.answer_inline_query(...)
Method as object
----------------
Imports:
- :code:`from aiogram.methods.answer_inline_query import AnswerInlineQuery`
- alias: :code:`from aiogram.methods import AnswerInlineQuery`
In handlers with current bot
----------------------------
.. code-block:: python
result: bool = await AnswerInlineQuery(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block:: python
result: bool = await bot(AnswerInlineQuery(...))
As reply into Webhook in handler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block:: python
return AnswerInlineQuery(...)

View file

@ -1,60 +0,0 @@
# 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
```python3
result: bool = await bot.answer_pre_checkout_query(...)
```
### Method as object
Imports:
- `from aiogram.methods import AnswerPreCheckoutQuery`
- `from aiogram.api.methods import AnswerPreCheckoutQuery`
- `from aiogram.api.methods.answer_pre_checkout_query import AnswerPreCheckoutQuery`
#### In handlers with current bot
```python3
result: bool = await AnswerPreCheckoutQuery(...)
```
#### With specific bot
```python3
result: bool = await bot(AnswerPreCheckoutQuery(...))
```
#### As reply into Webhook in handler
```python3
return AnswerPreCheckoutQuery(...)
```
## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#answerprecheckoutquery)
- [aiogram.types.PreCheckoutQuery](../types/pre_checkout_query.md)
- [Aliases](../types/pre_checkout_query.md#aliases)

View file

@ -0,0 +1,51 @@
######################
answerPreCheckoutQuery
######################
Returns: :obj:`bool`
.. automodule:: aiogram.methods.answer_pre_checkout_query
:members:
:member-order: bysource
:undoc-members: True
Usage
=====
As bot method
-------------
.. code-block::
result: bool = await bot.answer_pre_checkout_query(...)
Method as object
----------------
Imports:
- :code:`from aiogram.methods.answer_pre_checkout_query import AnswerPreCheckoutQuery`
- alias: :code:`from aiogram.methods import AnswerPreCheckoutQuery`
In handlers with current bot
----------------------------
.. code-block:: python
result: bool = await AnswerPreCheckoutQuery(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block:: python
result: bool = await bot(AnswerPreCheckoutQuery(...))
As reply into Webhook in handler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block:: python
return AnswerPreCheckoutQuery(...)

View file

@ -1,62 +0,0 @@
# 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
```python3
result: bool = await bot.answer_shipping_query(...)
```
### Method as object
Imports:
- `from aiogram.methods import AnswerShippingQuery`
- `from aiogram.api.methods import AnswerShippingQuery`
- `from aiogram.api.methods.answer_shipping_query import AnswerShippingQuery`
#### In handlers with current bot
```python3
result: bool = await AnswerShippingQuery(...)
```
#### With specific bot
```python3
result: bool = await bot(AnswerShippingQuery(...))
```
#### As reply into Webhook in handler
```python3
return AnswerShippingQuery(...)
```
## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#answershippingquery)
- [aiogram.types.ShippingOption](../types/shipping_option.md)
- [aiogram.types.ShippingQuery](../types/shipping_query.md)
- [Aliases](../types/shipping_query.md#aliases)

View file

@ -0,0 +1,51 @@
###################
answerShippingQuery
###################
Returns: :obj:`bool`
.. automodule:: aiogram.methods.answer_shipping_query
:members:
:member-order: bysource
:undoc-members: True
Usage
=====
As bot method
-------------
.. code-block::
result: bool = await bot.answer_shipping_query(...)
Method as object
----------------
Imports:
- :code:`from aiogram.methods.answer_shipping_query import AnswerShippingQuery`
- alias: :code:`from aiogram.methods import AnswerShippingQuery`
In handlers with current bot
----------------------------
.. code-block:: python
result: bool = await AnswerShippingQuery(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block:: python
result: bool = await bot(AnswerShippingQuery(...))
As reply into Webhook in handler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block:: python
return AnswerShippingQuery(...)

View file

@ -0,0 +1,51 @@
#####
close
#####
Returns: :obj:`bool`
.. automodule:: aiogram.methods.close
:members:
:member-order: bysource
:undoc-members: True
Usage
=====
As bot method
-------------
.. code-block::
result: bool = await bot.close(...)
Method as object
----------------
Imports:
- :code:`from aiogram.methods.close import Close`
- alias: :code:`from aiogram.methods import Close`
In handlers with current bot
----------------------------
.. code-block:: python
result: bool = await Close(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block:: python
result: bool = await bot(Close(...))
As reply into Webhook in handler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block:: python
return Close(...)

View file

@ -0,0 +1,51 @@
###########
copyMessage
###########
Returns: :obj:`MessageId`
.. automodule:: aiogram.methods.copy_message
:members:
:member-order: bysource
:undoc-members: True
Usage
=====
As bot method
-------------
.. code-block::
result: MessageId = await bot.copy_message(...)
Method as object
----------------
Imports:
- :code:`from aiogram.methods.copy_message import CopyMessage`
- alias: :code:`from aiogram.methods import CopyMessage`
In handlers with current bot
----------------------------
.. code-block:: python
result: MessageId = await CopyMessage(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block:: python
result: MessageId = await bot(CopyMessage(...))
As reply into Webhook in handler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block:: python
return CopyMessage(...)

View file

@ -0,0 +1,51 @@
####################
createChatInviteLink
####################
Returns: :obj:`ChatInviteLink`
.. automodule:: aiogram.methods.create_chat_invite_link
:members:
:member-order: bysource
:undoc-members: True
Usage
=====
As bot method
-------------
.. code-block::
result: ChatInviteLink = await bot.create_chat_invite_link(...)
Method as object
----------------
Imports:
- :code:`from aiogram.methods.create_chat_invite_link import CreateChatInviteLink`
- alias: :code:`from aiogram.methods import CreateChatInviteLink`
In handlers with current bot
----------------------------
.. code-block:: python
result: ChatInviteLink = await CreateChatInviteLink(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block:: python
result: ChatInviteLink = await bot(CreateChatInviteLink(...))
As reply into Webhook in handler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block:: python
return CreateChatInviteLink(...)

View file

@ -1,66 +0,0 @@
# createNewStickerSet
## Description
Use this method to create a new sticker set owned by a user. The bot will be able to edit the sticker set thus created. You must use exactly one of the fields png_sticker or tgs_sticker. Returns True on success.
## Arguments
| 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 |
| `emojis` | `#!python3 str` | One or more emoji corresponding to the sticker |
| `png_sticker` | `#!python3 Optional[Union[InputFile, str]]` | Optional. PNG image with the sticker, must be up to 512 kilobytes in size, dimensions must not exceed 512px, and either width or height must be exactly 512px. Pass a file_id as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. |
| `tgs_sticker` | `#!python3 Optional[InputFile]` | Optional. TGS animation with the sticker, uploaded using multipart/form-data. See https://core.telegram.org/animated_stickers#technical-requirements for technical requirements |
| `contains_masks` | `#!python3 Optional[bool]` | Optional. Pass True, if a set of mask stickers should be created |
| `mask_position` | `#!python3 Optional[MaskPosition]` | Optional. A JSON-serialized object for position where the mask should be placed on faces |
## Response
Type: `#!python3 bool`
Description: Returns True on success.
## Usage
### As bot method
```python3
result: bool = await bot.create_new_sticker_set(...)
```
### Method as object
Imports:
- `from aiogram.methods import CreateNewStickerSet`
- `from aiogram.api.methods import CreateNewStickerSet`
- `from aiogram.api.methods.create_new_sticker_set import CreateNewStickerSet`
#### In handlers with current bot
```python3
result: bool = await CreateNewStickerSet(...)
```
#### With specific bot
```python3
result: bool = await bot(CreateNewStickerSet(...))
```
#### As reply into Webhook in handler
```python3
return 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)
- [How to upload file?](../upload_file.md)

View file

@ -0,0 +1,51 @@
###################
createNewStickerSet
###################
Returns: :obj:`bool`
.. automodule:: aiogram.methods.create_new_sticker_set
:members:
:member-order: bysource
:undoc-members: True
Usage
=====
As bot method
-------------
.. code-block::
result: bool = await bot.create_new_sticker_set(...)
Method as object
----------------
Imports:
- :code:`from aiogram.methods.create_new_sticker_set import CreateNewStickerSet`
- alias: :code:`from aiogram.methods import CreateNewStickerSet`
In handlers with current bot
----------------------------
.. code-block:: python
result: bool = await CreateNewStickerSet(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block:: python
result: bool = await bot(CreateNewStickerSet(...))
As reply into Webhook in handler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block:: python
return CreateNewStickerSet(...)

View file

@ -1,56 +0,0 @@
# 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
```python3
result: bool = await bot.delete_chat_photo(...)
```
### Method as object
Imports:
- `from aiogram.methods import DeleteChatPhoto`
- `from aiogram.api.methods import DeleteChatPhoto`
- `from aiogram.api.methods.delete_chat_photo import DeleteChatPhoto`
#### In handlers with current bot
```python3
result: bool = await DeleteChatPhoto(...)
```
#### With specific bot
```python3
result: bool = await bot(DeleteChatPhoto(...))
```
#### As reply into Webhook in handler
```python3
return DeleteChatPhoto(...)
```
## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#deletechatphoto)

View file

@ -0,0 +1,51 @@
###############
deleteChatPhoto
###############
Returns: :obj:`bool`
.. automodule:: aiogram.methods.delete_chat_photo
:members:
:member-order: bysource
:undoc-members: True
Usage
=====
As bot method
-------------
.. code-block::
result: bool = await bot.delete_chat_photo(...)
Method as object
----------------
Imports:
- :code:`from aiogram.methods.delete_chat_photo import DeleteChatPhoto`
- alias: :code:`from aiogram.methods import DeleteChatPhoto`
In handlers with current bot
----------------------------
.. code-block:: python
result: bool = await DeleteChatPhoto(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block:: python
result: bool = await bot(DeleteChatPhoto(...))
As reply into Webhook in handler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block:: python
return DeleteChatPhoto(...)

View file

@ -1,56 +0,0 @@
# 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
```python3
result: bool = await bot.delete_chat_sticker_set(...)
```
### Method as object
Imports:
- `from aiogram.methods import DeleteChatStickerSet`
- `from aiogram.api.methods import DeleteChatStickerSet`
- `from aiogram.api.methods.delete_chat_sticker_set import DeleteChatStickerSet`
#### In handlers with current bot
```python3
result: bool = await DeleteChatStickerSet(...)
```
#### With specific bot
```python3
result: bool = await bot(DeleteChatStickerSet(...))
```
#### As reply into Webhook in handler
```python3
return DeleteChatStickerSet(...)
```
## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#deletechatstickerset)

View file

@ -0,0 +1,51 @@
####################
deleteChatStickerSet
####################
Returns: :obj:`bool`
.. automodule:: aiogram.methods.delete_chat_sticker_set
:members:
:member-order: bysource
:undoc-members: True
Usage
=====
As bot method
-------------
.. code-block::
result: bool = await bot.delete_chat_sticker_set(...)
Method as object
----------------
Imports:
- :code:`from aiogram.methods.delete_chat_sticker_set import DeleteChatStickerSet`
- alias: :code:`from aiogram.methods import DeleteChatStickerSet`
In handlers with current bot
----------------------------
.. code-block:: python
result: bool = await DeleteChatStickerSet(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block:: python
result: bool = await bot(DeleteChatStickerSet(...))
As reply into Webhook in handler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block:: python
return DeleteChatStickerSet(...)

View file

@ -1,73 +0,0 @@
# 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.
- A dice message in a private chat can only be deleted if it was sent more than 24 hours ago.
- Bots can delete outgoing messages in private chats, groups, and supergroups.
- Bots can delete incoming messages in private chats.
- Bots granted can_post_messages permissions can delete outgoing messages in channels.
- If the bot is an administrator of a group, it can delete any message there.
- If the bot has can_delete_messages permission in a supergroup or a channel, it can delete any message there.
Returns True on success.
## 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
```python3
result: bool = await bot.delete_message(...)
```
### Method as object
Imports:
- `from aiogram.methods import DeleteMessage`
- `from aiogram.api.methods import DeleteMessage`
- `from aiogram.api.methods.delete_message import DeleteMessage`
#### In handlers with current bot
```python3
result: bool = await DeleteMessage(...)
```
#### With specific bot
```python3
result: bool = await bot(DeleteMessage(...))
```
#### As reply into Webhook in handler
```python3
return DeleteMessage(...)
```
## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#deletemessage)

View file

@ -0,0 +1,51 @@
#############
deleteMessage
#############
Returns: :obj:`bool`
.. automodule:: aiogram.methods.delete_message
:members:
:member-order: bysource
:undoc-members: True
Usage
=====
As bot method
-------------
.. code-block::
result: bool = await bot.delete_message(...)
Method as object
----------------
Imports:
- :code:`from aiogram.methods.delete_message import DeleteMessage`
- alias: :code:`from aiogram.methods import DeleteMessage`
In handlers with current bot
----------------------------
.. code-block:: python
result: bool = await DeleteMessage(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block:: python
result: bool = await bot(DeleteMessage(...))
As reply into Webhook in handler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block:: python
return DeleteMessage(...)

View file

@ -1,56 +0,0 @@
# 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
```python3
result: bool = await bot.delete_sticker_from_set(...)
```
### Method as object
Imports:
- `from aiogram.methods import DeleteStickerFromSet`
- `from aiogram.api.methods import DeleteStickerFromSet`
- `from aiogram.api.methods.delete_sticker_from_set import DeleteStickerFromSet`
#### In handlers with current bot
```python3
result: bool = await DeleteStickerFromSet(...)
```
#### With specific bot
```python3
result: bool = await bot(DeleteStickerFromSet(...))
```
#### As reply into Webhook in handler
```python3
return DeleteStickerFromSet(...)
```
## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#deletestickerfromset)

View file

@ -0,0 +1,51 @@
####################
deleteStickerFromSet
####################
Returns: :obj:`bool`
.. automodule:: aiogram.methods.delete_sticker_from_set
:members:
:member-order: bysource
:undoc-members: True
Usage
=====
As bot method
-------------
.. code-block::
result: bool = await bot.delete_sticker_from_set(...)
Method as object
----------------
Imports:
- :code:`from aiogram.methods.delete_sticker_from_set import DeleteStickerFromSet`
- alias: :code:`from aiogram.methods import DeleteStickerFromSet`
In handlers with current bot
----------------------------
.. code-block:: python
result: bool = await DeleteStickerFromSet(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block:: python
result: bool = await bot(DeleteStickerFromSet(...))
As reply into Webhook in handler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block:: python
return DeleteStickerFromSet(...)

View file

@ -1,50 +0,0 @@
# 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
```python3
result: bool = await bot.delete_webhook(...)
```
### Method as object
Imports:
- `from aiogram.methods import DeleteWebhook`
- `from aiogram.api.methods import DeleteWebhook`
- `from aiogram.api.methods.delete_webhook import DeleteWebhook`
#### In handlers with current bot
```python3
result: bool = await DeleteWebhook(...)
```
#### With specific bot
```python3
result: bool = await bot(DeleteWebhook(...))
```
#### As reply into Webhook in handler
```python3
return DeleteWebhook(...)
```
## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#deletewebhook)

View file

@ -0,0 +1,51 @@
#############
deleteWebhook
#############
Returns: :obj:`bool`
.. automodule:: aiogram.methods.delete_webhook
:members:
:member-order: bysource
:undoc-members: True
Usage
=====
As bot method
-------------
.. code-block::
result: bool = await bot.delete_webhook(...)
Method as object
----------------
Imports:
- :code:`from aiogram.methods.delete_webhook import DeleteWebhook`
- alias: :code:`from aiogram.methods import DeleteWebhook`
In handlers with current bot
----------------------------
.. code-block:: python
result: bool = await DeleteWebhook(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block:: python
result: bool = await bot(DeleteWebhook(...))
As reply into Webhook in handler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block:: python
return DeleteWebhook(...)

View file

@ -0,0 +1,51 @@
##################
editChatInviteLink
##################
Returns: :obj:`ChatInviteLink`
.. automodule:: aiogram.methods.edit_chat_invite_link
:members:
:member-order: bysource
:undoc-members: True
Usage
=====
As bot method
-------------
.. code-block::
result: ChatInviteLink = await bot.edit_chat_invite_link(...)
Method as object
----------------
Imports:
- :code:`from aiogram.methods.edit_chat_invite_link import EditChatInviteLink`
- alias: :code:`from aiogram.methods import EditChatInviteLink`
In handlers with current bot
----------------------------
.. code-block:: python
result: ChatInviteLink = await EditChatInviteLink(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block:: python
result: ChatInviteLink = await bot(EditChatInviteLink(...))
As reply into Webhook in handler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block:: python
return EditChatInviteLink(...)

View file

@ -1,63 +0,0 @@
# 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, 0-1024 characters after entities parsing |
| `parse_mode` | `#!python3 Optional[str]` | Optional. Mode for parsing entities in the message caption. See formatting options for more details. |
| `reply_markup` | `#!python3 Optional[InlineKeyboardMarkup]` | Optional. A JSON-serialized object for an inline keyboard. |
## 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
```python3
result: Union[Message, bool] = await bot.edit_message_caption(...)
```
### Method as object
Imports:
- `from aiogram.methods import EditMessageCaption`
- `from aiogram.api.methods import EditMessageCaption`
- `from aiogram.api.methods.edit_message_caption import EditMessageCaption`
#### In handlers with current bot
```python3
result: Union[Message, bool] = await EditMessageCaption(...)
```
#### With specific bot
```python3
result: Union[Message, bool] = await bot(EditMessageCaption(...))
```
#### As reply into Webhook in handler
```python3
return 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)

View file

@ -0,0 +1,51 @@
##################
editMessageCaption
##################
Returns: :obj:`Union[Message, bool]`
.. automodule:: aiogram.methods.edit_message_caption
:members:
:member-order: bysource
:undoc-members: True
Usage
=====
As bot method
-------------
.. code-block::
result: Union[Message, bool] = await bot.edit_message_caption(...)
Method as object
----------------
Imports:
- :code:`from aiogram.methods.edit_message_caption import EditMessageCaption`
- alias: :code:`from aiogram.methods import EditMessageCaption`
In handlers with current bot
----------------------------
.. code-block:: python
result: Union[Message, bool] = await EditMessageCaption(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block:: python
result: Union[Message, bool] = await bot(EditMessageCaption(...))
As reply into Webhook in handler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block:: python
return EditMessageCaption(...)

View file

@ -1,63 +0,0 @@
# 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
```python3
result: Union[Message, bool] = await bot.edit_message_live_location(...)
```
### Method as object
Imports:
- `from aiogram.methods import EditMessageLiveLocation`
- `from aiogram.api.methods import EditMessageLiveLocation`
- `from aiogram.api.methods.edit_message_live_location import EditMessageLiveLocation`
#### In handlers with current bot
```python3
result: Union[Message, bool] = await EditMessageLiveLocation(...)
```
#### With specific bot
```python3
result: Union[Message, bool] = await bot(EditMessageLiveLocation(...))
```
#### As reply into Webhook in handler
```python3
return 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)

View file

@ -0,0 +1,51 @@
#######################
editMessageLiveLocation
#######################
Returns: :obj:`Union[Message, bool]`
.. automodule:: aiogram.methods.edit_message_live_location
:members:
:member-order: bysource
:undoc-members: True
Usage
=====
As bot method
-------------
.. code-block::
result: Union[Message, bool] = await bot.edit_message_live_location(...)
Method as object
----------------
Imports:
- :code:`from aiogram.methods.edit_message_live_location import EditMessageLiveLocation`
- alias: :code:`from aiogram.methods import EditMessageLiveLocation`
In handlers with current bot
----------------------------
.. code-block:: python
result: Union[Message, bool] = await EditMessageLiveLocation(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block:: python
result: Union[Message, bool] = await bot(EditMessageLiveLocation(...))
As reply into Webhook in handler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block:: python
return EditMessageLiveLocation(...)

View file

@ -1,63 +0,0 @@
# 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
```python3
result: Union[Message, bool] = await bot.edit_message_media(...)
```
### Method as object
Imports:
- `from aiogram.methods import EditMessageMedia`
- `from aiogram.api.methods import EditMessageMedia`
- `from aiogram.api.methods.edit_message_media import EditMessageMedia`
#### In handlers with current bot
```python3
result: Union[Message, bool] = await EditMessageMedia(...)
```
#### With specific bot
```python3
result: Union[Message, bool] = await bot(EditMessageMedia(...))
```
#### As reply into Webhook in handler
```python3
return 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)

View file

@ -0,0 +1,51 @@
################
editMessageMedia
################
Returns: :obj:`Union[Message, bool]`
.. automodule:: aiogram.methods.edit_message_media
:members:
:member-order: bysource
:undoc-members: True
Usage
=====
As bot method
-------------
.. code-block::
result: Union[Message, bool] = await bot.edit_message_media(...)
Method as object
----------------
Imports:
- :code:`from aiogram.methods.edit_message_media import EditMessageMedia`
- alias: :code:`from aiogram.methods import EditMessageMedia`
In handlers with current bot
----------------------------
.. code-block:: python
result: Union[Message, bool] = await EditMessageMedia(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block:: python
result: Union[Message, bool] = await bot(EditMessageMedia(...))
As reply into Webhook in handler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block:: python
return EditMessageMedia(...)

View file

@ -1,61 +0,0 @@
# 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
```python3
result: Union[Message, bool] = await bot.edit_message_reply_markup(...)
```
### Method as object
Imports:
- `from aiogram.methods import EditMessageReplyMarkup`
- `from aiogram.api.methods import EditMessageReplyMarkup`
- `from aiogram.api.methods.edit_message_reply_markup import EditMessageReplyMarkup`
#### In handlers with current bot
```python3
result: Union[Message, bool] = await EditMessageReplyMarkup(...)
```
#### With specific bot
```python3
result: Union[Message, bool] = await bot(EditMessageReplyMarkup(...))
```
#### As reply into Webhook in handler
```python3
return 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)

View file

@ -0,0 +1,51 @@
######################
editMessageReplyMarkup
######################
Returns: :obj:`Union[Message, bool]`
.. automodule:: aiogram.methods.edit_message_reply_markup
:members:
:member-order: bysource
:undoc-members: True
Usage
=====
As bot method
-------------
.. code-block::
result: Union[Message, bool] = await bot.edit_message_reply_markup(...)
Method as object
----------------
Imports:
- :code:`from aiogram.methods.edit_message_reply_markup import EditMessageReplyMarkup`
- alias: :code:`from aiogram.methods import EditMessageReplyMarkup`
In handlers with current bot
----------------------------
.. code-block:: python
result: Union[Message, bool] = await EditMessageReplyMarkup(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block:: python
result: Union[Message, bool] = await bot(EditMessageReplyMarkup(...))
As reply into Webhook in handler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block:: python
return EditMessageReplyMarkup(...)

View file

@ -1,64 +0,0 @@
# 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, 1-4096 characters after entities parsing |
| `chat_id` | `#!python3 Optional[Union[int, str]]` | Optional. Required if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername) |
| `message_id` | `#!python3 Optional[int]` | Optional. Required if inline_message_id is not specified. Identifier of the message to edit |
| `inline_message_id` | `#!python3 Optional[str]` | Optional. Required if chat_id and message_id are not specified. Identifier of the inline message |
| `parse_mode` | `#!python3 Optional[str]` | Optional. Mode for parsing entities in the message text. See formatting options for more details. |
| `disable_web_page_preview` | `#!python3 Optional[bool]` | Optional. Disables link previews for links in this message |
| `reply_markup` | `#!python3 Optional[InlineKeyboardMarkup]` | Optional. A JSON-serialized object for an inline keyboard. |
## 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
```python3
result: Union[Message, bool] = await bot.edit_message_text(...)
```
### Method as object
Imports:
- `from aiogram.methods import EditMessageText`
- `from aiogram.api.methods import EditMessageText`
- `from aiogram.api.methods.edit_message_text import EditMessageText`
#### In handlers with current bot
```python3
result: Union[Message, bool] = await EditMessageText(...)
```
#### With specific bot
```python3
result: Union[Message, bool] = await bot(EditMessageText(...))
```
#### As reply into Webhook in handler
```python3
return 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)

View file

@ -0,0 +1,51 @@
###############
editMessageText
###############
Returns: :obj:`Union[Message, bool]`
.. automodule:: aiogram.methods.edit_message_text
:members:
:member-order: bysource
:undoc-members: True
Usage
=====
As bot method
-------------
.. code-block::
result: Union[Message, bool] = await bot.edit_message_text(...)
Method as object
----------------
Imports:
- :code:`from aiogram.methods.edit_message_text import EditMessageText`
- alias: :code:`from aiogram.methods import EditMessageText`
In handlers with current bot
----------------------------
.. code-block:: python
result: Union[Message, bool] = await EditMessageText(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block:: python
result: Union[Message, bool] = await bot(EditMessageText(...))
As reply into Webhook in handler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block:: python
return EditMessageText(...)

View file

@ -1,58 +0,0 @@
# 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
```python3
result: str = await bot.export_chat_invite_link(...)
```
### Method as object
Imports:
- `from aiogram.methods import ExportChatInviteLink`
- `from aiogram.api.methods import ExportChatInviteLink`
- `from aiogram.api.methods.export_chat_invite_link import ExportChatInviteLink`
#### In handlers with current bot
```python3
result: str = await ExportChatInviteLink(...)
```
#### With specific bot
```python3
result: str = await bot(ExportChatInviteLink(...))
```
#### As reply into Webhook in handler
```python3
return ExportChatInviteLink(...)
```
## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#exportchatinvitelink)

View file

@ -0,0 +1,51 @@
####################
exportChatInviteLink
####################
Returns: :obj:`str`
.. automodule:: aiogram.methods.export_chat_invite_link
:members:
:member-order: bysource
:undoc-members: True
Usage
=====
As bot method
-------------
.. code-block::
result: str = await bot.export_chat_invite_link(...)
Method as object
----------------
Imports:
- :code:`from aiogram.methods.export_chat_invite_link import ExportChatInviteLink`
- alias: :code:`from aiogram.methods import ExportChatInviteLink`
In handlers with current bot
----------------------------
.. code-block:: python
result: str = await ExportChatInviteLink(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block:: python
result: str = await bot(ExportChatInviteLink(...))
As reply into Webhook in handler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block:: python
return ExportChatInviteLink(...)

View file

@ -1,60 +0,0 @@
# 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
```python3
result: Message = await bot.forward_message(...)
```
### Method as object
Imports:
- `from aiogram.methods import ForwardMessage`
- `from aiogram.api.methods import ForwardMessage`
- `from aiogram.api.methods.forward_message import ForwardMessage`
#### In handlers with current bot
```python3
result: Message = await ForwardMessage(...)
```
#### With specific bot
```python3
result: Message = await bot(ForwardMessage(...))
```
#### As reply into Webhook in handler
```python3
return ForwardMessage(...)
```
## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#forwardmessage)
- [aiogram.types.Message](../types/message.md)

View file

@ -0,0 +1,51 @@
##############
forwardMessage
##############
Returns: :obj:`Message`
.. automodule:: aiogram.methods.forward_message
:members:
:member-order: bysource
:undoc-members: True
Usage
=====
As bot method
-------------
.. code-block::
result: Message = await bot.forward_message(...)
Method as object
----------------
Imports:
- :code:`from aiogram.methods.forward_message import ForwardMessage`
- alias: :code:`from aiogram.methods import ForwardMessage`
In handlers with current bot
----------------------------
.. code-block:: python
result: Message = await ForwardMessage(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block:: python
result: Message = await bot(ForwardMessage(...))
As reply into Webhook in handler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block:: python
return ForwardMessage(...)

View file

@ -1,54 +0,0 @@
# 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
```python3
result: Chat = await bot.get_chat(...)
```
### Method as object
Imports:
- `from aiogram.methods import GetChat`
- `from aiogram.api.methods import GetChat`
- `from aiogram.api.methods.get_chat import GetChat`
#### In handlers with current bot
```python3
result: Chat = await GetChat(...)
```
#### With specific bot
```python3
result: Chat = await bot(GetChat(...))
```
## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#getchat)
- [aiogram.types.Chat](../types/chat.md)

View file

@ -0,0 +1,44 @@
#######
getChat
#######
Returns: :obj:`Chat`
.. automodule:: aiogram.methods.get_chat
:members:
:member-order: bysource
:undoc-members: True
Usage
=====
As bot method
-------------
.. code-block::
result: Chat = await bot.get_chat(...)
Method as object
----------------
Imports:
- :code:`from aiogram.methods.get_chat import GetChat`
- alias: :code:`from aiogram.methods import GetChat`
In handlers with current bot
----------------------------
.. code-block:: python
result: Chat = await GetChat(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block:: python
result: Chat = await bot(GetChat(...))

View file

@ -1,54 +0,0 @@
# 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
```python3
result: List[ChatMember] = await bot.get_chat_administrators(...)
```
### Method as object
Imports:
- `from aiogram.methods import GetChatAdministrators`
- `from aiogram.api.methods import GetChatAdministrators`
- `from aiogram.api.methods.get_chat_administrators import GetChatAdministrators`
#### In handlers with current bot
```python3
result: List[ChatMember] = await GetChatAdministrators(...)
```
#### With specific bot
```python3
result: List[ChatMember] = await bot(GetChatAdministrators(...))
```
## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#getchatadministrators)
- [aiogram.types.ChatMember](../types/chat_member.md)

View file

@ -0,0 +1,44 @@
#####################
getChatAdministrators
#####################
Returns: :obj:`List[ChatMember]`
.. automodule:: aiogram.methods.get_chat_administrators
:members:
:member-order: bysource
:undoc-members: True
Usage
=====
As bot method
-------------
.. code-block::
result: List[ChatMember] = await bot.get_chat_administrators(...)
Method as object
----------------
Imports:
- :code:`from aiogram.methods.get_chat_administrators import GetChatAdministrators`
- alias: :code:`from aiogram.methods import GetChatAdministrators`
In handlers with current bot
----------------------------
.. code-block:: python
result: List[ChatMember] = await GetChatAdministrators(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block:: python
result: List[ChatMember] = await bot(GetChatAdministrators(...))

View file

@ -1,55 +0,0 @@
# 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
```python3
result: ChatMember = await bot.get_chat_member(...)
```
### Method as object
Imports:
- `from aiogram.methods import GetChatMember`
- `from aiogram.api.methods import GetChatMember`
- `from aiogram.api.methods.get_chat_member import GetChatMember`
#### In handlers with current bot
```python3
result: ChatMember = await GetChatMember(...)
```
#### With specific bot
```python3
result: ChatMember = await bot(GetChatMember(...))
```
## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#getchatmember)
- [aiogram.types.ChatMember](../types/chat_member.md)

View file

@ -0,0 +1,44 @@
#############
getChatMember
#############
Returns: :obj:`ChatMember`
.. automodule:: aiogram.methods.get_chat_member
:members:
:member-order: bysource
:undoc-members: True
Usage
=====
As bot method
-------------
.. code-block::
result: ChatMember = await bot.get_chat_member(...)
Method as object
----------------
Imports:
- :code:`from aiogram.methods.get_chat_member import GetChatMember`
- alias: :code:`from aiogram.methods import GetChatMember`
In handlers with current bot
----------------------------
.. code-block:: python
result: ChatMember = await GetChatMember(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block:: python
result: ChatMember = await bot(GetChatMember(...))

View file

@ -1,53 +0,0 @@
# 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
```python3
result: int = await bot.get_chat_members_count(...)
```
### Method as object
Imports:
- `from aiogram.methods import GetChatMembersCount`
- `from aiogram.api.methods import GetChatMembersCount`
- `from aiogram.api.methods.get_chat_members_count import GetChatMembersCount`
#### In handlers with current bot
```python3
result: int = await GetChatMembersCount(...)
```
#### With specific bot
```python3
result: int = await bot(GetChatMembersCount(...))
```
## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#getchatmemberscount)

View file

@ -0,0 +1,44 @@
###################
getChatMembersCount
###################
Returns: :obj:`int`
.. automodule:: aiogram.methods.get_chat_members_count
:members:
:member-order: bysource
:undoc-members: True
Usage
=====
As bot method
-------------
.. code-block::
result: int = await bot.get_chat_members_count(...)
Method as object
----------------
Imports:
- :code:`from aiogram.methods.get_chat_members_count import GetChatMembersCount`
- alias: :code:`from aiogram.methods import GetChatMembersCount`
In handlers with current bot
----------------------------
.. code-block:: python
result: int = await GetChatMembersCount(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block:: python
result: int = await bot(GetChatMembersCount(...))

View file

@ -1,56 +0,0 @@
# 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
```python3
result: File = await bot.get_file(...)
```
### Method as object
Imports:
- `from aiogram.methods import GetFile`
- `from aiogram.api.methods import GetFile`
- `from aiogram.api.methods.get_file import GetFile`
#### In handlers with current bot
```python3
result: File = await GetFile(...)
```
#### With specific bot
```python3
result: File = await bot(GetFile(...))
```
## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#getfile)
- [aiogram.types.File](../types/file.md)

View file

@ -0,0 +1,44 @@
#######
getFile
#######
Returns: :obj:`File`
.. automodule:: aiogram.methods.get_file
:members:
:member-order: bysource
:undoc-members: True
Usage
=====
As bot method
-------------
.. code-block::
result: File = await bot.get_file(...)
Method as object
----------------
Imports:
- :code:`from aiogram.methods.get_file import GetFile`
- alias: :code:`from aiogram.methods import GetFile`
In handlers with current bot
----------------------------
.. code-block:: python
result: File = await GetFile(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block:: python
result: File = await bot(GetFile(...))

View file

@ -1,59 +0,0 @@
# getGameHighScores
## Description
Use this method to get data for high score tables. Will return the score of the specified user and several of their neighbors in a game. On success, returns an Array of GameHighScore objects.
This method will currently return scores for the target user, plus two of their closest neighbors on each side. Will also return the top three users if the user and his neighbors are not among them. Please note that this behavior is subject to change.
## 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 their neighbors in a game. On success, returns an Array of GameHighScore objects. This method will currently return scores for the target user, plus two of their closest neighbors on each side. Will also return the top three users if the user and his neighbors are not among them.
## Usage
### As bot method
```python3
result: List[GameHighScore] = await bot.get_game_high_scores(...)
```
### Method as object
Imports:
- `from aiogram.methods import GetGameHighScores`
- `from aiogram.api.methods import GetGameHighScores`
- `from aiogram.api.methods.get_game_high_scores import GetGameHighScores`
#### In handlers with current bot
```python3
result: List[GameHighScore] = await GetGameHighScores(...)
```
#### With specific bot
```python3
result: List[GameHighScore] = await bot(GetGameHighScores(...))
```
## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#getgamehighscores)
- [aiogram.types.GameHighScore](../types/game_high_score.md)

View file

@ -0,0 +1,44 @@
#################
getGameHighScores
#################
Returns: :obj:`List[GameHighScore]`
.. automodule:: aiogram.methods.get_game_high_scores
:members:
:member-order: bysource
:undoc-members: True
Usage
=====
As bot method
-------------
.. code-block::
result: List[GameHighScore] = await bot.get_game_high_scores(...)
Method as object
----------------
Imports:
- :code:`from aiogram.methods.get_game_high_scores import GetGameHighScores`
- alias: :code:`from aiogram.methods import GetGameHighScores`
In handlers with current bot
----------------------------
.. code-block:: python
result: List[GameHighScore] = await GetGameHighScores(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block:: python
result: List[GameHighScore] = await bot(GetGameHighScores(...))

View file

@ -1,48 +0,0 @@
# 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
```python3
result: User = await bot.get_me(...)
```
### Method as object
Imports:
- `from aiogram.methods import GetMe`
- `from aiogram.api.methods import GetMe`
- `from aiogram.api.methods.get_me import GetMe`
#### In handlers with current bot
```python3
result: User = await GetMe(...)
```
#### With specific bot
```python3
result: User = await bot(GetMe(...))
```
## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#getme)
- [aiogram.types.User](../types/user.md)

View file

@ -0,0 +1,44 @@
#####
getMe
#####
Returns: :obj:`User`
.. automodule:: aiogram.methods.get_me
:members:
:member-order: bysource
:undoc-members: True
Usage
=====
As bot method
-------------
.. code-block::
result: User = await bot.get_me(...)
Method as object
----------------
Imports:
- :code:`from aiogram.methods.get_me import GetMe`
- alias: :code:`from aiogram.methods import GetMe`
In handlers with current bot
----------------------------
.. code-block:: python
result: User = await GetMe(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block:: python
result: User = await bot(GetMe(...))

View file

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

View file

@ -0,0 +1,44 @@
#############
getMyCommands
#############
Returns: :obj:`List[BotCommand]`
.. automodule:: aiogram.methods.get_my_commands
:members:
:member-order: bysource
:undoc-members: True
Usage
=====
As bot method
-------------
.. code-block::
result: List[BotCommand] = await bot.get_my_commands(...)
Method as object
----------------
Imports:
- :code:`from aiogram.methods.get_my_commands import GetMyCommands`
- alias: :code:`from aiogram.methods import GetMyCommands`
In handlers with current bot
----------------------------
.. code-block:: python
result: List[BotCommand] = await GetMyCommands(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block:: python
result: List[BotCommand] = await bot(GetMyCommands(...))

View file

@ -1,54 +0,0 @@
# 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
```python3
result: StickerSet = await bot.get_sticker_set(...)
```
### Method as object
Imports:
- `from aiogram.methods import GetStickerSet`
- `from aiogram.api.methods import GetStickerSet`
- `from aiogram.api.methods.get_sticker_set import GetStickerSet`
#### In handlers with current bot
```python3
result: StickerSet = await GetStickerSet(...)
```
#### With specific bot
```python3
result: StickerSet = await bot(GetStickerSet(...))
```
## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#getstickerset)
- [aiogram.types.StickerSet](../types/sticker_set.md)

View file

@ -0,0 +1,44 @@
#############
getStickerSet
#############
Returns: :obj:`StickerSet`
.. automodule:: aiogram.methods.get_sticker_set
:members:
:member-order: bysource
:undoc-members: True
Usage
=====
As bot method
-------------
.. code-block::
result: StickerSet = await bot.get_sticker_set(...)
Method as object
----------------
Imports:
- :code:`from aiogram.methods.get_sticker_set import GetStickerSet`
- alias: :code:`from aiogram.methods import GetStickerSet`
In handlers with current bot
----------------------------
.. code-block:: python
result: StickerSet = await GetStickerSet(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block:: python
result: StickerSet = await bot(GetStickerSet(...))

View file

@ -1,63 +0,0 @@
# 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. A JSON-serialized list of the update types you want your bot to receive. For example, specify ['message', 'edited_channel_post', 'callback_query'] to only receive updates of these types. See Update for a complete list of available update types. Specify an empty list to receive all updates regardless of type (default). If not specified, the previous setting will be used. |
## Response
Type: `#!python3 List[Update]`
Description: An Array of Update objects is returned.
## Usage
### As bot method
```python3
result: List[Update] = await bot.get_updates(...)
```
### Method as object
Imports:
- `from aiogram.methods import GetUpdates`
- `from aiogram.api.methods import GetUpdates`
- `from aiogram.api.methods.get_updates import GetUpdates`
#### In handlers with current bot
```python3
result: List[Update] = await GetUpdates(...)
```
#### With specific bot
```python3
result: List[Update] = await bot(GetUpdates(...))
```
## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#getupdates)
- [aiogram.types.Update](../types/update.md)

View file

@ -0,0 +1,44 @@
##########
getUpdates
##########
Returns: :obj:`List[Update]`
.. automodule:: aiogram.methods.get_updates
:members:
:member-order: bysource
:undoc-members: True
Usage
=====
As bot method
-------------
.. code-block::
result: List[Update] = await bot.get_updates(...)
Method as object
----------------
Imports:
- :code:`from aiogram.methods.get_updates import GetUpdates`
- alias: :code:`from aiogram.methods import GetUpdates`
In handlers with current bot
----------------------------
.. code-block:: python
result: List[Update] = await GetUpdates(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block:: python
result: List[Update] = await bot(GetUpdates(...))

View file

@ -1,56 +0,0 @@
# 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
```python3
result: UserProfilePhotos = await bot.get_user_profile_photos(...)
```
### Method as object
Imports:
- `from aiogram.methods import GetUserProfilePhotos`
- `from aiogram.api.methods import GetUserProfilePhotos`
- `from aiogram.api.methods.get_user_profile_photos import GetUserProfilePhotos`
#### In handlers with current bot
```python3
result: UserProfilePhotos = await GetUserProfilePhotos(...)
```
#### With specific bot
```python3
result: UserProfilePhotos = await bot(GetUserProfilePhotos(...))
```
## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#getuserprofilephotos)
- [aiogram.types.UserProfilePhotos](../types/user_profile_photos.md)

View file

@ -0,0 +1,44 @@
####################
getUserProfilePhotos
####################
Returns: :obj:`UserProfilePhotos`
.. automodule:: aiogram.methods.get_user_profile_photos
:members:
:member-order: bysource
:undoc-members: True
Usage
=====
As bot method
-------------
.. code-block::
result: UserProfilePhotos = await bot.get_user_profile_photos(...)
Method as object
----------------
Imports:
- :code:`from aiogram.methods.get_user_profile_photos import GetUserProfilePhotos`
- alias: :code:`from aiogram.methods import GetUserProfilePhotos`
In handlers with current bot
----------------------------
.. code-block:: python
result: UserProfilePhotos = await GetUserProfilePhotos(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block:: python
result: UserProfilePhotos = await bot(GetUserProfilePhotos(...))

View file

@ -1,48 +0,0 @@
# 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
```python3
result: WebhookInfo = await bot.get_webhook_info(...)
```
### Method as object
Imports:
- `from aiogram.methods import GetWebhookInfo`
- `from aiogram.api.methods import GetWebhookInfo`
- `from aiogram.api.methods.get_webhook_info import GetWebhookInfo`
#### In handlers with current bot
```python3
result: WebhookInfo = await GetWebhookInfo(...)
```
#### With specific bot
```python3
result: WebhookInfo = await bot(GetWebhookInfo(...))
```
## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#getwebhookinfo)
- [aiogram.types.WebhookInfo](../types/webhook_info.md)

View file

@ -0,0 +1,44 @@
##############
getWebhookInfo
##############
Returns: :obj:`WebhookInfo`
.. automodule:: aiogram.methods.get_webhook_info
:members:
:member-order: bysource
:undoc-members: True
Usage
=====
As bot method
-------------
.. code-block::
result: WebhookInfo = await bot.get_webhook_info(...)
Method as object
----------------
Imports:
- :code:`from aiogram.methods.get_webhook_info import GetWebhookInfo`
- alias: :code:`from aiogram.methods import GetWebhookInfo`
In handlers with current bot
----------------------------
.. code-block:: python
result: WebhookInfo = await GetWebhookInfo(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block:: python
result: WebhookInfo = await bot(GetWebhookInfo(...))

View file

@ -1,82 +0,0 @@
# Methods
Here is list of all available API methods:
- Getting updates
- [getUpdates](get_updates.md)
- [setWebhook](set_webhook.md)
- [deleteWebhook](delete_webhook.md)
- [getWebhookInfo](get_webhook_info.md)
- Available methods
- [getMe](get_me.md)
- [sendMessage](send_message.md)
- [forwardMessage](forward_message.md)
- [sendPhoto](send_photo.md)
- [sendAudio](send_audio.md)
- [sendDocument](send_document.md)
- [sendVideo](send_video.md)
- [sendAnimation](send_animation.md)
- [sendVoice](send_voice.md)
- [sendVideoNote](send_video_note.md)
- [sendMediaGroup](send_media_group.md)
- [sendLocation](send_location.md)
- [editMessageLiveLocation](edit_message_live_location.md)
- [stopMessageLiveLocation](stop_message_live_location.md)
- [sendVenue](send_venue.md)
- [sendContact](send_contact.md)
- [sendPoll](send_poll.md)
- [sendDice](send_dice.md)
- [sendChatAction](send_chat_action.md)
- [getUserProfilePhotos](get_user_profile_photos.md)
- [getFile](get_file.md)
- [kickChatMember](kick_chat_member.md)
- [unbanChatMember](unban_chat_member.md)
- [restrictChatMember](restrict_chat_member.md)
- [promoteChatMember](promote_chat_member.md)
- [setChatAdministratorCustomTitle](set_chat_administrator_custom_title.md)
- [setChatPermissions](set_chat_permissions.md)
- [exportChatInviteLink](export_chat_invite_link.md)
- [setChatPhoto](set_chat_photo.md)
- [deleteChatPhoto](delete_chat_photo.md)
- [setChatTitle](set_chat_title.md)
- [setChatDescription](set_chat_description.md)
- [pinChatMessage](pin_chat_message.md)
- [unpinChatMessage](unpin_chat_message.md)
- [leaveChat](leave_chat.md)
- [getChat](get_chat.md)
- [getChatAdministrators](get_chat_administrators.md)
- [getChatMembersCount](get_chat_members_count.md)
- [getChatMember](get_chat_member.md)
- [setChatStickerSet](set_chat_sticker_set.md)
- [deleteChatStickerSet](delete_chat_sticker_set.md)
- [answerCallbackQuery](answer_callback_query.md)
- [setMyCommands](set_my_commands.md)
- [getMyCommands](get_my_commands.md)
- Updating messages
- [editMessageText](edit_message_text.md)
- [editMessageCaption](edit_message_caption.md)
- [editMessageMedia](edit_message_media.md)
- [editMessageReplyMarkup](edit_message_reply_markup.md)
- [stopPoll](stop_poll.md)
- [deleteMessage](delete_message.md)
- Stickers
- [sendSticker](send_sticker.md)
- [getStickerSet](get_sticker_set.md)
- [uploadStickerFile](upload_sticker_file.md)
- [createNewStickerSet](create_new_sticker_set.md)
- [addStickerToSet](add_sticker_to_set.md)
- [setStickerPositionInSet](set_sticker_position_in_set.md)
- [deleteStickerFromSet](delete_sticker_from_set.md)
- [setStickerSetThumb](set_sticker_set_thumb.md)
- Inline mode
- [answerInlineQuery](answer_inline_query.md)
- Payments
- [sendInvoice](send_invoice.md)
- [answerShippingQuery](answer_shipping_query.md)
- [answerPreCheckoutQuery](answer_pre_checkout_query.md)
- Telegram Passport
- [setPassportDataErrors](set_passport_data_errors.md)
- Games
- [sendGame](send_game.md)
- [setGameScore](set_game_score.md)
- [getGameHighScores](get_game_high_scores.md)

141
docs/api/methods/index.rst Normal file
View file

@ -0,0 +1,141 @@
#######
Methods
#######
Here is list of all available API methods:
Getting updates
===============
.. toctree::
:maxdepth: 1
get_updates
set_webhook
delete_webhook
get_webhook_info
Available methods
=================
.. toctree::
:maxdepth: 1
get_me
log_out
close
send_message
forward_message
copy_message
send_photo
send_audio
send_document
send_video
send_animation
send_voice
send_video_note
send_media_group
send_location
edit_message_live_location
stop_message_live_location
send_venue
send_contact
send_poll
send_dice
send_chat_action
get_user_profile_photos
get_file
kick_chat_member
unban_chat_member
restrict_chat_member
promote_chat_member
set_chat_administrator_custom_title
set_chat_permissions
export_chat_invite_link
create_chat_invite_link
edit_chat_invite_link
revoke_chat_invite_link
set_chat_photo
delete_chat_photo
set_chat_title
set_chat_description
pin_chat_message
unpin_chat_message
unpin_all_chat_messages
leave_chat
get_chat
get_chat_administrators
get_chat_members_count
get_chat_member
set_chat_sticker_set
delete_chat_sticker_set
answer_callback_query
set_my_commands
get_my_commands
Updating messages
=================
.. toctree::
:maxdepth: 1
edit_message_text
edit_message_caption
edit_message_media
edit_message_reply_markup
stop_poll
delete_message
Stickers
========
.. toctree::
:maxdepth: 1
send_sticker
get_sticker_set
upload_sticker_file
create_new_sticker_set
add_sticker_to_set
set_sticker_position_in_set
delete_sticker_from_set
set_sticker_set_thumb
Inline mode
===========
.. toctree::
:maxdepth: 1
answer_inline_query
Payments
========
.. toctree::
:maxdepth: 1
send_invoice
answer_shipping_query
answer_pre_checkout_query
Telegram Passport
=================
.. toctree::
:maxdepth: 1
set_passport_data_errors
Games
=====
.. toctree::
:maxdepth: 1
send_game
set_game_score
get_game_high_scores

View file

@ -1,58 +0,0 @@
# 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[datetime.datetime, datetime.timedelta, int]]` | Optional. Date when the user will be unbanned, unix time. If user is banned for more than 366 days or less than 30 seconds from the current time they are considered to be banned forever |
## 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
```python3
result: bool = await bot.kick_chat_member(...)
```
### Method as object
Imports:
- `from aiogram.methods import KickChatMember`
- `from aiogram.api.methods import KickChatMember`
- `from aiogram.api.methods.kick_chat_member import KickChatMember`
#### In handlers with current bot
```python3
result: bool = await KickChatMember(...)
```
#### With specific bot
```python3
result: bool = await bot(KickChatMember(...))
```
#### As reply into Webhook in handler
```python3
return KickChatMember(...)
```
## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#kickchatmember)

View file

@ -0,0 +1,51 @@
##############
kickChatMember
##############
Returns: :obj:`bool`
.. automodule:: aiogram.methods.kick_chat_member
:members:
:member-order: bysource
:undoc-members: True
Usage
=====
As bot method
-------------
.. code-block::
result: bool = await bot.kick_chat_member(...)
Method as object
----------------
Imports:
- :code:`from aiogram.methods.kick_chat_member import KickChatMember`
- alias: :code:`from aiogram.methods import KickChatMember`
In handlers with current bot
----------------------------
.. code-block:: python
result: bool = await KickChatMember(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block:: python
result: bool = await bot(KickChatMember(...))
As reply into Webhook in handler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block:: python
return KickChatMember(...)

View file

@ -1,56 +0,0 @@
# 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
```python3
result: bool = await bot.leave_chat(...)
```
### Method as object
Imports:
- `from aiogram.methods import LeaveChat`
- `from aiogram.api.methods import LeaveChat`
- `from aiogram.api.methods.leave_chat import LeaveChat`
#### In handlers with current bot
```python3
result: bool = await LeaveChat(...)
```
#### With specific bot
```python3
result: bool = await bot(LeaveChat(...))
```
#### As reply into Webhook in handler
```python3
return LeaveChat(...)
```
## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#leavechat)

View file

@ -0,0 +1,51 @@
#########
leaveChat
#########
Returns: :obj:`bool`
.. automodule:: aiogram.methods.leave_chat
:members:
:member-order: bysource
:undoc-members: True
Usage
=====
As bot method
-------------
.. code-block::
result: bool = await bot.leave_chat(...)
Method as object
----------------
Imports:
- :code:`from aiogram.methods.leave_chat import LeaveChat`
- alias: :code:`from aiogram.methods import LeaveChat`
In handlers with current bot
----------------------------
.. code-block:: python
result: bool = await LeaveChat(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block:: python
result: bool = await bot(LeaveChat(...))
As reply into Webhook in handler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block:: python
return LeaveChat(...)

View file

@ -0,0 +1,51 @@
######
logOut
######
Returns: :obj:`bool`
.. automodule:: aiogram.methods.log_out
:members:
:member-order: bysource
:undoc-members: True
Usage
=====
As bot method
-------------
.. code-block::
result: bool = await bot.log_out(...)
Method as object
----------------
Imports:
- :code:`from aiogram.methods.log_out import LogOut`
- alias: :code:`from aiogram.methods import LogOut`
In handlers with current bot
----------------------------
.. code-block:: python
result: bool = await LogOut(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block:: python
result: bool = await bot(LogOut(...))
As reply into Webhook in handler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block:: python
return LogOut(...)

View file

@ -1,58 +0,0 @@
# 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
```python3
result: bool = await bot.pin_chat_message(...)
```
### Method as object
Imports:
- `from aiogram.methods import PinChatMessage`
- `from aiogram.api.methods import PinChatMessage`
- `from aiogram.api.methods.pin_chat_message import PinChatMessage`
#### In handlers with current bot
```python3
result: bool = await PinChatMessage(...)
```
#### With specific bot
```python3
result: bool = await bot(PinChatMessage(...))
```
#### As reply into Webhook in handler
```python3
return PinChatMessage(...)
```
## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#pinchatmessage)

View file

@ -0,0 +1,51 @@
##############
pinChatMessage
##############
Returns: :obj:`bool`
.. automodule:: aiogram.methods.pin_chat_message
:members:
:member-order: bysource
:undoc-members: True
Usage
=====
As bot method
-------------
.. code-block::
result: bool = await bot.pin_chat_message(...)
Method as object
----------------
Imports:
- :code:`from aiogram.methods.pin_chat_message import PinChatMessage`
- alias: :code:`from aiogram.methods import PinChatMessage`
In handlers with current bot
----------------------------
.. code-block:: python
result: bool = await PinChatMessage(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block:: python
result: bool = await bot(PinChatMessage(...))
As reply into Webhook in handler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block:: python
return PinChatMessage(...)

View file

@ -1,65 +0,0 @@
# 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 their 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
```python3
result: bool = await bot.promote_chat_member(...)
```
### Method as object
Imports:
- `from aiogram.methods import PromoteChatMember`
- `from aiogram.api.methods import PromoteChatMember`
- `from aiogram.api.methods.promote_chat_member import PromoteChatMember`
#### In handlers with current bot
```python3
result: bool = await PromoteChatMember(...)
```
#### With specific bot
```python3
result: bool = await bot(PromoteChatMember(...))
```
#### As reply into Webhook in handler
```python3
return PromoteChatMember(...)
```
## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#promotechatmember)

View file

@ -0,0 +1,51 @@
#################
promoteChatMember
#################
Returns: :obj:`bool`
.. automodule:: aiogram.methods.promote_chat_member
:members:
:member-order: bysource
:undoc-members: True
Usage
=====
As bot method
-------------
.. code-block::
result: bool = await bot.promote_chat_member(...)
Method as object
----------------
Imports:
- :code:`from aiogram.methods.promote_chat_member import PromoteChatMember`
- alias: :code:`from aiogram.methods import PromoteChatMember`
In handlers with current bot
----------------------------
.. code-block:: python
result: bool = await PromoteChatMember(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block:: python
result: bool = await bot(PromoteChatMember(...))
As reply into Webhook in handler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block:: python
return PromoteChatMember(...)

View file

@ -1,60 +0,0 @@
# 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[datetime.datetime, datetime.timedelta, int]]` | Optional. Date when restrictions will be lifted for the user, unix time. If user is restricted for more than 366 days or less than 30 seconds from the current time, they are considered to be restricted forever |
## Response
Type: `#!python3 bool`
Description: Returns True on success.
## Usage
### As bot method
```python3
result: bool = await bot.restrict_chat_member(...)
```
### Method as object
Imports:
- `from aiogram.methods import RestrictChatMember`
- `from aiogram.api.methods import RestrictChatMember`
- `from aiogram.api.methods.restrict_chat_member import RestrictChatMember`
#### In handlers with current bot
```python3
result: bool = await RestrictChatMember(...)
```
#### With specific bot
```python3
result: bool = await bot(RestrictChatMember(...))
```
#### As reply into Webhook in handler
```python3
return RestrictChatMember(...)
```
## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#restrictchatmember)
- [aiogram.types.ChatPermissions](../types/chat_permissions.md)

View file

@ -0,0 +1,51 @@
##################
restrictChatMember
##################
Returns: :obj:`bool`
.. automodule:: aiogram.methods.restrict_chat_member
:members:
:member-order: bysource
:undoc-members: True
Usage
=====
As bot method
-------------
.. code-block::
result: bool = await bot.restrict_chat_member(...)
Method as object
----------------
Imports:
- :code:`from aiogram.methods.restrict_chat_member import RestrictChatMember`
- alias: :code:`from aiogram.methods import RestrictChatMember`
In handlers with current bot
----------------------------
.. code-block:: python
result: bool = await RestrictChatMember(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block:: python
result: bool = await bot(RestrictChatMember(...))
As reply into Webhook in handler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block:: python
return RestrictChatMember(...)

View file

@ -0,0 +1,51 @@
####################
revokeChatInviteLink
####################
Returns: :obj:`ChatInviteLink`
.. automodule:: aiogram.methods.revoke_chat_invite_link
:members:
:member-order: bysource
:undoc-members: True
Usage
=====
As bot method
-------------
.. code-block::
result: ChatInviteLink = await bot.revoke_chat_invite_link(...)
Method as object
----------------
Imports:
- :code:`from aiogram.methods.revoke_chat_invite_link import RevokeChatInviteLink`
- alias: :code:`from aiogram.methods import RevokeChatInviteLink`
In handlers with current bot
----------------------------
.. code-block:: python
result: ChatInviteLink = await RevokeChatInviteLink(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block:: python
result: ChatInviteLink = await bot(RevokeChatInviteLink(...))
As reply into Webhook in handler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block:: python
return RevokeChatInviteLink(...)

View file

@ -1,73 +0,0 @@
# 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 thumbnails width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails cant be reused and can be only uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. |
| `caption` | `#!python3 Optional[str]` | Optional. Animation caption (may also be used when resending animation by file_id), 0-1024 characters after entities parsing |
| `parse_mode` | `#!python3 Optional[str]` | Optional. Mode for parsing entities in the animation caption. See formatting options for more details. |
| `disable_notification` | `#!python3 Optional[bool]` | Optional. Sends the message silently. Users will receive a notification with no sound. |
| `reply_to_message_id` | `#!python3 Optional[int]` | Optional. If the message is a reply, ID of the original message |
| `reply_markup` | `#!python3 Optional[Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]]` | Optional. Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user. |
## Response
Type: `#!python3 Message`
Description: On success, the sent Message is returned.
## Usage
### As bot method
```python3
result: Message = await bot.send_animation(...)
```
### Method as object
Imports:
- `from aiogram.methods import SendAnimation`
- `from aiogram.api.methods import SendAnimation`
- `from aiogram.api.methods.send_animation import SendAnimation`
#### In handlers with current bot
```python3
result: Message = await SendAnimation(...)
```
#### With specific bot
```python3
result: Message = await bot(SendAnimation(...))
```
#### As reply into Webhook in handler
```python3
return SendAnimation(...)
```
## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#sendanimation)
- [aiogram.types.ForceReply](../types/force_reply.md)
- [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md)
- [aiogram.types.InputFile](../types/input_file.md)
- [aiogram.types.Message](../types/message.md)
- [aiogram.types.ReplyKeyboardMarkup](../types/reply_keyboard_markup.md)
- [aiogram.types.ReplyKeyboardRemove](../types/reply_keyboard_remove.md)
- [How to upload file?](../upload_file.md)

View file

@ -0,0 +1,51 @@
#############
sendAnimation
#############
Returns: :obj:`Message`
.. automodule:: aiogram.methods.send_animation
:members:
:member-order: bysource
:undoc-members: True
Usage
=====
As bot method
-------------
.. code-block::
result: Message = await bot.send_animation(...)
Method as object
----------------
Imports:
- :code:`from aiogram.methods.send_animation import SendAnimation`
- alias: :code:`from aiogram.methods import SendAnimation`
In handlers with current bot
----------------------------
.. code-block:: python
result: Message = await SendAnimation(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block:: python
result: Message = await bot(SendAnimation(...))
As reply into Webhook in handler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block:: python
return SendAnimation(...)

View file

@ -1,75 +0,0 @@
# 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 after entities parsing |
| `parse_mode` | `#!python3 Optional[str]` | Optional. Mode for parsing entities in the audio caption. See formatting options for more details. |
| `duration` | `#!python3 Optional[int]` | Optional. Duration of the audio in seconds |
| `performer` | `#!python3 Optional[str]` | Optional. Performer |
| `title` | `#!python3 Optional[str]` | Optional. Track name |
| `thumb` | `#!python3 Optional[Union[InputFile, str]]` | Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnails width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails cant be reused and can be only uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. |
| `disable_notification` | `#!python3 Optional[bool]` | Optional. Sends the message silently. Users will receive a notification with no sound. |
| `reply_to_message_id` | `#!python3 Optional[int]` | Optional. If the message is a reply, ID of the original message |
| `reply_markup` | `#!python3 Optional[Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]]` | Optional. Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user. |
## Response
Type: `#!python3 Message`
Description: On success, the sent Message is returned.
## Usage
### As bot method
```python3
result: Message = await bot.send_audio(...)
```
### Method as object
Imports:
- `from aiogram.methods import SendAudio`
- `from aiogram.api.methods import SendAudio`
- `from aiogram.api.methods.send_audio import SendAudio`
#### In handlers with current bot
```python3
result: Message = await SendAudio(...)
```
#### With specific bot
```python3
result: Message = await bot(SendAudio(...))
```
#### As reply into Webhook in handler
```python3
return SendAudio(...)
```
## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#sendaudio)
- [aiogram.types.ForceReply](../types/force_reply.md)
- [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md)
- [aiogram.types.InputFile](../types/input_file.md)
- [aiogram.types.Message](../types/message.md)
- [aiogram.types.ReplyKeyboardMarkup](../types/reply_keyboard_markup.md)
- [aiogram.types.ReplyKeyboardRemove](../types/reply_keyboard_remove.md)
- [How to upload file?](../upload_file.md)

View file

@ -0,0 +1,51 @@
#########
sendAudio
#########
Returns: :obj:`Message`
.. automodule:: aiogram.methods.send_audio
:members:
:member-order: bysource
:undoc-members: True
Usage
=====
As bot method
-------------
.. code-block::
result: Message = await bot.send_audio(...)
Method as object
----------------
Imports:
- :code:`from aiogram.methods.send_audio import SendAudio`
- alias: :code:`from aiogram.methods import SendAudio`
In handlers with current bot
----------------------------
.. code-block:: python
result: Message = await SendAudio(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block:: python
result: Message = await bot(SendAudio(...))
As reply into Webhook in handler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block:: python
return SendAudio(...)

View file

@ -1,61 +0,0 @@
# 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
```python3
result: bool = await bot.send_chat_action(...)
```
### Method as object
Imports:
- `from aiogram.methods import SendChatAction`
- `from aiogram.api.methods import SendChatAction`
- `from aiogram.api.methods.send_chat_action import SendChatAction`
#### In handlers with current bot
```python3
result: bool = await SendChatAction(...)
```
#### With specific bot
```python3
result: bool = await bot(SendChatAction(...))
```
#### As reply into Webhook in handler
```python3
return SendChatAction(...)
```
## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#sendchataction)

View file

@ -0,0 +1,51 @@
##############
sendChatAction
##############
Returns: :obj:`bool`
.. automodule:: aiogram.methods.send_chat_action
:members:
:member-order: bysource
:undoc-members: True
Usage
=====
As bot method
-------------
.. code-block::
result: bool = await bot.send_chat_action(...)
Method as object
----------------
Imports:
- :code:`from aiogram.methods.send_chat_action import SendChatAction`
- alias: :code:`from aiogram.methods import SendChatAction`
In handlers with current bot
----------------------------
.. code-block:: python
result: bool = await SendChatAction(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block:: python
result: bool = await bot(SendChatAction(...))
As reply into Webhook in handler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block:: python
return SendChatAction(...)

View file

@ -1,68 +0,0 @@
# 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
```python3
result: Message = await bot.send_contact(...)
```
### Method as object
Imports:
- `from aiogram.methods import SendContact`
- `from aiogram.api.methods import SendContact`
- `from aiogram.api.methods.send_contact import SendContact`
#### In handlers with current bot
```python3
result: Message = await SendContact(...)
```
#### With specific bot
```python3
result: Message = await bot(SendContact(...))
```
#### As reply into Webhook in handler
```python3
return SendContact(...)
```
## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#sendcontact)
- [aiogram.types.ForceReply](../types/force_reply.md)
- [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md)
- [aiogram.types.Message](../types/message.md)
- [aiogram.types.ReplyKeyboardMarkup](../types/reply_keyboard_markup.md)
- [aiogram.types.ReplyKeyboardRemove](../types/reply_keyboard_remove.md)

View file

@ -0,0 +1,51 @@
###########
sendContact
###########
Returns: :obj:`Message`
.. automodule:: aiogram.methods.send_contact
:members:
:member-order: bysource
:undoc-members: True
Usage
=====
As bot method
-------------
.. code-block::
result: Message = await bot.send_contact(...)
Method as object
----------------
Imports:
- :code:`from aiogram.methods.send_contact import SendContact`
- alias: :code:`from aiogram.methods import SendContact`
In handlers with current bot
----------------------------
.. code-block:: python
result: Message = await SendContact(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block:: python
result: Message = await bot(SendContact(...))
As reply into Webhook in handler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block:: python
return SendContact(...)

View file

@ -1,65 +0,0 @@
# sendDice
## Description
Use this method to send a dice, which will have a random value from 1 to 6. On success, the sent Message is returned. (Yes, we're aware of the 'proper' singular of die. But it's awkward, and we decided to help it change. One dice at a time!)
## Arguments
| Name | Type | Description |
| - | - | - |
| `chat_id` | `#!python3 Union[int, str]` | Unique identifier for the target chat or username of the target channel (in the format @channelusername) |
| `emoji` | `#!python3 Optional[str]` | Optional. Emoji on which the dice throw animation is based. Currently, must be one of '' or ''. Defauts to '' |
| `disable_notification` | `#!python3 Optional[bool]` | Optional. Sends the message silently. Users will receive a notification with no sound. |
| `reply_to_message_id` | `#!python3 Optional[int]` | Optional. If the message is a reply, ID of the original message |
| `reply_markup` | `#!python3 Optional[Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]]` | Optional. Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user. |
## Response
Type: `#!python3 Message`
Description: On success, the sent Message is returned.
## Usage
### As bot method
```python3
result: Message = await bot.send_dice(...)
```
### Method as object
Imports:
- `from aiogram.methods import SendDice`
- `from aiogram.api.methods import SendDice`
- `from aiogram.api.methods.send_dice import SendDice`
#### In handlers with current bot
```python3
result: Message = await SendDice(...)
```
#### With specific bot
```python3
result: Message = await bot(SendDice(...))
```
#### As reply into Webhook in handler
```python3
return SendDice(...)
```
## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#senddice)
- [aiogram.types.ForceReply](../types/force_reply.md)
- [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md)
- [aiogram.types.Message](../types/message.md)
- [aiogram.types.ReplyKeyboardMarkup](../types/reply_keyboard_markup.md)
- [aiogram.types.ReplyKeyboardRemove](../types/reply_keyboard_remove.md)

View file

@ -0,0 +1,51 @@
########
sendDice
########
Returns: :obj:`Message`
.. automodule:: aiogram.methods.send_dice
:members:
:member-order: bysource
:undoc-members: True
Usage
=====
As bot method
-------------
.. code-block::
result: Message = await bot.send_dice(...)
Method as object
----------------
Imports:
- :code:`from aiogram.methods.send_dice import SendDice`
- alias: :code:`from aiogram.methods import SendDice`
In handlers with current bot
----------------------------
.. code-block:: python
result: Message = await SendDice(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block:: python
result: Message = await bot(SendDice(...))
As reply into Webhook in handler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block:: python
return SendDice(...)

View file

@ -1,70 +0,0 @@
# 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 thumbnails width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails cant be reused and can be only uploaded as a new file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. |
| `caption` | `#!python3 Optional[str]` | Optional. Document caption (may also be used when resending documents by file_id), 0-1024 characters after entities parsing |
| `parse_mode` | `#!python3 Optional[str]` | Optional. Mode for parsing entities in the document caption. See formatting options for more details. |
| `disable_notification` | `#!python3 Optional[bool]` | Optional. Sends the message silently. Users will receive a notification with no sound. |
| `reply_to_message_id` | `#!python3 Optional[int]` | Optional. If the message is a reply, ID of the original message |
| `reply_markup` | `#!python3 Optional[Union[InlineKeyboardMarkup, ReplyKeyboardMarkup, ReplyKeyboardRemove, ForceReply]]` | Optional. Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user. |
## Response
Type: `#!python3 Message`
Description: On success, the sent Message is returned.
## Usage
### As bot method
```python3
result: Message = await bot.send_document(...)
```
### Method as object
Imports:
- `from aiogram.methods import SendDocument`
- `from aiogram.api.methods import SendDocument`
- `from aiogram.api.methods.send_document import SendDocument`
#### In handlers with current bot
```python3
result: Message = await SendDocument(...)
```
#### With specific bot
```python3
result: Message = await bot(SendDocument(...))
```
#### As reply into Webhook in handler
```python3
return SendDocument(...)
```
## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#senddocument)
- [aiogram.types.ForceReply](../types/force_reply.md)
- [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md)
- [aiogram.types.InputFile](../types/input_file.md)
- [aiogram.types.Message](../types/message.md)
- [aiogram.types.ReplyKeyboardMarkup](../types/reply_keyboard_markup.md)
- [aiogram.types.ReplyKeyboardRemove](../types/reply_keyboard_remove.md)
- [How to upload file?](../upload_file.md)

View file

@ -0,0 +1,51 @@
############
sendDocument
############
Returns: :obj:`Message`
.. automodule:: aiogram.methods.send_document
:members:
:member-order: bysource
:undoc-members: True
Usage
=====
As bot method
-------------
.. code-block::
result: Message = await bot.send_document(...)
Method as object
----------------
Imports:
- :code:`from aiogram.methods.send_document import SendDocument`
- alias: :code:`from aiogram.methods import SendDocument`
In handlers with current bot
----------------------------
.. code-block:: python
result: Message = await SendDocument(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block:: python
result: Message = await bot(SendDocument(...))
As reply into Webhook in handler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block:: python
return SendDocument(...)

View file

@ -1,62 +0,0 @@
# 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
```python3
result: Message = await bot.send_game(...)
```
### Method as object
Imports:
- `from aiogram.methods import SendGame`
- `from aiogram.api.methods import SendGame`
- `from aiogram.api.methods.send_game import SendGame`
#### In handlers with current bot
```python3
result: Message = await SendGame(...)
```
#### With specific bot
```python3
result: Message = await bot(SendGame(...))
```
#### As reply into Webhook in handler
```python3
return 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)

View file

@ -0,0 +1,51 @@
########
sendGame
########
Returns: :obj:`Message`
.. automodule:: aiogram.methods.send_game
:members:
:member-order: bysource
:undoc-members: True
Usage
=====
As bot method
-------------
.. code-block::
result: Message = await bot.send_game(...)
Method as object
----------------
Imports:
- :code:`from aiogram.methods.send_game import SendGame`
- alias: :code:`from aiogram.methods import SendGame`
In handlers with current bot
----------------------------
.. code-block:: python
result: Message = await SendGame(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block:: python
result: Message = await bot(SendGame(...))
As reply into Webhook in handler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block:: python
return SendGame(...)

View file

@ -1,81 +0,0 @@
# 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 JSON-serialized 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
```python3
result: Message = await bot.send_invoice(...)
```
### Method as object
Imports:
- `from aiogram.methods import SendInvoice`
- `from aiogram.api.methods import SendInvoice`
- `from aiogram.api.methods.send_invoice import SendInvoice`
#### In handlers with current bot
```python3
result: Message = await SendInvoice(...)
```
#### With specific bot
```python3
result: Message = await bot(SendInvoice(...))
```
#### As reply into Webhook in handler
```python3
return SendInvoice(...)
```
## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#sendinvoice)
- [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md)
- [aiogram.types.LabeledPrice](../types/labeled_price.md)
- [aiogram.types.Message](../types/message.md)

View file

@ -0,0 +1,51 @@
###########
sendInvoice
###########
Returns: :obj:`Message`
.. automodule:: aiogram.methods.send_invoice
:members:
:member-order: bysource
:undoc-members: True
Usage
=====
As bot method
-------------
.. code-block::
result: Message = await bot.send_invoice(...)
Method as object
----------------
Imports:
- :code:`from aiogram.methods.send_invoice import SendInvoice`
- alias: :code:`from aiogram.methods import SendInvoice`
In handlers with current bot
----------------------------
.. code-block:: python
result: Message = await SendInvoice(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block:: python
result: Message = await bot(SendInvoice(...))
As reply into Webhook in handler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block:: python
return SendInvoice(...)

Some files were not shown because too many files have changed in this diff Show more