I'm having trouble formatting a message in Telegram. I need to output each word on a new line.
Example 1:
const text = "word1\nword2\nword3"
This works, but when I try to output in wildcard quotes (``), it stops working.
Example 2:
const a = "amobus"
const b = "amogus"
const c = "autobus"
const text2 = `
word1: ${a}
word2: ${b}
word3: ${c}
`
or
const a = "amobus"
const b = "amogus"
const c = "autobus"
const text2 = `word1: ${a}\nword2: ${b}\nword3: ${c}`
or
const a = "amobus"
const b = "amogus"
const c = "autobus"
const text2 = "word1: " + a + "\n" + "word2: " + b + "\n" + "word3: " + c
This is what it looks like in a real example:
But the static text with line breaks is output fine:
P.S. In the query I use parse_mode=HTML
const url =`https://api.telegram.org/bot${TOKEN}/sendMessagechat_id=${testID}&text=${message}&parse_mode=HTML`