Making code more modular

pull/4/head
sgoudham 5 years ago
parent c7e48c2e32
commit ece1224f71

@ -1,5 +1,4 @@
import asyncio
import datetime
import random
from discord import Colour, Embed, Member
@ -7,6 +6,7 @@ from discord.ext import commands
from discord.ext.commands import cooldown, command, BucketType
import settings
from settings import time, colour_list
# Set up the Cog
@ -38,8 +38,8 @@ class Interactive(commands.Cog):
# Set up the embed to display a random kissing gif
embed = Embed(
title=f"<a:huh:676195228872474643> <a:huh:676195228872474643> | **{member.display_name}** kissed **{target.display_name}**",
colour=Colour(int(random.choice(settings.colour_list))),
timestamp=datetime.datetime.utcnow())
colour=Colour(int(random.choice(colour_list))),
timestamp=time)
embed.set_image(url=random.choice(kissing_array))
embed.set_footer(text=f"Requested by {member}", icon_url='{}'.format(userAvatar))
@ -83,8 +83,8 @@ class Interactive(commands.Cog):
# Set up the embed to display a random killing gif
embed = Embed(
title=f"<:monkaW:718960264896184380> <:monkaW:718960264896184380> | **{member.display_name}** killed **{target.display_name}**",
colour=Colour(int(random.choice(settings.colour_list))),
timestamp=datetime.datetime.utcnow())
colour=Colour(int(random.choice(colour_list))),
timestamp=time)
embed.set_image(url=random.choice(killing_array))
embed.set_footer(text=f"Requested by {member}", icon_url='{}'.format(userAvatar))
@ -128,8 +128,8 @@ class Interactive(commands.Cog):
# Set up the embed to display a random cuddling gif
embed = Embed(
title=f"<:blushlook1:677310734123663363> <:blushlook2:679524467248201769> | **{member.display_name}** cuddled **{target.display_name}**",
colour=Colour(int(random.choice(settings.colour_list))),
timestamp=datetime.datetime.utcnow())
colour=Colour(int(random.choice(colour_list))),
timestamp=time)
embed.set_image(url=random.choice(cuddling_array))
embed.set_footer(text=f"Requested by {member}", icon_url='{}'.format(userAvatar))
@ -173,8 +173,8 @@ class Interactive(commands.Cog):
# Set up the embed to display a random slapping gif
embed = Embed(
title=f"<:baka:718942872061083678> <:baka:718942872061083678> | **{member.display_name}** slapped **{target.display_name}**",
colour=Colour(int(random.choice(settings.colour_list))),
timestamp=datetime.datetime.utcnow())
colour=Colour(int(random.choice(colour_list))),
timestamp=time)
embed.set_image(url=random.choice(slapping_array))
embed.set_footer(text=f"Requested by {member}", icon_url='{}'.format(userAvatar))
@ -218,8 +218,8 @@ class Interactive(commands.Cog):
# Set up the embed to display a random patting gif
embed = Embed(
title=f"<:xoxo:679893117482303564> <:xoxo:679893117482303564> | **{member.display_name}** patted **{target.display_name} on the head**",
colour=Colour(int(random.choice(settings.colour_list))),
timestamp=datetime.datetime.utcnow())
colour=Colour(int(random.choice(colour_list))),
timestamp=time)
embed.set_image(url=random.choice(patting_array))
embed.set_footer(text=f"Requested by {member}", icon_url='{}'.format(userAvatar))
@ -262,8 +262,8 @@ class Interactive(commands.Cog):
# Set up the embed to display a random lemon gif
embed = Embed(
title=f"<a:huh:676195228872474643> <a:huh:676195228872474643> | **{member.display_name}** Gives A Lemon To **{target.display_name}**",
colour=Colour(int(random.choice(settings.colour_list))),
timestamp=datetime.datetime.utcnow())
colour=Colour(int(random.choice(colour_list))),
timestamp=time)
embed.set_image(url=random.choice(lemon_array))
embed.set_footer(text=f"Requested by {member}", icon_url='{}'.format(userAvatar))

@ -1,5 +1,4 @@
import asyncio
import datetime
import discord
from decouple import config
@ -7,7 +6,7 @@ from discord import Embed
from discord.ext import commands
import settings
from settings import blank_space, enso_embedmod_colours
from settings import blank_space, enso_embedmod_colours, time
# Getting the Bot token from Environment Variables
API_TOKEN = config('DISCORD_TOKEN')
@ -74,7 +73,7 @@ async def on_member_join(member):
# Set up embed for the #newpeople channel
embed = Embed(title="\n**Welcome To Ensō!**",
colour=enso_embedmod_colours,
timestamp=datetime.datetime.utcnow())
timestamp=time)
embed.set_thumbnail(url=server_icon)
embed.set_image(url=welcome_gif)

Loading…
Cancel
Save