Meme API Update
This commit is contained in:
parent
aa2787fd4a
commit
5ec774ed5b
@ -31,7 +31,7 @@ class meme(commands.Cog):
|
|||||||
@commands.hybrid_command(name="meme", description="Shows a random meme")
|
@commands.hybrid_command(name="meme", description="Shows a random meme")
|
||||||
@commands.check(is_enabled)
|
@commands.check(is_enabled)
|
||||||
async def meme(self, ctx):
|
async def meme(self, ctx):
|
||||||
url = "https://reddit-meme.p.rapidapi.com/memes/trending"
|
url = "https://reddit-meme.p.rapidapi.com/memes/top"
|
||||||
|
|
||||||
headers = {
|
headers = {
|
||||||
"X-RapidAPI-Key": "5f878d0f8dmshe3320b9c7df0e88p1b8038jsnf03c5763a129",
|
"X-RapidAPI-Key": "5f878d0f8dmshe3320b9c7df0e88p1b8038jsnf03c5763a129",
|
||||||
@ -41,13 +41,16 @@ 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)
|
||||||
|
|
||||||
json_data = json.loads(response.text)
|
await ctx.send(response.json())
|
||||||
new_data = json_data[1]
|
"""
|
||||||
title = new_data["title"]
|
json_data = json.loads(response.text)
|
||||||
image = new_data["url"]
|
new_data = json_data[0]
|
||||||
em = discord.Embed(title=title, color=ctx.author.color)
|
title = new_data["title"]
|
||||||
em.set_image(url=image)
|
image = new_data["url"]
|
||||||
await ctx.send(embed=em)
|
em = discord.Embed(title=title, color=ctx.author.color)
|
||||||
|
em.set_image(url=image)
|
||||||
|
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))
|
Loading…
Reference in New Issue
Block a user