thelounge/src/plugins/inputs/kick.js
Jérémie Astori 1dc92d8934
Enforce dangling commas with ESLint
¯\_(ツ)_/¯
2017-11-15 01:35:15 -05:00

25 lines
494 B
JavaScript

"use strict";
var Chan = require("../../models/chan");
var Msg = require("../../models/msg");
exports.commands = ["kick"];
exports.input = function(network, chan, cmd, args) {
if (chan.type !== Chan.Type.CHANNEL) {
chan.pushMessage(this, new Msg({
type: Msg.Type.ERROR,
text: `${cmd} command can only be used in channels.`,
}));
return;
}
if (args.length !== 0) {
var irc = network.irc;
irc.raw("KICK", chan.name, args[0], args.slice(1).join(" "));
}
return true;
};