Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add proxy variable #9739

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 7 additions & 1 deletion discord/webhook/async_.py
Expand Up @@ -1231,6 +1231,8 @@ def from_url(
cls,
url: str,
*,
proxy: Optional[str] = None,
proxy_auth: Optional[aiohttp.BasicAuth] = None,
session: aiohttp.ClientSession = MISSING,
client: Client = MISSING,
bot_token: Optional[str] = None,
Expand All @@ -1245,6 +1247,10 @@ def from_url(
------------
url: :class:`str`
The URL of the webhook.
proxy: Optional[:class:`str`]
Proxy URL.
proxy_auth: Optional[:class:`aiohttp.BasicAuth`]
An object that represents proxy HTTP Basic Authorization.
session: :class:`aiohttp.ClientSession`
The session to use to send requests with. Note
that the library does not manage the session and
Expand Down Expand Up @@ -1291,7 +1297,7 @@ def from_url(

data: Dict[str, Any] = m.groupdict()
data['type'] = 1
return cls(data, session, token=bot_token, state=state) # type: ignore # Casting dict[str, Any] to WebhookPayload
return cls(data, session, token=bot_token, state=state, proxy=proxy, proxy_auth=proxy_auth) # type: ignore # Casting dict[str, Any] to WebhookPayload

@classmethod
def _as_follower(cls, data, *, channel, user) -> Self:
Expand Down