so im trying to create a discord.js v14 code that will work with better-sqlite3 module and once a button is clicked it will check at db, if he already pressed this button (without clicking the offline as well) and the rest of the code is easily undertandable. Can you help me resolve the error ?
The Error Message is:
TypeError: db.get is not a function
at Object.execute (C:\Users\MariosWRLD\Desktop\Programming\New\src\events\interactionCreate.js:21:41)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
The code is:
const role = interaction.guild.roles.cache.get(config.on_duty_role);
const member = interaction.member;
await member.roles.add(role);
const status = await db.get(`time_${interaction.guild.id}_${interaction.user.id}`);
if (status) {
interaction.reply({
embeds: [
new EmbedBuilder({
"description": "** Η κατάσταση σου είναι ήδη ενεργή **",
"color": "#ffb600",
"author": {
"name": interaction.user.username,
"url": "https://discord.com/users/" + interaction.user.id,
"icon_url": interaction.user.displayAvatarURL()
}
})
],
ephemeral: true
});
} else {
interaction.reply({
embeds: [
new EmbedBuilder({
"description": "** Η κατάσταση σου είναι ενεργή **",
"color": "#ffb600",
"author": {
"name": interaction.user.username,
"url": "https://discord.com/users/" + interaction.user.id,
"icon_url": interaction.user.displayAvatarURL()
}
})
],
ephemeral: true
});
await db.set(`time_${interaction.guild.id}_${interaction.user.id}`, new Date().getTime());
}