Trying to get errorFunction to work

pull/2/head
sgoudham 5 years ago
parent fe6e7dcb63
commit b334ad877b

@ -1,4 +1,3 @@
import asyncio
import datetime
import random
@ -42,7 +41,7 @@ class Embeds(commands.Cog):
else:
await errorFunction(ctx)
await errorFunction()
#
except FileNotFoundError as e:
print(e)
@ -72,7 +71,7 @@ class Embeds(commands.Cog):
else:
await errorFunction(ctx)
await errorFunction()
except FileNotFoundError as e:
print(e)
@ -102,7 +101,7 @@ class Embeds(commands.Cog):
else:
await errorFunction(ctx)
await errorFunction()
except FileNotFoundError as e:
print(e)
@ -131,19 +130,14 @@ class Embeds(commands.Cog):
await ctx.send(embed=embed)
else:
await errorFunction(ctx)
await errorFunction()
except FileNotFoundError as e:
print(e)
async def errorFunction(ctx):
message = await ctx.send(error_function())
# Let the user read the message for 2.5 seconds
await asyncio.sleep(2.5)
# Delete the message
await message.delete()
def errorFunction():
return error_function()
def setup(bot):

@ -117,7 +117,7 @@ class Fun(commands.Cog):
else:
await errorFunction(ctx)
await errorFunction()
except FileNotFoundError as e:
print(e)

Loading…
Cancel
Save