thelounge/src/plugins/inputs/part.js

21 lines
377 B
JavaScript
Raw Normal View History

2014-09-13 23:29:45 +02:00
var _ = require("lodash");
exports.commands = ["close", "leave", "part"];
2016-03-06 10:24:56 +01:00
exports.input = function(network, chan, cmd, args) {
if (chan.type !== "query") {
2014-09-13 23:29:45 +02:00
var irc = network.irc;
if (args.length === 0) {
args.push(chan.name);
}
irc.part(args);
}
2016-03-06 10:24:56 +01:00
network.channels = _.without(network.channels, chan);
this.emit("part", {
chan: chan.id
});
2016-03-06 10:24:56 +01:00
return true;
2014-09-13 23:29:45 +02:00
};