From 781ec9c8209c995e9ea0aceda9fb8631b389f985 Mon Sep 17 00:00:00 2001 From: tropii <97747461+TropiiDev@users.noreply.github.com> Date: Fri, 24 Nov 2023 17:37:42 -0500 Subject: [PATCH] Meme --- commands/meme.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/commands/meme.py b/commands/meme.py index 2e03bb9..7abab4a 100644 --- a/commands/meme.py +++ b/commands/meme.py @@ -41,10 +41,14 @@ class meme(commands.Cog): async with session.get("https://reddit-meme.p.rapidapi.com/memes/trending") as response: response = requests.request("GET", url, headers=headers) - embed = discord.Embed(title=response.json()['title'], color=discord.Color.random()) - await ctx.send(embed=embed) - - await ctx.send(response.json()) + json_data = json.loads(response.text) + meme = json_data["postLink"] + title = json_data["title"] + image = json_data["url"] + em = discord.Embed(title=title, color=ctx.author.color) + em.set_image(url=image) + em.set_footer(text=meme) + await ctx.send(embed=em) async def setup(bot): await bot.add_cog(meme(bot)) \ No newline at end of file