UNPKG

twiedenbein-thelounge

Version:

The self-hosted Web IRC client

26 lines (25 loc) 821 B
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const msg_1 = __importDefault(require("../../models/msg")); const msg_2 = require("../../../shared/types/msg"); const chan_1 = require("../../../shared/types/chan"); const commands = ["cycle", "rejoin"]; const input = function ({ irc }, chan) { if (chan.type !== chan_1.ChanType.CHANNEL) { chan.pushMessage(this, new msg_1.default({ type: msg_2.MessageType.ERROR, text: "You can only rejoin channels.", })); return; } irc.part(chan.name, "Rejoining"); irc.join(chan.name); return true; }; exports.default = { commands, input, };