aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Johannes Christ <[email protected]>2024-07-13 08:18:54 +0200
committerGravatar Johannes Christ <[email protected]>2024-07-13 08:18:54 +0200
commit3c9abdd5f529d87218d6b67dc44e284878a996c9 (patch)
treefe259e6eca0d909a8b3460c34bafd48d4a7ecd9e
parentMerge pull request #231 from python-discord/fix-status-embed-problems (diff)
Set explicit user-agent header
Allow people to know that we're not just a dumb scraper, but we're business professionals.
-rw-r--r--arthur/__main__.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/arthur/__main__.py b/arthur/__main__.py
index 8b013b4..6416e09 100644
--- a/arthur/__main__.py
+++ b/arthur/__main__.py
@@ -3,6 +3,7 @@
import asyncio
import aiohttp
+import aiohttp.http
import discord
from discord.ext import commands
@@ -22,8 +23,9 @@ async def main() -> None:
intents.invites = False
intents.webhooks = False
intents.integrations = False
+ user_agent = f"github.com/python-discord/king-arthur ({aiohttp.http.SERVER_SOFTWARE})"
- async with aiohttp.ClientSession() as session:
+ async with aiohttp.ClientSession(headers={"User-Agent": user_agent}) as session:
arthur.instance = KingArthur(
guild_id=CONFIG.guild_id,
http_session=session,