【发布时间】:2020-11-04 06:19:08
【问题描述】:
我正在尝试将嵌入消息发送到使用分片机器人的特定频道。 我已经使用此代码成功发送了一条简单的消息:
client.shard.broadcastEval(`
(async () => {
let channel = await this.channels.get("683353482748756047");
channel.send("Hello")
})()
`)
当我想发送嵌入消息时,问题就开始了。我试过像这样传递变量:
//exampleEmbed is created
client.shard.broadcastEval(`
(async () => {
let channel = await this.channels.get("683353482748756047");
channel.send('${exampleEmbed}')
})()
`)
但消息的发送方式类似于“[object Object]”。
我曾考虑将频道对象返回到 broadcastEval 之外,然后发送我的变量,但我读过这是不可能的,因为您无法返回完整的不和谐对象。
我应该如何发送嵌入消息?感谢您的宝贵时间。
【问题讨论】:
标签: discord.js sharding