mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
52 lines
No EOL
1.1 KiB
ReStructuredText
52 lines
No EOL
1.1 KiB
ReStructuredText
##################
|
|
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.api.methods.set_chat_permissions
|
|
:members:
|
|
|
|
|
|
Usage
|
|
=====
|
|
|
|
As bot method
|
|
-------------
|
|
|
|
.. code-block::
|
|
|
|
result: bool = await bot.set_chat_permissions(...)
|
|
|
|
|
|
Method as object
|
|
----------------
|
|
|
|
Imports:
|
|
|
|
- :code:`from aiogram.methods import SetChatPermissions`
|
|
- :code:`from aiogram.api.methods import SetChatPermissions`
|
|
- :code:`from aiogram.api.methods.set_chat_permissions import SetChatPermissions`
|
|
|
|
In handlers with current bot
|
|
----------------------------
|
|
|
|
.. code-block::
|
|
|
|
result: bool = await SetChatPermissions(...)
|
|
|
|
With specific bot
|
|
~~~~~~~~~~~~~~~~~
|
|
|
|
.. code-block::
|
|
|
|
result: bool = await bot(SetChatPermissions(...))
|
|
|
|
As reply into Webhook in handler
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
.. code-block::
|
|
|
|
return SetChatPermissions(...) |