Discord botu yaptım fakat şöyle bir hata ile karşılaşıyorum hata bu
Kod ise bu
Kod:
(node:3302) DeprecationWarning: Collection#find: pass a function instead
(node:3302) UnhandledPromiseRejectionWarning: SqliteError: file is not a database
at newConnection (/rbd/pnpm-volume/37b4e8b1-a61d-4d7a-8dce-b86d78a59893/node_modules/.registry.npmjs.org/quick.db/6.3.2/node_modules/quick.db/src/functions/fetch.js:16:10)
at Promise (/rbd/pnpm-volume/37b4e8b1-a61d-4d7a-8dce-b86d78a59893/node_modules/.registry.npmjs.org/quick.db/6.3.2/node_modules/quick.db/src/functions/fetch.js:47:5)
at new Promise (<anonymous>)
at Object.module.exports [as fetchDebug] (/rbd/pnpm-volume/37b4e8b1-a61d-4d7a-8dce-b86d78a59893/node_modules/.registry.npmjs.org/quick.db/6.3.2/node_modules/quick.db/src/functions/fetch.js:5:19)
at executeQueue (/rbd/pnpm-volume/37b4e8b1-a61d-4d7a-8dce-b86d78a59893/node_modules/.registry.npmjs.org/quick.db/6.3.2/node_modules/quick.db/src/queue.js:25:25)
at Promise (/rbd/pnpm-volume/37b4e8b1-a61d-4d7a-8dce-b86d78a59893/node_modules/.registry.npmjs.org/quick.db/6.3.2/node_modules/quick.db/src/queue.js:42:7)
at new Promise (<anonymous>)
at Object.fetch (/rbd/pnpm-volume/37b4e8b1-a61d-4d7a-8dce-b86d78a59893/node_modules/.registry.npmjs.org/quick.db/6.3.2/node_modules/quick.db/src/queue.js:41:12)
at Client.client.on (/app/bot.js:53:26)
at emitOne (events.js:121:20)
(node:3302) 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: 2)
(node:3302) [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.
Kod ise bu
Kod:
client.on("message", async message => {
let prefix = (await db.fetch(`prefix_${message.guild.id}`)) || ayarlar.prefix;
let kullanıcı = message.mentions.users.first() || message.author;
let afkdkullanıcı = await db.fetch(`afk_${message.author.id}`);
let afkkullanıcı = await db.fetch(`afk_${kullanıcı.id}`);
let sebep = afkkullanıcı;
if (message.author.bot) return;
if (message.content.includes(`${prefix}afk`)) return;
if (message.content.includes(`<@${kullanıcı.id}>`)) {
if (afkdkullanıcı) {
message.channel.send(
`🔹 \`${message.author.tag}\` Adlı Kullanıcı Artık AFK Değil!`
);
db.delete(`afk_${message.author.id}`);
}
if (afkkullanıcı)
return message.channel.send(`
${kullanıcı.tag}\`⏰ Şu Anda AFK\n \nSebep : \`${sebep}\``);
}
if (!message.content.includes(`<@${kullanıcı.id}>`)) {
if (afkdkullanıcı) {
message.channel.send(
`🔹 \`${message.author.tag}\` Adlı Kullanıcı Artık AFK Değil!`
);
db.delete(`afk_${message.author.id}`);
}
}
});

