From 1fc74fe722d499f80956f9865eddfd09cf4a556e Mon Sep 17 00:00:00 2001 From: owocado <24418520+owocado@users.noreply.github.com> Date: Sat, 15 Mar 2025 11:37:27 +0000 Subject: [PATCH 1/5] fix `Thread.applied_tags` to account for `ChannelType.media` --- discord/threads.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/discord/threads.py b/discord/threads.py index 024b22506..b026661e8 100644 --- a/discord/threads.py +++ b/discord/threads.py @@ -272,12 +272,12 @@ class Thread(Messageable, Hashable): .. versionadded:: 2.1 """ tags = [] - if self.parent is None or self.parent.type != ChannelType.forum: + if self.parent is None or self.parent.type not in (ChannelType.forum, ChannelType.media): return tags parent = self.parent for tag_id in self._applied_tags: - tag = parent.get_tag(tag_id) + tag = parent.get_tag(tag_id) # pyright: ignore[reportAttributeAccessIssue] # parent here will be ForumChannel instance if tag is not None: tags.append(tag) From ecd61519ea5ec576e05cf484a33e14ad2095acc9 Mon Sep 17 00:00:00 2001 From: owocado <24418520+owocado@users.noreply.github.com> Date: Wed, 30 Apr 2025 16:20:53 +0530 Subject: [PATCH 2/5] remove `#pyright: ignore` for now --- discord/threads.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/discord/threads.py b/discord/threads.py index b026661e8..5abbd8fee 100644 --- a/discord/threads.py +++ b/discord/threads.py @@ -277,7 +277,7 @@ class Thread(Messageable, Hashable): parent = self.parent for tag_id in self._applied_tags: - tag = parent.get_tag(tag_id) # pyright: ignore[reportAttributeAccessIssue] # parent here will be ForumChannel instance + tag = parent.get_tag(tag_id) if tag is not None: tags.append(tag) From 682b6206f22d42d297cec4ae9195a0951c94a5bc Mon Sep 17 00:00:00 2001 From: owocado <24418520+owocado@users.noreply.github.com> Date: Wed, 30 Apr 2025 16:27:21 +0530 Subject: [PATCH 3/5] looks like `# pyright: ignore` is needed here LOL --- discord/threads.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/discord/threads.py b/discord/threads.py index 5abbd8fee..b026661e8 100644 --- a/discord/threads.py +++ b/discord/threads.py @@ -277,7 +277,7 @@ class Thread(Messageable, Hashable): parent = self.parent for tag_id in self._applied_tags: - tag = parent.get_tag(tag_id) + tag = parent.get_tag(tag_id) # pyright: ignore[reportAttributeAccessIssue] # parent here will be ForumChannel instance if tag is not None: tags.append(tag) From bea619d323271738fa6eb98f3e2ae1a24a35e925 Mon Sep 17 00:00:00 2001 From: owocado <24418520+owocado@users.noreply.github.com> Date: Wed, 30 Apr 2025 12:06:12 +0100 Subject: [PATCH 4/5] lint: black --- discord/threads.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/discord/threads.py b/discord/threads.py index b026661e8..0872ac9c9 100644 --- a/discord/threads.py +++ b/discord/threads.py @@ -277,7 +277,9 @@ class Thread(Messageable, Hashable): parent = self.parent for tag_id in self._applied_tags: - tag = parent.get_tag(tag_id) # pyright: ignore[reportAttributeAccessIssue] # parent here will be ForumChannel instance + tag = parent.get_tag( + tag_id + ) # pyright: ignore[reportAttributeAccessIssue] # parent here will be ForumChannel instance if tag is not None: tags.append(tag) From 7047e36b68223157c1f18317e60074fa4d4e669d Mon Sep 17 00:00:00 2001 From: owocado <24418520+owocado@users.noreply.github.com> Date: Wed, 30 Apr 2025 12:08:32 +0100 Subject: [PATCH 5/5] fix --- discord/threads.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/discord/threads.py b/discord/threads.py index 0872ac9c9..5c9176d49 100644 --- a/discord/threads.py +++ b/discord/threads.py @@ -277,9 +277,9 @@ class Thread(Messageable, Hashable): parent = self.parent for tag_id in self._applied_tags: - tag = parent.get_tag( + tag = parent.get_tag( # pyright: ignore[reportAttributeAccessIssue] # parent here will be ForumChannel instance tag_id - ) # pyright: ignore[reportAttributeAccessIssue] # parent here will be ForumChannel instance + ) if tag is not None: tags.append(tag)