Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Improve command output and chat readablility #133
Wrapping stuff into a code block can of course increase readability, but also increases the site of the message on the screen (as there is a passing inside the box and a margin around it).
Worth noting, but nothing serious: Putting something into code brackets must be done carefully, as the message could contain ` by itself, so these must be removed before inserting.
For the 2nd point:
@Norway174 What benefits do you see from prefix and suffixes for command output? Do you see the config to be global or command related?
@Mijago Command related.
And the benefits are plenty. Not just to make code blocks. You could add other formating too, such as bold, italics, underscore______, and even add your own text.
As for the message output containing `
If it's in a message from a user, then it may contain it.
At which case, you'd leave the prefix and suffix options empty for that particular command.
However, if you'd rather deal with with. If you're also including the Prefix and Suffix options for messages from players. I'd suggest you also place a \ in front of * if that symbol is included in either the prefix or suffix.
I think having an optional parser for this would be ideal.
So Parse would then, first check if suffix and prefix contains `, if it does. It'd check the message for that symbol, and convert those to '.
Hopefully, this makes sense? :P
It makes perfekt sense. It would also be quite easy to implement it.
But somehow I do not see a great gain of just adding some formatting to commands. For that we could add boolean fields like 'bold', 'italic', etc. But remember, everything we add here pollutes the configuration even more, so we should add as less configuration entries as possible.
But do we really need formatted command result? We could put every command result into a code block, yes, that would be okayish but it will rob the bot the opportunity to format its commands, like the link command in https://github.com/Chikachi/DiscordIntegration/blob/1.12/src/main/java/chikachi/discord/listener/DiscordListener.java .
I'm not totally against your idea, but we may need to think more about the concept and it's impact to the config / bot.