mirror of
				https://github.com/Rapptz/discord.py.git
				synced 2025-10-25 18:43:00 +00:00 
			
		
		
		
	Don't set VoiceClient.channel to None when VOICE_STATE_UPDATE says so.
Sometimes VOICE_STATE_UPDATE gives us a channel_id: null payload and we would end up clearing the VoiceClient.channel state along with it.
This commit is contained in:
		| @@ -674,7 +674,9 @@ class ConnectionState: | |||||||
|             if int(data['user_id']) == self.user.id: |             if int(data['user_id']) == self.user.id: | ||||||
|                 voice = self._get_voice_client(guild.id) |                 voice = self._get_voice_client(guild.id) | ||||||
|                 if voice is not None: |                 if voice is not None: | ||||||
|                     voice.channel = guild.get_channel(channel_id) |                     ch = guild.get_channel(channel_id) | ||||||
|  |                     if ch is not None: | ||||||
|  |                         voice.channel = ch | ||||||
|  |  | ||||||
|             member, before, after = guild._update_voice_state(data, channel_id) |             member, before, after = guild._update_voice_state(data, channel_id) | ||||||
|             if after is not None: |             if after is not None: | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user