简体   繁体   中英

TypeError: Cannot read property 'get' of undefined Discord.js Error

at module.exports (/Users/beyoki/Desktop/Coding/8FE Bot/events/guild/message.js:8:37)

Making a discord bot, working on getting it to work inside my server, and any time i use my code for an embed

(code Below)

const { MessageEmbed } = require("discord.js")

module.exports = {
    name: 'seed',
    description: "seed time baby, Whos ready?",
    execute(message, args, Discord){
        const seedEmbed = new MessageEmbed()
        .setColor('#0099ff')
        .setTitle('Seed Time!')
        .setDescription('Click on the reaction to let us know if you are able to seed with us')
        .setFooter('Made by Beyoki#9983')
        .setImage('https://imgur.com/4pD7GvP')
        message.channel.send({embeds: [newEmbed]});
    }
}

And the message handler code

module.exports = (Discord, client, message) => {
    const prefix = ';';
    if(!message.content.startsWith(prefix) || message.author.bot) return;

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

    const command = client.commands.get(cmd);

    if(command) command.execute(client, message, args, Discord);
}

client.command 未定义,不是 discord.js 的问题

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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