🟪setCredentials
The setCredentials method sets the bot's nickname, real name, and optional password for connecting to an IRC server.
Syntax
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
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):
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
setCredentialsbefore connecting ensures the correct identity is used.
Last updated