Skip to content

Commit 1f17777

Browse files
tyrantlinkLulalaby
andauthored
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 <[email protected]> Co-authored-by: Lala Sabathil <[email protected]>
1 parent d29f73d commit 1f17777

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ These changes are available on the `master` branch, but have not yet been releas
5858
([#2611](https://github.com/Pycord-Development/pycord/pull/2611))
5959
- Fixed `TypeError` when passing `skus` parameter in `Client.entitlements()`.
6060
([#2627](https://github.com/Pycord-Development/pycord/issues/2627))
61+
- Fixed `AttributeError` when sending polls with `PartialWebook`.
62+
([#2624](https://github.com/Pycord-Development/pycord/pull/2624))
6163

6264
### Changed
6365

discord/webhook/async_.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -803,6 +803,12 @@ def create_user(self, data):
803803
# state parameter is artificial
804804
return BaseUser(state=self, data=data) # type: ignore
805805

806+
def store_poll(self, poll: Poll, message_id: int):
807+
if self._parent is not None:
808+
return self._parent.store_poll(poll, message_id)
809+
# state parameter is artificial
810+
return None
811+
806812
@property
807813
def http(self):
808814
if self._parent is not None:

0 commit comments

Comments
 (0)