简体   繁体   English

Discord.js 和 quick.db 数据未找到错误

[英]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 [我得到的错误:][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');

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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