discord.py icon indicating copy to clipboard operation
discord.py copied to clipboard

ignore_extra option for commands.Bot

Open sevenc-nanashi opened this issue 4 years ago • 2 comments

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)

sevenc-nanashi avatar Oct 17 '20 00:10 sevenc-nanashi

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

Vexs avatar Oct 17 '20 00:10 Vexs

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.

Rapptz avatar Oct 17 '20 03:10 Rapptz