Skip to content

Commit 901bdfe

Browse files
authored
implement types
1 parent 58e7c6c commit 901bdfe

File tree

1 file changed

+29
-5
lines changed

1 file changed

+29
-5
lines changed

discord/types/message.py

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,11 @@ class MessageApplication(TypedDict):
9999
name: str
100100

101101

102+
MessageReferenceType = Literal[0, 1]
103+
104+
102105
class MessageReference(TypedDict, total=False):
106+
type: NotRequired[MessageReferenceType]
103107
message_id: Snowflake
104108
channel_id: Snowflake
105109
guild_id: Snowflake
@@ -111,6 +115,29 @@ class MessageReference(TypedDict, total=False):
111115
]
112116

113117

118+
class MessageCall(TypedDict):
119+
participants: SnowflakeList
120+
ended_timestamp: NotRequired[str]
121+
122+
123+
class ForwardedMessage(TypedDict):
124+
type: MessageType
125+
content: str
126+
embeds: list[Embed]
127+
attachments: list[Attachment]
128+
timestamp: str
129+
edited_timestamp: str | None
130+
flags: NotRequired[int]
131+
mentions: list[UserWithMember]
132+
mention_roles: SnowflakeList
133+
sticker_items: NotRequired[list[StickerItem]]
134+
components: NotRequired[list[Component]]
135+
136+
137+
class MessageSnapshot(TypedDict):
138+
message: ForwardedMessage
139+
140+
114141
class Message(TypedDict):
115142
guild_id: NotRequired[Snowflake]
116143
member: NotRequired[Member]
@@ -144,6 +171,8 @@ class Message(TypedDict):
144171
pinned: bool
145172
type: MessageType
146173
poll: Poll
174+
call: MessageCall
175+
message_snapshots: NotRequired[list[MessageSnapshot]]
147176

148177

149178
AllowedMentionType = Literal["roles", "users", "everyone"]
@@ -154,8 +183,3 @@ class AllowedMentions(TypedDict):
154183
roles: SnowflakeList
155184
users: SnowflakeList
156185
replied_user: bool
157-
158-
159-
class MessageCall(TypedDict):
160-
participants: SnowflakeList
161-
ended_timestamp: NotRequired[str]

0 commit comments

Comments
 (0)