(node:12503) UnhandledPromiseRejectionWarning: Error: Data @ ID: "para_678703128970919949" IS NOT A number.
11:02 AM
FOUND: "1"
11:02 AM
EXPECTED: number
11:02 AM
at Object.module.exports [as add] (/rbd/pnpm-volume/42d1176b-665d-47f4-b20b-5f12797c50c4/node_modules/.registry.npmjs.org/quick.db/7.0.0-b21/node_modules/quick.db/lib/add.js:29:36)
11:02 AM
at arbitrate (/rbd/pnpm-volume/42d1176b-665d-47f4-b20b-5f12797c50c4/node_modules/.registry.npmjs.org/quick.db/7.0.0-b21/node_modules/quick.db/bin/handler.js:279:25)
11:02 AM
at Object.add (/rbd/pnpm-volume/42d1176b-665d-47f4-b20b-5f12797c50c4/node_modules/.registry.npmjs.org/quick.db/7.0.0-b21/node_modules/quick.db/bin/handler.js:79:12)
11:02 AM
Jump Toat AnaOkuluWin (/app/komutlar/rob.js:144:6)
11:02 AM
Jump Toat message.channel.send.then.message (/app/komutlar/rob.js:127:15)
11:02 AM
at <anonymous>
11:02 AM
at process._tickCallback (internal/process/next_tick.js:189:7)
11:02 AM
(node:12503) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
11:02 AM
(node:12503) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
I get such an error when I use quick.db in the function.
and code is here
function AnaOkuluWin(message, lvl, user) {
var winMoney0 = Number(crimes[0].basePara);
var winExp0 = Number(crimes[0].baseExp);
randomMoney = Math.round(Math.random() * (winMoney0 - 1 + 1));
randomExp = Math.round(Math.random() * (winExp0 - 1 + 1));
db.add(`para_${message.author.id}`, randomMoney);
db.add(`exp_${message.author.id}`, randomExp);
const embed = {
title: "Soygun Başarılı",
color: 8084528,
thumbnail: {
url: user.displayAvatarURL
},
fields: [
{
name: "Soygun yapılan yer",
value: crimes[0].name
},
{
name: "Kazandığın para",
value: randomMoney
},
{
name: "Kazandığın exp",
value: randomExp
}
]
};
message.channel.send({ embed });
}