Allowed the error functions to be in EnsoBot.py

Added the ~slap command
pull/2/head
sgoudham 5 years ago
parent fe520fdb15
commit fe6e7dcb63

@ -198,6 +198,11 @@ async def on_raw_reaction_remove(payload):
print(e)
# Error handling function to make sure that the commands only work in enso-chan-commands
def error_function():
return "Sorry! I only work in #enso-chan-commands!"
# Run the bot, allowing to come online
try:
client.run(API_TOKEN)

@ -7,7 +7,7 @@ from discord.ext import commands
from discord.ext.commands import BucketType, cooldown
import config
from cogs.FunCommands import error_function
from EnsoBot import error_function
colour_list = [c for c in config.colors.values()]
channels = ["enso-chan-commands", 'general']
@ -42,12 +42,8 @@ class Embeds(commands.Cog):
else:
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()
await errorFunction(ctx)
#
except FileNotFoundError as e:
print(e)
@ -76,12 +72,8 @@ class Embeds(commands.Cog):
else:
message = await ctx.send(error_function())
await errorFunction(ctx)
# 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)
@ -110,12 +102,8 @@ class Embeds(commands.Cog):
else:
message = await ctx.send(error_function())
await errorFunction(ctx)
# 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)
@ -143,15 +131,19 @@ class Embeds(commands.Cog):
await ctx.send(embed=embed)
else:
await errorFunction(ctx)
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()
except FileNotFoundError as e:
print(e)
def setup(bot):

@ -1,4 +1,3 @@
import asyncio
import random
import discord
@ -6,7 +5,7 @@ from discord.ext import commands
from discord.ext.commands import BucketType, cooldown
import config
from cogs.WaifuImages import error_function
from cogs.Embeds import errorFunction
colour_list = [c for c in config.colors.values()]
@ -118,12 +117,7 @@ class Fun(commands.Cog):
else:
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()
await errorFunction(ctx)
except FileNotFoundError as e:
print(e)

@ -59,6 +59,12 @@ class CustomHelp(commands.Cog):
"\n Allows the user to throw an insult to someone in the server" +
"\n *(Perms: Co-Owner)*",
inline=True)
embed.add_field(
name="\u200b",
value="**➳ ~slap**" +
"\n Allows the user to slap someone in the server" +
"\n *(Perms: Everyone)*",
inline=True)
embed.add_field(
name="\u200b",
value="**➳ ~compliment**" +

@ -1,4 +1,3 @@
import asyncio
import datetime
import random
import string
@ -8,6 +7,7 @@ from discord.ext import commands
from discord.ext.commands import cooldown, BucketType
import config
from cogs.Embeds import errorFunction
channels = ["enso-chan-commands"]
@ -41,12 +41,7 @@ class Waifus(commands.Cog):
else:
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()
await errorFunction(ctx)
except FileNotFoundError as e:
print(e)
@ -74,12 +69,7 @@ class Waifus(commands.Cog):
else:
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()
await errorFunction(ctx)
except FileNotFoundError as e:
print(e)
@ -106,12 +96,8 @@ class Waifus(commands.Cog):
else:
message = await ctx.send(error_function())
await errorFunction(ctx)
# 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)
@ -176,11 +162,6 @@ def displayServerImage(array, ctx, name):
return embed
# Error handling function to make sure that the commands only work in bot-commands
def error_function():
return "Sorry! I only work in #enso-chan-commands!"
def setup(bot):
bot.add_cog(Waifus(bot))

Loading…
Cancel
Save