23 lines
1.1 KiB
JavaScript
23 lines
1.1 KiB
JavaScript
module.exports = (interaction, client, bvs) => {
|
|
const member = interaction.guild.members.cache.get(interaction.user.id);
|
|
|
|
if (!member) {
|
|
interaction.reply({ content: `Could not find member with ID ${user.id}.`, ephemeral: true });
|
|
return;
|
|
}
|
|
bvs.getPremiumDIDs().then(dids => {
|
|
const userDIDs = dids.filter(did => did.userId === interaction.user.id);
|
|
if (userDIDs.length === 0) {
|
|
if (member.premiumSince) {
|
|
interaction.reply({ content: `You don't have a DID associated with your account. But with your currently active server boost, you can get one with \`/getnumber\`!`, ephemeral: true });
|
|
} else {
|
|
interaction.reply({ content: `You don't have a DID associated with your account. Boost the server to request one!`, ephemeral: true });
|
|
}
|
|
} else {
|
|
interaction.reply({ content: `Your DID is \`${bvs.formatPhoneNumber(userDIDs[0].did)}\``, ephemeral: true });
|
|
}
|
|
}).catch(error => {
|
|
console.error("Error fetching premium DIDs:", error);
|
|
interaction.reply({ content: `There was an error fetching your DID. Please try again later.`, ephemeral: true });
|
|
});
|
|
} |