thelounge/src/plugins/inputs/topic.js

20 lines
419 B
JavaScript
Raw Normal View History

"use strict";
2018-01-11 12:33:36 +01:00
const Chan = require("../../models/chan");
const Msg = require("../../models/msg");
exports.commands = ["topic"];
2015-10-01 00:39:57 +02:00
exports.input = function({irc}, chan, cmd, args) {
if (chan.type !== Chan.Type.CHANNEL) {
chan.pushMessage(this, new Msg({
type: Msg.Type.ERROR,
text: `${cmd} command can only be used in channels.`,
}));
return;
}
irc.setTopic(chan.name, args.join(" "));
2016-03-06 10:24:56 +01:00
return true;
2014-09-13 23:29:45 +02:00
};