mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-09-07 10:22:59 +00:00
Fix channel deletion not removing associated threads
This commit is contained in:
committed by
GitHub
parent
0b4263e697
commit
0ee1794c6d
@ -378,10 +378,11 @@ class Guild(Hashable):
|
||||
def _clear_threads(self) -> None:
|
||||
self._threads.clear()
|
||||
|
||||
def _remove_threads_by_channel(self, channel_id: int) -> None:
|
||||
to_remove = [k for k, t in self._threads.items() if t.parent_id == channel_id]
|
||||
for k in to_remove:
|
||||
del self._threads[k]
|
||||
def _remove_threads_by_channel(self, channel_id: int) -> List[Thread]:
|
||||
to_remove = [t for t in self._threads.values() if t.parent_id == channel_id]
|
||||
for thread in to_remove:
|
||||
del self._threads[thread.id]
|
||||
return to_remove
|
||||
|
||||
def _filter_threads(self, channel_ids: Set[int]) -> Dict[int, Thread]:
|
||||
to_remove: Dict[int, Thread] = {k: t for k, t in self._threads.items() if t.parent_id in channel_ids}
|
||||
|
Reference in New Issue
Block a user