我正在运行Discord JS机器人,在Windows上运行都正常,但是在Ubuntu VPS上运行则会出现此错误
我尝试将Python从3.5升级到3.6.1,安装了nodejs模块。
client.on("message", async message => {
if (message.author.bot) return;
if (message.content.indexOf(config.prefix) !== 0) return;
const args = message.content.slice(config.prefix.length).trim().split(/ +/g);
const command = args.shift().toLowerCase();
setInterval(function start(){
let totalSeconds = (client.uptime / 1000);
let hours = Math.floor(totalSeconds / 3600);
totalSeconds %= 3600;
let minutes = Math.floor(totalSeconds / 60);
let seconds = Math.floor(totalSeconds % 60);
let uptime = `${hours} hours, ${minutes} minutes and ${seconds} seconds`;
fs.writeFile('api.json', `{"ping": ${Math.round(client.ping)}, "users": ${client.users.size}, "servers": ${client.guilds.size}, "uptime": ["${hours} hours", "${minutes} minutes", "${seconds} seconds"]}`, (err) => {
if (err) {console.error(err)}
});
return start;
}(), 600000);
});