2021年4月30日星期五

target is not a number quick.db

I am trying to update a value every so often, but now a line of code that was function is showing up the error: target is not a number

const db = require('quick.db');    module.exports = {      name: 'farmstart',      description: 'Gives you your first chicken to start farming with.',      execute: async (message, args, Discord) => {          let user = message.author          let chickens = await db.fetch(`chickens_${user.id}`)          let water = await db.fetch(`water_${user.id}`)            function updatewater() {              chickens = db.fetch(`chickens_${user.id}`)              water = db.fetch(`water_${user.id}`)                            if (water < chickens) {                  let waterdif = chickens - water                  db.subtract(`chickens_${user.id}`, waterdif)                  console.log(`took ${waterdif} water from ${user.tag}`)              }              setTimeout(updatewater, 21600000)          }          setTimeout(updatewater, 5000)      }  }  

this is the code that is returning the error at db.subtract. I have tried everything i can think of and it still does not work

https://stackoverflow.com/questions/67342055/target-is-not-a-number-quick-db May 01, 2021 at 09:06AM

没有评论:

发表评论