2016-03-14 04:21:42 +00:00
|
|
|
exports.commands = ["slap", "me"];
|
2015-09-30 22:39:57 +00:00
|
|
|
|
2016-03-14 04:21:42 +00:00
|
|
|
exports.input = function(network, chan, cmd, args) {
|
2014-09-13 21:29:45 +00:00
|
|
|
var irc = network.irc;
|
2016-03-08 13:36:25 +00:00
|
|
|
var text;
|
2015-09-30 22:39:57 +00:00
|
|
|
|
2014-09-13 21:29:45 +00:00
|
|
|
switch (cmd) {
|
|
|
|
case "slap":
|
2016-03-08 13:36:25 +00:00
|
|
|
text = "slaps " + args[0] + " around a bit with a large trout";
|
2014-09-13 21:29:45 +00:00
|
|
|
/* fall through */
|
|
|
|
case "me":
|
|
|
|
if (args.length === 0) {
|
|
|
|
break;
|
|
|
|
}
|
2015-09-30 22:39:57 +00:00
|
|
|
|
2016-03-08 13:36:25 +00:00
|
|
|
text = text || args.join(" ");
|
|
|
|
|
2016-05-06 17:51:38 +00:00
|
|
|
irc.action(chan.name, text);
|
2016-04-22 16:38:13 +00:00
|
|
|
|
|
|
|
if (!network.irc.network.cap.isEnabled("echo-message")) {
|
|
|
|
irc.emit("action", {
|
|
|
|
nick: irc.user.nick,
|
|
|
|
target: chan.name,
|
|
|
|
message: text
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2014-09-13 21:29:45 +00:00
|
|
|
break;
|
|
|
|
}
|
2016-03-06 09:24:56 +00:00
|
|
|
|
|
|
|
return true;
|
2014-09-13 21:29:45 +00:00
|
|
|
};
|