diff --git a/cogs/WaifuImages.py b/cogs/WaifuImages.py index 194bb9f7..0211da27 100644 --- a/cogs/WaifuImages.py +++ b/cogs/WaifuImages.py @@ -176,6 +176,22 @@ class Waifus(commands.Cog): 'izzy', 'david', 'clarity', 'angel', 'chloe', 'corona', 'skye'] + def displayServerImage(array, ctx, name): + # If the channel that the command has been sent is in the list of accepted channels + if str(ctx.channel) in settings.channels: + # Set member as the author + member = ctx.message.author + userAvatar = member.avatar_url + + embed = discord.Embed( + title=f"**Look At What A Cutie {name.capitalize()} is!! **", + colour=discord.Colour(random.choice(settings.colour_list))) + embed.set_image(url=random.choice(array)) + embed.set_footer(text=f"Requested by {member}", icon_url='{}'.format(userAvatar)) + embed.timestamp = datetime.datetime.utcnow() + + return embed + if name: proper_name = name.lower() try: @@ -212,22 +228,5 @@ class Waifus(commands.Cog): await ctx.send(embed=embed) -def displayServerImage(array, ctx, name): - # If the channel that the command has been sent is in the list of accepted channels - if str(ctx.channel) in settings.channels: - # Set member as the author - member = ctx.message.author - userAvatar = member.avatar_url - - embed = discord.Embed( - title=f"**Look At What A Cutie {name.capitalize()} is!! **", - colour=discord.Colour(random.choice(settings.colour_list))) - embed.set_image(url=random.choice(array)) - embed.set_footer(text=f"Requested by {member}", icon_url='{}'.format(userAvatar)) - embed.timestamp = datetime.datetime.utcnow() - - return embed - - def setup(bot): bot.add_cog(Waifus(bot))