This commit is contained in:
tropii 2023-11-24 17:37:42 -05:00
parent df3307f185
commit 781ec9c820

View File

@ -41,10 +41,14 @@ class meme(commands.Cog):
async with session.get("https://reddit-meme.p.rapidapi.com/memes/trending") as response: async with session.get("https://reddit-meme.p.rapidapi.com/memes/trending") as response:
response = requests.request("GET", url, headers=headers) response = requests.request("GET", url, headers=headers)
embed = discord.Embed(title=response.json()['title'], color=discord.Color.random()) json_data = json.loads(response.text)
await ctx.send(embed=embed) meme = json_data["postLink"]
title = json_data["title"]
await ctx.send(response.json()) 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): async def setup(bot):
await bot.add_cog(meme(bot)) await bot.add_cog(meme(bot))