thelounge/src/plugins/inputs/topic.js

24 lines
434 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) {
2019-07-17 11:33:59 +02:00
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
};