From 1ce86069fc02a0811efef19b85c1b5ddc8569110 Mon Sep 17 00:00:00 2001 From: artie Date: Sun, 27 Oct 2024 17:14:21 +0100 Subject: [PATCH] add UA to trace cmd --- artemis/cogs/anime.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/artemis/cogs/anime.py b/artemis/cogs/anime.py index 99095f0..e4e1bf2 100644 --- a/artemis/cogs/anime.py +++ b/artemis/cogs/anime.py @@ -236,7 +236,11 @@ class Anime(commands.Cog): url = ctx.message.attachments[0].url 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: raise ArtemisError("Error: The bot has reached max API search quota for the month.") json = await r.json()