How to sent new line in message using bots

I’m trying to send message to channels using Bot. But unable to send new-lines in the message. “\n” is not working.

How can we send new-lines in the message to channel using Bot?

Hi and welcome to the Mattermost forums!

Can you please share the code you’re using to send newlines? I just tried it and there does not seem to be something special that needs to be taken care of.

Payload:

{
  "text": "test\ntest",
  "channel": "off-topic"
}

Result:
grafik