> For the complete documentation index, see [llms.txt](https://bmsvieira.gitbook.io/nova-irc/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://bmsvieira.gitbook.io/nova-irc/methods/ban.md).

# ban

The `ban`  method allows the bot to ban a specific user from an IRC channel.

#### Syntax

```javascript
bot.ban(channel, userinfo);
```

#### Parameters

* **`channel`** *(string, required)* – The IRC channel from which the user should be kicked (e.g., #channelname).
* **`userinfo`** *(string, required)* – User/Host to add a Mode +b.

#### Example Usage

Kick a user from a channel with a custom message:

```javascript
bot.ban('#testingpg', 'JohnDoe59@2001:818:df14:8c00:f08b:fad2:e1cd:63c5');
```

**Notes**

* Ensure the channel name starts with `#`.
* The bot must have sufficient permissions (usually operator or higher) to set mode on a user from the channel.
* Some IRC networks may require additional permissions or an IRC operator role.
* The user must be present in the channel to be banned.

4o mini
