thelounge/src/plugins/inputs/rejoin.js

22 lines
419 B
JavaScript
Raw Normal View History

"use strict";
2018-01-11 12:33:36 +01:00
const Msg = require("../../models/msg");
const 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;
};