# setCredentials

The `setCredentials` method sets the bot's nickname, real name, and optional password for connecting to an IRC server.

#### Syntax

```javascript
bot.setCredentials(nickname, realname, password);
```

#### Parameters

* **`nickname`** *(string, required)* – The nickname your bot will use on the IRC network.
* **`realname`** *(string, required)* – The real name or description of the bot.
* **`password`** *(string, optional, default: `null`)* – The optional password for authentication, if required by the server.

#### Example Usage

```javascript
bot.setCredentials('YOUR-NICKNAME', 'BOT-DESCRIPTION');
```

This sets the bot's nickname to `YOUR-NICKNAME` and the real name to `BOT-DESCRIPTION`, without a password.

If authentication is required (your account is registered):

```javascript
bot.setCredentials('YOUR-NICKNAME', 'BOT-DESCRIPTION', 'PASSWORD');
```

#### Notes

* The nickname should be unique on the IRC server.
* If a password is required, ensure it is stored securely.
* Calling `setCredentials` before connecting ensures the correct identity is used.


---

# 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/setcredentials.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.
