[CodeFactor] Apply fixes to commit 2e12fe3
This commit is contained in:
parent
91b25452e8
commit
883cd59497
3 changed files with 12 additions and 11 deletions
|
@ -6,9 +6,7 @@ module.exports = async (interaction) => {
|
||||||
await credits.find().then(async (data) => {
|
await credits.find().then(async (data) => {
|
||||||
const topTen = data.sort((a, b) => (a.balance > b.balance ? -1 : 1)).slice(0, 10);
|
const topTen = data.sort((a, b) => (a.balance > b.balance ? -1 : 1)).slice(0, 10);
|
||||||
|
|
||||||
const item = (x, index) => {
|
const item = (x, index) => `**Top ${index + 1}** - <@${x.userId}> ${creditNoun(x.balance)}`;
|
||||||
return `**Top ${index + 1}** - <@${x.userId}> ${creditNoun(x.balance)}`;
|
|
||||||
};
|
|
||||||
|
|
||||||
const embed = {
|
const embed = {
|
||||||
title: 'Balance Top',
|
title: 'Balance Top',
|
||||||
|
|
|
@ -79,15 +79,20 @@ module.exports = {
|
||||||
async execute(interaction) {
|
async execute(interaction) {
|
||||||
if (interaction.options.getSubcommand() === 'balance') {
|
if (interaction.options.getSubcommand() === 'balance') {
|
||||||
await balance(interaction);
|
await balance(interaction);
|
||||||
} else if (interaction.options.getSubcommand() === 'gift') {
|
}
|
||||||
|
else if (interaction.options.getSubcommand() === 'gift') {
|
||||||
await gift(interaction);
|
await gift(interaction);
|
||||||
} else if (interaction.options.getSubcommand() === 'give') {
|
}
|
||||||
|
else if (interaction.options.getSubcommand() === 'give') {
|
||||||
await give(interaction);
|
await give(interaction);
|
||||||
} else if (interaction.options.getSubcommand() === 'redeem') {
|
}
|
||||||
|
else if (interaction.options.getSubcommand() === 'redeem') {
|
||||||
await redeem(interaction);
|
await redeem(interaction);
|
||||||
} else if (interaction.options.getSubcommand() === 'take') {
|
}
|
||||||
|
else if (interaction.options.getSubcommand() === 'take') {
|
||||||
await take(interaction);
|
await take(interaction);
|
||||||
} else if (interaction.options.getSubcommand() === 'top') {
|
}
|
||||||
|
else if (interaction.options.getSubcommand() === 'top') {
|
||||||
await top(interaction);
|
await top(interaction);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,3 +1 @@
|
||||||
module.exports = (amount) => {
|
module.exports = (amount) => `${amount <= 1 ? `${amount} credit` : `${amount} credits`}`;
|
||||||
return `${amount <= 1 ? `${amount} credit` : `${amount} credits`}`;
|
|
||||||
};
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue