Browse Source

Fix crash in Activity.__init__ with missing keys

not all activity payloads have `state_url` and `details_url` keys present.
master
owocado 3 days ago
committed by GitHub
parent
commit
4496df79d0
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 4
      discord/activity.py

4
discord/activity.py

@ -257,8 +257,8 @@ class Activity(BaseActivity):
emoji = kwargs.pop('emoji', None)
self.emoji: Optional[PartialEmoji] = PartialEmoji.from_dict(emoji) if emoji is not None else None
self.state_url: Optional[str] = kwargs.pop('state_url')
self.details_url: Optional[str] = kwargs.pop('details_url')
self.state_url: Optional[str] = kwargs.pop('state_url', None)
self.details_url: Optional[str] = kwargs.pop('details_url', None)
status_display_type = kwargs.pop('status_display_type', None)
self.status_display_type: Optional[StatusDisplayType] = (

Loading…
Cancel
Save