Answer the question
In order to leave comments, you need to log in
DISLASH.py how to output an error about lack of rights?
I did the restriction of rights with:
According to the documentation it was written to use the on_slash_command_error event
I already tried like this:
@slash.event
async def on_slash_command_error(inter, error):
if isinstance(error, dislash.application_commands.errors.MissingPermissions):
await inter.reply(
embed=discord.Embed(title=f'Ошибка',
description=f'Извини, но у тебя нет прав!',
colour=discord.Color.red()))
elif isinstance(error, dislash.application_commands.errors.BotMissingPermissions):
await inter.reply(
embed=discord.Embed(title=f'Ошибка',
description=f'Извини, но у меня нет прав!',
colour=discord.Color.red()))
if isinstance(error, dislash.errors.MissingPermissions):
await inter.reply(
embed=discord.Embed(title=f'Ошибка',
description=f'Извини, но у тебя нет прав!',
colour=discord.Color.red()))
elif isinstance(error, dislash.errors.BotMissingPermissions):
await inter.reply(
embed=discord.Embed(title=f'Ошибка',
description=f'Извини, но у меня нет прав!',
colour=discord.Color.red()))
if isinstance(error, dislash.MissingPermissions):
await inter.reply(
embed=discord.Embed(title=f'Ошибка',
description=f'Извини, но у тебя нет прав!',
colour=discord.Color.red()))
elif isinstance(error, dislash.BotMissingPermissions):
await inter.reply(
embed=discord.Embed(title=f'Ошибка',
description=f'Извини, но у меня нет прав!',
colour=discord.Color.red()))
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question