1
0
mirror of https://github.com/toast-ts/Daggerbot-TS.git synced 2024-12-27 00:05:39 -05:00

Fetch user directly from cache and send DM from there.

This commit is contained in:
toast-ts 2024-01-05 12:50:33 +11:00
parent 1b849e26e6
commit fce639de1c

View File

@ -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()]();
}