FuelRats / pipsqueak

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

refactored all the @require{role} commands into a single command #244

Closed theunkn0wn1 closed 6 years ago

theunkn0wn1 commented 6 years ago

I found it somewhat wasteful to have different @require decorators for each permission level, eg @require_rat ,@require_techrat, and for some reason @require_recruit. Half the decorators arn't even in use! All the decorators share the same base code, the only difference is a hardcoded constant int. What ive done is replaced all the old decorators with a single require_permission decorator.

its signature is as follows:

def require_permission(privilage:Permissions, message =''):
   pass

and comes with an enum Permissions.

theunkn0wn1 commented 6 years ago

Oh.. and this depends on #240