Discord.js向已创建的新频道发送嵌入,并随机配对2名用户进行战斗



如何在下面的代码中添加多个嵌入?我并不是要求你为我编写代码,我只是需要一些关于如何添加嵌入的提示和要点。因为我想创建新的频道,然后你会在该频道上发布2或3个嵌入。一个嵌入会在那里产生反应,我希望机器人能随机配对两个玩家,这样他们就可以再次进行lvl战斗。

if (
guild.channels.cache.find((channel) => channel.name === "t5-battle-channel")
)
return;
if (reaction.emoji.name === "5️⃣") {
let guild = reaction.message.guild;
guild.channels.create("T5 Battle Channel", {
//Creating the channel
type: "text", //Make sure the channel type is text
permissionOverwrites: [
//Set overwrites
{
id: guild.id,
deny: "VIEW_CHANNEL",
},
{
id: "788400016736780338",
allow: ["VIEW_CHANNEL"],
},
],
});
}

if (
guild.channels.cache.find((channel) => channel.name === "t5-battle-channel")
)
return;
if (reaction.emoji.name === "5️⃣") {
let guild = reaction.message.guild;
guild.channels
.create("T5 Battle Channel", {
//Creating the channel
type: "text", //Make sure the channel type is text
permissionOverwrites: [
//Set overwrites
{
id: guild.id,
deny: "VIEW_CHANNEL",
},
{
id: "788400016736780338",
allow: ["VIEW_CHANNEL"],
},
],
})
.then((channel) => {
channel.send(embed).then((embedMessage) => {
embedMessage.react("👍");
embedMessage.react("👎");
});
});
}
let embed = new Discord.MessageEmbed()
.setColor("#0099ff")
.setTitle("⚔️ T5 Battles! ⚔️")
.setDescription(
"Please react with a Thumbs up if you want to be paired with you opponent!"
)
.setTimestamp()
.setFooter("⚔️ 1657 Battles! ⚔️ | ⚔️ Managed by Ukzs⚔️");

最新更新