From 3c9abdd5f529d87218d6b67dc44e284878a996c9 Mon Sep 17 00:00:00 2001 From: Johannes Christ Date: Sat, 13 Jul 2024 08:18:54 +0200 Subject: Set explicit user-agent header Allow people to know that we're not just a dumb scraper, but we're business professionals. --- arthur/__main__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'arthur/__main__.py') 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, -- cgit v1.2.3