diff options
author | 2024-07-13 08:18:54 +0200 | |
---|---|---|
committer | 2024-07-13 08:18:54 +0200 | |
commit | 3c9abdd5f529d87218d6b67dc44e284878a996c9 (patch) | |
tree | fe259e6eca0d909a8b3460c34bafd48d4a7ecd9e | |
parent | Merge 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__.py | 4 |
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, |