From /help file:
Code:
 on <level>:TEXT:<matchtext>:<*><?><#[,#]><commands>

Example:
Code:
 ON *:text:!test:#:{ ;do something }

If you want it to work only on certain channels:
Code:
 ON *:text:!test:#channel1,#channel2:{ ;do something }