一键导入
legacy-command-client-keeper
// Maintain the optional prefix-command layer — DiscordCommandClient, Command class, parsing, aliases, cooldowns, and help system. Use when touching message-based command handling.
// Maintain the optional prefix-command layer — DiscordCommandClient, Command class, parsing, aliases, cooldowns, and help system. Use when touching message-based command handling.
| name | legacy-command-client-keeper |
| description | Maintain the optional prefix-command layer — DiscordCommandClient, Command class, parsing, aliases, cooldowns, and help system. Use when touching message-based command handling. |
Use this skill when work touches:
src/Discord/DiscordCommandClient.phpsrc/Discord/CommandClient/Command.phpThis is optional-prefix-command skill. Load it when maintaining the message-command layer built on top of core Discord.
Keep prefix-command behavior as a clean optional layer:
Discordsrc/Discord/DiscordCommandClient.phpsrc/Discord/CommandClient/Command.phpsrc/Discord/Helpers/RegisteredCommand.phpsrc/Discord/WebSockets/Events/InteractionCreate.phpDiscordCommandClient extends Discord, but it does not replace core client architecture. It layers:
The command layer should stay optional and message-driven.
DiscordCommandClientOwns:
CommandClient\CommandOwns:
If code does not clearly belong to one of those two, re-check whether it belongs in core Discord instead.
DiscordCommandClient uses OptionsResolver for its own layer. Preserve existing semantics around:
prefixprefixesnamedescriptiondefaultHelpCommanddiscordOptionscaseInsensitiveCommandsinternalRejectedPromiseHandlerCommand-client options are not core runtime options. Keep them isolated unless a true cross-layer dependency exists.
Message-command flow today:
checkForPrefix() strips prefixstr_getcsv(..., ' ', '\"', '\\\\')If changing parsing, preserve expectations around:
The default help command is not incidental. It is part of command-client feature set.
Preserve:
If help behavior changes, inspect both top-level help and per-command help.
CommandClient\Command carries its own operational semantics:
Do not move cooldown logic into unrelated core message or user models.
This layer is not the same as application commands.
Keep these separate:
DiscordCommandClient + CommandClient\CommandDiscord::listenCommand() + RegisteredCommand + interaction eventsDo not try to force one abstraction to power both unless you intend a broad architectural redesign.
Shared naming concepts are fine. Shared execution path is not current repo design.
Internal rejected promises use internalRejectedPromiseHandler. Preserve that pattern rather than sprinkling silent catches or inconsistent logger behavior through callbacks.
If user-facing callback returns string, reply behavior should remain simple and unsurprising.
registerCommand()CommandStop if you see:
Message, Channel, Discord, or interaction codeLegacy command client is convenience layer, not core runtime. Keep it self-contained, predictable, and clearly separate from slash-command interactions.
Maintain test and documentation alignment — PHPUnit tests, async testing patterns, PHPDoc contracts, guide pages, and documentation workflow. Use when adding tests, updating docs, or changing public behavior.
Maintain Builder classes — outbound payload construction, validation, serialization, component handling, and fromPart symmetry. Use when changing Builders or outbound Discord API payloads.
Maintain gateway event handlers — payload hydration, cache mutation, event return shapes, and handler registration. Use when touching WebSockets/Events, Handlers.php, or Event.php.
Work with DiscordPHP's infrastructure utilities — CacheWrapper, CacheConfig, BigInt, Multipart, Endpoint::bind URL templates, Collection base class, and domain Exceptions. Use when changing cache behavior, REST endpoint routing, file uploads, big-integer ID math, or adding/modifying exceptions.
Maintain interaction flow — Interaction typing, resolved data caching, command routing, autocomplete, modal responses, and interaction builders. Use when touching Interactions or slash command handling.
Maintain Part domain models — fillable attributes, mutators, typed nested data, save/fetch behavior, permission checks, PHPDoc, and repository bindings. Use when adding or modifying any Discord Part class.