From 8f062ca0def4e87c5f74c9fd6c8e0ba9232aad36 Mon Sep 17 00:00:00 2001 From: Dorukyum Date: Tue, 29 Nov 2022 17:54:29 +0300 Subject: [PATCH 1/3] fix: map received applied_tags to int --- discord/threads.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/discord/threads.py b/discord/threads.py index 96eee779ec..13cf320cb1 100644 --- a/discord/threads.py +++ b/discord/threads.py @@ -198,7 +198,7 @@ def _from_data(self, data: ThreadPayload): self.member_count = data.get("member_count", None) self.flags: ChannelFlags = ChannelFlags._from_value(data.get("flags", 0)) self.total_message_sent = data.get("total_message_sent", None) - self._applied_tags: list[int] = data.get("applied_tags", []) + self._applied_tags: list[int] = [int(tag_id) for tag_id in data.get("applied_tags", [])] # Here, we try to fill in potentially missing data if thread := self.guild.get_thread(self.id) and data.pop("_invoke_flag", False): From 9f6f91e5a1d73f076726dfa0c75c6fabe1c61ddc Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sat, 3 Dec 2022 15:45:12 +0000 Subject: [PATCH 2/3] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- discord/threads.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/discord/threads.py b/discord/threads.py index 13cf320cb1..6eb1bfc0a9 100644 --- a/discord/threads.py +++ b/discord/threads.py @@ -198,7 +198,9 @@ def _from_data(self, data: ThreadPayload): self.member_count = data.get("member_count", None) self.flags: ChannelFlags = ChannelFlags._from_value(data.get("flags", 0)) self.total_message_sent = data.get("total_message_sent", None) - self._applied_tags: list[int] = [int(tag_id) for tag_id in data.get("applied_tags", [])] + self._applied_tags: list[int] = [ + int(tag_id) for tag_id in data.get("applied_tags", []) + ] # Here, we try to fill in potentially missing data if thread := self.guild.get_thread(self.id) and data.pop("_invoke_flag", False): From 58cf34c30c337bbddeaf4848b021d475f1b76356 Mon Sep 17 00:00:00 2001 From: BobDotCom <71356958+BobDotCom@users.noreply.github.com> Date: Sat, 3 Dec 2022 09:55:10 -0600 Subject: [PATCH 3/3] Add changelog entry --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b6bea3b715..524adfbe19 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,8 @@ _No changes yet_ `ext.bridge.Bot`. ([#1815](https://github.com/Pycord-Development/pycord/pull/1815)) - Fixed an `AttributeError` in select relating to the select type. ([#1814](https://github.com/Pycord-Development/pycord/pull/1814)) +- Fix `Thread.applied_tags` always returning an empty list. + ([#1817](https://github.com/Pycord-Development/pycord/pull/1817)) ## [2.3.1] - 2022-11-27