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: (Sync)WebhookMessage._thread_id could be None #2343

Merged
merged 2 commits into from
Feb 1, 2024
Merged
Show file tree
Hide file tree
Changes from all 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 @@ -230,6 +230,8 @@ These changes are available on the `master` branch, but have not yet been releas
([#2333](https://github.com/Pycord-Development/pycord/issues/2333))
- Fixed `BridgeContext` type hints raising an exception for unsupported option type.
([#2337](https://github.com/Pycord-Development/pycord/pull/2337))
- Fixed `TypeError` due to `(Sync)WebhookMessage._thread_id` being set to `None`.
([#2343](https://github.com/Pycord-Development/pycord/pull/2343))

## [2.4.1] - 2023-03-20

Expand Down
2 changes: 1 addition & 1 deletion discord/webhook/async_.py
Original file line number Diff line number Diff line change
Expand Up @@ -1855,7 +1855,7 @@ async def fetch_message(
thread_id=thread_id,
)
msg = self._create_message(data)
if isinstance(msg.channel, PartialMessageable):
if thread_id and isinstance(msg.channel, PartialMessageable):
msg._thread_id = thread_id

return msg
Expand Down
2 changes: 1 addition & 1 deletion discord/webhook/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -1147,7 +1147,7 @@ def fetch_message(
thread_id=thread_id,
)
msg = self._create_message(data)
if isinstance(msg.channel, PartialMessageable):
if thread_id and isinstance(msg.channel, PartialMessageable):
msg._thread_id = thread_id

return msg
Expand Down
Loading