From fce639de1cf8ba8a4d58d2f5a0dd1cd437a52c9c Mon Sep 17 00:00:00 2001 From: toast-ts <96593068+toast-ts@users.noreply.github.com> Date: Fri, 5 Jan 2024 12:50:33 +1100 Subject: [PATCH] Fetch user directly from cache and send DM from there. --- src/commands/dev.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/commands/dev.ts b/src/commands/dev.ts index e293325..763c84a 100644 --- a/src/commands/dev.ts +++ b/src/commands/dev.ts @@ -121,7 +121,7 @@ export default class Developer { const member = interaction.options.getMember('member'); const message = interaction.options.getString('message'); const int = await interaction.reply({content: '*Sending...*', fetchReply: true}); - member.send(`${message}\n╰ ${interaction.member.displayName}`).then(()=>int.edit(`Successfully sent a DM to **${member.user.username}** with the following message:\n\`\`\`${message}\`\`\``)).catch((e:Error)=>int.edit(`\`${e.message}\``)) + client.users.cache.get(member.id).send(`${message}\n╰ ${interaction.member.displayName}`).then(()=>int.edit(`Successfully sent a DM to **${member.user.username}** with the following message:\n\`\`\`${message}\`\`\``)).catch((e:Error)=>int.edit(`\`${e.message}\``)) } } as any)[interaction.options.getSubcommand()](); }