简体   繁体   中英

Discord.js and quick.db data not found error

It is a topic opened by making use of translation.

The part that gives the error without giving the whole code is as follows:

const Discord = require('discord.js');
const moment = require('moment');
const { prefix } = require('../config.json');

module.exports = async(message,guild,args,member) => {

//console.log(guild,message)
const db = require('quick.db');

const d2 = db.fetch(`dil_${message.guild.id}`);
var lang;
if(!d2) {
lang = require('../lang/tr.json');
} else {
if(d2 == "tr") {
 lang = require('../lang/tr.json');
} else {
    if(d2 == "en") {
        lang = require('../lang/en.json');
    }
}

} }

[the error i got:][1] [1]: https://i.stack.imgur.com/ilaQs.png

You should be using:

const { QuickDB } = require("quick.db");
const db = new QuickDB(); 

at the top of the file and remove the following:

const db = require ('quick.db');

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM