πͺjoinChannel
The joinChannel
method allows the bot to join a specific IRC channel.
Syntax
bot.joinChannel(channel, password);
Parameters
channel
(string, required) β The IRC channel the bot should join (e.g.,#channelname
).password
(string, optional) β Password to join a protected channel
Example Usage
While you can call joinChannel
directly, it is recommended to do so after receiving the connected
event to ensure the bot is properly connected before joining channels.
bot.on('connected', () => {
// Join the channel after the bot is connected.
bot.joinChannel('#YOUR-CHANNEL', 'PASSWORD');
});
Notes
Ensure the channel name starts with
#
.The bot should be connected before attempting to join a channel.
If the channel is password-protected, you need to set your "password" parameter.
Last updated