Working multi-server voice support.

This commit is contained in:
Rapptz
2016-04-29 05:48:48 -04:00
parent 5fa715c350
commit d9c780b8a8
4 changed files with 97 additions and 65 deletions

View File

@@ -158,6 +158,9 @@ class VoiceClient:
The endpoint we are connecting to.
channel : :class:`Channel`
The voice channel connected to.
server : :class:`Server`
The server the voice channel is connected to.
Shorthand for ``channel.server``.
loop
The event loop that the voice client is running on.
"""
@@ -176,6 +179,10 @@ class VoiceClient:
self.encoder = OpusEncoder(48000, 2)
log.info('created opus encoder with {0.__dict__}'.format(self.encoder))
@property
def server(self):
return self.channel.server
def checked_add(self, attr, value, limit):
val = getattr(self, attr)
if val + value > limit: