discord.py
discord.py copied to clipboard
ignore_extra option for commands.Bot
The Problem
Problem that I have to write ignore_extra=False in all commands when I want to raise Too many arguments
.
The Ideal Solution
ignore_extra option in commands.Bot. Like:
bot = commands.Bot(command_prefix="!", ignore_extra=False)
The Current Solution
write ignore_extra=False
to all @bot.command
(or @commands.command
)
or change the lib.(core.py line 230)
(Maybe not right sentence, sorry. I'm Japanese)
This is pretty niche and would be best accomplished by writing your own decorator that wrapped the commands.command deco, ala
def mydeco(func):
return commands.command(ignore_extra=False)(func)
@mydeco
async def mycommand...
Should work
Commands can be created without a bot object at all so it's improbable to configure them in such a way currently without resorting to a merge trick upon the command object being added. If this feature were to be implemented it'd have to be using command_attrs=dict(ignore_extra=False)
instead. I'm unsure how feasible this is though.