Use a thread values view when constructing TextChannel.threads
Avoids an accidental O(n^2) situation.
This commit is contained in:
parent
2d8f299b6b
commit
dd7d4b8e7f
@ -230,7 +230,7 @@ class TextChannel(discord.abc.Messageable, discord.abc.GuildChannel, Hashable):
|
|||||||
|
|
||||||
.. versionadded:: 2.0
|
.. versionadded:: 2.0
|
||||||
"""
|
"""
|
||||||
return [thread for thread in self.guild.threads if thread.parent_id == self.id]
|
return [thread for thread in self.guild._threads.values() if thread.parent_id == self.id]
|
||||||
|
|
||||||
def is_nsfw(self) -> bool:
|
def is_nsfw(self) -> bool:
|
||||||
""":class:`bool`: Checks if the channel is NSFW."""
|
""":class:`bool`: Checks if the channel is NSFW."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user