Skip to content

Commit

Permalink
feat(Message): reply updates (#34)
Browse files Browse the repository at this point in the history
* feat(allowedmentions): replied_user

* feat(message): message_reference channel_id is now optional

* fix: make message_id required when sending

* chore: export APIMessageReferenceSend
  • Loading branch information
advaith1 committed Nov 21, 2020
1 parent 39ea1f4 commit 21b9ae4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion v8/payloads/channel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ export interface APIMessageApplication {
*/
export interface APIMessageReference {
message_id?: string;
channel_id: string;
channel_id?: string;
guild_id?: string;
}

Expand Down
7 changes: 5 additions & 2 deletions v8/rest/channel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export interface APIAllowedMentionsSend {
parse?: AllowedMentionsTypes[];
roles?: string[];
users?: string[];
replied_user?: boolean;
}

// #endregion TypeDefs
Expand Down Expand Up @@ -66,6 +67,8 @@ export interface RESTGetAPIChannelMessagesQuery {

export type RESTGetAPIChannelMessagesResult = APIMessage[];

export type APIMessageReferenceSend = APIMessageReference & Required<Pick<APIMessageReference, 'message_id'>>;

/**
* https://discord.com/developers/docs/resources/channel#create-message
*/
Expand All @@ -75,7 +78,7 @@ export interface RESTPostAPIChannelMessageJSONBody {
tts?: boolean;
embed?: APIEmbed;
allowed_mentions?: APIAllowedMentionsSend;
message_reference?: Required<Omit<APIMessageReference, 'guild_id'>> & Pick<APIMessageReference, 'guild_id'>;
message_reference?: APIMessageReferenceSend;
}

/**
Expand All @@ -98,7 +101,7 @@ export type RESTPostAPIChannelMessageFormDataBody =
tts?: boolean;
embed?: APIEmbed;
allowed_mentions?: APIAllowedMentionsSend;
message_reference?: APIMessageReference;
message_reference?: APIMessageReferenceSend;
/**
* The file contents
*/
Expand Down

0 comments on commit 21b9ae4

Please sign in to comment.