mirror of
https://github.com/artiemis/artemis.git
synced 2026-02-14 08:31:55 +00:00
add UA to trace cmd
This commit is contained in:
parent
510b5a8778
commit
1ce86069fc
@ -236,7 +236,11 @@ class Anime(commands.Cog):
|
|||||||
url = ctx.message.attachments[0].url
|
url = ctx.message.attachments[0].url
|
||||||
|
|
||||||
await ctx.typing()
|
await ctx.typing()
|
||||||
async with self.bot.session.get(f"https://api.trace.moe/search?anilistInfo&url={url}") as r:
|
|
||||||
|
headers = {"User-Agent": ctx.bot.user_agent}
|
||||||
|
async with self.bot.session.get(
|
||||||
|
f"https://api.trace.moe/search?anilistInfo&url={url}", headers=headers
|
||||||
|
) as r:
|
||||||
if r.status == 402:
|
if r.status == 402:
|
||||||
raise ArtemisError("Error: The bot has reached max API search quota for the month.")
|
raise ArtemisError("Error: The bot has reached max API search quota for the month.")
|
||||||
json = await r.json()
|
json = await r.json()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user