# 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


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://bmsvieira.gitbook.io/nova-irc/methods/ban.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
