我试图在不和谐的情况下发送一个带有代码块的嵌入,它的三倍`我的代码是我可以做些什么来在代码块中添加 oldMessage.cleanContent 和 newMessage.cleanContentclient.on('messageUpdate', function(oldMessage, newMessage) { if (newMessage.channel.type == 'text' && newMessage.cleanContent != oldMessage.cleanContent) { var log = newMessage.guild.channels.find(ch => ch.name.includes('member-log')) if (log != null) var sEmbed = new Discord.RichEmbed() .setColor("e8a515") .setTitle(`:information_source: A Message Was Edited!`) .setDescription(`**USER**\n${newMessage.author.username}`) .addField(`Before `,` ${oldMessage.cleanContent} `) //what can i do to put oldMessage.cleanContent in codeblock .addField(`After`,`${newMessage.cleanContent} `) log.send(sEmbed); }});
1 回答
慕的地6264312
TA贡献1817条经验 获得超6个赞
您可以通过两种方式做到这一点,这两种方式都是正确的:
你只需用引号评论逗号
.addField(`Before `,"```" + ` ${oldMessage.cleanContent} `+"```")
或者你可以用斜线评论它
.addField(`Before `,` \`\`\` ${oldMessage.cleanContent} \`\`\` `)
添加回答
举报
0/150
提交
取消