From 89f171a964dffb5850bb19f855d406d78345759c Mon Sep 17 00:00:00 2001 From: sgoudham Date: Wed, 17 Jun 2020 20:08:49 +0100 Subject: [PATCH] Trying to fix Student Jon command --- cogs/WaifuImages.py | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/cogs/WaifuImages.py b/cogs/WaifuImages.py index ebda5ec3..3587af0e 100644 --- a/cogs/WaifuImages.py +++ b/cogs/WaifuImages.py @@ -165,16 +165,28 @@ class Waifus(commands.Cog): def displayServerImage(array, ctx, name): if str(ctx.channel) in channels: - # set member as the author - member = ctx.message.author - userAvatar = member.avatar_url - - embed = discord.Embed( - title=f"**Oh Look! A Cute Picture of {name.capitalize()}!! **", - colour=discord.Colour(random.choice(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() + if name is 'studentjon': + # set member as the author + member = ctx.message.author + userAvatar = member.avatar_url + + embed = discord.Embed( + title=f"**Oh Look! A Cute Picture of Student Jon!! **", + colour=discord.Colour(random.choice(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() + else: + # set member as the author + member = ctx.message.author + userAvatar = member.avatar_url + + embed = discord.Embed( + title=f"**Oh Look! A Cute Picture of {name.capitalize()}!! **", + colour=discord.Colour(random.choice(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