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
##############
|
|
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.api.methods.kick_chat_member
|
|
:members:
|
|
|
|
|
|
Usage
|
|
=====
|
|
|
|
As bot method
|
|
-------------
|
|
|
|
.. code-block::
|
|
|
|
result: bool = await bot.kick_chat_member(...)
|
|
|
|
|
|
Method as object
|
|
----------------
|
|
|
|
Imports:
|
|
|
|
- :code:`from aiogram.methods import KickChatMember`
|
|
- :code:`from aiogram.api.methods import KickChatMember`
|
|
- :code:`from aiogram.api.methods.kick_chat_member import KickChatMember`
|
|
|
|
In handlers with current bot
|
|
----------------------------
|
|
|
|
.. code-block::
|
|
|
|
result: bool = await KickChatMember(...)
|
|
|
|
With specific bot
|
|
~~~~~~~~~~~~~~~~~
|
|
|
|
.. code-block::
|
|
|
|
result: bool = await bot(KickChatMember(...))
|
|
|
|
As reply into Webhook in handler
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
.. code-block::
|
|
|
|
return KickChatMember(...) |