2.0/Modules/m rewrite

From AnopeWiki
Jump to: navigation, search


Section Extra_Modules
Module m_rewrite
Author Anope


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

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


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" }
        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"