Skip to content

feat(bot): add a command module registry so new commands live in their own files #327

Closed as not planned

Description

@enliven17

Goal

Let new slash commands be added as self-contained modules under src/commands/ instead of growing registerCommandHandlers in src/bot.ts.

Context

registerCommandHandlers in src/bot.ts keeps every handler in one handlers record keyed by the COMMANDS list, and createBot registers /export separately. Every new command edits the same lines, which has caused repeated merge conflicts.

Scope

  • Add src/commands/types.ts with a CommandModule shape (command, description, operatorOnly, allowlisted, handle(ctx, deps)).
  • Add src/commands/index.ts exporting an ordered array of modules; move /contracts and /preview into modules as the first two examples.
  • Make registerCommandHandlers and registerCommands iterate the registry, keeping existing commands byte-identical.

Acceptance criteria

  • Existing commands reply exactly as before.
  • helpMessage and setMyCommands list module commands in registry order.
  • Operator-only and allowlist checks are applied centrally from module flags.

Test expectations

Add tests/command-registry.test.mjs that registers the modules on a fake bot and asserts command names, order and authorization behaviour; existing tests/bot.test.mjs and tests/help-command.test.mjs must pass unchanged.

Out of scope

Adding any new user-visible command; changing message text.

Wave notes

Please link your PR to this issue with Closes #<this issue> so it is tracked, keep the change focused on this issue, and base your branch on the latest main.

Activity

  1. added
    help wantedExtra attention is needed
    Stellar WaveIssues in the Stellar wave program
    complexity/high200 points - complex engineering or architecture
    area/telegramTelegram commands, messages, and chat UX
    on Oct 14, 2026
  2. danvenger commented on Oct 18, 2026

    @danvenger
    Contributor

    @danvenger has applied to work on this issue as part of the Stellar Wave Program's 10th wave.

    Hi, I'll like to work on this issues, I'll provide the best technical skills from experience, please assign it to me

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @danvenger to this issue.

  3. drips-wave commented on Oct 18, 2026

    @drips-wave

    Congratulations, @danvenger! 🎉 Your application was accepted by the repo's maintainers, and the issue is due on October 22, 2026.

    🧑‍💻 @danvenger: Please resolve the issue such that the repo's maintainers have enough time to review your contribution before the due date. You'll earn Points for completing the issue on-time, which will make you eligible for a share of the Stellar Wave Program's reward pool.

    Warning

    When opening a PR, please link it to this issue to ensure it gets tracked accurately. Points are awarded when this issue is marked as completed by the maintainer.

    🤠 Repo maintainers: Please keep an eye on the contributor's progress and review their work before the due date. You can manage this issue, including adjusting its complexity and points, here.

    🌊 Happy Wave 🌊

  4. drips-wave commented on Oct 26, 2026

    @drips-wave

    This issue has been marked as completed by a Drips Wave moderator for @danvenger as part of the Stellar Wave Program's 10th Wave 🥳

    Moderator's reason: [Auto-assessed] The contributor successfully implemented the command module registry as requested in issue #327, creating self-contained command modules, centralizing authorization flags, and adding comprehensive tests with 100% diff coverage. Although maintainers have not yet formally reviewed or merged PR #732, the PR has passing CI checks, zero merge conflicts, and fulfills all stated acceptance criteria.

    😎 @danvenger: You earned 100 Points for completing this issue! Once the Wave's rewards are finalized, you'll be eligible for a percentage of the Wave's reward pool based on the percentage of total points you've earned. Learn more here.

    🧑‍💻 Repo maintainers: How'd the contributor do? Leave a review to share your experience working with them.

    ℹ️ Note: This issue was marked complete via moderation. Points were issued even though the GitHub issue remains open.

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

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programarea/telegramTelegram commands, messages, and chat UXcomplexity/high200 points - complex engineering or architecturehelp wantedExtra attention is neededtype/refactor

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions