# /ban

Bot's command `/ban` is able moderators and administrators to ban users for a certain period or forever.

{% hint style="info" %}
Note. This command supports arguments! Read the following paragraphs for the details
{% endhint %}

{% hint style="success" %}
Note. This command supports "quiet" mode. In this mode, your commands will be deleted, and members of your chat will not see any notifications\
To use "quiet" mode add "q" before the command (like /qban instead of /ban)
{% endhint %}

## Configuration of the command

* Press the button "Chat settings" near the selected chat on the ["My Chats" page](https://fullyst.com/my_chats)
* Open "Moderation" settings by clicking the corresponding menu item
* Enable `/ban` command on the page

<figure><img src="https://1355699699-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvbbEGxRTwrzUPUEXxps8%2Fuploads%2FMKUPYCfRmdrABhHPYSBO%2FScreenshot%202022-11-08%20at%2022.34.59.png?alt=media&#x26;token=fcc7e85c-fc6b-48e3-aa1f-7ec6308a30d9" alt=""><figcaption><p>Moderation settings</p></figcaption></figure>

## Command usage

{% hint style="info" %}
This command is available only for moderators and administrators in the chat
{% endhint %}

### Simple usage

Just send `/ban` as a reply to a message and the user will be banned and the message will be removed.

<figure><img src="https://1355699699-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvbbEGxRTwrzUPUEXxps8%2Fuploads%2FLix5ZUphodDhKLvDeXWy%2Fphoto_2022-11-08%2022.43.45.jpeg?alt=media&#x26;token=84a11fbb-9d97-4f85-9f81-28d6298566e7" alt=""><figcaption><p>How to ban user in the chat</p></figcaption></figure>

Or you may use the `/ban` command with one argument - the user mention:

<figure><img src="https://1355699699-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvbbEGxRTwrzUPUEXxps8%2Fuploads%2FHEafkS4PD1KTt2Xiynfb%2FIMG_6563.PNG?alt=media&#x26;token=ec744982-47b1-430b-93b1-70f3a4b9eba4" alt=""><figcaption><p>How to ban user by mention</p></figcaption></figure>

### Usage with arguments

Command `/ban` supports the following arguments:

* Length of the ban in minutes, hours, and days
* "No-delete" mark which prevents to deletion of the message from the banned user
* Reason - the reason that will be saved

#### Ban a user by the mention

`/ban <mention> <reason>`

Arguments for the /ban command in this case are:

* `mention` (required) - any valid user mention (just type @ and then mention any user in your chat by username or by name)
* `duration` (optional) - the period for which the user will be blocked. If not provided - the user will be banned forever\
  Xm - X **m**inutes\
  Xh - X **h**ours\
  Xd - X **d**ays
* `reason` (optional) - a reason for the ban will be saved and printed

#### Ban a user by reply

You can also ban a user by replying to their message with the ban command

`/ban <duration> <delete> <reason>`

Arguments for the /bane command in this case are:

* `duration` (optional) - the period for which the user will be blocked. If not provided - the user will be banned forever\
  Xm - X **m**inutes\
  Xh - X **h**ours\
  Xd - X **d**ays
* `delete` (optional) - if this argument is `no-delete`, the message you reply to won't be deleted
* `reason` (optional) - a reason for the ban will be saved and printed

Let's ban a user for 1 hour:

<figure><img src="https://1355699699-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvbbEGxRTwrzUPUEXxps8%2Fuploads%2FdgfCuymkXdVZCmJSJX4m%2Fphoto_2022-11-08%2022.46.40.jpeg?alt=media&#x26;token=6c50099f-e519-4a8a-a430-754262703ff3" alt=""><figcaption><p>How to ban user for 1 hour</p></figcaption></figure>

Now let's ban the user forever, but keep its message

<figure><img src="https://1355699699-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvbbEGxRTwrzUPUEXxps8%2Fuploads%2FQWrBRaQMnANur46KDVdx%2Fphoto_2022-11-08%2022.46.44.jpeg?alt=media&#x26;token=890bf4c7-c81e-43c5-be67-6a590569e2cf" alt=""><figcaption><p>How to ban user forever but keep message</p></figcaption></figure>

Also, you may combine both arguments in any order. In the example below, we will ban the user for 5 days and keep its message

<figure><img src="https://1355699699-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvbbEGxRTwrzUPUEXxps8%2Fuploads%2FYq6RdbsJASc47AQzNYcg%2Fphoto_2022-11-08%2022.46.46.jpeg?alt=media&#x26;token=7501020e-8522-4970-846d-fdfb83636424" alt=""><figcaption><p>How to ban user for five days and keep its messages</p></figcaption></figure>
