2016-10-09 21:14:02 +02:00
|
|
|
"use strict";
|
|
|
|
|
2017-03-11 19:09:37 +01:00
|
|
|
var Chan = require("../../models/chan");
|
|
|
|
var Msg = require("../../models/msg");
|
|
|
|
|
2016-03-14 05:21:42 +01:00
|
|
|
exports.commands = ["kick"];
|
2016-03-06 10:24:56 +01:00
|
|
|
|
2017-11-22 07:39:32 +01:00
|
|
|
exports.input = function({irc}, chan, cmd, args) {
|
2017-03-11 19:09:37 +01:00
|
|
|
if (chan.type !== Chan.Type.CHANNEL) {
|
|
|
|
chan.pushMessage(this, new Msg({
|
|
|
|
type: Msg.Type.ERROR,
|
2017-11-15 07:35:15 +01:00
|
|
|
text: `${cmd} command can only be used in channels.`,
|
2017-03-11 19:09:37 +01:00
|
|
|
}));
|
|
|
|
|
|
|
|
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
|
|
|
};
|