mirror of
https://github.com/thelounge/thelounge.git
synced 2024-05-11 10:46:48 +02:00
20 lines
415 B
JavaScript
20 lines
415 B
JavaScript
"use strict";
|
|
|
|
var Chan = require("../../models/chan");
|
|
var Msg = require("../../models/msg");
|
|
|
|
exports.commands = ["topic"];
|
|
|
|
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(" "));
|
|
return true;
|
|
};
|