Skip to content

Commit

Permalink
fix: map received applied_tags to int (#1817)
Browse files Browse the repository at this point in the history
* 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 <71356958+BobDotCom@users.noreply.github.com>
  • Loading branch information
3 people committed Dec 3, 2022
1 parent 6fc350f commit 7b0f851
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Expand Up @@ -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

Expand Down
4 changes: 3 additions & 1 deletion discord/threads.py
Expand Up @@ -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] = 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):
Expand Down

0 comments on commit 7b0f851

Please sign in to comment.