mirror of
https://github.com/thelounge/thelounge.git
synced 2024-06-28 10:10:20 +02:00
25 lines
433 B
JavaScript
25 lines
433 B
JavaScript
"use strict";
|
|
|
|
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;
|
|
};
|