UnhandledPromiseRejectionWarning:RangeError [EMBED_FIELD_VALUE]:MessageEmbed字段值不能为空

时间:2020-09-15 02:39:05

标签: javascript discord bots

我正在执行票证命令,但出现此错误: UnhandledPromiseRejectionWarning:RangeError [EMBED_FIELD_VALUE]:MessageEmbed字段值不能为空。 只是在此命令中发生其他事情

请帮助谢谢

这是我的代码

bot.on("message", async message =>{
    const args = message.content.substring(PREFIX.length).split(" ")
    if(message.author.bot) return
    if(message.channel.type === "dm") return
    if(message.content.startsWith(`${PREFIX}openticket`)){
        const reason = message.content.split(" ").slice(1).join(" ");
        const role2 = message.guild.roles.cache.find(role2 => role2.name == "@everyone");

   const channel =  message.guild.channels.create(`ticket-${message.author.username}`,  {
        permissionOverwrites: [
            {
              id: role2.id,
              deny: 'VIEW_CHANNEL',
              deny: 'READ_MESSAGES',
              deny: 'SEND_MESSAGES'
            }, {
              id: message.author.id,
              allow: 'VIEW_CHANNEL',
              allow: 'READ_MESSAGES',
              allow: 'SEND_MESSAGES'
            }
          ]

    })

        const embedcreated = new Discord.MessageEmbed()
        .setColor("#f00202")
        .setDescription(`You ticket has been created ` + `#ticket-${message.author.username}` )
        .setTitle("Tickets")
        .setFooter(`Tickets System`)
        .setTimestamp()

        message.channel.send(embedcreated);

        const embed = new Discord.MessageEmbed()
        .setColor("#f00202")
        .addField(`Hey ${message.author.username}!`, ` Please wait until support arrives`)
        .addField(`Reason`, reason)
        .setTimestamp();
        channel.send(embed);
        channel.send(`${message.author}`)
}})

0 个答案:

没有答案