2.0/Modules/m rewrite

From AnopeWiki
Revision as of 22:08, 12 May 2014 by Azander (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Language

English

Section Extra_Modules
Module m_rewrite
Author Anope


Description

Allows you to re-write any command that it sent to/from clients.

command {...} 
The rewritten command
service= 
The service having it's command re-written.
rewrite= 
Enable or disable the individual re-write of the command.
rewrite_source= 
What to watch for to rewrite.
rewrite_target= 
What to change the command to.
rewrite_description= 
Description of the re-write.

Examples

Original command typed by user: /msg ChanServ CLEAR #myChannel USERS

What would be seen by Chanserv: /msg ChanServ KICK #myChannel *

Command configuration:

command {
     service= "ChanServ";
     rewrite = true;
     rewrite_source = "CLEAR $ USERS";
     rewrite_target = "KICK $1 *";
     rewrite_description = "Clears all users from a channel";
}

Default Configuration

/*
 * m_rewrite
 *
 * Allows rewriting commands sent to/from clients.
 */
#module { name = "m_rewrite" }
#command
{
        service = "ChanServ"; name = "CLEAR"; command = "rewrite"
 
        /* Enable m_rewrite. */
        rewrite = true
 
        /* Source message to match. A $ can be used to match anything. */
        rewrite_source = "CLEAR $ USERS"
 
        /*
         * Message to rewrite the source message to. A $ followed by a number, eg $0, gets
         * replaced by the number-th word from the source_message, starting from 0.
         */
        rewrite_target = "KICK $1 *"
 
        /*
         * The command description. This only shows up in HELP's output.
         * Comment this option to prevent the command from showing in the
         * HELP command.
         */
        rewrite_description = "Clears all users from a channel"
}