Merge pull request #3276 from thelounge/xpaw/unhandled-params-check

Make sure unhandled command has params
This commit is contained in:
Pavel Djundik 2019-07-03 11:57:29 +03:00 committed by GitHub
commit bac95325dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -8,6 +8,7 @@ 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];
if (command.params.length > 0) {
// Do not display users own name // Do not display users own name
if (command.params[0] === network.irc.user.nick) { if (command.params[0] === network.irc.user.nick) {
command.params.shift(); command.params.shift();
@ -20,6 +21,7 @@ module.exports = function(irc, network) {
target = channel; target = channel;
} }
} }
}
target.pushMessage(client, new Msg({ target.pushMessage(client, new Msg({
type: Msg.Type.UNHANDLED, type: Msg.Type.UNHANDLED,