Skip to content

Commit

Permalink
Cleanup stale member scrape request state
Browse files Browse the repository at this point in the history
  • Loading branch information
dolfies committed Mar 30, 2024
1 parent 51d43a1 commit 9c1047b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion discord/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -1465,12 +1465,14 @@ async def _delay_ready(self) -> None:
to_chunk.append(guild.id)
states.append((guild, future))
elif not guild._offline_members_hidden:
self._scrape_requests[guild.id] = request = MemberSidebar(
request = MemberSidebar(
guild, MISSING, chunk=True, cache=True, loop=self.loop, delay=0
)
if not request.channels:
# Not possible to scrape here
continue

self._scrape_requests[guild.id] = request
request.start()
states.append((guild, request.get_future()))

Expand Down Expand Up @@ -2914,6 +2916,7 @@ async def scrape_guild(
guild, channels, chunk=chunk, cache=cache, loop=self.loop, delay=delay or 0
)
if not request.channels:
del self._scrape_requests[guild.id]
if chunk:
raise ClientException('Guild cannot be chunked: no channels viewable by @everyone')
raise ClientException('Failed to automatically choose channels; please specify them manually')
Expand Down

0 comments on commit 9c1047b

Please sign in to comment.