#handle newline in string for build embed

10 messages · Page 1 of 1 (latest)

restive halo
#

Hello so i decided to make an slash command for build embed message, and on of option is description of building embed, but after type an some text\nanother some text looks like this, and it is my question. how to handle newline in string and make it in embed?

steady eagleBOT
#

• What's your exact discord.js npm list discord.js and node node -v version?
• Post the full error stack trace, not just the top part!
• Show your code!
• Explain what exactly your issue is.
• Not a discord.js issue? Check out #useful-servers.

languid acorn
#

string.replaceAll("\n", "\n") should work

#

\\n

#

.replaceAll("\\n", "\n")

restive halo
#

using \\n and \n in string option

languid acorn
#

description = description.replaceAll(...)
Or
getString(...)?.replaceAll(...)

#

Or .setDescription(description.replaceAll(...))

restive halo
#

bless you variable = variable.replaceall works fine