[3.0] Bot API 5.1 + FSM + Utils (#525)

* Regenerate corresponding to Bot API 5.1

* Added base of FSM. Markup constructor and small refactoring

* Fix dependencies

* Fix mypy windows error

* Move StatesGroup.get_root() from meta to class

* Fixed chat and user constraints

* Update pipeline

* Remove docs pipeline

* Added GLOBAL_USER FSM strategy

* Reformat code

* Fixed Dispatcher._process_update

* Bump Bot API 5.2. Added integration with MagicFilter

* Coverage
This commit is contained in:
Alex Root Junior 2021-05-11 23:04:32 +03:00 committed by GitHub
parent a6f824a117
commit 0e72d8e65b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
265 changed files with 2921 additions and 1324 deletions

View file

@ -48,4 +48,4 @@ As reply into Webhook in handler
.. code-block:: python
return AddStickerToSet(...)
return AddStickerToSet(...)

View file

@ -48,4 +48,4 @@ As reply into Webhook in handler
.. code-block:: python
return AnswerCallbackQuery(...)
return AnswerCallbackQuery(...)

View file

@ -48,4 +48,4 @@ As reply into Webhook in handler
.. code-block:: python
return AnswerInlineQuery(...)
return AnswerInlineQuery(...)

View file

@ -48,4 +48,4 @@ As reply into Webhook in handler
.. code-block:: python
return AnswerPreCheckoutQuery(...)
return AnswerPreCheckoutQuery(...)

View file

@ -48,4 +48,4 @@ As reply into Webhook in handler
.. code-block:: python
return AnswerShippingQuery(...)
return AnswerShippingQuery(...)

View file

@ -48,4 +48,4 @@ As reply into Webhook in handler
.. code-block:: python
return Close(...)
return Close(...)

View file

@ -48,4 +48,4 @@ As reply into Webhook in handler
.. code-block:: python
return CopyMessage(...)
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

@ -48,4 +48,4 @@ As reply into Webhook in handler
.. code-block:: python
return CreateNewStickerSet(...)
return CreateNewStickerSet(...)

View file

@ -48,4 +48,4 @@ As reply into Webhook in handler
.. code-block:: python
return DeleteChatPhoto(...)
return DeleteChatPhoto(...)

View file

@ -48,4 +48,4 @@ As reply into Webhook in handler
.. code-block:: python
return DeleteChatStickerSet(...)
return DeleteChatStickerSet(...)

View file

@ -48,4 +48,4 @@ As reply into Webhook in handler
.. code-block:: python
return DeleteMessage(...)
return DeleteMessage(...)

View file

@ -48,4 +48,4 @@ As reply into Webhook in handler
.. code-block:: python
return DeleteStickerFromSet(...)
return DeleteStickerFromSet(...)

View file

@ -48,4 +48,4 @@ As reply into Webhook in handler
.. code-block:: python
return DeleteWebhook(...)
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

@ -48,4 +48,4 @@ As reply into Webhook in handler
.. code-block:: python
return EditMessageCaption(...)
return EditMessageCaption(...)

View file

@ -48,4 +48,4 @@ As reply into Webhook in handler
.. code-block:: python
return EditMessageLiveLocation(...)
return EditMessageLiveLocation(...)

View file

@ -48,4 +48,4 @@ As reply into Webhook in handler
.. code-block:: python
return EditMessageMedia(...)
return EditMessageMedia(...)

View file

@ -48,4 +48,4 @@ As reply into Webhook in handler
.. code-block:: python
return EditMessageReplyMarkup(...)
return EditMessageReplyMarkup(...)

View file

@ -48,4 +48,4 @@ As reply into Webhook in handler
.. code-block:: python
return EditMessageText(...)
return EditMessageText(...)

View file

@ -48,4 +48,4 @@ As reply into Webhook in handler
.. code-block:: python
return ExportChatInviteLink(...)
return ExportChatInviteLink(...)

View file

@ -48,4 +48,4 @@ As reply into Webhook in handler
.. code-block:: python
return ForwardMessage(...)
return ForwardMessage(...)

View file

@ -42,4 +42,3 @@ With specific bot
.. code-block:: python
result: Chat = await bot(GetChat(...))

View file

@ -42,4 +42,3 @@ With specific bot
.. code-block:: python
result: List[ChatMember] = await bot(GetChatAdministrators(...))

View file

@ -42,4 +42,3 @@ With specific bot
.. code-block:: python
result: ChatMember = await bot(GetChatMember(...))

View file

@ -42,4 +42,3 @@ With specific bot
.. code-block:: python
result: int = await bot(GetChatMembersCount(...))

View file

@ -42,4 +42,3 @@ With specific bot
.. code-block:: python
result: File = await bot(GetFile(...))

View file

@ -42,4 +42,3 @@ With specific bot
.. code-block:: python
result: List[GameHighScore] = await bot(GetGameHighScores(...))

View file

@ -42,4 +42,3 @@ With specific bot
.. code-block:: python
result: User = await bot(GetMe(...))

View file

@ -42,4 +42,3 @@ With specific bot
.. code-block:: python
result: List[BotCommand] = await bot(GetMyCommands(...))

View file

@ -42,4 +42,3 @@ With specific bot
.. code-block:: python
result: StickerSet = await bot(GetStickerSet(...))

View file

@ -42,4 +42,3 @@ With specific bot
.. code-block:: python
result: List[Update] = await bot(GetUpdates(...))

View file

@ -42,4 +42,3 @@ With specific bot
.. code-block:: python
result: UserProfilePhotos = await bot(GetUserProfilePhotos(...))

View file

@ -42,4 +42,3 @@ With specific bot
.. code-block:: python
result: WebhookInfo = await bot(GetWebhookInfo(...))

View file

@ -55,6 +55,9 @@ Available methods
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
@ -136,4 +139,3 @@ Games
send_game
set_game_score
get_game_high_scores

View file

@ -48,4 +48,4 @@ As reply into Webhook in handler
.. code-block:: python
return KickChatMember(...)
return KickChatMember(...)

View file

@ -48,4 +48,4 @@ As reply into Webhook in handler
.. code-block:: python
return LeaveChat(...)
return LeaveChat(...)

View file

@ -48,4 +48,4 @@ As reply into Webhook in handler
.. code-block:: python
return LogOut(...)
return LogOut(...)

View file

@ -48,4 +48,4 @@ As reply into Webhook in handler
.. code-block:: python
return PinChatMessage(...)
return PinChatMessage(...)

View file

@ -48,4 +48,4 @@ As reply into Webhook in handler
.. code-block:: python
return PromoteChatMember(...)
return PromoteChatMember(...)

View file

@ -48,4 +48,4 @@ As reply into Webhook in handler
.. code-block:: python
return RestrictChatMember(...)
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

@ -48,4 +48,4 @@ As reply into Webhook in handler
.. code-block:: python
return SendAnimation(...)
return SendAnimation(...)

View file

@ -48,4 +48,4 @@ As reply into Webhook in handler
.. code-block:: python
return SendAudio(...)
return SendAudio(...)

View file

@ -48,4 +48,4 @@ As reply into Webhook in handler
.. code-block:: python
return SendChatAction(...)
return SendChatAction(...)

View file

@ -48,4 +48,4 @@ As reply into Webhook in handler
.. code-block:: python
return SendContact(...)
return SendContact(...)

View file

@ -48,4 +48,4 @@ As reply into Webhook in handler
.. code-block:: python
return SendDice(...)
return SendDice(...)

View file

@ -48,4 +48,4 @@ As reply into Webhook in handler
.. code-block:: python
return SendDocument(...)
return SendDocument(...)

View file

@ -48,4 +48,4 @@ As reply into Webhook in handler
.. code-block:: python
return SendGame(...)
return SendGame(...)

View file

@ -48,4 +48,4 @@ As reply into Webhook in handler
.. code-block:: python
return SendInvoice(...)
return SendInvoice(...)

View file

@ -48,4 +48,4 @@ As reply into Webhook in handler
.. code-block:: python
return SendLocation(...)
return SendLocation(...)

View file

@ -48,4 +48,4 @@ As reply into Webhook in handler
.. code-block:: python
return SendMediaGroup(...)
return SendMediaGroup(...)

View file

@ -48,4 +48,4 @@ As reply into Webhook in handler
.. code-block:: python
return SendMessage(...)
return SendMessage(...)

View file

@ -48,4 +48,4 @@ As reply into Webhook in handler
.. code-block:: python
return SendPhoto(...)
return SendPhoto(...)

View file

@ -48,4 +48,4 @@ As reply into Webhook in handler
.. code-block:: python
return SendPoll(...)
return SendPoll(...)

View file

@ -48,4 +48,4 @@ As reply into Webhook in handler
.. code-block:: python
return SendSticker(...)
return SendSticker(...)

View file

@ -48,4 +48,4 @@ As reply into Webhook in handler
.. code-block:: python
return SendVenue(...)
return SendVenue(...)

View file

@ -48,4 +48,4 @@ As reply into Webhook in handler
.. code-block:: python
return SendVideo(...)
return SendVideo(...)

View file

@ -48,4 +48,4 @@ As reply into Webhook in handler
.. code-block:: python
return SendVideoNote(...)
return SendVideoNote(...)

View file

@ -48,4 +48,4 @@ As reply into Webhook in handler
.. code-block:: python
return SendVoice(...)
return SendVoice(...)

View file

@ -48,4 +48,4 @@ As reply into Webhook in handler
.. code-block:: python
return SetChatAdministratorCustomTitle(...)
return SetChatAdministratorCustomTitle(...)

View file

@ -48,4 +48,4 @@ As reply into Webhook in handler
.. code-block:: python
return SetChatDescription(...)
return SetChatDescription(...)

View file

@ -48,4 +48,4 @@ As reply into Webhook in handler
.. code-block:: python
return SetChatPermissions(...)
return SetChatPermissions(...)

View file

@ -42,4 +42,3 @@ With specific bot
.. code-block:: python
result: bool = await bot(SetChatPhoto(...))

View file

@ -48,4 +48,4 @@ As reply into Webhook in handler
.. code-block:: python
return SetChatStickerSet(...)
return SetChatStickerSet(...)

View file

@ -48,4 +48,4 @@ As reply into Webhook in handler
.. code-block:: python
return SetChatTitle(...)
return SetChatTitle(...)

View file

@ -48,4 +48,4 @@ As reply into Webhook in handler
.. code-block:: python
return SetGameScore(...)
return SetGameScore(...)

View file

@ -48,4 +48,4 @@ As reply into Webhook in handler
.. code-block:: python
return SetMyCommands(...)
return SetMyCommands(...)

View file

@ -48,4 +48,4 @@ As reply into Webhook in handler
.. code-block:: python
return SetPassportDataErrors(...)
return SetPassportDataErrors(...)

View file

@ -48,4 +48,4 @@ As reply into Webhook in handler
.. code-block:: python
return SetStickerPositionInSet(...)
return SetStickerPositionInSet(...)

View file

@ -48,4 +48,4 @@ As reply into Webhook in handler
.. code-block:: python
return SetStickerSetThumb(...)
return SetStickerSetThumb(...)

View file

@ -48,4 +48,4 @@ As reply into Webhook in handler
.. code-block:: python
return SetWebhook(...)
return SetWebhook(...)

View file

@ -48,4 +48,4 @@ As reply into Webhook in handler
.. code-block:: python
return StopMessageLiveLocation(...)
return StopMessageLiveLocation(...)

View file

@ -48,4 +48,4 @@ As reply into Webhook in handler
.. code-block:: python
return StopPoll(...)
return StopPoll(...)

View file

@ -48,4 +48,4 @@ As reply into Webhook in handler
.. code-block:: python
return UnbanChatMember(...)
return UnbanChatMember(...)

View file

@ -48,4 +48,4 @@ As reply into Webhook in handler
.. code-block:: python
return UnpinAllChatMessages(...)
return UnpinAllChatMessages(...)

View file

@ -48,4 +48,4 @@ As reply into Webhook in handler
.. code-block:: python
return UnpinChatMessage(...)
return UnpinChatMessage(...)

View file

@ -42,4 +42,3 @@ With specific bot
.. code-block:: python
result: File = await bot(UploadStickerFile(...))