JavaScript:
const { MessageEmbed } = require("discord.js");
const Dremy = require('dremy');
const db = new Dremy({
fileName: 'ekonomi.json'
});
module.exports = {
name: "cüzdan",
aliases: ["para", "balance", "cüzdan", "cuzdan"],
description: "Paranızı gösterir.",
usage: "cüzdan",
ownerOnly: false,
run: async (message,args,client) => {
let user =
message.mentions.members.first() ||
message.guild.members.cache.get(args[0]) ||
message.guild.members.cache.find(
r =>
r.user.username.toLowerCase() === args.join(" ").toLocaleLowerCase()
) ||
message.guild.members.cache.find(
r => r.displayName.toLowerCase() === args.join(" ").toLocaleLowerCase()
) ||
message.member;
let para = await db.get(`money_${message.author.id}`) || 0;
let bank = await db.get(`bank_${message.author.id}`) || 0;
if (user) {
let moneyEmbed = new MessageEmbed()
.setColor("RANDOM")
.setDescription(
`**${user.user.username}'in Paraları:**\n\n**Cüzdan:** ${para} TL\n**Banka:** ${bank} TL`
);
message.channel.send(moneyEmbed);
} else {
return message.channel.send("**Bir üye girin!**");
}
}
};
Kod bu. Aldığım hata:
(node:2487) UnhandledPromiseRejectionWarning: Error: There is no such data
at Dremy.get (/home/runner/ghost/node_modules/dremy/src/Dremy.js:32:36)
at Object.run (/home/runner/ghost/komutlar/cüzdan.js:29:25)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:2487) 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(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:2487) [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.