Closed ralyodio closed 3 years ago
yourbot.join('#channel')
There's an example in the readme doing exactly as you mentioned and the full API docs can be found https://github.com/kiwiirc/irc-framework/blob/master/docs/clientapi.md
it doesn't work.
const IRC = require('irc-framework');
const bot = new IRC.Client();
bot.connect({
host: 'irc.freenode.net',
port: 6667,
nick: 'mywsbbot',
account: {
account: 'mywsbbot',
password: 'asdf1234',
email: 'chovy@pm.me',
},
});
bot.matchMessage(/^!stonk/, function(event) {
console.log(event);
event.reply(event.message);
});
bot.matchMessage(/^!identify/, event => {
bot.say('nickserv', 'identify' + bot.options.account + ' ' + bot.options.password, console.log);
});
bot.matchMessage(/^!register/, event => {
bot.say('nickserv', 'register' + bot.options.account + ' ' + bot.options.password, console.log);
});
bot.matchMessage(/^!join/, function(event) {
console.log(event);
const chan = event.message.split()[1];
bot.join(chan);
});
Try adding the following to see any error messages the network is giving you
bot.on('raw', event => {
console.log(event);
});
nothing obvious but i think its trying to join too early.
Can you paste the raw log?
I don't see the !join
message being sent to the bot? When are you expecting it to join?
i added bot.join('##wallstreetbets')
right after bot.connect()
I'm trying to write a bot, it works when I message the bot but I can't seem to get it to join my channel and respond to events.
Seems like basic stuff that should be in the readme.
I'm using freenode btw