diff options
Diffstat (limited to 'discord/state.py')
| -rw-r--r-- | discord/state.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/discord/state.py b/discord/state.py index 8d0757dd..10f6d16e 100644 --- a/discord/state.py +++ b/discord/state.py @@ -688,6 +688,16 @@ class ConnectionState: if call is not None: call._update_voice_state(data) + def parse_voice_server_update(self, data): + try: + key_id = int(data['guild_id']) + except KeyError: + key_id = int(data['channel_id']) + + vc = self._get_voice_client(key_id) + if vc is not None and vc.is_connected(): + compat.create_task(vc._switch_regions()) + def parse_typing_start(self, data): channel = self.get_channel(int(data['channel_id'])) if channel is not None: |