FuelRats / pipsqueak

ED Fuel rats IRC bot
Other
13 stars 14 forks source link

The Trigger class and modifications to how commands are decorated and invoked #266

Closed MHajoha closed 6 years ago

MHajoha commented 6 years ago

Changes:

The message !mycommand arg1 arg2 would result in:

words = ["mycommand", "arg1", "arg2"]
words_eol = ["mycommand arg1 arg2", "arg1 arg2", "arg2"]

(if the command prefix is !, of course.)

Each decorator calls the underlying function with all four arguments (calling the wrapper created by the decorator below) or only bot, trigger if it is the bottommost decorator in the chain (calling the command function directly). An exception to this will likely be the parametrize decorator, which will, if present, always be at the bottom, calling the command function with bot, trigger followed by the parameters specified.

theunkn0wn1 commented 6 years ago

oh come on, what did i break this time?

theunkn0wn1 commented 6 years ago

LGTM.