Browse Source

Change all IntEnum to Enum

A testament to how many 3.5 users there are.
pull/2054/head
Rapptz 6 years ago
parent
commit
0ddc6867e9
  1. 2
      discord/activity.py
  2. 14
      discord/enums.py

2
discord/activity.py

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

14
discord/enums.py

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

Loading…
Cancel
Save