Trying to get errorFunction to work

pull/2/head
sgoudham 4 years ago
parent 3a8657f21a
commit 1be066ec59

@ -1,3 +1,4 @@
import asyncio
import datetime
import random
@ -40,9 +41,13 @@ class Embeds(commands.Cog):
await ctx.send(embed=embed)
else:
message = error_function()
# Let the user read the message for 2.5 seconds
await asyncio.sleep(2.5)
# Delete the message
await message.delete()
await errorFunction()
#
except FileNotFoundError as e:
print(e)
@ -70,8 +75,12 @@ class Embeds(commands.Cog):
await ctx.send(embed=embed)
else:
message = error_function()
await errorFunction()
# Let the user read the message for 2.5 seconds
await asyncio.sleep(2.5)
# Delete the message
await message.delete()
except FileNotFoundError as e:
print(e)
@ -100,8 +109,12 @@ class Embeds(commands.Cog):
await ctx.send(embed=embed)
else:
message = error_function()
await errorFunction()
# Let the user read the message for 2.5 seconds
await asyncio.sleep(2.5)
# Delete the message
await message.delete()
except FileNotFoundError as e:
print(e)
@ -130,15 +143,15 @@ class Embeds(commands.Cog):
await ctx.send(embed=embed)
else:
await errorFunction()
message = error_function()
# Let the user read the message for 2.5 seconds
await asyncio.sleep(2.5)
# Delete the message
await message.delete()
except FileNotFoundError as e:
print(e)
def errorFunction():
return error_function()
def setup(bot):
bot.add_cog(Embeds(bot))

@ -1,3 +1,4 @@
import asyncio
import random
import discord
@ -5,7 +6,7 @@ from discord.ext import commands
from discord.ext.commands import BucketType, cooldown
import config
from cogs.Embeds import errorFunction
from EnsoBot import error_function
colour_list = [c for c in config.colors.values()]
@ -117,7 +118,12 @@ class Fun(commands.Cog):
else:
await errorFunction()
message = error_function()
# Let the user read the message for 2.5 seconds
await asyncio.sleep(2.5)
# Delete the message
await message.delete()
except FileNotFoundError as e:
print(e)

@ -1,3 +1,4 @@
import asyncio
import datetime
import random
import string
@ -7,7 +8,7 @@ from discord.ext import commands
from discord.ext.commands import cooldown, BucketType
import config
from cogs.Embeds import errorFunction
from EnsoBot import error_function
channels = ["enso-chan-commands"]
@ -41,7 +42,12 @@ class Waifus(commands.Cog):
else:
await errorFunction()
message = error_function()
# Let the user read the message for 2.5 seconds
await asyncio.sleep(2.5)
# Delete the message
await message.delete()
except FileNotFoundError as e:
print(e)
@ -69,7 +75,12 @@ class Waifus(commands.Cog):
else:
await errorFunction()
message = error_function()
# Let the user read the message for 2.5 seconds
await asyncio.sleep(2.5)
# Delete the message
await message.delete()
except FileNotFoundError as e:
print(e)
@ -96,7 +107,12 @@ class Waifus(commands.Cog):
else:
await errorFunction()
message = error_function()
# Let the user read the message for 2.5 seconds
await asyncio.sleep(2.5)
# Delete the message
await message.delete()
except FileNotFoundError as e:
print(e)

Loading…
Cancel
Save