Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: sending polls with PartialWebhook #2624

Merged
merged 6 commits into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ These changes are available on the `master` branch, but have not yet been releas
([#2587](https://github.com/Pycord-Development/pycord/pull/2587/))
- Added optional `filter` parameter to `utils.basic_autocomplete()`.
([#2590](https://github.com/Pycord-Development/pycord/pull/2590))
- Added `store_poll` method to `Webhook._WebhookState`.
([#2624](https://github.com/Pycord-Development/pycord/pull/2624))
tyrantlink marked this conversation as resolved.
Show resolved Hide resolved

### Fixed

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