mirror of
https://bitbucket.org/SosoM1k0r31z31/funny-cat.git
synced 2025-04-11 22:55:46 +02:00
add character search
This commit is contained in:
parent
41a75ed98e
commit
48e0a75379
14
bot.py
14
bot.py
@ -1491,4 +1491,18 @@ async def anchovy(ctx):
|
||||
anchovy = secrets.choice(lines)
|
||||
await ctx.send(f"{anchovy}")
|
||||
|
||||
@bot.command()
|
||||
async def character(ctx, *, char):
|
||||
url = "https://api.jikan.moe/v3/search/character?q=mako-reizei&page=1"
|
||||
headers = {'User-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:80.0) Gecko/20100101 Firefox/80.0'}
|
||||
|
||||
r = requests.get(url, headers=headers)
|
||||
s = r.json()
|
||||
|
||||
name = (s['results'][0]['name'])
|
||||
image = (s['results'][0]['image_url'])
|
||||
|
||||
await ctx.send(f"Search result\n{image}\n`{name}`")
|
||||
|
||||
|
||||
bot.run(TOKEN)
|
||||
|
Loading…
x
Reference in New Issue
Block a user