diff --git a/EnsoBot.py b/EnsoBot.py index b481c768..61bc1d3b 100644 --- a/EnsoBot.py +++ b/EnsoBot.py @@ -46,6 +46,17 @@ async def on_command_error(ctx, error): await message.delete() +@client.event +async def on_command_error(ctx, target: discord.member): + if isinstance(target, commands.MissingRequiredArgument): + message = await ctx.send("Uh oh! Couldn't find anyone to mention! Try again!") + + # Let the user read the message for 2.5 seconds + await asyncio.sleep(1.5) + # Delete the message + await message.delete() + + try: client.run(API_TOKEN) except discord.errors.LoginFailure as e: