Skip to content

Commit

Permalink
fix: sending polls with PartialWebhook (#2624)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
tyrantlink and Lulalaby authored Nov 8, 2024
1 parent d29f73d commit 1f17777
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 6 additions & 0 deletions discord/webhook/async_.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 1f17777

Please sign in to comment.