• If you need help or want to discuss things, you now can also join us on our Discord Server!
  • A first preview of the unlimited version of SinusBot can be found in the Upcoming Changes thread. A version for Windows will follow, but we don't have a release date, yet.

EN Multi-line Chat Message

Status
Not open for further replies.

raymondfish

Member
I have created a script that gets the lyrics of the playing song and send the lyrics through private chat. The HTML returned for the lyrics are multi-line as seen below.

HTML Lyric Example
Code:
This will be the day
That u will hear me say
That I will never run away
I am here for u
Love is meant for two
Now tell me what u're gonna do

The HTML codes uses <br/> to seperate each line. I have tried replacing these with \n, \r, \n\n, and others to figure out how I can send a chat message that looks the same. FYI, when using \n it sends a new message therefore flooding the chat and gives error so that is not the answer.

In Teamspeak itself, you can SHFT-ENTER to write on a new line without it sending the message. If the above is pasted into a Teamspeak chat box, it looks fine.

So, my question is what I need to replace <br/> with (character? character code?) to have same output.
 

mxschmitt

Moderator
Staff member
is awesome!
V.I.P.
is uber awesome!
Contributor
Insider
Normally something like that should work:
Code:
sinusbot.chatChannel("Hello,\nI'm a cat!");
 

raymondfish

Member
Yea, as I outlined in original post when using \n sinusbot send a new message.

If I use this code (I's the same for chatChannel):
Code:
chatPrivate(ev.clientId, "This will be the day\nThat u will hear me say\nThat I will never run away");

The output in TS is:
Code:
"-MusicBot-": This will be the day
"-MusicBot-": That u will hear me say
"-MusicBot-": That I will never run away

As you see, instead of it displaying ONE message over three lines, it sends three messages which is weird since it is a single call to chatPrivate or chatChannel.

EDIT:

It is also worth noting that prior to sending the message, I am splitting the lyrics text into chunks due to the character limit of TS messages. So a full song may be sent over 5 messages.
 
Last edited:
Status
Not open for further replies.
Top