Node.js 我正在开发一个discord机器人,但我一直遇到这个错误

Node.js 我正在开发一个discord机器人,但我一直遇到这个错误,node.js,discord,bots,token,Node.js,Discord,Bots,Token,这是我使用的代码,有人知道这里出了什么问题吗?我对编码相当陌生,我正在用新功能将一个机器人改造成一个新的机器人,我正在和朋友一起做这件事。如果有人能帮我找到这个错误我会很高兴的,我已经找了很多时间了,但是我找不到任何对我来说有用的东西,所以如果你们能找到一些东西就太好了。谢谢 const Discord = require('discord.js'); const {Client, Attachment, MessageEmbed} = require('discord.js'); const

这是我使用的代码,有人知道这里出了什么问题吗?我对编码相当陌生,我正在用新功能将一个机器人改造成一个新的机器人,我正在和朋友一起做这件事。如果有人能帮我找到这个错误我会很高兴的,我已经找了很多时间了,但是我找不到任何对我来说有用的东西,所以如果你们能找到一些东西就太好了。谢谢

const Discord = require('discord.js');
const {Client, Attachment, MessageEmbed} = require('discord.js');
const bot = new Discord.Client();
const fs = require('fs');
const { prefix, token } = require('./Storages/config.json');

bot.commands = new Discord.Collection();
const commandFiles = fs.readdirSync('./Commands/').filter(file => file.endsWith('.js'));
for(const file of commandFiles){
    const command = require(`./Commands/${file}`);
    bot.commands.set(command.name, command);
}


bot.on('ready', () =>{
    console.log(`Logged in as ${bot.user.tag}`)
    bot.user.setPresence({
        status: 'online',
        activity: {
            name: 'h!help | Made by cxntered',
            type: 'PLAYING',
        }
    })
})

setInterval(function presenceReset() {
    bot.user.setPresence({
        status: 'online',
        activity: {
            name: 'h!help | Made by cxntered',
            type: 'PLAYING',
        }
    })
}, 86400000)

bot.on('guildCreate', guild => {
    const channel = guild.channels.cache.find(channel => channel.type === 'text' && channel.permissionsFor(guild.me).has('SEND_MESSAGES'))
    channel.send("**Thank you for adding me!** \n`-` My prefix is `h!` \n`-` You can see all commands by typing `h!help` \n`-` Join the HyDiscord server! `h!invite`")
})

bot.on('message', message => {
    if (!message.content.startsWith(prefix) || message.author.bot) return;

    const args = message.content.slice(prefix.length).trim().split(/ +/);
    const commandName = args.shift().toLowerCase();

    const command = bot.commands.get(commandName)
        || bot.commands.find(cmd => cmd.aliases && cmd.aliases.includes(commandName));

    if (!command) return;

    if (command.guildOnly && message.channel.type === 'dm') {
        return message.reply('I can\'t execute that command inside DMs!');
    }

    try {
        command.execute(message, args, bot);
    } catch (error) {
        console.error(error);
        message.channel.send('There was an error trying to execute that command!');
    }
});

bot.login(token);

您的错误来自npm包“Hypix api reborn”,请确保此包没有任何问题。或者直接联系他们的支持人员。它与您的代码无关。