Make sure unhandled command has params
This commit is contained in:
parent
1b38e6cc02
commit
4765f06940
@ -8,16 +8,18 @@ module.exports = function(irc, network) {
|
|||||||
irc.on("unknown command", function(command) {
|
irc.on("unknown command", function(command) {
|
||||||
let target = network.channels[0];
|
let target = network.channels[0];
|
||||||
|
|
||||||
// Do not display users own name
|
if (command.params.length > 0) {
|
||||||
if (command.params[0] === network.irc.user.nick) {
|
// Do not display users own name
|
||||||
command.params.shift();
|
if (command.params[0] === network.irc.user.nick) {
|
||||||
} else {
|
command.params.shift();
|
||||||
// If this numeric starts with a channel name that exists
|
} else {
|
||||||
// put this message in that channel
|
// If this numeric starts with a channel name that exists
|
||||||
const channel = network.getChannel(command.params[0]);
|
// put this message in that channel
|
||||||
|
const channel = network.getChannel(command.params[0]);
|
||||||
|
|
||||||
if (typeof channel !== "undefined") {
|
if (typeof channel !== "undefined") {
|
||||||
target = channel;
|
target = channel;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user