thelounge/src/plugins/inputs/kick.js

27 lines
485 B
JavaScript
Raw Normal View History

"use strict";
2018-01-11 12:33:36 +01:00
const Chan = require("../../models/chan");
const Msg = require("../../models/msg");
exports.commands = ["kick"];
2016-03-06 10:24:56 +01:00
exports.input = function ({irc}, chan, cmd, args) {
if (chan.type !== Chan.Type.CHANNEL) {
2019-07-17 11:33:59 +02:00
chan.pushMessage(
this,
new Msg({
type: Msg.Type.ERROR,
text: `${cmd} command can only be used in channels.`,
})
);
return;
}
2014-09-13 23:29:45 +02:00
if (args.length !== 0) {
2016-03-27 05:29:59 +02:00
irc.raw("KICK", chan.name, args[0], args.slice(1).join(" "));
2014-09-13 23:29:45 +02:00
}
2016-03-06 10:24:56 +01:00
return true;
2014-09-13 23:29:45 +02:00
};