2017-08-23 23:08:44 +00:00
|
|
|
"use strict";
|
|
|
|
|
|
|
|
var Msg = require("../../models/msg");
|
|
|
|
var Chan = require("../../models/chan");
|
|
|
|
|
|
|
|
exports.commands = ["cycle", "rejoin"];
|
|
|
|
|
2017-11-22 06:39:32 +00:00
|
|
|
exports.input = function({irc}, chan) {
|
2017-08-23 23:08:44 +00:00
|
|
|
if (chan.type !== Chan.Type.CHANNEL) {
|
|
|
|
chan.pushMessage(this, new Msg({
|
|
|
|
type: Msg.Type.ERROR,
|
2017-11-15 06:35:15 +00:00
|
|
|
text: "You can only rejoin channels.",
|
2017-08-23 23:08:44 +00:00
|
|
|
}));
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2017-11-22 06:39:32 +00:00
|
|
|
irc.part(chan.name, "Rejoining");
|
|
|
|
irc.join(chan.name);
|
2017-08-23 23:08:44 +00:00
|
|
|
|
|
|
|
return true;
|
|
|
|
};
|