hardlounge/src/plugins/irc-events/unhandled.js
2017-11-19 02:46:45 -05:00

21 lines
447 B
JavaScript

"use strict";
const Msg = require("../../models/msg");
module.exports = function(irc, network) {
const client = this;
irc.on("unknown command", function(command) {
// Do not display users own name
if (command.params[0] === network.irc.user.nick) {
command.params.shift();
}
network.channels[0].pushMessage(client, new Msg({
type: Msg.Type.UNHANDLED,
command: command.command,
params: command.params,
}), true);
});
};