SO-ChatBot
SO-ChatBot copied to clipboard
Zalgo can cause messages to be too long
Zalgo messages have to many characters, causing relatively short source messages to exceed the per-line character limit.
Example: http://chat.stackexchange.com/transcript/message/14017140#14017140
Suggested solutions:
- Split text over multiple lines
- How would that work with the Unicode diacritics?
- Also, looks messy[ier]
- Reduce zalgo-ness of the output, hopefully adding less characters
- Perhaps combine with splitting over multiple lines
Thoughts?
!!zalgo adds a random amount of Zalgo-ness to the message, so where one long message might fail, another will work. I can add a MAX_ZALGO or something. Expect a fix in the next few days.
IIIRC the guy from serverfault had a patch to span too long messages over multiple messages. Didn't we merge this a while back? It doesn't work with zalgo? Le 27 févr. 2014 19:19, "Randall Koutnik" [email protected] a écrit :
!!zalgo adds a random amount of Zalgo-ness to the message, so where one long message might fail, another will work. I can add a MAX_ZALGO or something. Expect a fix in the next few days.
Reply to this email directly or view it on GitHubhttps://github.com/Zirak/SO-ChatBot/issues/185#issuecomment-36273156 .
!! s/serverfault/superuser
And that guy was Bob, I think (the guy who reported this issue).
https://github.com/Zirak/SO-ChatBot/pull/154
Looks like it was merged, but I guess it doesn't apply to zalgo.
My earlier patch for too-long messages was specifically for /listcommands, converting it from multiple messages to multi-line.
In the case of Zalgo, too-long messages don't seem to be handled at all.
But that does seem like a good idea - handle message length closer to the core rather than doing it individually for every command and plugin.
This is one of those troublesome areas because of Markdown and the chat's ineptness of processing multiline messages. When the bot was created I was just "oh well, this is a problem..." and kinda ignored it, but that doesn't seem to work out any more.
There are two big problems with this:
- As you all know, multiline messages fudge up markdown. This can "gracefully" be solved inside commands because they can just run the output-formatting again without using markdown. This is what
/googledoes. - Where do we cut? Obviously every
{MAX_MESSAGE_LENGTH}characters is stupid, and then we're concerned with the problem of "what is a word" - if we cut in the beginning of the last word, we might further made the markdown look weird.[this is\na link](http://blah.org), so should we also make it markdown aware, or just ignore it altogether?
The 2nd problem is classic. What if a message is just 1000 characters, no spaces? Then do we cut a hard 500? And in this case Zalgo - what's a "word" in its output? And so on and so on.
But yeah, this is a useful thing to have in core.
It's true that it's not easy nor reliable to pick a place to cut. But is it worse than failing with an error? I guess that would depend on the command.