feat(Message): reply updates (#34)

* feat(allowedmentions): replied_user

* feat(message): message_reference channel_id is now optional

* fix: make message_id required when sending

* chore: export APIMessageReferenceSend
This commit is contained in:
Advaith
2020-11-21 06:22:32 -08:00
committed by GitHub
parent 39ea1f4429
commit 21b9ae4aaf
2 changed files with 6 additions and 3 deletions

View File

@@ -130,7 +130,7 @@ export interface APIMessageApplication {
*/
export interface APIMessageReference {
message_id?: string;
channel_id: string;
channel_id?: string;
guild_id?: string;
}

View File

@@ -31,6 +31,7 @@ export interface APIAllowedMentionsSend {
parse?: AllowedMentionsTypes[];
roles?: string[];
users?: string[];
replied_user?: boolean;
}
// #endregion TypeDefs
@@ -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
*/
@@ -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;
}
/**
@@ -98,7 +101,7 @@ export type RESTPostAPIChannelMessageFormDataBody =
tts?: boolean;
embed?: APIEmbed;
allowed_mentions?: APIAllowedMentionsSend;
message_reference?: APIMessageReference;
message_reference?: APIMessageReferenceSend;
/**
* The file contents
*/