UNPKG

twiedenbein-thelounge

Version:

The self-hosted Web IRC client

30 lines (29 loc) 967 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 commands = ["ctcp"]; const input = function ({ irc }, chan, cmd, args) { if (args.length < 2) { chan.pushMessage(this, new msg_1.default({ type: msg_2.MessageType.ERROR, text: "Usage: /ctcp <nick> <ctcp_type>", })); return; } const target = args.shift(); const type = args.shift(); chan.pushMessage(this, new msg_1.default({ type: msg_2.MessageType.CTCP_REQUEST, ctcpMessage: `"${type}" to ${target}`, from: chan.getUser(irc.user.nick), })); irc.ctcpRequest(target, type, ...args); }; exports.default = { commands, input, };