From 1f17777f2471c4c8b4b3d81a8130031c80b8f622 Mon Sep 17 00:00:00 2001 From: tyrantlink <38902185+tyrantlink@users.noreply.github.com> Date: Thu, 7 Nov 2024 19:59:14 -0800 Subject: [PATCH] fix: sending polls with PartialWebhook (#2624) * fix: add store poll to webhook state * Update CHANGELOG.md * Update CHANGELOG.md * Update CHANGELOG.md --------- Signed-off-by: tyrantlink <38902185+tyrantlink@users.noreply.github.com> Co-authored-by: Lala Sabathil --- CHANGELOG.md | 2 ++ discord/webhook/async_.py | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0c77698498..bc995ffd76 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -58,6 +58,8 @@ These changes are available on the `master` branch, but have not yet been releas ([#2611](https://github.com/Pycord-Development/pycord/pull/2611)) - Fixed `TypeError` when passing `skus` parameter in `Client.entitlements()`. ([#2627](https://github.com/Pycord-Development/pycord/issues/2627)) +- Fixed `AttributeError` when sending polls with `PartialWebook`. + ([#2624](https://github.com/Pycord-Development/pycord/pull/2624)) ### Changed diff --git a/discord/webhook/async_.py b/discord/webhook/async_.py index 090f7c96f2..23b6386a7d 100644 --- a/discord/webhook/async_.py +++ b/discord/webhook/async_.py @@ -803,6 +803,12 @@ def create_user(self, data): # state parameter is artificial return BaseUser(state=self, data=data) # type: ignore + def store_poll(self, poll: Poll, message_id: int): + if self._parent is not None: + return self._parent.store_poll(poll, message_id) + # state parameter is artificial + return None + @property def http(self): if self._parent is not None: