Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/36.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 在Discord.js上嵌入_Javascript_Node.js_Discord.js - Fatal编程技术网

Javascript 在Discord.js上嵌入

Javascript 在Discord.js上嵌入,javascript,node.js,discord.js,Javascript,Node.js,Discord.js,因此,我正在制作一个discord机器人,我希望它在我键入hy时发送一个嵌入!帮助 所以我在discord.js文档中使用了这种格式,到目前为止,我的代码是这样的 const client = new Discord.Client({ token: "pls-no-hack-ty" }); client.on("ready", () => { //do stuff lol }); client.on("message", message => { if(m

因此,我正在制作一个discord机器人,我希望它在我键入hy时发送一个嵌入!帮助 所以我在discord.js文档中使用了这种格式,到目前为止,我的代码是这样的

const client = new Discord.Client({
    token: "pls-no-hack-ty"
});

client.on("ready", () => {
    //do stuff lol
});

client.on("message", message => {
    if(message.content === "hy!help") {
        const exampleEmbed = new Discord.MessageEmbed()
            .setColor('#0099ff')
            .setTitle('Some title')
            .setURL('https://discord.js.org/')
            .setAuthor('Some name', 'https://i.imgur.com/wSTFkRM.png', 'https://discord.js.org')
            .setDescription('Some description here')
            .setThumbnail('https://i.imgur.com/wSTFkRM.png')
            .addFields(
                { name: 'Regular field title', value: 'Some value here' },
                { name: '\u200B', value: '\u200B' },
                { name: 'Inline field title', value: 'Some value here', inline: true },
                { name: 'Inline field title', value: 'Some value here', inline: true },
            )
            .addField('Inline field title', 'Some value here', true)
            .setImage('https://i.imgur.com/wSTFkRM.png')
            .setTimestamp()
            .setFooter('Some footer text here', 'https://i.imgur.com/wSTFkRM.png');
    channel.send(exampleEmbed);
        }  } )
但是我得到了一个
通道点定义的
错误

我做错了什么?
感谢您在最后一行中使用了-rly907,而不是
channel.send(示例嵌入)执行

message.channel.send(exampleEmbed);
您应该向用户发送它不能使用
频道。发送

message.channel.send(嵌入);

如果您想知道《嵌入指南》的内容