Ban, unban user or chat
You can ban and unban chat member
To ban the user, use .ban
answer/api method or Ban class-method. To unban the user, use .unban
answer/api method. This is an example where we ban a user if they type "****" in the chat and unban after 5 seconds
Using these methods, you can also ban users who write via chats
Ban class-method or .ban Answer method take arguments:
Until ban date (unix date). If a user is banned for more than 366 days or less than 30 seconds from the current time they are considered to be banned forever. Applied for supergroups and channels only
Optional
Revoke messages. Pass true
to delete all messages from the chat for the user that is being removed
Optional
User ID you want to ban
Optional. Current user id by default
.unban Answer method take arguments:
Only if banned. Do nothing if user is unbanned
Optional
User id you want to unban
Optional. Current user id by default
If you want to know what arguments Api methods takes, see IDE hints
Last updated