admin管理员组文章数量:1221374
/n
is not putting a break in my embed message. My code and the embed it sent is located below. Can someone help?
The section of Code:
client.on("message", (message) => {
if (!message.content.startsWith(prefix) || message.author.bot) return;
if (message.content.toLowerCase().startsWith(prefix + `rules`)) {
const embed = new Discord.RichEmbed()
.setTitle(`OFFICIAL SERVER RULES`)
.setColor(0xCF40FA)
.setDescription(`Official rules for the USA discord server. Last updated: 1st October 2018`)
.addField(`**GENERAL RULES**`, `1.Swearing is allowed, But not targeted towards a person./n2. Be respectful to everyone in the server./n3. No form of racism./n4. No public arguments./n5. Anything not suitable for work if forbidden./n6. All conversations are limited to English./n7. Spamming or mass mentioning is strictly forbidden./n8. Keep messages in their respective channels./n9. Fake or bad links, advertising anything non-US related, stays out of this discord./n10. Keep bot commands in #bot-commands ./n11. No talking in #announcements .`)
message.channel.send({ embed: embed });
}
});
/n
is not putting a break in my embed message. My code and the embed it sent is located below. Can someone help?
The section of Code:
client.on("message", (message) => {
if (!message.content.startsWith(prefix) || message.author.bot) return;
if (message.content.toLowerCase().startsWith(prefix + `rules`)) {
const embed = new Discord.RichEmbed()
.setTitle(`OFFICIAL SERVER RULES`)
.setColor(0xCF40FA)
.setDescription(`Official rules for the USA discord server. Last updated: 1st October 2018`)
.addField(`**GENERAL RULES**`, `1.Swearing is allowed, But not targeted towards a person./n2. Be respectful to everyone in the server./n3. No form of racism./n4. No public arguments./n5. Anything not suitable for work if forbidden./n6. All conversations are limited to English./n7. Spamming or mass mentioning is strictly forbidden./n8. Keep messages in their respective channels./n9. Fake or bad links, advertising anything non-US related, stays out of this discord./n10. Keep bot commands in #bot-commands ./n11. No talking in #announcements .`)
message.channel.send({ embed: embed });
}
});
Share
Improve this question
edited Oct 1, 2018 at 20:27
Federico Grandi
6,8065 gold badges33 silver badges51 bronze badges
asked Oct 1, 2018 at 17:17
ScottEScottE
992 gold badges2 silver badges10 bronze badges
1
|
1 Answer
Reset to default 17The correct escape character for newline is \n
not /n
.
本文标签: javascriptn doesn39t display as line breakStack Overflow
版权声明:本文标题:javascript - n doesn't display as line break - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1739282239a2156300.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
\n
. – Rup Commented Oct 1, 2018 at 17:19