tuxbot-bot/cogs/utils/extra.py
Romain J 97980e96d1 feat(command|prefix): add prefix commands (new, del, list)
known issue: `prefix list` return weird result when there is no custom prefix
2019-12-17 22:41:54 +01:00

22 lines
575 B
Python

from discord.ext import commands
class commandsPlus(commands.Command):
def __init__(self, func, **kwargs):
super().__init__(func, **kwargs)
self.category = kwargs.get("category", 'other')
def commandExtra(*args, **kwargs):
return commands.command(*args, **kwargs, cls=commandsPlus)
class GroupPlus(commands.Group):
def __init__(self, func, **kwargs):
super().__init__(func, **kwargs)
self.category = kwargs.get("category", 'other')
def groupExtra(*args, **kwargs):
return commands.group(*args, **kwargs, cls=GroupPlus)