Skip to content

Commit 7b0f851

Browse files
Dorukyumpre-commit-ci[bot]BobDotCom
authored
fix: map received applied_tags to int (#1817)
* fix: map received applied_tags to int * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Add changelog entry Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: BobDotCom <[email protected]>
1 parent 6fc350f commit 7b0f851

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ _No changes yet_
2020
`ext.bridge.Bot`. ([#1815](https://github.com/Pycord-Development/pycord/pull/1815))
2121
- Fixed an `AttributeError` in select relating to the select type.
2222
([#1814](https://github.com/Pycord-Development/pycord/pull/1814))
23+
- Fix `Thread.applied_tags` always returning an empty list.
24+
([#1817](https://github.com/Pycord-Development/pycord/pull/1817))
2325

2426
## [2.3.1] - 2022-11-27
2527

discord/threads.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,9 @@ def _from_data(self, data: ThreadPayload):
198198
self.member_count = data.get("member_count", None)
199199
self.flags: ChannelFlags = ChannelFlags._from_value(data.get("flags", 0))
200200
self.total_message_sent = data.get("total_message_sent", None)
201-
self._applied_tags: list[int] = data.get("applied_tags", [])
201+
self._applied_tags: list[int] = [
202+
int(tag_id) for tag_id in data.get("applied_tags", [])
203+
]
202204

203205
# Here, we try to fill in potentially missing data
204206
if thread := self.guild.get_thread(self.id) and data.pop("_invoke_flag", False):

0 commit comments

Comments
 (0)