banChatMember¶
Returns: bool
- class litegram.methods.ban_chat_member.BanChatMember(*, chat_id: ChatIdUnion, user_id: int, until_date: DateTimeUnion | None = None, revoke_messages: bool | None = None, **extra_data: Any)[source]¶
Use this method to ban a user in a group, a supergroup or a channel. In the case of supergroups and channels, the user will not be able to return to the chat 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 administrator rights. Returns
Trueon success.Source: https://core.telegram.org/bots/api#banchatmember
- chat_id: ChatIdUnion¶
Unique identifier for the target group or username of the target supergroup or channel (in the format
@channelusername)
Usage¶
As bot method¶
result: bool = await bot.ban_chat_member(...)
Method as object¶
Imports:
from litegram.methods.ban_chat_member import BanChatMemberalias:
from litegram.methods import BanChatMember
With specific bot¶
result: bool = await bot(BanChatMember(...))
As reply into Webhook in handler¶
return BanChatMember(...)