Skip to content

Commit

Permalink
Update discord/stage_instance.py
Browse files Browse the repository at this point in the history
Co-authored-by: Middledot <[email protected]>
  • Loading branch information
Lulalaby and Middledot authored Jul 22, 2022
1 parent d2ce246 commit e4be6dc
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions discord/stage_instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,9 @@ def _update(self, data: StageInstancePayload):
self.privacy_level: StagePrivacyLevel = try_enum(StagePrivacyLevel, data["privacy_level"])
self.discoverable_disabled: bool = data.get("discoverable_disabled", False)

if (event_id := data.get("guild_scheduled_event_id", None)) is not None:
self.scheduled_event = None
if event_id := data.get("guild_scheduled_event_id", None):
self.scheduled_event = self.guild.get_scheduled_event(int(event_id))
else:
self.scheduled_event = None

def __repr__(self) -> str:
return f"<StageInstance id={self.id} guild={self.guild!r} channel_id={self.channel_id} topic={self.topic!r}>"
Expand Down

0 comments on commit e4be6dc

Please sign in to comment.