Browse Source

Fix regression in Activity relying on `try_enum`

pull/6669/head
Nadir Chowdhury 4 years ago
committed by GitHub
parent
commit
a43ea5c550
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      discord/activity.py

5
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)

Loading…
Cancel
Save