From 6a802f028311dd3e4f3782defd8a25e3ad266376 Mon Sep 17 00:00:00 2001 From: Yuzu Date: Sun, 30 Jan 2022 20:09:19 +0700 Subject: [PATCH] Allow some more interaction type --- src/utils/DiscordMessage.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/utils/DiscordMessage.ts b/src/utils/DiscordMessage.ts index d265efe..8363c00 100644 --- a/src/utils/DiscordMessage.ts +++ b/src/utils/DiscordMessage.ts @@ -65,7 +65,9 @@ export async function sendMessage(channel: TextChannel | DMChannel | BaseGuildTe try { message = await channel.send(options); } catch(error) { - if(typeof user === 'undefined') return; + if(typeof user === 'undefined') { + return Logger.error(`Cannot find available destinations to send the message CID: ${channel.id} C_ERR: ${error}`); + } try { message = await user.send(options); } catch(errorDM) { Logger.error(`Cannot find available destinations to send the message CID: ${channel.id} UID: ${user.id} C_ERR: ${error} DM_ERR: ${errorDM}`); @@ -99,7 +101,7 @@ export async function sendMessageOrInteractionResponse(data: Message | Interacti const isSlashCommand = data instanceof Interaction && data.isCommand(); const isMessage = data instanceof Message; - if(isSlashCommand) { + if(isSlashCommand || (data instanceof Interaction && data.isSelectMenu())) { if(!data.replied) { let message; try {