mirror of
https://github.com/thelounge/thelounge.git
synced 2024-06-15 20:15:11 +02:00
23599fc39b
Fixes #956
23 lines
446 B
JavaScript
23 lines
446 B
JavaScript
"use strict";
|
|
|
|
var Chan = require("../../models/chan");
|
|
var Msg = require("../../models/msg");
|
|
|
|
exports.commands = ["topic"];
|
|
|
|
exports.input = function(network, 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;
|
|
}
|
|
|
|
var irc = network.irc;
|
|
irc.raw("TOPIC", chan.name, args.join(" "));
|
|
|
|
return true;
|
|
};
|