From 8bf2c1e99d245c68998b3969a9a82f9a65592812 Mon Sep 17 00:00:00 2001 From: DjDeveloperr Date: Sun, 4 Apr 2021 10:11:00 +0530 Subject: [PATCH] required changes --- src/structures/slash.ts | 36 ++++++++++++++---------------------- 1 file changed, 14 insertions(+), 22 deletions(-) diff --git a/src/structures/slash.ts b/src/structures/slash.ts index 0891f4a..0f61cc2 100644 --- a/src/structures/slash.ts +++ b/src/structures/slash.ts @@ -177,15 +177,15 @@ export class Interaction extends SnowflakeBase { type: data.type ?? InteractionResponseType.CHANNEL_MESSAGE_WITH_SOURCE, data: data.type === undefined || - data.type === InteractionResponseType.CHANNEL_MESSAGE_WITH_SOURCE || - data.type === InteractionResponseType.CHANNEL_MESSAGE + data.type === InteractionResponseType.CHANNEL_MESSAGE_WITH_SOURCE || + data.type === InteractionResponseType.CHANNEL_MESSAGE ? { - content: data.content ?? '', - embeds: data.embeds, - tts: data.tts ?? false, - flags, - allowed_mentions: data.allowedMentions ?? undefined - } + content: data.content ?? '', + embeds: data.embeds, + tts: data.tts ?? false, + flags, + allowed_mentions: data.allowedMentions ?? undefined + } : undefined } @@ -239,7 +239,7 @@ export class Interaction extends SnowflakeBase { content: options.content, embeds: options.embeds, flags: options.flags, - allowedMentions: options.allowedMentions, + allowedMentions: options.allowedMentions }) } else await this.respond( @@ -258,11 +258,7 @@ export class Interaction extends SnowflakeBase { flags?: number | number[] allowedMentions?: AllowedMentionsPayload }): Promise { - const url = WEBHOOK_MESSAGE( - this.applicationID, - this.token, - '@original' - ) + const url = WEBHOOK_MESSAGE(this.applicationID, this.token, '@original') await this.client.rest.patch(url, { content: data.content ?? '', embeds: data.embeds ?? [], @@ -277,11 +273,7 @@ export class Interaction extends SnowflakeBase { /** Delete the original Interaction Response */ async deleteResponse(): Promise { - const url = WEBHOOK_MESSAGE( - this.applicationID, - this.token, - '@original' - ) + const url = WEBHOOK_MESSAGE(this.applicationID, this.token, '@original') await this.client.rest.delete(url) return this } @@ -315,8 +307,8 @@ export class Interaction extends SnowflakeBase { (option as WebhookMessageOptions)?.embed !== undefined ? [(option as WebhookMessageOptions).embed] : (option as WebhookMessageOptions)?.embeds !== undefined - ? (option as WebhookMessageOptions).embeds - : undefined, + ? (option as WebhookMessageOptions).embeds + : undefined, file: (option as WebhookMessageOptions)?.file, files: (option as WebhookMessageOptions)?.files, tts: (option as WebhookMessageOptions)?.tts, @@ -357,7 +349,7 @@ export class Interaction extends SnowflakeBase { msg: Message | string, data: { content?: string - embeds?: Embed[] + embeds?: Array file?: any allowed_mentions?: { parse?: string