mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-06-07 12:18:59 +00:00
Fix Webhook states for stateful objects
This commit is contained in:
parent
7f4c57dd5a
commit
33dc3411ac
@ -102,7 +102,7 @@ class WebhookAdapter:
|
||||
|
||||
def store_user(self, data):
|
||||
# mocks a ConnectionState for appropriate use for Message
|
||||
return BaseUser(state=self, data=data)
|
||||
return BaseUser(state=self.webhook._state, data=data)
|
||||
|
||||
def execute_webhook(self, *, payload, wait=False, file=None, files=None):
|
||||
if file is not None:
|
||||
@ -197,7 +197,7 @@ class AsyncWebhookAdapter(WebhookAdapter):
|
||||
|
||||
# transform into Message object
|
||||
from .message import Message
|
||||
return Message(data=data, state=self, channel=self.webhook.channel)
|
||||
return Message(data=data, state=self.webhook._state, channel=self.webhook.channel)
|
||||
|
||||
class RequestsWebhookAdapter(WebhookAdapter):
|
||||
"""A webhook adapter suited for use with ``requests``.
|
||||
@ -278,7 +278,7 @@ class RequestsWebhookAdapter(WebhookAdapter):
|
||||
|
||||
# transform into Message object
|
||||
from .message import Message
|
||||
return Message(data=response, state=self, channel=self.webhook.channel)
|
||||
return Message(data=response, state=self.webhook._state, channel=self.webhook.channel)
|
||||
|
||||
class Webhook:
|
||||
"""Represents a Discord webhook.
|
||||
|
Loading…
x
Reference in New Issue
Block a user