Skip to content

fix: resolve message command aliases in prefix command dispatch - #634

Open
AboMeezO wants to merge 1 commit into
neplexlabs:mainfrom
AboMeezO:fix/AppCommandHandler-alias-lookup
Open

fix: resolve message command aliases in prefix command dispatch#634
AboMeezO wants to merge 1 commit into
neplexlabs:mainfrom
AboMeezO:fix/AppCommandHandler-alias-lookup

Conversation

@AboMeezO

@AboMeezO AboMeezO commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Summary

Fix prefix command aliases not being resolved when invoked through their alias.

For example, !testing worked, but !t silently failed when t was defined as an alias for testing.

Root Cause

prepareCommandRun passed usedCommandOverride to findCommandByRoute as allowFlatAliasFallback. Since normal message dispatch doesn't use a cmdName override, this was false, preventing alias resolution.

Fix

Removed the incorrect argument so findCommandByRoute uses its default alias fallback behavior.

Hierarchical routes remain unaffected.

Tests

Added coverage for:

  • Prefix alias resolution
  • Primary command name resolution
  • Hierarchical routes
  • Unknown commands

Files

  • AppCommandHandler.ts
  • AppCommandHandler.alias-resolution.test.ts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant