thelounge/src/plugins/inputs/ctcp.js
Jos Ahrens 0fbf301e0f
plugin/ctcp: Let the user know a CTCP request was sent
Because responding to a CTCP request is completely optional,
sometimes thelounge will just do absolutely nothing. (the request
was received, but the client did not respond to it)

This alleviates the problem by always notifying the user that
*something* was sent.
2019-02-16 21:01:32 +00:00

24 lines
487 B
JavaScript

"use strict";
const Msg = require("../../models/msg");
exports.commands = ["ctcp"];
exports.input = function({irc}, chan, cmd, args) {
if (args.length < 2) {
chan.pushMessage(this, new Msg({
type: Msg.Type.ERROR,
text: "Usage: /ctcp <nick> <ctcp_type>",
}));
return;
}
chan.pushMessage(this, new Msg({
type: Msg.Type.CTCP_REQUEST,
ctcpMessage: `"${args.slice(1).join(" ")}" to ${args[0]}`,
from: chan.getUser(irc.user.nick),
}));
irc.ctcpRequest(...args);
};