Discord 如何添加一个if子句,比如if(特定条件),然后添加一个.addField?

Discord 如何添加一个if子句,比如if(特定条件),然后添加一个.addField?,discord,discord.js,Discord,Discord.js,如何添加一个if子句,比如if(特定条件),然后添加一个.addField let embed2 = new Discord.MessageEmbed() //.addField('**Description**', ) .setTitle(`**Command name :** ${name}`) .addField('**Description**', `${command.description}`) .addField('**Ali

如何添加一个if子句,比如if(特定条件),然后添加一个.addField

let embed2 = new Discord.MessageEmbed()
       //.addField('**Description**', )
       .setTitle(`**Command name :** ${name}`)
       .addField('**Description**', `${command.description}`)
       .addField('**Aliases**', `${command.aliases.join(', ')}`)
       .addField('**Usage**', `${prefix}${command.name} ${command.usage}`)
       .addField('**Cooldown**', `${command.cooldown || 3} second(s)`)
       .setColor('RANDOM')
       message.channel.send(embed2);
你可以做:

if(condition)embed2.addField('Title','Text');