【发布时间】:2021-07-05 16:53:35
【问题描述】:
我想让我的存在将来自 json 文件的订单数量显示到机器人的存在中,但它不显示任何内容,也不会在控制台中显示任何错误
const fsn = require("fs-nextra");
module.exports = {
name: 'ready',
once: true,
execute(client) {
fsn.readJSON("./orders.json").then((orderDB) => {
let amount = 0;
for (let x in orderDB) {
amount++;
client.user.setPresence({
status: 'online',
activity: {
name: `${amount} orders | .help`,
type: "WATCHING"
}
})
}
});
console.log(`Ready! Logged in as ${client.user.tag}`);
},
};
【问题讨论】:
标签: node.js discord.js