Feature Update : Codeblocks for usage in errorembedd
See original GitHub issueDescription of issue:
Catagory: Feature request/bug
Brief Description: Eddiebot’s Command Error message embeds, suggest a Usage
case of the particular command telling the user about how to use the command when things like bad arguments or missing arguments are passed. This Usage field is plain text, and it would be of much more utility if it was emphasized via code-blocks
.
Additional Context:
- Screenshot:
The current usage text in command error embeds-
Better usage text format-
-
How to reproduce: type any command with wrong arguments(like-
^standup .
) -
Information regarding resolution of this: (this might be useful, if provided in the opened issue) There are two ways to this(there may be more ways, but these are from the top of my head):
-
the longer way: Edit the
usage
string in each file insrc/commandHandlers
folder, to format the usage string with code-blocks, by adding backticks around the commands text. Example: the current usage strings are like this-> this could be altered, to format with code-blocks on discord by slight modifications-> -
Slightly quicker way: Run a format function on the usage variable, before adding that to the BuildErrorEmbed function: Here, the
usage
string gets split into a list of different ways of using the command, by theusageTextOptions
variable, then theformatted
variable calls themapToCodeBlock
arrow function, to format the obtained list of usage into code-block formatted strings(with backticks), and then these usage cases get joined with anor
in b/w and stored informatted
variable, which holds the string with the code-block formatting, ready to be passed into thebuildErrorEmbed
function:
-
_Originally posted by @Vyvy-vi in https://github.com/EddieJaoudeCommunity/support/discussions/547_
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:11 (9 by maintainers)
Top GitHub Comments
For the time being , I’ll just create a pr for one command in a bit . could you test it out?
PR #382 merged 👍