-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stop printing help menu on unknown command #558
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks!
src/commands/CommandHandler.ts
Outdated
const html = `<b>Mjolnir help:</b><br><pre><code>${htmlEscape(menu)}</code></pre>`; | ||
const text = `Mjolnir help:\n${menu}`; | ||
|
||
const html = `<h3>Mjolnir help menu:</h3><br><b>Protection Actions/Options:</b><pre><code>${htmlEscape(protectionMenu)}</code></pre><br><b>Moderation Actions:</b><pre><code>${htmlEscape(actionMenu)}</code></pre><br><b>Policy List Options/Actions:</b><pre><code>${htmlEscape(policyListMenu)}</code></pre><br><b>Room Managment:</b><pre><code>${htmlEscape(roomsMenu)}</code></pre><br><b>Bot Status and Management:</b><pre><code>${htmlEscape(botMenu)}</code></pre>`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
non-blocking: fwiw, the tilde character strings support newlines to retain formatting. For plaintext this is somewhat of an issue, but for HTML the extra whitespace doesn't affect anything. To make this a bit easier to read we can add a bunch of newlines:
const html = `<h3>Mjolnir help menu:</h3><br><b>Protection Actions/Options:</b><pre><code>${htmlEscape(protectionMenu)}</code></pre><br><b>Moderation Actions:</b><pre><code>${htmlEscape(actionMenu)}</code></pre><br><b>Policy List Options/Actions:</b><pre><code>${htmlEscape(policyListMenu)}</code></pre><br><b>Room Managment:</b><pre><code>${htmlEscape(roomsMenu)}</code></pre><br><b>Bot Status and Management:</b><pre><code>${htmlEscape(botMenu)}</code></pre>`; | |
const html = `<h3>Mjolnir help menu:</h3><br> | |
<b>Protection Actions/Options:</b><pre><code>${htmlEscape(protectionMenu)}</code></pre><br> | |
<b>Moderation Actions:</b><pre><code>${htmlEscape(actionMenu)}</code></pre><br> | |
<b>Policy List Options/Actions:</b><pre><code>${htmlEscape(policyListMenu)}</code></pre><br> | |
<b>Room Managment:</b><pre><code>${htmlEscape(roomsMenu)}</code></pre><br> | |
<b>Bot Status and Management:</b><pre><code>${htmlEscape(botMenu)}</code></pre>`; |
The linter may have opinions on my formatting here.
(also <br />
should be self-closing, like so)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are good to know, thanks for pointing them out!
while I was in the area, make the help menu a little more manageable by grouping related commands. I couldn't fit all of the new menu into a screenshot, but the gist of it is:
Areas are:
Fixes #204 and #52