on ctcp_request
This hook is triggered when the client receives a CTCP request. If you choose to suppress the default action, then you have full control over how the ctcp request is handled. If you do not choose to suppress the default action, the client will process it for you. The usual result of the client processing a ctcp request is the sending of a ctcp reply, and the throwing of an on ctcp event.
It is important to understand the distinction between on ctcp_request and on ctcp. The on ctcp_request event is thrown “early”, and gives you first access to the request. The on ctcp event is thrown “late”, and you should never try to respond to a ctcp request there.
Because this on is hooked as the result of a PRIVMSG, you cannot send a PRIVMSG in reply to this on, only NOTICEs. If you use the CTCP command, it will send a proper ctcp reply. If you use the MSG command it will be sent as a NOTICE.
| $0 | nickname of CTCP message sender |
| $1 | target of CTCP (client’s nickname or channel name) |
| $2 | type of CTCP |
| $3- | arguments to CTCP command, if any |
To customize CTCP VERSION replies:
on ^ctcp_request "% % VERSION*" (sender, recvr, type, args) {
ctcp $sender VERSION ircII $J + myscript;
};
# $EPIC: on_ctcp_request.txt,v 1.6 2007/10/08 16:28:18 jnelson Exp $