Trying to get errorFunction to work

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

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

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

Loading…
Cancel
Save