How to reply to !commands

Jun 20th, 2018
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # This is the best piece of code to use and learn from to code a bot or to have automatic replies from your client.
  2. # The regex will look at the first chr of your trigger. in this example it could be !paste @paste or .paste
  3. # If @paste is used, the bot will reply with a channel message, the other 2 triggers would send out a /notice
  4. # The second and 3rd lines are there to prevent pricks to try and flood you off. (one request per 60 seconds, if more HALT)
  5. # you could add more characters in between the brackets, like this: [@!.%$-]
  7. on $*:TEXT:/^[@!.]paste/Si:#:{
  8.   inc -u60 %ms. [ $+ [ $address($nick,2) ] ]
  9.   if (%ms. [ $+ [ $address($nick,2) ] ] >= 1) { halt }
  10.   $iif($left($1,1) == @,.msg #,.notice $nick) Please paste your code or long text on: and then give us the generated link. *DO NOT* paste text in here.
  11. }
RAW Paste Data