简体   繁体   English

使用 Discord.JS 发送嵌入

[英]Sending an embed with Discord.JS

I am trying to send an Embed with Discord.js, and it is returning the error TypeError: Cannot read property 'send' of undefined我正在尝试使用 Discord.js 发送一个 Embed,它返回错误TypeError: Cannot read property 'send' of undefined

The code is shown a pastebin https://hasteb.in/sanunede.js代码显示为一个 pastebin https://hasteb.in/sanunede.js

Error Cannot read property 'send' of undefined in message.channel.send(embed) means, that message.channel returns undefined, so message doesn't contain property channel and message must be wrongly parsed to the function meme错误Cannot read property 'send' of undefined message.channel.send(embed) Cannot read property 'send' of undefined意味着,message.channel 返回 undefined,因此消息不包含属性通道并且消息必须被错误地解析为函数 meme

Try using console.log(message) right in the beggining of the function if its valid如果有效,请尝试在函数的开头使用console.log(message)

Could you also show the main code invoking this funciton??你还能显示调用这个函数的主要代码吗??

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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