noghri/moocow — pull request #3 by drewlander (2013-10-16 17:26:04+00:00)
Title: Better routes

removed giant IF statement in favor of dispatch queues.
Still needs some work, but it works for now and looks a little better.

to add a new command:

Add it to $cmd_actions.
to add an action on !newcmd you would add the following to cmd_actions:
newcmd => sub { function_to_run(@) }

and to add the regex to match it modify @cmd_regex_array:
'!(newcmd)'
or if you needed what was after !newcmd:
'!(newcmd) (.*)

currently you get the arguments after the command, the channel and nick, but those can be modified.