diff options
| author | Rapptz <[email protected]> | 2019-06-25 21:50:06 -0400 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2019-06-25 21:50:06 -0400 |
| commit | 1e982e0042ae6c50e59b9b77fb77aa6f361ef0e9 (patch) | |
| tree | 1f3b7befe64787ebeeb75a6dedf6bc8b9a13cfc9 | |
| parent | Translation sync from crowdin (diff) | |
| download | discord.py-1e982e0042ae6c50e59b9b77fb77aa6f361ef0e9.tar.xz discord.py-1e982e0042ae6c50e59b9b77fb77aa6f361ef0e9.zip | |
Cast activity enumerator to integer instead of accessing value directly
Should make the library more resilient to future changes.
| -rw-r--r-- | discord/activity.py | 2 | ||||
| -rw-r--r-- | discord/enums.py | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/discord/activity.py b/discord/activity.py index 692e20e9..3acc046d 100644 --- a/discord/activity.py +++ b/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 diff --git a/discord/enums.py b/discord/enums.py index ddabbe72..5fec3a02 100644 --- a/discord/enums.py +++ b/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 |