Add /help in-game chat command for discoverability#44
Merged
Conversation
Players had no way to discover what KC's chat commands were on a given
server — defaulting to /home or /shop only worked if someone told them
the commands existed first. Adds /help (also /commands and /?) which
lists every chat-command group enabled on this server, formatted one
line per group:
Available commands:
HOME: /home [name], /sethome <name>, /delhome <name>, /homes
TELEPORT: /tp <city>, /cities
POINTS: /points, /signin
STORE: /shop, /buy <item>
VIP: /vip
TICKETS: /ticket <message>, /ticket <id>, /tickets
BLOOD MOON: /skipbm (alias: /voteskip)
Two design decisions worth flagging:
- Help itself has no enable toggle. Even if every optional group is
turned off, /help still works and surfaces 'all groups disabled' —
which is itself useful info for the player and the admin.
- Group lines respect each feature's own enable flag, so a server
running without the store doesn't tell players to try /buy.
- Uses settings.Prefix so non-default prefixes ('!', '.', etc.)
render correctly. (Bootstrapping is still on the operator: a
player who doesn't know the prefix can't reach /help in the first
place. Server MOTD or welcome message handles that.)
Three aliases (help / commands / ?) so different player muscle memory
all hits the same handler.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Players couldn't discover KC's chat commands without out-of-band docs (a server MOTD, a Discord channel, a friend telling them). Default-case-returns-false in the dispatcher means an unknown `/foo` just goes through as normal chat with no hint that there are commands. This adds the obvious missing affordance.
What
`/help` (also `/commands` and `/?`) lists every enabled chat-command group, one line per group, in PM:
```
Available commands:
HOME: /home [name], /sethome , /delhome , /homes
TELEPORT: /tp , /cities
POINTS: /points, /signin
STORE: /shop, /buy
VIP: /vip
TICKETS: /ticket , /ticket , /tickets
BLOOD MOON: /skipbm (alias: /voteskip)
```
Each group line only renders if that group's `*Enabled` flag in `ChatCommandSettings` is `true`. A server with the store turned off doesn't tell its players to try `/buy`.
If every optional group is disabled, the help reply collapses to:
```
Available commands:
BLOOD MOON: /skipbm (alias: /voteskip)
(All optional feature groups are currently disabled on this server.)
```
Three small design notes
Test plan
🤖 Generated with Claude Code