From 8bcf4afb96ceca7c809809d255b4d90101f535db Mon Sep 17 00:00:00 2001 From: DA344 <108473820+DA-344@users.noreply.github.com> Date: Thu, 16 May 2024 02:45:06 +0200 Subject: [PATCH] Fix Webhook poll sending raising AttributeError with a mocked state --- discord/webhook/async_.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/discord/webhook/async_.py b/discord/webhook/async_.py index ee4c08444..be3208ebc 100644 --- a/discord/webhook/async_.py +++ b/discord/webhook/async_.py @@ -510,6 +510,11 @@ class _WebhookState: return self._parent._get_guild(guild_id) return None + def _get_poll(self, msg_id: Optional[int]) -> Optional[Poll]: + if self._parent is not None: + return self._parent._get_poll(msg_id) + return None + def store_user(self, data: Union[UserPayload, PartialUserPayload], *, cache: bool = True) -> BaseUser: if self._parent is not None: return self._parent.store_user(data, cache=cache)