Site Tools


on_ctcp

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

on_ctcp [2011/10/31 20:01] (current)
Line 1: Line 1:
 +======Synopsis:​======
 +[[on]] [<​modes>​]ctcp [<​serial#>​] [-|^]<​match>​ { <​action>​ }
 +
 +======Summary:​======
 +Triggered by other people'​s [[ctcp]] commands
 +
 +======Description:​======
 +This hook is triggered whenever the client has finished processing a CTCP 
 +request and has determined the final disposition of the request should be 
 +displaying it to the user.  This hook cannot be used to control how the 
 +client processes CTCP replies. ​ You should use the [[on ctcp_request]] hook 
 +for that.  Doing anything more complicated than an [[echo]] in an [[on ctcp]] ​
 +hook is considered bad style.
 +
 +======Parameters:​======
 +|$0    |Who sent the [[CTCP]] ​                   |
 +|$1    |Who they sent it to (your nickname or a channel you're on) |
 +|$2    |What kind of [[CTCP]] ​                   |
 +|$3-   ​|Arguments of [[CTCP]] command (if any)   |
 +
 +======Examples:​======
 +To customize the normal CTCP message:
 +   on ^ctcp * (sender, recvr, ctcp, args) {
 +      if (*args) {
 +         @args = ': ' ## args;
 +      };
 +      if (ischannel($recvr)) {
 +         xecho -b $sender sent to $recvr a CTCP $ctcp$args;
 +      } {
 +         xecho -b $sender sent you a CTCP $ctcp$args;
 +      };
 +   };
 +
 +======History======
 +
  
on_ctcp.txt ยท Last modified: 2011/10/31 20:01 (external edit)