diff options
| author | Rapptz <[email protected]> | 2016-07-23 05:18:56 -0400 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2016-07-23 05:18:56 -0400 |
| commit | b0e535771677fe34cefeec2716a7c4ed750e032f (patch) | |
| tree | 77ce630b048dceebc18fad3ddd5dd2b5421c9bfd /discord/server.py | |
| parent | Fix TypeError when constructing a channel in start_private_message. (diff) | |
| download | discord.py-b0e535771677fe34cefeec2716a7c4ed750e032f.tar.xz discord.py-b0e535771677fe34cefeec2716a7c4ed750e032f.zip | |
Fix voice state update issue in on_voice_state_update
Bug was caused to the shallow copy not copying over the VoiceState
information embedded into the copy. This would mean that when the event
is called, before and after voice state information is essentially
equivalent.
The solution to fix this is to also copy the VoiceState objects.
Diffstat (limited to 'discord/server.py')
| -rw-r--r-- | discord/server.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/discord/server.py b/discord/server.py index 0a22f38c..aa3c230a 100644 --- a/discord/server.py +++ b/discord/server.py @@ -31,7 +31,6 @@ from .game import Game from .channel import Channel from .enums import ServerRegion, Status from .mixins import Hashable -import copy class Server(Hashable): """Represents a Discord server. @@ -137,8 +136,9 @@ class Server(Hashable): def _update_voice_state(self, data): user_id = data.get('user_id') member = self.get_member(user_id) - before = copy.copy(member) + before = None if member is not None: + before = member._copy() ch_id = data.get('channel_id') channel = self.get_channel(ch_id) member._update_voice_state(voice_channel=channel, **data) |