Gquqww
This commit is contained in:
parent
330a769b88
commit
42bb858134
|
|
@ -11,11 +11,6 @@ module.exports = (interaction, client, bvs) => {
|
||||||
return interaction.reply({ content: `You must be boosting the server to use this command.`, ephemeral: true });
|
return interaction.reply({ content: `You must be boosting the server to use this command.`, ephemeral: true });
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check that the member doesn't already have a number.
|
|
||||||
bvs.getPremiumDIDs().then(dids => {
|
|
||||||
const userDIDs = dids.filter(did => did.userId === interaction.user.id);
|
|
||||||
if (userDIDs.length === 0) {
|
|
||||||
|
|
||||||
const choice = interaction.options.getNumber('choice');
|
const choice = interaction.options.getNumber('choice');
|
||||||
if (!choice) {
|
if (!choice) {
|
||||||
return interaction.reply({ content: `You must provide a choice from the latest run of \`/searchnumbers\`. Use \`/searchnumbers\` to see available DIDs and their corresponding choices.`, ephemeral: true });
|
return interaction.reply({ content: `You must provide a choice from the latest run of \`/searchnumbers\`. Use \`/searchnumbers\` to see available DIDs and their corresponding choices.`, ephemeral: true });
|
||||||
|
|
@ -60,6 +55,10 @@ module.exports = (interaction, client, bvs) => {
|
||||||
return interaction.reply({ content: `You must provide a choice from the latest run of \`/searchnumbers\`. Use \`/searchnumbers\` to see available DIDs and their corresponding choices.`, ephemeral: true });
|
return interaction.reply({ content: `You must provide a choice from the latest run of \`/searchnumbers\`. Use \`/searchnumbers\` to see available DIDs and their corresponding choices.`, ephemeral: true });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check that the member doesn't already have a number.
|
||||||
|
bvs.getPremiumDIDs().then(dids => {
|
||||||
|
const userDIDs = dids.filter(did => did.userId === interaction.user.id);
|
||||||
|
if (userDIDs.length === 0) {
|
||||||
const dids = global.tempPurchasableDIDs[interaction.user.id];
|
const dids = global.tempPurchasableDIDs[interaction.user.id];
|
||||||
const index = parseInt(choice) - 1;
|
const index = parseInt(choice) - 1;
|
||||||
if (isNaN(index) || index < 0 || index >= dids.length) {
|
if (isNaN(index) || index < 0 || index >= dids.length) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue