W
W
Wolf_Yout2021-09-15 22:23:59
Python
Wolf_Yout, 2021-09-15 22:23:59

The bot does not give an error about the lack of rights, how to fix it?

The code:

@bot.event
async def on_command_error(ctx, error):
  emoji = discord.utils.get(bot.emojis, name='symbol_error')
  if isinstance(error, commands.MissingPermissions):
    await ctx.reply(embed = discord.Embed(title=f'{str(emoji)} Ошибка',description = f'Извини, но у тебя нет прав!', colour = discord.Color.red()))
  elif isinstance(error, commands.BotMissingPermissions):
    await ctx.reply(embed = discord.Embed(title=f'{str(emoji)} Ошибка',description=f'Извини, но у меня нет прав!', colour = discord.Color.red()))

But the bot does not display the error BotMissingPermissions

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
mashincode, 2021-09-17
@mashincode

Give the bot rights and check the rights before sending messages - there is a method in the telegram api, how to do it in your library - I don’t know

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question