twiedenbein-thelounge
Version:
The self-hosted Web IRC client
25 lines (24 loc) • 819 B
JavaScript
;
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 = ["topic"];
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;
}
irc.setTopic(chan.name, args.join(" "));
return true;
};
exports.default = {
commands,
input,
};