Closed MSIKT4AV closed 4 years ago
It depends on the network. Most modern networks will use SASL so you would set the nick and password options. If the network doesn't support SASL then you may have to listen for the registered
event and send the login command via .say('nickserv', 'identify ' + password)
Like this?:
var password = 'simplepassword'
bot.on('registered', function() { bot.say('nickserv', 'identify ' + password) console.log('Connected!'); bot.join('#test000'); });
Test it and see what happens. Does it work?
Works for networks that use SASL:
var bot = new IRC.Client();
bot.connect({
host: 'irc.irc.com',
tls: true,
port: 6697,
nick: 'somenick',
password: 'somepassword',
});
Works for networks that don't use SASL but uses nickserv:
var password = 'mypassword';
var username = 'myusername';
bot.on('registered', function() {
bot.say('nickserv', 'identify ' + username + ' ' + password)
console.log('Connected!');
bot.join('#prawnsalad');
});
This example does not work for my chat. In python this code work:
irc = socket.socket(socket.AF_INET, socket.SOCK_STREAM) irc.connect((server,port)) irc.setblocking(False) time.sleep(1) irc.send(("USER "+botnick+" "+botnick+" "+botnick+" :Hi, I'm just a bot!\r\n").encode()) time.sleep(1) irc.send(("NICK "+botnick+"\n").encode()) time.sleep(1) irc.send(("LOGIN "+botnick+" "+password+"\n").encode()) time.sleep(3) irc.send(("JOIN "+channel+"\n").encode())
and... I dont know how rewrite this in javascript
LOGIN
is not a standard command, that's why it doesn't work.
var password = 'mypassword';
var username = 'myusername';
bot.on('registered', function() {
bot.raw('LOGIN', username + ' ' + password);
console.log('Connected!');
bot.join('#prawnsalad');
});
Still not. Can you try login on this chat and write as bot? I can give you login/pass
Hi, how login with username and password to irc channel? simply add "password: 'ghffd'" not working