Change all IntEnum to Enum

A testament to how many 3.5 users there are.
This commit is contained in:
Rapptz 2019-04-08 17:35:09 -04:00
parent 1da624a8b5
commit 0ddc6867e9
2 changed files with 8 additions and 8 deletions

View File

@ -158,7 +158,7 @@ class Activity(_ActivityTag):
continue continue
ret[attr] = value ret[attr] = value
ret['type'] = int(self.type) ret['type'] = self.type.value
return ret return ret
@property @property

View File

@ -24,7 +24,7 @@ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE. DEALINGS IN THE SOFTWARE.
""" """
from enum import Enum, IntEnum from enum import Enum
__all__ = ['ChannelType', 'MessageType', 'VoiceRegion', 'SpeakingState', __all__ = ['ChannelType', 'MessageType', 'VoiceRegion', 'SpeakingState',
'VerificationLevel', 'ContentFilter', 'Status', 'DefaultAvatar', 'VerificationLevel', 'ContentFilter', 'Status', 'DefaultAvatar',
@ -78,7 +78,7 @@ class VoiceRegion(Enum):
def __str__(self): def __str__(self):
return self.value return self.value
class SpeakingState(IntEnum): class SpeakingState(Enum):
none = 0 none = 0
voice = 1 voice = 1
soundshare = 2 soundshare = 2
@ -87,7 +87,7 @@ class SpeakingState(IntEnum):
def __str__(self): def __str__(self):
return self.name return self.name
class VerificationLevel(IntEnum): class VerificationLevel(Enum):
none = 0 none = 0
low = 1 low = 1
medium = 2 medium = 2
@ -99,7 +99,7 @@ class VerificationLevel(IntEnum):
def __str__(self): def __str__(self):
return self.name return self.name
class ContentFilter(IntEnum): class ContentFilter(Enum):
disabled = 0 disabled = 0
no_role = 1 no_role = 1
all_members = 2 all_members = 2
@ -107,7 +107,7 @@ class ContentFilter(IntEnum):
def __str__(self): def __str__(self):
return self.name return self.name
class UserContentFilter(IntEnum): class UserContentFilter(Enum):
disabled = 0 disabled = 0
friends = 1 friends = 1
all_messages = 2 all_messages = 2
@ -151,7 +151,7 @@ class RelationshipType(Enum):
incoming_request = 3 incoming_request = 3
outgoing_request = 4 outgoing_request = 4
class NotificationLevel(IntEnum): class NotificationLevel(Enum):
all_messages = 0 all_messages = 0
only_mentions = 1 only_mentions = 1
@ -252,7 +252,7 @@ class UserFlags(Enum):
hypesquad_balance = 256 hypesquad_balance = 256
early_supporter = 512 early_supporter = 512
class ActivityType(IntEnum): class ActivityType(Enum):
unknown = -1 unknown = -1
playing = 0 playing = 0
streaming = 1 streaming = 1