From 3aa76a58954e6eb619fec3de8d197bff633d5e5e Mon Sep 17 00:00:00 2001 From: Yuzu Date: Wed, 5 Oct 2022 12:34:19 +0700 Subject: [PATCH] Fixed broken changes --- src/utils/DiscordMessage.ts | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/src/utils/DiscordMessage.ts b/src/utils/DiscordMessage.ts index 981ca10..02987b5 100644 --- a/src/utils/DiscordMessage.ts +++ b/src/utils/DiscordMessage.ts @@ -2,7 +2,7 @@ import { EmbedBuilder, User, MessagePayload, - MessageOptions, + BaseMessageOptions, GuildTextBasedChannel, TextChannel, DMChannel, @@ -131,17 +131,22 @@ export function makeProcessingEmbed(data: EmbedDataPresets) { } export async function sendMessage( - channel: TextChannel | DMChannel | BaseGuildTextChannel | GuildTextBasedChannel | PartialDMChannel | BaseGuildTextChannel | BaseGuildVoiceChannel, + channel: + | TextChannel + | DMChannel + | BaseGuildTextChannel + | GuildTextBasedChannel + | PartialDMChannel + | BaseGuildTextChannel + | BaseGuildVoiceChannel, user: User | undefined, - options: string | MessagePayload | MessageOptions + options: string | MessagePayload | BaseMessageOptions ) { let message; try { - if(channel instanceof BaseGuildVoiceChannel) - message = await (channel as VoiceChannel).send(options); - else - message = await channel.send(options); + if (channel instanceof BaseGuildVoiceChannel) message = await (channel as VoiceChannel).send(options); + else message = await channel.send(options); } catch (error) { if (typeof user === 'undefined') { return Logger.error( @@ -163,7 +168,7 @@ export async function sendMessage( export async function sendHybridInteractionMessageResponse( data: HybridInteractionMessage, - payload: MessageOptions | InteractionReplyOptions, + payload: BaseMessageOptions | InteractionReplyOptions, replace = false ): Promise { if (data.isApplicationCommand() || data.isButton() || data.isSelectMenu()) { @@ -205,14 +210,14 @@ export async function sendHybridInteractionMessageResponse( return message; } } - } else if (data.isMessage()) return await sendReply(data.getMessage(), payload as MessageOptions); + } else if (data.isMessage()) return await sendReply(data.getMessage(), payload as BaseMessageOptions); } export function getEmotes() { return emotes; } -async function sendReply(rMessage: Message, options: string | MessagePayload | MessageOptions) { +async function sendReply(rMessage: Message, options: string | MessagePayload | BaseMessageOptions) { let message; try {