Update API

This commit is contained in:
Alex Root Junior 2021-01-24 20:54:38 +02:00
parent 5aeab63384
commit 915c84c742
363 changed files with 1510 additions and 2262 deletions

View file

@ -2,14 +2,11 @@
addStickerToSet
###############
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.
Returns: :obj:`bool`
.. automodule:: aiogram.methods.add_sticker_to_set
:members:
:member-order: bysource
:special-members: __init__
:undoc-members: True
@ -29,27 +26,26 @@ Method as object
Imports:
- :code:`from aiogram.methods import AddStickerToSet`
- :code:`from aiogram.methods import AddStickerToSet`
- :code:`from aiogram.methods.add_sticker_to_set import AddStickerToSet`
- alias: :code:`from aiogram.methods import AddStickerToSet`
In handlers with current bot
----------------------------
.. code-block::
.. code-block:: python
result: bool = await AddStickerToSet(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
result: bool = await bot(AddStickerToSet(...))
As reply into Webhook in handler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
return AddStickerToSet(...)

View file

@ -2,16 +2,11 @@
answerCallbackQuery
###################
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.
Returns: :obj:`bool`
.. automodule:: aiogram.methods.answer_callback_query
:members:
:member-order: bysource
:special-members: __init__
:undoc-members: True
@ -31,27 +26,26 @@ Method as object
Imports:
- :code:`from aiogram.methods import AnswerCallbackQuery`
- :code:`from aiogram.methods import AnswerCallbackQuery`
- :code:`from aiogram.methods.answer_callback_query import AnswerCallbackQuery`
- alias: :code:`from aiogram.methods import AnswerCallbackQuery`
In handlers with current bot
----------------------------
.. code-block::
.. code-block:: python
result: bool = await AnswerCallbackQuery(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
result: bool = await bot(AnswerCallbackQuery(...))
As reply into Webhook in handler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
return AnswerCallbackQuery(...)

View file

@ -2,16 +2,11 @@
answerInlineQuery
#################
Use this method to send answers to an inline query. On success, True is returned.
No more than 50 results per query are allowed.
Returns: :obj:`bool`
.. automodule:: aiogram.methods.answer_inline_query
:members:
:member-order: bysource
:special-members: __init__
:undoc-members: True
@ -31,27 +26,26 @@ Method as object
Imports:
- :code:`from aiogram.methods import AnswerInlineQuery`
- :code:`from aiogram.methods import AnswerInlineQuery`
- :code:`from aiogram.methods.answer_inline_query import AnswerInlineQuery`
- alias: :code:`from aiogram.methods import AnswerInlineQuery`
In handlers with current bot
----------------------------
.. code-block::
.. code-block:: python
result: bool = await AnswerInlineQuery(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
result: bool = await bot(AnswerInlineQuery(...))
As reply into Webhook in handler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
return AnswerInlineQuery(...)

View file

@ -2,14 +2,11 @@
answerPreCheckoutQuery
######################
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.
Returns: :obj:`bool`
.. automodule:: aiogram.methods.answer_pre_checkout_query
:members:
:member-order: bysource
:special-members: __init__
:undoc-members: True
@ -29,27 +26,26 @@ Method as object
Imports:
- :code:`from aiogram.methods import AnswerPreCheckoutQuery`
- :code:`from aiogram.methods import AnswerPreCheckoutQuery`
- :code:`from aiogram.methods.answer_pre_checkout_query import AnswerPreCheckoutQuery`
- alias: :code:`from aiogram.methods import AnswerPreCheckoutQuery`
In handlers with current bot
----------------------------
.. code-block::
.. code-block:: python
result: bool = await AnswerPreCheckoutQuery(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
result: bool = await bot(AnswerPreCheckoutQuery(...))
As reply into Webhook in handler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
return AnswerPreCheckoutQuery(...)

View file

@ -2,14 +2,11 @@
answerShippingQuery
###################
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.
Returns: :obj:`bool`
.. automodule:: aiogram.methods.answer_shipping_query
:members:
:member-order: bysource
:special-members: __init__
:undoc-members: True
@ -29,27 +26,26 @@ Method as object
Imports:
- :code:`from aiogram.methods import AnswerShippingQuery`
- :code:`from aiogram.methods import AnswerShippingQuery`
- :code:`from aiogram.methods.answer_shipping_query import AnswerShippingQuery`
- alias: :code:`from aiogram.methods import AnswerShippingQuery`
In handlers with current bot
----------------------------
.. code-block::
.. code-block:: python
result: bool = await AnswerShippingQuery(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
result: bool = await bot(AnswerShippingQuery(...))
As reply into Webhook in handler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block::
.. 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

@ -2,14 +2,11 @@
createNewStickerSet
###################
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.
Returns: :obj:`bool`
.. automodule:: aiogram.methods.create_new_sticker_set
:members:
:member-order: bysource
:special-members: __init__
:undoc-members: True
@ -29,27 +26,26 @@ Method as object
Imports:
- :code:`from aiogram.methods import CreateNewStickerSet`
- :code:`from aiogram.methods import CreateNewStickerSet`
- :code:`from aiogram.methods.create_new_sticker_set import CreateNewStickerSet`
- alias: :code:`from aiogram.methods import CreateNewStickerSet`
In handlers with current bot
----------------------------
.. code-block::
.. code-block:: python
result: bool = await CreateNewStickerSet(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
result: bool = await bot(CreateNewStickerSet(...))
As reply into Webhook in handler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
return CreateNewStickerSet(...)

View file

@ -2,14 +2,11 @@
deleteChatPhoto
###############
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.
Returns: :obj:`bool`
.. automodule:: aiogram.methods.delete_chat_photo
:members:
:member-order: bysource
:special-members: __init__
:undoc-members: True
@ -29,27 +26,26 @@ Method as object
Imports:
- :code:`from aiogram.methods import DeleteChatPhoto`
- :code:`from aiogram.methods import DeleteChatPhoto`
- :code:`from aiogram.methods.delete_chat_photo import DeleteChatPhoto`
- alias: :code:`from aiogram.methods import DeleteChatPhoto`
In handlers with current bot
----------------------------
.. code-block::
.. code-block:: python
result: bool = await DeleteChatPhoto(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
result: bool = await bot(DeleteChatPhoto(...))
As reply into Webhook in handler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
return DeleteChatPhoto(...)

View file

@ -2,14 +2,11 @@
deleteChatStickerSet
####################
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.
Returns: :obj:`bool`
.. automodule:: aiogram.methods.delete_chat_sticker_set
:members:
:member-order: bysource
:special-members: __init__
:undoc-members: True
@ -29,27 +26,26 @@ Method as object
Imports:
- :code:`from aiogram.methods import DeleteChatStickerSet`
- :code:`from aiogram.methods import DeleteChatStickerSet`
- :code:`from aiogram.methods.delete_chat_sticker_set import DeleteChatStickerSet`
- alias: :code:`from aiogram.methods import DeleteChatStickerSet`
In handlers with current bot
----------------------------
.. code-block::
.. code-block:: python
result: bool = await DeleteChatStickerSet(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
result: bool = await bot(DeleteChatStickerSet(...))
As reply into Webhook in handler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
return DeleteChatStickerSet(...)

View file

@ -2,30 +2,11 @@
deleteMessage
#############
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.
Returns: :obj:`bool`
.. automodule:: aiogram.methods.delete_message
:members:
:member-order: bysource
:special-members: __init__
:undoc-members: True
@ -45,27 +26,26 @@ Method as object
Imports:
- :code:`from aiogram.methods import DeleteMessage`
- :code:`from aiogram.methods import DeleteMessage`
- :code:`from aiogram.methods.delete_message import DeleteMessage`
- alias: :code:`from aiogram.methods import DeleteMessage`
In handlers with current bot
----------------------------
.. code-block::
.. code-block:: python
result: bool = await DeleteMessage(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
result: bool = await bot(DeleteMessage(...))
As reply into Webhook in handler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
return DeleteMessage(...)

View file

@ -2,14 +2,11 @@
deleteStickerFromSet
####################
Use this method to delete a sticker from a set created by the bot. Returns True on success.
Returns: :obj:`bool`
.. automodule:: aiogram.methods.delete_sticker_from_set
:members:
:member-order: bysource
:special-members: __init__
:undoc-members: True
@ -29,27 +26,26 @@ Method as object
Imports:
- :code:`from aiogram.methods import DeleteStickerFromSet`
- :code:`from aiogram.methods import DeleteStickerFromSet`
- :code:`from aiogram.methods.delete_sticker_from_set import DeleteStickerFromSet`
- alias: :code:`from aiogram.methods import DeleteStickerFromSet`
In handlers with current bot
----------------------------
.. code-block::
.. code-block:: python
result: bool = await DeleteStickerFromSet(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
result: bool = await bot(DeleteStickerFromSet(...))
As reply into Webhook in handler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
return DeleteStickerFromSet(...)

View file

@ -2,14 +2,11 @@
deleteWebhook
#############
Use this method to remove webhook integration if you decide to switch back to getUpdates. Returns True on success. Requires no parameters.
Returns: :obj:`bool`
.. automodule:: aiogram.methods.delete_webhook
:members:
:member-order: bysource
:special-members: __init__
:undoc-members: True
@ -29,27 +26,26 @@ Method as object
Imports:
- :code:`from aiogram.methods import DeleteWebhook`
- :code:`from aiogram.methods import DeleteWebhook`
- :code:`from aiogram.methods.delete_webhook import DeleteWebhook`
- alias: :code:`from aiogram.methods import DeleteWebhook`
In handlers with current bot
----------------------------
.. code-block::
.. code-block:: python
result: bool = await DeleteWebhook(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
result: bool = await bot(DeleteWebhook(...))
As reply into Webhook in handler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
return DeleteWebhook(...)

View file

@ -2,14 +2,11 @@
editMessageCaption
##################
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.
Returns: :obj:`Union[Message, bool]`
.. automodule:: aiogram.methods.edit_message_caption
:members:
:member-order: bysource
:special-members: __init__
:undoc-members: True
@ -29,27 +26,26 @@ Method as object
Imports:
- :code:`from aiogram.methods import EditMessageCaption`
- :code:`from aiogram.methods import EditMessageCaption`
- :code:`from aiogram.methods.edit_message_caption import EditMessageCaption`
- alias: :code:`from aiogram.methods import EditMessageCaption`
In handlers with current bot
----------------------------
.. code-block::
.. code-block:: python
result: Union[Message, bool] = await EditMessageCaption(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
result: Union[Message, bool] = await bot(EditMessageCaption(...))
As reply into Webhook in handler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
return EditMessageCaption(...)

View file

@ -2,14 +2,11 @@
editMessageLiveLocation
#######################
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.
Returns: :obj:`Union[Message, bool]`
.. automodule:: aiogram.methods.edit_message_live_location
:members:
:member-order: bysource
:special-members: __init__
:undoc-members: True
@ -29,27 +26,26 @@ Method as object
Imports:
- :code:`from aiogram.methods import EditMessageLiveLocation`
- :code:`from aiogram.methods import EditMessageLiveLocation`
- :code:`from aiogram.methods.edit_message_live_location import EditMessageLiveLocation`
- alias: :code:`from aiogram.methods import EditMessageLiveLocation`
In handlers with current bot
----------------------------
.. code-block::
.. code-block:: python
result: Union[Message, bool] = await EditMessageLiveLocation(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
result: Union[Message, bool] = await bot(EditMessageLiveLocation(...))
As reply into Webhook in handler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
return EditMessageLiveLocation(...)

View file

@ -2,14 +2,11 @@
editMessageMedia
################
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.
Returns: :obj:`Union[Message, bool]`
.. automodule:: aiogram.methods.edit_message_media
:members:
:member-order: bysource
:special-members: __init__
:undoc-members: True
@ -29,27 +26,26 @@ Method as object
Imports:
- :code:`from aiogram.methods import EditMessageMedia`
- :code:`from aiogram.methods import EditMessageMedia`
- :code:`from aiogram.methods.edit_message_media import EditMessageMedia`
- alias: :code:`from aiogram.methods import EditMessageMedia`
In handlers with current bot
----------------------------
.. code-block::
.. code-block:: python
result: Union[Message, bool] = await EditMessageMedia(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
result: Union[Message, bool] = await bot(EditMessageMedia(...))
As reply into Webhook in handler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
return EditMessageMedia(...)

View file

@ -2,14 +2,11 @@
editMessageReplyMarkup
######################
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.
Returns: :obj:`Union[Message, bool]`
.. automodule:: aiogram.methods.edit_message_reply_markup
:members:
:member-order: bysource
:special-members: __init__
:undoc-members: True
@ -29,27 +26,26 @@ Method as object
Imports:
- :code:`from aiogram.methods import EditMessageReplyMarkup`
- :code:`from aiogram.methods import EditMessageReplyMarkup`
- :code:`from aiogram.methods.edit_message_reply_markup import EditMessageReplyMarkup`
- alias: :code:`from aiogram.methods import EditMessageReplyMarkup`
In handlers with current bot
----------------------------
.. code-block::
.. code-block:: python
result: Union[Message, bool] = await EditMessageReplyMarkup(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
result: Union[Message, bool] = await bot(EditMessageReplyMarkup(...))
As reply into Webhook in handler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
return EditMessageReplyMarkup(...)

View file

@ -2,14 +2,11 @@
editMessageText
###############
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.
Returns: :obj:`Union[Message, bool]`
.. automodule:: aiogram.methods.edit_message_text
:members:
:member-order: bysource
:special-members: __init__
:undoc-members: True
@ -29,27 +26,26 @@ Method as object
Imports:
- :code:`from aiogram.methods import EditMessageText`
- :code:`from aiogram.methods import EditMessageText`
- :code:`from aiogram.methods.edit_message_text import EditMessageText`
- alias: :code:`from aiogram.methods import EditMessageText`
In handlers with current bot
----------------------------
.. code-block::
.. code-block:: python
result: Union[Message, bool] = await EditMessageText(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
result: Union[Message, bool] = await bot(EditMessageText(...))
As reply into Webhook in handler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
return EditMessageText(...)

View file

@ -2,16 +2,11 @@
exportChatInviteLink
####################
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.
Returns: :obj:`str`
.. automodule:: aiogram.methods.export_chat_invite_link
:members:
:member-order: bysource
:special-members: __init__
:undoc-members: True
@ -31,27 +26,26 @@ Method as object
Imports:
- :code:`from aiogram.methods import ExportChatInviteLink`
- :code:`from aiogram.methods import ExportChatInviteLink`
- :code:`from aiogram.methods.export_chat_invite_link import ExportChatInviteLink`
- alias: :code:`from aiogram.methods import ExportChatInviteLink`
In handlers with current bot
----------------------------
.. code-block::
.. code-block:: python
result: str = await ExportChatInviteLink(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
result: str = await bot(ExportChatInviteLink(...))
As reply into Webhook in handler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
return ExportChatInviteLink(...)

View file

@ -2,14 +2,11 @@
forwardMessage
##############
Use this method to forward messages of any kind. On success, the sent Message is returned.
Returns: :obj:`Message`
.. automodule:: aiogram.methods.forward_message
:members:
:member-order: bysource
:special-members: __init__
:undoc-members: True
@ -29,27 +26,26 @@ Method as object
Imports:
- :code:`from aiogram.methods import ForwardMessage`
- :code:`from aiogram.methods import ForwardMessage`
- :code:`from aiogram.methods.forward_message import ForwardMessage`
- alias: :code:`from aiogram.methods import ForwardMessage`
In handlers with current bot
----------------------------
.. code-block::
.. code-block:: python
result: Message = await ForwardMessage(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
result: Message = await bot(ForwardMessage(...))
As reply into Webhook in handler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
return ForwardMessage(...)

View file

@ -2,14 +2,11 @@
getChat
#######
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.
Returns: :obj:`Chat`
.. automodule:: aiogram.methods.get_chat
:members:
:member-order: bysource
:special-members: __init__
:undoc-members: True
@ -29,21 +26,20 @@ Method as object
Imports:
- :code:`from aiogram.methods import GetChat`
- :code:`from aiogram.methods import GetChat`
- :code:`from aiogram.methods.get_chat import GetChat`
- alias: :code:`from aiogram.methods import GetChat`
In handlers with current bot
----------------------------
.. code-block::
.. code-block:: python
result: Chat = await GetChat(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
result: Chat = await bot(GetChat(...))

View file

@ -2,14 +2,11 @@
getChatAdministrators
#####################
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.
Returns: :obj:`List[ChatMember]`
.. automodule:: aiogram.methods.get_chat_administrators
:members:
:member-order: bysource
:special-members: __init__
:undoc-members: True
@ -29,21 +26,20 @@ Method as object
Imports:
- :code:`from aiogram.methods import GetChatAdministrators`
- :code:`from aiogram.methods import GetChatAdministrators`
- :code:`from aiogram.methods.get_chat_administrators import GetChatAdministrators`
- alias: :code:`from aiogram.methods import GetChatAdministrators`
In handlers with current bot
----------------------------
.. code-block::
.. code-block:: python
result: List[ChatMember] = await GetChatAdministrators(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
result: List[ChatMember] = await bot(GetChatAdministrators(...))

View file

@ -2,14 +2,11 @@
getChatMember
#############
Use this method to get information about a member of a chat. Returns a ChatMember object on success.
Returns: :obj:`ChatMember`
.. automodule:: aiogram.methods.get_chat_member
:members:
:member-order: bysource
:special-members: __init__
:undoc-members: True
@ -29,21 +26,20 @@ Method as object
Imports:
- :code:`from aiogram.methods import GetChatMember`
- :code:`from aiogram.methods import GetChatMember`
- :code:`from aiogram.methods.get_chat_member import GetChatMember`
- alias: :code:`from aiogram.methods import GetChatMember`
In handlers with current bot
----------------------------
.. code-block::
.. code-block:: python
result: ChatMember = await GetChatMember(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
result: ChatMember = await bot(GetChatMember(...))

View file

@ -2,14 +2,11 @@
getChatMembersCount
###################
Use this method to get the number of members in a chat. Returns Int on success.
Returns: :obj:`int`
.. automodule:: aiogram.methods.get_chat_members_count
:members:
:member-order: bysource
:special-members: __init__
:undoc-members: True
@ -29,21 +26,20 @@ Method as object
Imports:
- :code:`from aiogram.methods import GetChatMembersCount`
- :code:`from aiogram.methods import GetChatMembersCount`
- :code:`from aiogram.methods.get_chat_members_count import GetChatMembersCount`
- alias: :code:`from aiogram.methods import GetChatMembersCount`
In handlers with current bot
----------------------------
.. code-block::
.. code-block:: python
result: int = await GetChatMembersCount(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
result: int = await bot(GetChatMembersCount(...))

View file

@ -2,16 +2,11 @@
getFile
#######
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.
Returns: :obj:`File`
.. automodule:: aiogram.methods.get_file
:members:
:member-order: bysource
:special-members: __init__
:undoc-members: True
@ -31,21 +26,20 @@ Method as object
Imports:
- :code:`from aiogram.methods import GetFile`
- :code:`from aiogram.methods import GetFile`
- :code:`from aiogram.methods.get_file import GetFile`
- alias: :code:`from aiogram.methods import GetFile`
In handlers with current bot
----------------------------
.. code-block::
.. code-block:: python
result: File = await GetFile(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
result: File = await bot(GetFile(...))

View file

@ -2,16 +2,11 @@
getGameHighScores
#################
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.
Returns: :obj:`List[GameHighScore]`
.. automodule:: aiogram.methods.get_game_high_scores
:members:
:member-order: bysource
:special-members: __init__
:undoc-members: True
@ -31,21 +26,20 @@ Method as object
Imports:
- :code:`from aiogram.methods import GetGameHighScores`
- :code:`from aiogram.methods import GetGameHighScores`
- :code:`from aiogram.methods.get_game_high_scores import GetGameHighScores`
- alias: :code:`from aiogram.methods import GetGameHighScores`
In handlers with current bot
----------------------------
.. code-block::
.. code-block:: python
result: List[GameHighScore] = await GetGameHighScores(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
result: List[GameHighScore] = await bot(GetGameHighScores(...))

View file

@ -2,14 +2,11 @@
getMe
#####
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.
Returns: :obj:`User`
.. automodule:: aiogram.methods.get_me
:members:
:member-order: bysource
:special-members: __init__
:undoc-members: True
@ -29,21 +26,20 @@ Method as object
Imports:
- :code:`from aiogram.methods import GetMe`
- :code:`from aiogram.methods import GetMe`
- :code:`from aiogram.methods.get_me import GetMe`
- alias: :code:`from aiogram.methods import GetMe`
In handlers with current bot
----------------------------
.. code-block::
.. code-block:: python
result: User = await GetMe(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
result: User = await bot(GetMe(...))

View file

@ -2,14 +2,11 @@
getMyCommands
#############
Use this method to get the current list of the bot's commands. Requires no parameters. Returns Array of BotCommand on success.
Returns: :obj:`List[BotCommand]`
.. automodule:: aiogram.methods.get_my_commands
:members:
:member-order: bysource
:special-members: __init__
:undoc-members: True
@ -29,21 +26,20 @@ Method as object
Imports:
- :code:`from aiogram.methods import GetMyCommands`
- :code:`from aiogram.methods import GetMyCommands`
- :code:`from aiogram.methods.get_my_commands import GetMyCommands`
- alias: :code:`from aiogram.methods import GetMyCommands`
In handlers with current bot
----------------------------
.. code-block::
.. code-block:: python
result: List[BotCommand] = await GetMyCommands(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
result: List[BotCommand] = await bot(GetMyCommands(...))

View file

@ -2,14 +2,11 @@
getStickerSet
#############
Use this method to get a sticker set. On success, a StickerSet object is returned.
Returns: :obj:`StickerSet`
.. automodule:: aiogram.methods.get_sticker_set
:members:
:member-order: bysource
:special-members: __init__
:undoc-members: True
@ -29,21 +26,20 @@ Method as object
Imports:
- :code:`from aiogram.methods import GetStickerSet`
- :code:`from aiogram.methods import GetStickerSet`
- :code:`from aiogram.methods.get_sticker_set import GetStickerSet`
- alias: :code:`from aiogram.methods import GetStickerSet`
In handlers with current bot
----------------------------
.. code-block::
.. code-block:: python
result: StickerSet = await GetStickerSet(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
result: StickerSet = await bot(GetStickerSet(...))

View file

@ -2,20 +2,11 @@
getUpdates
##########
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.
Returns: :obj:`List[Update]`
.. automodule:: aiogram.methods.get_updates
:members:
:member-order: bysource
:special-members: __init__
:undoc-members: True
@ -35,21 +26,20 @@ Method as object
Imports:
- :code:`from aiogram.methods import GetUpdates`
- :code:`from aiogram.methods import GetUpdates`
- :code:`from aiogram.methods.get_updates import GetUpdates`
- alias: :code:`from aiogram.methods import GetUpdates`
In handlers with current bot
----------------------------
.. code-block::
.. code-block:: python
result: List[Update] = await GetUpdates(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
result: List[Update] = await bot(GetUpdates(...))

View file

@ -2,14 +2,11 @@
getUserProfilePhotos
####################
Use this method to get a list of profile pictures for a user. Returns a UserProfilePhotos object.
Returns: :obj:`UserProfilePhotos`
.. automodule:: aiogram.methods.get_user_profile_photos
:members:
:member-order: bysource
:special-members: __init__
:undoc-members: True
@ -29,21 +26,20 @@ Method as object
Imports:
- :code:`from aiogram.methods import GetUserProfilePhotos`
- :code:`from aiogram.methods import GetUserProfilePhotos`
- :code:`from aiogram.methods.get_user_profile_photos import GetUserProfilePhotos`
- alias: :code:`from aiogram.methods import GetUserProfilePhotos`
In handlers with current bot
----------------------------
.. code-block::
.. code-block:: python
result: UserProfilePhotos = await GetUserProfilePhotos(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
result: UserProfilePhotos = await bot(GetUserProfilePhotos(...))

View file

@ -2,14 +2,11 @@
getWebhookInfo
##############
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.
Returns: :obj:`WebhookInfo`
.. automodule:: aiogram.methods.get_webhook_info
:members:
:member-order: bysource
:special-members: __init__
:undoc-members: True
@ -29,21 +26,20 @@ Method as object
Imports:
- :code:`from aiogram.methods import GetWebhookInfo`
- :code:`from aiogram.methods import GetWebhookInfo`
- :code:`from aiogram.methods.get_webhook_info import GetWebhookInfo`
- alias: :code:`from aiogram.methods import GetWebhookInfo`
In handlers with current bot
----------------------------
.. code-block::
.. code-block:: python
result: WebhookInfo = await GetWebhookInfo(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
result: WebhookInfo = await bot(GetWebhookInfo(...))

View file

@ -2,12 +2,8 @@
Methods
#######
All methods is wrapped as `pydantic <https://pydantic-docs.helpmanual.io/>`_ models
and placed in :mod:`aiogram.methods` package so that's mean all values which you pass
as arguments to the methods will be validated.
Here is list of all available API methods:
Here is all methods is classes and in due to Python standards all classes named in
upper camel case, for example methods :code:`sendMessage` has the name :code:`SendMessage`
Getting updates
@ -29,8 +25,11 @@ Available methods
:maxdepth: 1
get_me
log_out
close
send_message
forward_message
copy_message
send_photo
send_audio
send_document
@ -62,6 +61,7 @@ Available methods
set_chat_description
pin_chat_message
unpin_chat_message
unpin_all_chat_messages
leave_chat
get_chat
get_chat_administrators
@ -136,3 +136,4 @@ Games
send_game
set_game_score
get_game_high_scores

View file

@ -2,14 +2,11 @@
kickChatMember
##############
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.
Returns: :obj:`bool`
.. automodule:: aiogram.methods.kick_chat_member
:members:
:member-order: bysource
:special-members: __init__
:undoc-members: True
@ -29,27 +26,26 @@ Method as object
Imports:
- :code:`from aiogram.methods import KickChatMember`
- :code:`from aiogram.methods import KickChatMember`
- :code:`from aiogram.methods.kick_chat_member import KickChatMember`
- alias: :code:`from aiogram.methods import KickChatMember`
In handlers with current bot
----------------------------
.. code-block::
.. code-block:: python
result: bool = await KickChatMember(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
result: bool = await bot(KickChatMember(...))
As reply into Webhook in handler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
return KickChatMember(...)

View file

@ -2,14 +2,11 @@
leaveChat
#########
Use this method for your bot to leave a group, supergroup or channel. Returns True on success.
Returns: :obj:`bool`
.. automodule:: aiogram.methods.leave_chat
:members:
:member-order: bysource
:special-members: __init__
:undoc-members: True
@ -29,27 +26,26 @@ Method as object
Imports:
- :code:`from aiogram.methods import LeaveChat`
- :code:`from aiogram.methods import LeaveChat`
- :code:`from aiogram.methods.leave_chat import LeaveChat`
- alias: :code:`from aiogram.methods import LeaveChat`
In handlers with current bot
----------------------------
.. code-block::
.. code-block:: python
result: bool = await LeaveChat(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
result: bool = await bot(LeaveChat(...))
As reply into Webhook in handler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block::
.. 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

@ -2,14 +2,11 @@
pinChatMessage
##############
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.
Returns: :obj:`bool`
.. automodule:: aiogram.methods.pin_chat_message
:members:
:member-order: bysource
:special-members: __init__
:undoc-members: True
@ -29,27 +26,26 @@ Method as object
Imports:
- :code:`from aiogram.methods import PinChatMessage`
- :code:`from aiogram.methods import PinChatMessage`
- :code:`from aiogram.methods.pin_chat_message import PinChatMessage`
- alias: :code:`from aiogram.methods import PinChatMessage`
In handlers with current bot
----------------------------
.. code-block::
.. code-block:: python
result: bool = await PinChatMessage(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
result: bool = await bot(PinChatMessage(...))
As reply into Webhook in handler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
return PinChatMessage(...)

View file

@ -2,14 +2,11 @@
promoteChatMember
#################
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.
Returns: :obj:`bool`
.. automodule:: aiogram.methods.promote_chat_member
:members:
:member-order: bysource
:special-members: __init__
:undoc-members: True
@ -29,27 +26,26 @@ Method as object
Imports:
- :code:`from aiogram.methods import PromoteChatMember`
- :code:`from aiogram.methods import PromoteChatMember`
- :code:`from aiogram.methods.promote_chat_member import PromoteChatMember`
- alias: :code:`from aiogram.methods import PromoteChatMember`
In handlers with current bot
----------------------------
.. code-block::
.. code-block:: python
result: bool = await PromoteChatMember(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
result: bool = await bot(PromoteChatMember(...))
As reply into Webhook in handler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
return PromoteChatMember(...)

View file

@ -2,14 +2,11 @@
restrictChatMember
##################
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.
Returns: :obj:`bool`
.. automodule:: aiogram.methods.restrict_chat_member
:members:
:member-order: bysource
:special-members: __init__
:undoc-members: True
@ -29,27 +26,26 @@ Method as object
Imports:
- :code:`from aiogram.methods import RestrictChatMember`
- :code:`from aiogram.methods import RestrictChatMember`
- :code:`from aiogram.methods.restrict_chat_member import RestrictChatMember`
- alias: :code:`from aiogram.methods import RestrictChatMember`
In handlers with current bot
----------------------------
.. code-block::
.. code-block:: python
result: bool = await RestrictChatMember(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
result: bool = await bot(RestrictChatMember(...))
As reply into Webhook in handler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
return RestrictChatMember(...)

View file

@ -2,14 +2,11 @@
sendAnimation
#############
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.
Returns: :obj:`Message`
.. automodule:: aiogram.methods.send_animation
:members:
:member-order: bysource
:special-members: __init__
:undoc-members: True
@ -29,27 +26,26 @@ Method as object
Imports:
- :code:`from aiogram.methods import SendAnimation`
- :code:`from aiogram.methods import SendAnimation`
- :code:`from aiogram.methods.send_animation import SendAnimation`
- alias: :code:`from aiogram.methods import SendAnimation`
In handlers with current bot
----------------------------
.. code-block::
.. code-block:: python
result: Message = await SendAnimation(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
result: Message = await bot(SendAnimation(...))
As reply into Webhook in handler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
return SendAnimation(...)

View file

@ -2,16 +2,11 @@
sendAudio
#########
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.
Returns: :obj:`Message`
.. automodule:: aiogram.methods.send_audio
:members:
:member-order: bysource
:special-members: __init__
:undoc-members: True
@ -31,27 +26,26 @@ Method as object
Imports:
- :code:`from aiogram.methods import SendAudio`
- :code:`from aiogram.methods import SendAudio`
- :code:`from aiogram.methods.send_audio import SendAudio`
- alias: :code:`from aiogram.methods import SendAudio`
In handlers with current bot
----------------------------
.. code-block::
.. code-block:: python
result: Message = await SendAudio(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
result: Message = await bot(SendAudio(...))
As reply into Webhook in handler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
return SendAudio(...)

View file

@ -2,18 +2,11 @@
sendChatAction
##############
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.
Returns: :obj:`bool`
.. automodule:: aiogram.methods.send_chat_action
:members:
:member-order: bysource
:special-members: __init__
:undoc-members: True
@ -33,27 +26,26 @@ Method as object
Imports:
- :code:`from aiogram.methods import SendChatAction`
- :code:`from aiogram.methods import SendChatAction`
- :code:`from aiogram.methods.send_chat_action import SendChatAction`
- alias: :code:`from aiogram.methods import SendChatAction`
In handlers with current bot
----------------------------
.. code-block::
.. code-block:: python
result: bool = await SendChatAction(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
result: bool = await bot(SendChatAction(...))
As reply into Webhook in handler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
return SendChatAction(...)

View file

@ -2,14 +2,11 @@
sendContact
###########
Use this method to send phone contacts. On success, the sent Message is returned.
Returns: :obj:`Message`
.. automodule:: aiogram.methods.send_contact
:members:
:member-order: bysource
:special-members: __init__
:undoc-members: True
@ -29,27 +26,26 @@ Method as object
Imports:
- :code:`from aiogram.methods import SendContact`
- :code:`from aiogram.methods import SendContact`
- :code:`from aiogram.methods.send_contact import SendContact`
- alias: :code:`from aiogram.methods import SendContact`
In handlers with current bot
----------------------------
.. code-block::
.. code-block:: python
result: Message = await SendContact(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
result: Message = await bot(SendContact(...))
As reply into Webhook in handler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
return SendContact(...)

View file

@ -2,14 +2,11 @@
sendDice
########
Use this method to send an animated emoji that will display a random value. On success, the sent Message is returned.
Returns: :obj:`Message`
.. automodule:: aiogram.methods.send_dice
:members:
:member-order: bysource
:special-members: __init__
:undoc-members: True
@ -29,27 +26,26 @@ Method as object
Imports:
- :code:`from aiogram.methods import SendDice`
- :code:`from aiogram.methods import SendDice`
- :code:`from aiogram.methods.send_dice import SendDice`
- alias: :code:`from aiogram.methods import SendDice`
In handlers with current bot
----------------------------
.. code-block::
.. code-block:: python
result: Message = await SendDice(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
result: Message = await bot(SendDice(...))
As reply into Webhook in handler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
return SendDice(...)

View file

@ -2,14 +2,11 @@
sendDocument
############
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.
Returns: :obj:`Message`
.. automodule:: aiogram.methods.send_document
:members:
:member-order: bysource
:special-members: __init__
:undoc-members: True
@ -29,27 +26,26 @@ Method as object
Imports:
- :code:`from aiogram.methods import SendDocument`
- :code:`from aiogram.methods import SendDocument`
- :code:`from aiogram.methods.send_document import SendDocument`
- alias: :code:`from aiogram.methods import SendDocument`
In handlers with current bot
----------------------------
.. code-block::
.. code-block:: python
result: Message = await SendDocument(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
result: Message = await bot(SendDocument(...))
As reply into Webhook in handler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
return SendDocument(...)

View file

@ -2,14 +2,11 @@
sendGame
########
Use this method to send a game. On success, the sent Message is returned.
Returns: :obj:`Message`
.. automodule:: aiogram.methods.send_game
:members:
:member-order: bysource
:special-members: __init__
:undoc-members: True
@ -29,27 +26,26 @@ Method as object
Imports:
- :code:`from aiogram.methods import SendGame`
- :code:`from aiogram.methods import SendGame`
- :code:`from aiogram.methods.send_game import SendGame`
- alias: :code:`from aiogram.methods import SendGame`
In handlers with current bot
----------------------------
.. code-block::
.. code-block:: python
result: Message = await SendGame(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
result: Message = await bot(SendGame(...))
As reply into Webhook in handler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
return SendGame(...)

View file

@ -2,14 +2,11 @@
sendInvoice
###########
Use this method to send invoices. On success, the sent Message is returned.
Returns: :obj:`Message`
.. automodule:: aiogram.methods.send_invoice
:members:
:member-order: bysource
:special-members: __init__
:undoc-members: True
@ -29,27 +26,26 @@ Method as object
Imports:
- :code:`from aiogram.methods import SendInvoice`
- :code:`from aiogram.methods import SendInvoice`
- :code:`from aiogram.methods.send_invoice import SendInvoice`
- alias: :code:`from aiogram.methods import SendInvoice`
In handlers with current bot
----------------------------
.. code-block::
.. code-block:: python
result: Message = await SendInvoice(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
result: Message = await bot(SendInvoice(...))
As reply into Webhook in handler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
return SendInvoice(...)

View file

@ -2,14 +2,11 @@
sendLocation
############
Use this method to send point on the map. On success, the sent Message is returned.
Returns: :obj:`Message`
.. automodule:: aiogram.methods.send_location
:members:
:member-order: bysource
:special-members: __init__
:undoc-members: True
@ -29,27 +26,26 @@ Method as object
Imports:
- :code:`from aiogram.methods import SendLocation`
- :code:`from aiogram.methods import SendLocation`
- :code:`from aiogram.methods.send_location import SendLocation`
- alias: :code:`from aiogram.methods import SendLocation`
In handlers with current bot
----------------------------
.. code-block::
.. code-block:: python
result: Message = await SendLocation(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
result: Message = await bot(SendLocation(...))
As reply into Webhook in handler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
return SendLocation(...)

View file

@ -2,14 +2,11 @@
sendMediaGroup
##############
Use this method to send a group of photos or videos as an album. On success, an array of the sent Messages is returned.
Returns: :obj:`List[Message]`
.. automodule:: aiogram.methods.send_media_group
:members:
:member-order: bysource
:special-members: __init__
:undoc-members: True
@ -29,27 +26,26 @@ Method as object
Imports:
- :code:`from aiogram.methods import SendMediaGroup`
- :code:`from aiogram.methods import SendMediaGroup`
- :code:`from aiogram.methods.send_media_group import SendMediaGroup`
- alias: :code:`from aiogram.methods import SendMediaGroup`
In handlers with current bot
----------------------------
.. code-block::
.. code-block:: python
result: List[Message] = await SendMediaGroup(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
result: List[Message] = await bot(SendMediaGroup(...))
As reply into Webhook in handler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
return SendMediaGroup(...)

View file

@ -2,14 +2,11 @@
sendMessage
###########
Use this method to send text messages. On success, the sent Message is returned.
Returns: :obj:`Message`
.. automodule:: aiogram.methods.send_message
:members:
:member-order: bysource
:special-members: __init__
:undoc-members: True
@ -29,27 +26,26 @@ Method as object
Imports:
- :code:`from aiogram.methods import SendMessage`
- :code:`from aiogram.methods import SendMessage`
- :code:`from aiogram.methods.send_message import SendMessage`
- alias: :code:`from aiogram.methods import SendMessage`
In handlers with current bot
----------------------------
.. code-block::
.. code-block:: python
result: Message = await SendMessage(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
result: Message = await bot(SendMessage(...))
As reply into Webhook in handler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
return SendMessage(...)

View file

@ -2,14 +2,11 @@
sendPhoto
#########
Use this method to send photos. On success, the sent Message is returned.
Returns: :obj:`Message`
.. automodule:: aiogram.methods.send_photo
:members:
:member-order: bysource
:special-members: __init__
:undoc-members: True
@ -29,27 +26,26 @@ Method as object
Imports:
- :code:`from aiogram.methods import SendPhoto`
- :code:`from aiogram.methods import SendPhoto`
- :code:`from aiogram.methods.send_photo import SendPhoto`
- alias: :code:`from aiogram.methods import SendPhoto`
In handlers with current bot
----------------------------
.. code-block::
.. code-block:: python
result: Message = await SendPhoto(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
result: Message = await bot(SendPhoto(...))
As reply into Webhook in handler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
return SendPhoto(...)

View file

@ -2,14 +2,11 @@
sendPoll
########
Use this method to send a native poll. On success, the sent Message is returned.
Returns: :obj:`Message`
.. automodule:: aiogram.methods.send_poll
:members:
:member-order: bysource
:special-members: __init__
:undoc-members: True
@ -29,27 +26,26 @@ Method as object
Imports:
- :code:`from aiogram.methods import SendPoll`
- :code:`from aiogram.methods import SendPoll`
- :code:`from aiogram.methods.send_poll import SendPoll`
- alias: :code:`from aiogram.methods import SendPoll`
In handlers with current bot
----------------------------
.. code-block::
.. code-block:: python
result: Message = await SendPoll(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
result: Message = await bot(SendPoll(...))
As reply into Webhook in handler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
return SendPoll(...)

View file

@ -2,14 +2,11 @@
sendSticker
###########
Use this method to send static .WEBP or animated .TGS stickers. On success, the sent Message is returned.
Returns: :obj:`Message`
.. automodule:: aiogram.methods.send_sticker
:members:
:member-order: bysource
:special-members: __init__
:undoc-members: True
@ -29,27 +26,26 @@ Method as object
Imports:
- :code:`from aiogram.methods import SendSticker`
- :code:`from aiogram.methods import SendSticker`
- :code:`from aiogram.methods.send_sticker import SendSticker`
- alias: :code:`from aiogram.methods import SendSticker`
In handlers with current bot
----------------------------
.. code-block::
.. code-block:: python
result: Message = await SendSticker(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
result: Message = await bot(SendSticker(...))
As reply into Webhook in handler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
return SendSticker(...)

View file

@ -2,14 +2,11 @@
sendVenue
#########
Use this method to send information about a venue. On success, the sent Message is returned.
Returns: :obj:`Message`
.. automodule:: aiogram.methods.send_venue
:members:
:member-order: bysource
:special-members: __init__
:undoc-members: True
@ -29,27 +26,26 @@ Method as object
Imports:
- :code:`from aiogram.methods import SendVenue`
- :code:`from aiogram.methods import SendVenue`
- :code:`from aiogram.methods.send_venue import SendVenue`
- alias: :code:`from aiogram.methods import SendVenue`
In handlers with current bot
----------------------------
.. code-block::
.. code-block:: python
result: Message = await SendVenue(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
result: Message = await bot(SendVenue(...))
As reply into Webhook in handler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
return SendVenue(...)

View file

@ -2,14 +2,11 @@
sendVideo
#########
Use this method to send video files, Telegram clients support mp4 videos (other formats may be sent as Document). On success, the sent Message is returned. Bots can currently send video files of up to 50 MB in size, this limit may be changed in the future.
Returns: :obj:`Message`
.. automodule:: aiogram.methods.send_video
:members:
:member-order: bysource
:special-members: __init__
:undoc-members: True
@ -29,27 +26,26 @@ Method as object
Imports:
- :code:`from aiogram.methods import SendVideo`
- :code:`from aiogram.methods import SendVideo`
- :code:`from aiogram.methods.send_video import SendVideo`
- alias: :code:`from aiogram.methods import SendVideo`
In handlers with current bot
----------------------------
.. code-block::
.. code-block:: python
result: Message = await SendVideo(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
result: Message = await bot(SendVideo(...))
As reply into Webhook in handler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
return SendVideo(...)

View file

@ -2,14 +2,11 @@
sendVideoNote
#############
As of v.4.0, Telegram clients support rounded square mp4 videos of up to 1 minute long. Use this method to send video messages. On success, the sent Message is returned.
Returns: :obj:`Message`
.. automodule:: aiogram.methods.send_video_note
:members:
:member-order: bysource
:special-members: __init__
:undoc-members: True
@ -29,27 +26,26 @@ Method as object
Imports:
- :code:`from aiogram.methods import SendVideoNote`
- :code:`from aiogram.methods import SendVideoNote`
- :code:`from aiogram.methods.send_video_note import SendVideoNote`
- alias: :code:`from aiogram.methods import SendVideoNote`
In handlers with current bot
----------------------------
.. code-block::
.. code-block:: python
result: Message = await SendVideoNote(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
result: Message = await bot(SendVideoNote(...))
As reply into Webhook in handler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
return SendVideoNote(...)

View file

@ -2,14 +2,11 @@
sendVoice
#########
Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .OGG file encoded with OPUS (other formats may be sent as Audio or Document). On success, the sent Message is returned. Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future.
Returns: :obj:`Message`
.. automodule:: aiogram.methods.send_voice
:members:
:member-order: bysource
:special-members: __init__
:undoc-members: True
@ -29,27 +26,26 @@ Method as object
Imports:
- :code:`from aiogram.methods import SendVoice`
- :code:`from aiogram.methods import SendVoice`
- :code:`from aiogram.methods.send_voice import SendVoice`
- alias: :code:`from aiogram.methods import SendVoice`
In handlers with current bot
----------------------------
.. code-block::
.. code-block:: python
result: Message = await SendVoice(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
result: Message = await bot(SendVoice(...))
As reply into Webhook in handler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
return SendVoice(...)

View file

@ -2,14 +2,11 @@
setChatAdministratorCustomTitle
###############################
Use this method to set a custom title for an administrator in a supergroup promoted by the bot. Returns True on success.
Returns: :obj:`bool`
.. automodule:: aiogram.methods.set_chat_administrator_custom_title
:members:
:member-order: bysource
:special-members: __init__
:undoc-members: True
@ -29,27 +26,26 @@ Method as object
Imports:
- :code:`from aiogram.methods import SetChatAdministratorCustomTitle`
- :code:`from aiogram.methods import SetChatAdministratorCustomTitle`
- :code:`from aiogram.methods.set_chat_administrator_custom_title import SetChatAdministratorCustomTitle`
- alias: :code:`from aiogram.methods import SetChatAdministratorCustomTitle`
In handlers with current bot
----------------------------
.. code-block::
.. code-block:: python
result: bool = await SetChatAdministratorCustomTitle(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
result: bool = await bot(SetChatAdministratorCustomTitle(...))
As reply into Webhook in handler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
return SetChatAdministratorCustomTitle(...)

View file

@ -2,14 +2,11 @@
setChatDescription
##################
Use this method to change the description of a group, a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Returns True on success.
Returns: :obj:`bool`
.. automodule:: aiogram.methods.set_chat_description
:members:
:member-order: bysource
:special-members: __init__
:undoc-members: True
@ -29,27 +26,26 @@ Method as object
Imports:
- :code:`from aiogram.methods import SetChatDescription`
- :code:`from aiogram.methods import SetChatDescription`
- :code:`from aiogram.methods.set_chat_description import SetChatDescription`
- alias: :code:`from aiogram.methods import SetChatDescription`
In handlers with current bot
----------------------------
.. code-block::
.. code-block:: python
result: bool = await SetChatDescription(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
result: bool = await bot(SetChatDescription(...))
As reply into Webhook in handler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
return SetChatDescription(...)

View file

@ -2,14 +2,11 @@
setChatPermissions
##################
Use this method to set default chat permissions for all members. The bot must be an administrator in the group or a supergroup for this to work and must have the can_restrict_members admin rights. Returns True on success.
Returns: :obj:`bool`
.. automodule:: aiogram.methods.set_chat_permissions
:members:
:member-order: bysource
:special-members: __init__
:undoc-members: True
@ -29,27 +26,26 @@ Method as object
Imports:
- :code:`from aiogram.methods import SetChatPermissions`
- :code:`from aiogram.methods import SetChatPermissions`
- :code:`from aiogram.methods.set_chat_permissions import SetChatPermissions`
- alias: :code:`from aiogram.methods import SetChatPermissions`
In handlers with current bot
----------------------------
.. code-block::
.. code-block:: python
result: bool = await SetChatPermissions(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
result: bool = await bot(SetChatPermissions(...))
As reply into Webhook in handler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
return SetChatPermissions(...)

View file

@ -2,14 +2,11 @@
setChatPhoto
############
Use this method to set a new profile photo for the chat. Photos can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Returns True on success.
Returns: :obj:`bool`
.. automodule:: aiogram.methods.set_chat_photo
:members:
:member-order: bysource
:special-members: __init__
:undoc-members: True
@ -29,21 +26,20 @@ Method as object
Imports:
- :code:`from aiogram.methods import SetChatPhoto`
- :code:`from aiogram.methods import SetChatPhoto`
- :code:`from aiogram.methods.set_chat_photo import SetChatPhoto`
- alias: :code:`from aiogram.methods import SetChatPhoto`
In handlers with current bot
----------------------------
.. code-block::
.. code-block:: python
result: bool = await SetChatPhoto(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
result: bool = await bot(SetChatPhoto(...))

View file

@ -2,14 +2,11 @@
setChatStickerSet
#################
Use this method to set a new group sticker set for a supergroup. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Use the field can_set_sticker_set optionally returned in getChat requests to check if the bot can use this method. Returns True on success.
Returns: :obj:`bool`
.. automodule:: aiogram.methods.set_chat_sticker_set
:members:
:member-order: bysource
:special-members: __init__
:undoc-members: True
@ -29,27 +26,26 @@ Method as object
Imports:
- :code:`from aiogram.methods import SetChatStickerSet`
- :code:`from aiogram.methods import SetChatStickerSet`
- :code:`from aiogram.methods.set_chat_sticker_set import SetChatStickerSet`
- alias: :code:`from aiogram.methods import SetChatStickerSet`
In handlers with current bot
----------------------------
.. code-block::
.. code-block:: python
result: bool = await SetChatStickerSet(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
result: bool = await bot(SetChatStickerSet(...))
As reply into Webhook in handler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
return SetChatStickerSet(...)

View file

@ -2,14 +2,11 @@
setChatTitle
############
Use this method to change the title of a chat. Titles can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Returns True on success.
Returns: :obj:`bool`
.. automodule:: aiogram.methods.set_chat_title
:members:
:member-order: bysource
:special-members: __init__
:undoc-members: True
@ -29,27 +26,26 @@ Method as object
Imports:
- :code:`from aiogram.methods import SetChatTitle`
- :code:`from aiogram.methods import SetChatTitle`
- :code:`from aiogram.methods.set_chat_title import SetChatTitle`
- alias: :code:`from aiogram.methods import SetChatTitle`
In handlers with current bot
----------------------------
.. code-block::
.. code-block:: python
result: bool = await SetChatTitle(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
result: bool = await bot(SetChatTitle(...))
As reply into Webhook in handler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
return SetChatTitle(...)

View file

@ -2,14 +2,11 @@
setGameScore
############
Use this method to set the score of the specified user in a game. On success, if the message was sent by the bot, returns the edited Message, otherwise returns True. Returns an error, if the new score is not greater than the user's current score in the chat and force is False.
Returns: :obj:`Union[Message, bool]`
.. automodule:: aiogram.methods.set_game_score
:members:
:member-order: bysource
:special-members: __init__
:undoc-members: True
@ -29,27 +26,26 @@ Method as object
Imports:
- :code:`from aiogram.methods import SetGameScore`
- :code:`from aiogram.methods import SetGameScore`
- :code:`from aiogram.methods.set_game_score import SetGameScore`
- alias: :code:`from aiogram.methods import SetGameScore`
In handlers with current bot
----------------------------
.. code-block::
.. code-block:: python
result: Union[Message, bool] = await SetGameScore(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
result: Union[Message, bool] = await bot(SetGameScore(...))
As reply into Webhook in handler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
return SetGameScore(...)

View file

@ -2,14 +2,11 @@
setMyCommands
#############
Use this method to change the list of the bot's commands. Returns True on success.
Returns: :obj:`bool`
.. automodule:: aiogram.methods.set_my_commands
:members:
:member-order: bysource
:special-members: __init__
:undoc-members: True
@ -29,27 +26,26 @@ Method as object
Imports:
- :code:`from aiogram.methods import SetMyCommands`
- :code:`from aiogram.methods import SetMyCommands`
- :code:`from aiogram.methods.set_my_commands import SetMyCommands`
- alias: :code:`from aiogram.methods import SetMyCommands`
In handlers with current bot
----------------------------
.. code-block::
.. code-block:: python
result: bool = await SetMyCommands(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
result: bool = await bot(SetMyCommands(...))
As reply into Webhook in handler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
return SetMyCommands(...)

View file

@ -2,16 +2,11 @@
setPassportDataErrors
#####################
Informs a user that some of the Telegram Passport elements they provided contains errors. The user will not be able to re-submit their Passport to you until the errors are fixed (the contents of the field for which you returned the error must change). Returns True on success.
Use this if the data submitted by the user doesn't satisfy the standards your service requires for any reason. For example, if a birthday date seems invalid, a submitted document is blurry, a scan shows evidence of tampering, etc. Supply some details in the error message to make sure the user knows how to correct the issues.
Returns: :obj:`bool`
.. automodule:: aiogram.methods.set_passport_data_errors
:members:
:member-order: bysource
:special-members: __init__
:undoc-members: True
@ -31,27 +26,26 @@ Method as object
Imports:
- :code:`from aiogram.methods import SetPassportDataErrors`
- :code:`from aiogram.methods import SetPassportDataErrors`
- :code:`from aiogram.methods.set_passport_data_errors import SetPassportDataErrors`
- alias: :code:`from aiogram.methods import SetPassportDataErrors`
In handlers with current bot
----------------------------
.. code-block::
.. code-block:: python
result: bool = await SetPassportDataErrors(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
result: bool = await bot(SetPassportDataErrors(...))
As reply into Webhook in handler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
return SetPassportDataErrors(...)

View file

@ -2,14 +2,11 @@
setStickerPositionInSet
#######################
Use this method to move a sticker in a set created by the bot to a specific position. Returns True on success.
Returns: :obj:`bool`
.. automodule:: aiogram.methods.set_sticker_position_in_set
:members:
:member-order: bysource
:special-members: __init__
:undoc-members: True
@ -29,27 +26,26 @@ Method as object
Imports:
- :code:`from aiogram.methods import SetStickerPositionInSet`
- :code:`from aiogram.methods import SetStickerPositionInSet`
- :code:`from aiogram.methods.set_sticker_position_in_set import SetStickerPositionInSet`
- alias: :code:`from aiogram.methods import SetStickerPositionInSet`
In handlers with current bot
----------------------------
.. code-block::
.. code-block:: python
result: bool = await SetStickerPositionInSet(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
result: bool = await bot(SetStickerPositionInSet(...))
As reply into Webhook in handler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
return SetStickerPositionInSet(...)

View file

@ -2,14 +2,11 @@
setStickerSetThumb
##################
Use this method to set the thumbnail of a sticker set. Animated thumbnails can be set for animated sticker sets only. Returns True on success.
Returns: :obj:`bool`
.. automodule:: aiogram.methods.set_sticker_set_thumb
:members:
:member-order: bysource
:special-members: __init__
:undoc-members: True
@ -29,27 +26,26 @@ Method as object
Imports:
- :code:`from aiogram.methods import SetStickerSetThumb`
- :code:`from aiogram.methods import SetStickerSetThumb`
- :code:`from aiogram.methods.set_sticker_set_thumb import SetStickerSetThumb`
- alias: :code:`from aiogram.methods import SetStickerSetThumb`
In handlers with current bot
----------------------------
.. code-block::
.. code-block:: python
result: bool = await SetStickerSetThumb(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
result: bool = await bot(SetStickerSetThumb(...))
As reply into Webhook in handler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
return SetStickerSetThumb(...)

View file

@ -2,26 +2,11 @@
setWebhook
##########
Use this method to specify a url and receive incoming updates via an outgoing webhook. Whenever there is an update for the bot, we will send an HTTPS POST request to the specified url, containing a JSON-serialized Update. In case of an unsuccessful request, we will give up after a reasonable amount of attempts. Returns True on success.
If you'd like to make sure that the Webhook request comes from Telegram, we recommend using a secret path in the URL, e.g. https://www.example.com/<token>. Since nobody else knows your bot's token, you can be pretty sure it's us.
Notes
1. You will not be able to receive updates using getUpdates for as long as an outgoing webhook is set up.
2. To use a self-signed certificate, you need to upload your public key certificate using certificate parameter. Please upload as InputFile, sending a String will not work.
3. Ports currently supported for Webhooks: 443, 80, 88, 8443.
NEW! If you're having any trouble setting up webhooks, please check out this amazing guide to Webhooks.
Returns: :obj:`bool`
.. automodule:: aiogram.methods.set_webhook
:members:
:member-order: bysource
:special-members: __init__
:undoc-members: True
@ -41,27 +26,26 @@ Method as object
Imports:
- :code:`from aiogram.methods import SetWebhook`
- :code:`from aiogram.methods import SetWebhook`
- :code:`from aiogram.methods.set_webhook import SetWebhook`
- alias: :code:`from aiogram.methods import SetWebhook`
In handlers with current bot
----------------------------
.. code-block::
.. code-block:: python
result: bool = await SetWebhook(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
result: bool = await bot(SetWebhook(...))
As reply into Webhook in handler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
return SetWebhook(...)

View file

@ -2,14 +2,11 @@
stopMessageLiveLocation
#######################
Use this method to stop updating a live location message before live_period expires. On success, if the message was sent by the bot, the sent Message is returned, otherwise True is returned.
Returns: :obj:`Union[Message, bool]`
.. automodule:: aiogram.methods.stop_message_live_location
:members:
:member-order: bysource
:special-members: __init__
:undoc-members: True
@ -29,27 +26,26 @@ Method as object
Imports:
- :code:`from aiogram.methods import StopMessageLiveLocation`
- :code:`from aiogram.methods import StopMessageLiveLocation`
- :code:`from aiogram.methods.stop_message_live_location import StopMessageLiveLocation`
- alias: :code:`from aiogram.methods import StopMessageLiveLocation`
In handlers with current bot
----------------------------
.. code-block::
.. code-block:: python
result: Union[Message, bool] = await StopMessageLiveLocation(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
result: Union[Message, bool] = await bot(StopMessageLiveLocation(...))
As reply into Webhook in handler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
return StopMessageLiveLocation(...)

View file

@ -2,14 +2,11 @@
stopPoll
########
Use this method to stop a poll which was sent by the bot. On success, the stopped Poll with the final results is returned.
Returns: :obj:`Poll`
.. automodule:: aiogram.methods.stop_poll
:members:
:member-order: bysource
:special-members: __init__
:undoc-members: True
@ -29,27 +26,26 @@ Method as object
Imports:
- :code:`from aiogram.methods import StopPoll`
- :code:`from aiogram.methods import StopPoll`
- :code:`from aiogram.methods.stop_poll import StopPoll`
- alias: :code:`from aiogram.methods import StopPoll`
In handlers with current bot
----------------------------
.. code-block::
.. code-block:: python
result: Poll = await StopPoll(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
result: Poll = await bot(StopPoll(...))
As reply into Webhook in handler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
return StopPoll(...)

View file

@ -2,14 +2,11 @@
unbanChatMember
###############
Use this method to unban a previously kicked user in a supergroup or channel. The user will not return to the group or channel automatically, but will be able to join via link, etc. The bot must be an administrator for this to work. Returns True on success.
Returns: :obj:`bool`
.. automodule:: aiogram.methods.unban_chat_member
:members:
:member-order: bysource
:special-members: __init__
:undoc-members: True
@ -29,27 +26,26 @@ Method as object
Imports:
- :code:`from aiogram.methods import UnbanChatMember`
- :code:`from aiogram.methods import UnbanChatMember`
- :code:`from aiogram.methods.unban_chat_member import UnbanChatMember`
- alias: :code:`from aiogram.methods import UnbanChatMember`
In handlers with current bot
----------------------------
.. code-block::
.. code-block:: python
result: bool = await UnbanChatMember(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
result: bool = await bot(UnbanChatMember(...))
As reply into Webhook in handler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
return UnbanChatMember(...)

View file

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

View file

@ -2,14 +2,11 @@
unpinChatMessage
################
Use this method to unpin a message in a group, a supergroup, or a channel. The bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' admin right in the supergroup or 'can_edit_messages' admin right in the channel. Returns True on success.
Returns: :obj:`bool`
.. automodule:: aiogram.methods.unpin_chat_message
:members:
:member-order: bysource
:special-members: __init__
:undoc-members: True
@ -29,27 +26,26 @@ Method as object
Imports:
- :code:`from aiogram.methods import UnpinChatMessage`
- :code:`from aiogram.methods import UnpinChatMessage`
- :code:`from aiogram.methods.unpin_chat_message import UnpinChatMessage`
- alias: :code:`from aiogram.methods import UnpinChatMessage`
In handlers with current bot
----------------------------
.. code-block::
.. code-block:: python
result: bool = await UnpinChatMessage(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
result: bool = await bot(UnpinChatMessage(...))
As reply into Webhook in handler
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
return UnpinChatMessage(...)

View file

@ -2,14 +2,11 @@
uploadStickerFile
#################
Use this method to upload a .PNG file with a sticker for later use in createNewStickerSet and addStickerToSet methods (can be used multiple times). Returns the uploaded File on success.
Returns: :obj:`File`
.. automodule:: aiogram.methods.upload_sticker_file
:members:
:member-order: bysource
:special-members: __init__
:undoc-members: True
@ -29,21 +26,20 @@ Method as object
Imports:
- :code:`from aiogram.methods import UploadStickerFile`
- :code:`from aiogram.methods import UploadStickerFile`
- :code:`from aiogram.methods.upload_sticker_file import UploadStickerFile`
- alias: :code:`from aiogram.methods import UploadStickerFile`
In handlers with current bot
----------------------------
.. code-block::
.. code-block:: python
result: File = await UploadStickerFile(...)
With specific bot
~~~~~~~~~~~~~~~~~
.. code-block::
.. code-block:: python
result: File = await bot(UploadStickerFile(...))