mahjong-discord-bot
mahjong-discord-bot copied to clipboard
Add initial newlines for Compact mode users
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.
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.
New lines and white space at the start (and end) of a message get trimmed out by Discord.
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.