I have a on_command_error()
event in my discord bot, but sometimes when I'm writing new commands it's just not enough information, how would I make it toggleable? So that if its off it shows the python error and if it's on it would just show a small user friendly error. Here's what I have right now:
@bot.listen()
async def on_command_error(icy, error):
try:
await icy.message.delete()
except:
pass
if __ERRORS__ == 0:
embed = discord.Embed(title='**Error**', description=f'{error}', color=0xff2b2b)
embed.set_thumbnail(url='https://media.tenor.com/images/fe70a29bb71a79150401c59c8991c4b8/tenor.gif')
embed.set_footer(text=__footer__)
await icy.send(embed=embed, delete_after=__deletetime__)
if __ERRORS__ == 1:
print(COLOR['RED'], f'| ERROR |',COLOR['YELLOW'],f'{error}', COLOR["DEFAULT"])
question from:
https://stackoverflow.com/questions/66065536/how-would-i-make-on-command-error-toggleable 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…