UNPKG

twiedenbein-thelounge

Version:

The self-hosted Web IRC client

27 lines (26 loc) 878 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 = ["kick"]; const input = function ({ irc }, chan, cmd, args) { if (chan.type !== chan_1.ChanType.CHANNEL) { chan.pushMessage(this, new msg_1.default({ type: msg_2.MessageType.ERROR, text: `${cmd} command can only be used in channels.`, })); return; } if (args.length !== 0) { irc.raw("KICK", chan.name, args[0], args.slice(1).join(" ")); } return true; }; exports.default = { commands, input, };