我在使用不和谐嵌入时遇到了一些问题
我有3个嵌入:embed1,embed2,embed3,但是当我尝试发送包含以下代码的嵌入信息:message.channel.send({embed1})
我收到此错误:
(节点:24120)UnhandledPromiseRejection警告:DiscordAPIError:无法发送空消息
答案 0 :(得分:1)
This is cause in ES6 without adding the definer in an object. The varible's name is now the definer. Example:
message.channel.send({embed1});
//Get's translated to:
message.channel.send({embed1:embed1});
Since all objects need an definer and a value. ES6 just shortens it.
So your message.channel.send({embed1});
sets the definer to embed1
Which then means discord has no message or embed to send, Hence the empty message error
To upload an embed you'll need message.channel.send({embed:embed1});
;