嵌入问题/所有消息一次发送
Embedding issue / All messages send at once
我遇到了所有嵌入都在一起的问题。我如何将它们分开?
我的问题是,每次我 运行 嵌入一起发送时,我知道这个问题,但我该如何解决?
我已经尝试添加那些应该结束该行的小 (;) 内容。我是 discord.js.
的新手
您需要使用自己的命令属性创建单独的文件,例如 yesben.js
并创建它们,
var yesben = new Discord.MessageEmbed()
.setTitle("Ben says..")
.setDescription("Yes")
.setImage()
.setTimestamp()
.setColor()
message.channel.send(yesben) // if this is a v12 discord.js
message.channel.send({embeds: [yesben]}) //if this is a v13 discord.js
你也可以把它们做成数组:
var array = ["Yes", "No", "Augh", "Hohoho"]
var math = Math.floor(Math.random() * array.length)
var embed = new Discord.MessageEmbed()
.setTitle("Ben says..")
.setDescription(array[math])
.setImage() //If you create like this, idk how to send the image same with array
.setTimestamp()
.setColor()
message.channel.send(embed) // if this is a v12 discord.js
message.channel.send({embeds: [embed]}) //if this is a v13 discord.js
You might get an error like `empty string` because of your `setDescription`
你所要做的就是把它变成字符串
.setDescription(`${array[math]}`)
我遇到了所有嵌入都在一起的问题。我如何将它们分开?
我的问题是,每次我 运行 嵌入一起发送时,我知道这个问题,但我该如何解决?
我已经尝试添加那些应该结束该行的小 (;) 内容。我是 discord.js.
的新手您需要使用自己的命令属性创建单独的文件,例如 yesben.js
并创建它们,
var yesben = new Discord.MessageEmbed()
.setTitle("Ben says..")
.setDescription("Yes")
.setImage()
.setTimestamp()
.setColor()
message.channel.send(yesben) // if this is a v12 discord.js
message.channel.send({embeds: [yesben]}) //if this is a v13 discord.js
你也可以把它们做成数组:
var array = ["Yes", "No", "Augh", "Hohoho"]
var math = Math.floor(Math.random() * array.length)
var embed = new Discord.MessageEmbed()
.setTitle("Ben says..")
.setDescription(array[math])
.setImage() //If you create like this, idk how to send the image same with array
.setTimestamp()
.setColor()
message.channel.send(embed) // if this is a v12 discord.js
message.channel.send({embeds: [embed]}) //if this is a v13 discord.js
You might get an error like `empty string` because of your `setDescription`
你所要做的就是把它变成字符串
.setDescription(`${array[math]}`)