我是创建不和谐机器人的新手。 我想进行颜色选择,但是当我输入@red或其他东西时,@ red没有颜色,并且不是红色。
这是我的代码:
case 'embed':
const embed = new Discord.MessageEmbed()
.setTitle('So... you joined this server... now pick a colour. ')
.addField('Austarataboo', message.author.username)
.setDescription('@red \n \n@Orange \n \n@Yellow \n \n@Pink \n \n@lavender blush \n \nPurple \n \n@Dark blue \n \n@Blue \n \n@Peach \n \n@Lime \n \n@Black \n \n@Sea')
.setColor(message.member.displayHexColor)
.setFooter('i have spent 2 days trying to make a embed pls send dino nuggies, also thanks to @Welcome to the dark side@ for the rules')
message.channel.send(embed);
break;
答案 0 :(得分:0)
当您简单地键入“ @red”或“ @Orange”时,它将被视为文字文本,因此您需要引用角色的ID 。
您可以通过执行以下操作获取角色的ID:
获得角色ID后,应在嵌入说明中键入<@&ROLE_ID>
,例如
const embed = new Discord.MessageEmbed()
.setTitle('test')
.addField('foo', message.author.username)
.setDescription('<@&123456> hello!')
.setColor(message.member.displayHexColor)
.setFooter('bar')
如果角色的ID为123456
。