I have a decorator
class Utilities(commands.Cog):
def has_any_role(self, *items):
async def predicate(ctx):
ctx.command.needed_roles = items
return await commands.has_any_role(*items).predicate(ctx)
return commands.check(predicate)
@has_any_role('Owner', 'Moderator')
@commands.command()
async def foo(...):
...
However now when I try to access a Command
s needed_roles
attribute, it'll only return Moderator for foo
, since "Owner"
is lost in self. How can I fix this without just putting the function outside of the class?