diff options
| author | Nadir Chowdhury <[email protected]> | 2021-04-07 12:17:04 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-04-07 07:17:04 -0400 |
| commit | a43ea5c55085cb1bc1b52928022e02aa12c433c7 (patch) | |
| tree | 21dde0d5ac484e7b4fc92d761c00be713365702d | |
| parent | [docs] add label to basic converters section (diff) | |
| download | discord.py-a43ea5c55085cb1bc1b52928022e02aa12c433c7.tar.xz discord.py-a43ea5c55085cb1bc1b52928022e02aa12c433c7.zip | |
Fix regression in Activity relying on `try_enum`
| -rw-r--r-- | discord/activity.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/discord/activity.py b/discord/activity.py index 80476c46..7c46a660 100644 --- a/discord/activity.py +++ b/discord/activity.py @@ -185,7 +185,10 @@ class Activity(BaseActivity): self.flags = kwargs.pop('flags', 0) self.sync_id = kwargs.pop('sync_id', None) self.session_id = kwargs.pop('session_id', None) - self.type = try_enum(ActivityType, kwargs.pop('type', -1)) + + activity_type = kwargs.pop('type', -1) + self.type = activity_type if isinstance(activity_type, ActivityType) else try_enum(ActivityType, activity_type) + emoji = kwargs.pop('emoji', None) if emoji is not None: self.emoji = PartialEmoji.from_dict(emoji) |