Skip to content

Commit 27e1aca

Browse files
authored
Fix scheduled event payload typings (#1108)
1 parent dbf1f6d commit 27e1aca

File tree

1 file changed

+19
-18
lines changed

1 file changed

+19
-18
lines changed

discord/types/scheduled_events.py

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,8 @@
2424

2525
from __future__ import annotations
2626

27-
from datetime import datetime
28-
from typing import Literal, Optional, TypedDict, Union
27+
from typing import Literal, Optional, TypedDict
2928

30-
from .channel import StageChannel, VoiceChannel
31-
from .guild import Guild
3229
from .member import Member
3330
from .snowflake import Snowflake
3431
from .user import User
@@ -38,26 +35,30 @@
3835
ScheduledEventPrivacyLevel = Literal[2]
3936

4037

41-
class ScheduledEventLocation(TypedDict):
42-
value: Union[StageChannel, VoiceChannel, str]
43-
type: ScheduledEventLocationType
44-
45-
4638
class ScheduledEvent(TypedDict):
4739
id: Snowflake
48-
guild: Guild
40+
guild_id: Snowflake
41+
channel_id: Snowflake
42+
creator_id: Snowflake
4943
name: str
5044
description: str
5145
image: Optional[str]
52-
start_time: datetime
53-
end_time: Optional[datetime]
54-
status: ScheduledEventStatus
55-
subscriber_count: Optional[int]
56-
creator_id: Snowflake
57-
creator: Optional[User]
58-
location: ScheduledEventLocation
46+
scheduled_start_time: str
47+
scheduled_end_time: Optional[str]
5948
privacy_level: ScheduledEventPrivacyLevel
49+
status: ScheduledEventStatus
50+
entity_type: ScheduledEventLocationType
51+
entity_id: Snowflake
52+
entity_metadata: ScheduledEventEntityMetadata
53+
creator: User
54+
user_count: Optional[int]
55+
56+
57+
class ScheduledEventEntityMetadata(TypedDict):
58+
location: str
6059

6160

62-
class ScheduledEventSubscriber(User):
61+
class ScheduledEventSubscriber(TypedDict):
62+
guild_scheduled_event_id: Snowflake
63+
user: User
6364
member: Optional[Member]

0 commit comments

Comments
 (0)