Skip to content

Commit

Permalink
Merge pull request #236 from python-discord/set-user-agent-explicitly
Browse files Browse the repository at this point in the history
Set explicit user-agent header
  • Loading branch information
shtlrs authored Jul 13, 2024
2 parents 9d94ff6 + 3c9abdd commit 91eec09
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion arthur/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import asyncio

import aiohttp
import aiohttp.http
import discord
from discord.ext import commands

Expand All @@ -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,
Expand Down

0 comments on commit 91eec09

Please sign in to comment.