# banChatMember

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 True on success.

<table><thead><tr><th width="159">Parameter</th><th width="109">Type</th><th width="110">Required</th><th>Description</th></tr></thead><tbody><tr><td>chat_id</td><td>Integer or String</td><td>Yes</td><td>Unique identifier for the target group or username of the target supergroup or channel (in the format <mark style="color:red;">@channelusername</mark>)</td></tr><tr><td>user_id</td><td>Integer</td><td>Yes</td><td>Unique identifier of the target user</td></tr><tr><td>until_date</td><td>Integer</td><td>Optional</td><td>Date when the user will be unbanned; Unix time. If 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.</td></tr><tr><td>revoke_messages</td><td>Boolean</td><td>Optional</td><td>Pass True to delete all messages from the chat for the user that is being removed. If False, the user will be able to see messages in the group that were sent before the user was removed. Always True for supergroups and channels.</td></tr></tbody></table>
