mahjong-discord-bot icon indicating copy to clipboard operation
mahjong-discord-bot copied to clipboard

Add initial newlines for Compact mode users

Open jmbtutor opened this issue 4 years ago • 2 comments

In compact mode, the first line is on the same line as the username, distorting the grid. This PR fixes that by forcing the grid to start on the next line.

image

This change will result in a blank line between the two messages for Cozy mode users, but at least the experience will be more or less the same for both since the second message gets split by the bot's name in Compact mode as well.

jmbtutor avatar Sep 05 '20 14:09 jmbtutor

New lines and white space at the start (and end) of a message get trimmed out by Discord.

Euophrys avatar Sep 05 '20 18:09 Euophrys

Adding zero-width non-joiners to the start of the line should do the trick. I'm pretty sure they don't count as whitespace, so they shouldn't get stripped out (manual testing in the Discord chatbox results in the newline being preserved), and because they're zero-width, you shouldn't be able to see it.. Zero-width space (U+200B) also appears to work if you'd prefer that.

I've added a commit that puts ZWNJ before the initial newline.

jmbtutor avatar Sep 05 '20 20:09 jmbtutor