diff --git a/CHANGELOG.md b/CHANGELOG.md index 7c84278116..3622668aac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/discord/webhook/async_.py b/discord/webhook/async_.py index 9c44c64d94..09ba8cc327 100644 --- a/discord/webhook/async_.py +++ b/discord/webhook/async_.py @@ -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 diff --git a/discord/webhook/sync.py b/discord/webhook/sync.py index 9e812b5709..4bcf6b6028 100644 --- a/discord/webhook/sync.py +++ b/discord/webhook/sync.py @@ -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