Closed Madriix closed 1 year ago
Could you please console.log(command) for a whois, this has been reported before, but is different for both inspircd and unrealircd. I would need to find a way that works for both.
I just tested this:
RPL_WHOISCOUNTRY: function(command, handler) {
const cache_key = command.params[1].toLowerCase();
const cache = handler.cache('whois.' + cache_key);
//cache.country = command.params[command.params.length - 1];
cache.country = command.params[2];
console.log(command);
process.exit(1);
},
Here is the returned log:
IrcCommand {
command: '344',
params: [ 'Sysop', 'Corail', 'CA', 'is connecting from Canada' ],
tags: {},
prefix: 'irc.xx.com',
nick: '',
ident: '',
hostname: 'irc.xx.com'
}
Sysop is the name of the nodejs robot
Thanks, so you are just wanting the country code? not the actual string with name?
Yes just "CA"
Today I updated irc-framework in my project, it hadn't been updated for 1 year. I encountered a bug on this file: https://github.com/kiwiirc/irc-framework/pull/318/commits/34683a7181aa1d3c384a2cf914149f13019906b8 https://github.com/kiwiirc/irc-framework/blob/master/src/commands/handlers/user.js#L294
I had to replace this line:
cache.country = command.params[command.params.length - 1];
by this one:cache.country = command.params[2];
The first line displays this entire line: is connecting from France and the second line replaced, it displays only country codes like FR, BE, DE ...