Skip to content
This repository has been archived by the owner on Dec 26, 2022. It is now read-only.

Commit

Permalink
Merge pull request #274 from Lunarmagpie/user-agent
Browse files Browse the repository at this point in the history
🛂 added User-Agent header
  • Loading branch information
Lunarmagpie authored Dec 1, 2021
2 parents 8558458 + 7eba5e6 commit b564533
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pincer/core/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

from aiohttp import ClientSession, ClientResponse

# Im open for ideas on how to get __version__ without doing this
import pincer
from . import __package__
from .ratelimiter import RateLimiter
from .._config import GatewayConfig
Expand Down Expand Up @@ -76,6 +78,7 @@ def __init__(self, token: str, *, version: int = None, ttl: int = 5):

headers: Dict[str, str] = {
"Authorization": f"Bot {token}",
"User-Agent": f"DiscordBot (https://github.com/Pincer-org/Pincer, {pincer.__version__})" # noqa: E501
}
self.__rate_limiter = RateLimiter()
self.__session: ClientSession = ClientSession(headers=headers)
Expand Down

0 comments on commit b564533

Please sign in to comment.