Finished meme

This commit is contained in:
tropii 2023-11-24 19:39:55 -05:00
parent adee477e90
commit 2ae7cbf3e9

View File

@ -43,16 +43,18 @@ 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)
await ctx.send(response.json()) json_data = json.loads(response.text)
""" description = json_data["description"]
json_data = json.loads(response.text) url = json_data["url"]
new_data = json_data[0]
title = new_data["title"] embed = discord.Embed(
image = new_data["url"] title="Meme",
em = discord.Embed(title=title, color=ctx.author.color) description=description,
em.set_image(url=image) color=ctx.author.color
await ctx.send(embed=em) )
""" embed.set_image(url=url)
await ctx.send(embed=embed)
async def setup(bot): async def setup(bot):
await bot.add_cog(meme(bot)) await bot.add_cog(meme(bot))