converted ShaiBot casino to Nut Economy
This commit is contained in:
@@ -8,7 +8,7 @@ module.exports = {
|
||||
const db = mClient.db(process.env.M_DB)
|
||||
const nutsColl = db.collection('items_nuts')
|
||||
|
||||
const self = await nutsColl.find({ userID: interaction.user.id }).toArray()
|
||||
const self = await nutsColl.find({ userId: interaction.user.id }).toArray()
|
||||
const all = await nutsColl.find({ nuts: { $gt: 0 } }).sort({ nuts: -1 }).toArray()
|
||||
|
||||
function findIndex(){
|
||||
@@ -16,7 +16,7 @@ module.exports = {
|
||||
for (let i = 0; i < all.length; i++) {
|
||||
index++
|
||||
if (all[i].nuts === self[0].nuts) {
|
||||
return index
|
||||
return index - 1
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -27,7 +27,7 @@ module.exports = {
|
||||
let fields
|
||||
nutsData.forEach((data) => {
|
||||
skip++
|
||||
fields = (fields ? fields : '') + (`${skip}. <@${data.userID}> : ${data.nuts} Nuts\r\n`)
|
||||
fields = (fields ? fields : '') + (`${skip}. <@${data.userId}> : ${data.nuts} Nuts\r\n`)
|
||||
})
|
||||
const embed = new EmbedBuilder()
|
||||
.setTitle('Nuts Leaderboard')
|
||||
|
||||
Reference in New Issue
Block a user