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

馃泜 added User-Agent header #274

Merged
merged 1 commit into from
Dec 1, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Lunarmagpie marked this conversation as resolved.
Show resolved Hide resolved
from . import __package__
Lunarmagpie marked this conversation as resolved.
Show resolved Hide resolved
from .._config import GatewayConfig
from ..exceptions import (
Expand Down Expand Up @@ -73,6 +75,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.__session: ClientSession = ClientSession(headers=headers)

Expand Down