Skip to content

Commit

Permalink
Fix wrong logic caused by moving the code
Browse files Browse the repository at this point in the history
  • Loading branch information
Dorukyum committed Apr 17, 2022
1 parent e6a5599 commit f1b85fb
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions discord/state.py
Expand Up @@ -1554,6 +1554,13 @@ def parse_voice_state_update(self, data) -> None:
elif channel_id is not None:
guild._add_member(member)

self.dispatch("voice_state_update", member, before, after)
else:
_log.debug(
"VOICE_STATE_UPDATE referencing an unknown member ID: %s. Discarding.",
data["user_id"],
)

if int(data["user_id"]) == self_id:
voice = self._get_voice_client(guild.id)
if voice is not None:
Expand All @@ -1562,12 +1569,6 @@ def parse_voice_state_update(self, data) -> None:
coro = voice.on_voice_state_update(data)
asyncio.create_task(logging_coroutine(coro, info="Voice Protocol voice state update handler"))

self.dispatch("voice_state_update", member, before, after)
else:
_log.debug(
"VOICE_STATE_UPDATE referencing an unknown member ID: %s. Discarding.",
data["user_id"],
)

def parse_voice_server_update(self, data) -> None:
try:
Expand Down

0 comments on commit f1b85fb

Please sign in to comment.