fixed Birthday Event, Renamed DB Colls
This commit is contained in:
@@ -12,7 +12,7 @@ module.exports = {
|
||||
const to = await interaction.message.guild.members.fetch(temp[6].slice(2,-1))
|
||||
|
||||
const db = mClient.db(process.env.M_DB)
|
||||
const nutsColl = db.collection('nuts')
|
||||
const nutsColl = db.collection('items_nuts')
|
||||
await nutsColl.findOneAndUpdate({ userID: from.id }, { $inc: { nuts: -amount } }, { upsert: true })
|
||||
await nutsColl.findOneAndUpdate({ userID: to.id }, { $inc: { nuts: +amount } }, { upsert: true })
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ module.exports = {
|
||||
const to = await interaction.message.guild.members.fetch(temp[6].slice(2,-1))
|
||||
|
||||
const db = mClient.db(process.env.M_DB)
|
||||
const nutsColl = db.collection('nuts')
|
||||
const nutsColl = db.collection('items_nuts')
|
||||
|
||||
const yourBalance = await nutsColl.findOne({ userID: from.id })
|
||||
const theirBalance = await nutsColl.findOne({ userID: to.id })
|
||||
|
||||
@@ -7,7 +7,7 @@ module.exports = {
|
||||
description: 'navigate a page up',
|
||||
async execute(interaction) {
|
||||
const db = mClient.db(process.env.M_DB)
|
||||
const nutsColl = db.collection('nuts')
|
||||
const nutsColl = db.collection('items_nuts')
|
||||
const min = 0
|
||||
let skip = interaction.message.embeds[0].data.description.split('.')
|
||||
skip = Number(skip[0]) - 6
|
||||
|
||||
@@ -6,7 +6,7 @@ module.exports = {
|
||||
description: 'navigate a page down',
|
||||
async execute(interaction) {
|
||||
const db = mClient.db(process.env.M_DB)
|
||||
const nutsColl = db.collection('nuts')
|
||||
const nutsColl = db.collection('items_nuts')
|
||||
const max = await nutsColl.countDocuments({ nuts: { $gt: 0 } })
|
||||
let skip = interaction.message.embeds[0].data.description.split('.')
|
||||
skip = Number(skip[0]) +4
|
||||
|
||||
@@ -6,7 +6,7 @@ module.exports = {
|
||||
description: 'navigate to your own placement',
|
||||
async execute(interaction) {
|
||||
const db = mClient.db(process.env.M_DB)
|
||||
const nutsColl = db.collection('nuts')
|
||||
const nutsColl = db.collection('items_nuts')
|
||||
|
||||
const self = await nutsColl.find({ userID: interaction.user.id }).toArray()
|
||||
const all = await nutsColl.find({ nuts: { $gt: 0 } }).sort({ nuts: -1 }).toArray()
|
||||
|
||||
Reference in New Issue
Block a user