thelounge/src/plugins/inputs/rejoin.js
2018-02-19 18:30:00 +02:00

22 lines
415 B
JavaScript

"use strict";
var Msg = require("../../models/msg");
var Chan = require("../../models/chan");
exports.commands = ["cycle", "rejoin"];
exports.input = function({irc}, chan) {
if (chan.type !== Chan.Type.CHANNEL) {
chan.pushMessage(this, new Msg({
type: Msg.Type.ERROR,
text: "You can only rejoin channels.",
}));
return;
}
irc.part(chan.name, "Rejoining");
irc.join(chan.name);
return true;
};