Answer the question
In order to leave comments, you need to log in
How to display an error through the bot if the user did not enter one of the arguments?
I have two arguments in command arg1 and arg2.
How to make it so that an error is displayed (in a video message) to the user if he did not enter / skipped one / all arguments?
Answer the question
In order to leave comments, you need to log in
https://discordpy.readthedocs.io/en/stable/ext/com...
class MyBot(commands.Bot):
async def on_command_error(self, ctx, e):
if isinstance(e, commands.MissingRequiredArgument):
await ctx.send(f"Недостаточно аргументов: {e.param} отсутствует")
else:
super().on_command_error(ctx, e) # вызвываем оригинальный обработчик ошибок команд
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question