Browse Source

image key is now optional for scheduled events

pull/7514/head
Nadir Chowdhury 3 years ago
committed by GitHub
parent
commit
b20ab5ae5d
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      discord/scheduled_event.py
  2. 2
      discord/types/scheduled_event.py

2
discord/scheduled_event.py

@ -136,7 +136,7 @@ class ScheduledEvent(Hashable):
self.start_time: datetime = parse_time(data['scheduled_start_time'])
self.privacy_level: PrivacyLevel = try_enum(PrivacyLevel, data['status'])
self.status: EventStatus = try_enum(EventStatus, data['status'])
self._cover_image: Optional[str] = data['image']
self._cover_image: Optional[str] = data.get('image', None)
self.user_count: int = data.get('user_count', 0)
creator = data.get('creator')

2
discord/types/scheduled_event.py

@ -38,6 +38,7 @@ class _BaseGuildScheduledEventOptional(TypedDict, total=False):
description: str
creator: User
user_count: int
image: Optional[str]
class _BaseGuildScheduledEvent(_BaseGuildScheduledEventOptional):
@ -48,7 +49,6 @@ class _BaseGuildScheduledEvent(_BaseGuildScheduledEventOptional):
scheduled_start_time: str
privacy_level: PrivacyLevel
status: EventStatus
image: Optional[str]
class _VoiceChannelScheduledEventOptional(_BaseGuildScheduledEvent, total=False):

Loading…
Cancel
Save