diff --git a/cogs/economy.py b/cogs/economy.py index 1594e20..2e322b1 100644 --- a/cogs/economy.py +++ b/cogs/economy.py @@ -267,7 +267,10 @@ def setup(client) -> commands.Cog: async def create_account(ctx): await ctx.send("You dont have a bank account registered in our database! I can resgister you now, is that okay? *(Yes/No)*") - message = await client.wait_for("message", check=lambda message: message.author.id != client.user.id, timeout=15) + try: + message = await client.wait_for("message", check=lambda message: message.author.id != client.user.id, timeout=15) + except asyncio.TimeoutError: + return await ctx.send(f"{ctx.author.mention} | Timed out! Please try again!") if any(x in message.content.lower() for x in ["yes", "y", "yea", "yeah", "yup"]): return await ctx.send(await add_user(ctx.author)) else: diff --git a/main.py b/main.py index 93ef88b..8d0b3d8 100644 --- a/main.py +++ b/main.py @@ -763,6 +763,11 @@ async def on_message_error(error: Exception, message): colour="#516BF2" ) return await message.reply(message.author.mention, embed=embed) + elif isinstance(error, PermissionError): + try: + return await message.reply("I don't have permission to do that!", delete_after=3) + except: + pass else: raise(error)