From 9c5259afd7bf8a71574ef13ae130009c3755662f Mon Sep 17 00:00:00 2001 From: Imayhaveborkedit Date: Wed, 16 Jan 2019 01:35:31 -0500 Subject: Update voice code to vws V4 - Update internals to be compatible with v4 - Adds multiple encryption mode support. Previously only `xsalsa20_poly1305` was supported. Now `xsalsa20_poly1305_suffix` is also supported. Note: There is no (nice) way to manually select a mode. The user needn't worry about this however. - Fixed speaking state bug. When you disconnected from a voice channel while a bot was playing, upon reconnect you would be unable to hear the bot. This was caused by bots not sending their speaking state while transmitting. Bots will now set their speaking state properly when transmitting. Note: This does not account for sending actual silence, the speaking indicator will still be active. --- discord/enums.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'discord/enums.py') diff --git a/discord/enums.py b/discord/enums.py index f7df9059..f11f1ed1 100644 --- a/discord/enums.py +++ b/discord/enums.py @@ -26,10 +26,10 @@ DEALINGS IN THE SOFTWARE. from enum import Enum, IntEnum -__all__ = ['ChannelType', 'MessageType', 'VoiceRegion', 'VerificationLevel', - 'ContentFilter', 'Status', 'DefaultAvatar', 'RelationshipType', - 'AuditLogAction', 'AuditLogActionCategory', 'UserFlags', - 'ActivityType', 'HypeSquadHouse', 'NotificationLevel'] +__all__ = ['ChannelType', 'MessageType', 'VoiceRegion', 'SpeakingState', + 'VerificationLevel', 'ContentFilter', 'Status', 'DefaultAvatar', + 'RelationshipType', 'AuditLogAction', 'AuditLogActionCategory', + 'UserFlags', 'ActivityType', 'HypeSquadHouse', 'NotificationLevel'] class ChannelType(Enum): text = 0 @@ -75,6 +75,15 @@ class VoiceRegion(Enum): def __str__(self): return self.value +class SpeakingState(IntEnum): + none = 0 + voice = 1 + soundshare = 2 + priority = 4 + + def __str__(self): + return self.name + class VerificationLevel(IntEnum): none = 0 low = 1 -- cgit v1.2.3