Browse Source

Cast activity enumerator to integer instead of accessing value directly

Should make the library more resilient to future changes.
pull/2247/head
Rapptz 6 years ago
parent
commit
1e982e0042
  1. 2
      discord/activity.py
  2. 3
      discord/enums.py

2
discord/activity.py

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

3
discord/enums.py

@ -380,6 +380,9 @@ class ActivityType(Enum):
listening = 2
watching = 3
def __int__(self):
return self.value
class HypeSquadHouse(Enum):
bravery = 1
brilliance = 2

Loading…
Cancel
Save