Skip to content

Commit

Permalink
Fix scheduled event payload typings (Pycord-Development#1108)
Browse files Browse the repository at this point in the history
  • Loading branch information
Middledot authored Mar 4, 2022
1 parent dbf1f6d commit 27e1aca
Showing 1 changed file with 19 additions and 18 deletions.
37 changes: 19 additions & 18 deletions discord/types/scheduled_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,8 @@

from __future__ import annotations

from datetime import datetime
from typing import Literal, Optional, TypedDict, Union
from typing import Literal, Optional, TypedDict

from .channel import StageChannel, VoiceChannel
from .guild import Guild
from .member import Member
from .snowflake import Snowflake
from .user import User
Expand All @@ -38,26 +35,30 @@
ScheduledEventPrivacyLevel = Literal[2]


class ScheduledEventLocation(TypedDict):
value: Union[StageChannel, VoiceChannel, str]
type: ScheduledEventLocationType


class ScheduledEvent(TypedDict):
id: Snowflake
guild: Guild
guild_id: Snowflake
channel_id: Snowflake
creator_id: Snowflake
name: str
description: str
image: Optional[str]
start_time: datetime
end_time: Optional[datetime]
status: ScheduledEventStatus
subscriber_count: Optional[int]
creator_id: Snowflake
creator: Optional[User]
location: ScheduledEventLocation
scheduled_start_time: str
scheduled_end_time: Optional[str]
privacy_level: ScheduledEventPrivacyLevel
status: ScheduledEventStatus
entity_type: ScheduledEventLocationType
entity_id: Snowflake
entity_metadata: ScheduledEventEntityMetadata
creator: User
user_count: Optional[int]


class ScheduledEventEntityMetadata(TypedDict):
location: str


class ScheduledEventSubscriber(User):
class ScheduledEventSubscriber(TypedDict):
guild_scheduled_event_id: Snowflake
user: User
member: Optional[Member]

0 comments on commit 27e1aca

Please sign in to comment.