我正在编码一个机器人,必须发送嵌入。但是当嵌入式被发送时,机器人会说[object Object]。
嵌入代码:
const embed9 = new Discord.MessageEmbed()
.setTitle("1h Until Convoy - Sim1")
.setURL("https://www.scanialtd.com/")
.setColor(16571139)
.setDescription("There is 1 hour untill the convoy on Simulation 1 in ETS2. Get ready to join by launching ETS2 and logging on to Simulation 1. Join the Convoy Lounge while you wait.")
.setFooter("Created by ScaniaLTD Convoy Announcements Bot, https://www.scanialtd.com/uploads/6/3/4/9/63493649/published/logo_3.png")
.setImage("http://i.imgur.com/yVpymuV.png")
.setThumbnail("https://www.scanialtd.com/uploads/6/3/4/9/63493649/published/logo_3.png")
.setTimestamp()
message.channel.send('@ConvoyReminders' + {embed9})发布于 2020-03-17 23:25:13
您正在连接一个字符串和一个带有embed9的对象。
要提到一个人,您需要在@<Username>中添加.setDescription。然后你就可以做message.channel.send(embed9)了
发布于 2020-03-18 06:38:35
因为您尝试在1个args中发送、搅拌+嵌入对象。您可以将@you need useuser.idfor this, like<@213123131321>or<@&1232312123132>`名称+t mention peaple with their用于角色。
正确的方式:
const embed9 = new Discord.MessageEmbed()
.setTitle("1h Until Convoy - Sim1")
.setURL("https://www.scanialtd.com/")
.setColor(16571139)
.setDescription("There is 1 hour untill the convoy on Simulation 1 in ETS2. Get ready to join by launching ETS2 and logging on to Simulation 1. Join the Convoy Lounge while you wait.")
.setFooter("Created by ScaniaLTD Convoy Announcements Bot, https://www.scanialtd.com/uploads/6/3/4/9/63493649/published/logo_3.png")
.setImage("http://i.imgur.com/yVpymuV.png")
.setThumbnail("https://www.scanialtd.com/uploads/6/3/4/9/63493649/published/logo_3.png")
.setTimestamp()
message.channel.send('@ConvoyReminders', embed9)https://stackoverflow.com/questions/60731486
复制相似问题