mirror of
https://github.com/thelounge/thelounge
synced 2024-11-23 12:33:07 +00:00
Merge pull request #3019 from Zarthus/ctcp_notify
plugin/ctcp: Let the user know a CTCP request was sent
This commit is contained in:
commit
88df9148dc
1 changed files with 16 additions and 2 deletions
|
@ -1,9 +1,23 @@
|
|||
"use strict";
|
||||
|
||||
const Msg = require("../../models/msg");
|
||||
|
||||
exports.commands = ["ctcp"];
|
||||
|
||||
exports.input = function({irc}, chan, cmd, args) {
|
||||
if (args.length > 1) {
|
||||
irc.ctcpRequest(...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);
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue