added rudimentary error handling

This commit is contained in:
Aaron Riedel 2022-01-23 03:19:43 +01:00
parent 56bba123c7
commit c9ad91a86a

8
bot.py
View file

@ -45,6 +45,14 @@ def is_gm():
emojinumbers = ["0\u20E3", "1\u20E3" , "2\u20E3" , "3\u20E3" , "4\u20E3" , "5\u20E3" , "6\u20E3" , "7\u20E3" , "8\u20E3" , "9\u20E3"] emojinumbers = ["0\u20E3", "1\u20E3" , "2\u20E3" , "3\u20E3" , "4\u20E3" , "5\u20E3" , "6\u20E3" , "7\u20E3" , "8\u20E3" , "9\u20E3"]
bot.help_command = commands.DefaultHelpCommand(dm_help=True, no_category="Befehle die du nutzen kannst:")
@bot.event
async def on_command_error(ctx, error):
await ctx.message.delete()
print(error)
await ctx.send(content="Fehler: %s" % error, delete_after=20)
@bot.event @bot.event
async def on_ready(): async def on_ready():
print("Bot ready on Version %s..." % discord.__version__) print("Bot ready on Version %s..." % discord.__version__)