Newlines in `message.content`

Is there any way for my bot to get the message content with newlines included? I have profiles that people post that I'm trying to parse, but the line breaks between each line are just showing up as spaces, so there aren't any newlines or anything to use in my regex. For example:
Name: John Doe
Age: 00
Gender: ...
Name: John Doe
Age: 00
Gender: ...
just comes out looking like this in message.content: Name: John Doe Age: 00 Gender: ... (my bot has the message content privileged intent - its just a one-server bot)
3 Replies
d.js toolkit
d.js toolkit2y ago
• 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.
Syjalo
Syjalo2y ago
There should be new lines. How did you check that?
Steffie
SteffieOP2y ago
I tried including the newline in my regex and, when that didn't work, I tried splitting the message into an array by newlines. console.logging it also usually shows them and it didn't. Its entirely possible I messed something up though, and I can go back and try again (and/or try to strip it down to a few lines of code to post here)
function parseProfile(message)
{
const regex = new RegExp('\n')
console.log(regex.test(message.content))
}
function parseProfile(message)
{
const regex = new RegExp('\n')
console.log(regex.test(message.content))
}
this is giving me false, and I'm very confused lol Facepalm I think I found my problem. Thank you for taking the time
Want results from more Discord servers?
Add your server