Browse Source

Fix Thread.applied_tags for media channels

pull/10215/head
owocado 2 weeks ago
committed by GitHub
parent
commit
e9f807e5ec
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 4
      discord/threads.py

4
discord/threads.py

@ -272,12 +272,12 @@ class Thread(Messageable, Hashable):
.. versionadded:: 2.1 .. versionadded:: 2.1
""" """
tags = [] 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 return tags
parent = self.parent parent = self.parent
for tag_id in self._applied_tags: for tag_id in self._applied_tags:
tag = parent.get_tag(tag_id) tag = parent.get_tag(tag_id) # type: ignore # parent here will be ForumChannel instance
if tag is not None: if tag is not None:
tags.append(tag) tags.append(tag)

Loading…
Cancel
Save