2016-10-09 21:14:02 +02:00
|
|
|
"use strict";
|
|
|
|
|
2018-01-11 12:33:36 +01:00
|
|
|
const Chan = require("../../models/chan");
|
|
|
|
const Msg = require("../../models/msg");
|
2017-03-11 19:09:37 +01:00
|
|
|
|
2016-03-14 05:21:42 +01:00
|
|
|
exports.commands = ["topic"];
|
2015-10-01 00:39:57 +02:00
|
|
|
|
2017-11-22 07:39:32 +01:00
|
|
|
exports.input = function({irc}, chan, cmd, args) {
|
2017-03-11 19:09:37 +01:00
|
|
|
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.`,
|
|
|
|
})
|
|
|
|
);
|
2017-03-11 19:09:37 +01:00
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
2018-02-20 08:28:04 +01:00
|
|
|
|
2017-11-22 07:39:32 +01:00
|
|
|
irc.setTopic(chan.name, args.join(" "));
|
2016-03-06 10:24:56 +01:00
|
|
|
return true;
|
2014-09-13 23:29:45 +02:00
|
|
|
};
|