mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
* Refactor: Introduce Union types for streamlined type handling Implemented Union types across various modules to consolidate and simplify type annotations. This change replaces repetitive union declarations with reusable Union aliases, improving code readability and maintainability. Updates applied to affected classes, methods, and imports accordingly. * Refactor unions into type aliases for better reusability Replaced inline `Union` types with predefined aliases like `MediaUnion`, `ReplyMarkupUnion`, and `ChatIdUnion`. Simplifies type annotations, improves code readability, and reduces duplication. Added `media_union.py` for grouping related media types. * Refactor type unions with ResultChatMemberUnion and ResultMenuButtonUnion Replaced verbose type definitions of chat member and menu button unions with `ResultChatMemberUnion` and `ResultMenuButtonUnion` for improved readability and maintainability. Updated relevant methods, modules, and documentation to use the new type aliases consistently. * Added changelog
46 lines
889 B
ReStructuredText
46 lines
889 B
ReStructuredText
#####################
|
|
getChatAdministrators
|
|
#####################
|
|
|
|
Returns: :obj:`list[ResultChatMemberUnion]`
|
|
|
|
.. automodule:: aiogram.methods.get_chat_administrators
|
|
:members:
|
|
:member-order: bysource
|
|
:undoc-members: True
|
|
:exclude-members: model_config,model_fields
|
|
|
|
|
|
Usage
|
|
=====
|
|
|
|
As bot method
|
|
-------------
|
|
|
|
.. code-block::
|
|
|
|
result: list[ResultChatMemberUnion] = await bot.get_chat_administrators(...)
|
|
|
|
|
|
Method as object
|
|
----------------
|
|
|
|
Imports:
|
|
|
|
- :code:`from aiogram.methods.get_chat_administrators import GetChatAdministrators`
|
|
- alias: :code:`from aiogram.methods import GetChatAdministrators`
|
|
|
|
With specific bot
|
|
~~~~~~~~~~~~~~~~~
|
|
|
|
.. code-block:: python
|
|
|
|
result: list[ResultChatMemberUnion] = await bot(GetChatAdministrators(...))
|
|
|
|
|
|
|
|
|
|
As shortcut from received object
|
|
--------------------------------
|
|
|
|
- :meth:`aiogram.types.chat.Chat.get_administrators`
|