【发布时间】:2021-11-04 02:58:25
【问题描述】:
当我尝试启动我的不和谐机器人时,我收到了这个错误,我什至尝试更新我的 node.js
请到这里查看错误我无法发布问题,包括错误https://athulrajtheno1.github.io/error/
如果你想看这里是代码
const client = new Discord.Client();
const fs = require('fs');
const prefix = '~';
client.commands = new Discord.Collection();
const commandFiles = fs.readdirSync('./commands/').filter(file => file.endsWith('.js'));
for(const file of commandFiles){
const command = require(`./commands/${file}`);
client.commands.set(command.name, command);
}
client.once('ready', () => {
console.log('bot is now online');// this sends a message to you in the console when the bot is online
client.on('message', message => {
if (!message.content.startsWith(prefix) || message.author.bot)return;
const args = message.content.slice(prefix.length).split(/ +/);
const command = args.shift().toLowerCase();
});
});
client.login('i had given bot token');
【问题讨论】:
-
问题的所有信息(包括错误消息)都需要包含在问题本身中,原因与不应发布为 images 的原因相同。请阅读有关询问的帮助中心文档,尤其是how to ask good questions。
标签: javascript node.js discord discord.js