Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Discord Commands Bundle Laravel Package

mrgoodbytes8667/discord-commands-bundle

A Symfony bundle for defining and registering Discord slash commands in your application. Wire up command classes, options, and handlers through the container, then expose them to Discord's API with minimal boilerplate. Useful for PHP projects already running Symfony that want structured, testable D...

View on GitHub
Deep Wiki
Context7

Getting Started

  • Install with a tight constraint: composer require mrgoodbytes8667/discord-commands-bundle:^0.15. This is a 0.x release, so ^0.15 will not pick up 0.16 — that's intentional, keep it that way.
  • Read in this order: the README, then the bundle/extension class in src/, then the DependencyInjection/Configuration.php config tree (it is the authoritative list of every option the package accepts — more reliable than the docs), then any Enum/ directory, which is what v0.15.0 touched.
  • Check composer.json for an extra.laravel.providers block before you hand-register anything. This is a bundle (Symfony lineage); if a Laravel provider is shipped you get auto-discovery, otherwise you'll be wiring it into config/app.php yourself and some console-driven features may not surface in Artisan.
  • First use case: register a single guild-scoped command, not a global one. Guild commands propagate immediately; global commands can take up to an hour. Get the loop working on a test guild, then graduate to global registration in production.

Implementation Patterns

  • One command class per slash command, with the name/description/options declared declaratively. Keep business logic in a handler or action class the command delegates to — you'll be re-syncing commands often and you don't want logic changes tangled with registration changes.
  • Drive option choices from backed enums (the subject of this release). Map string-backed enums to Discord choices and let ->value be the serialized choice value; keep enum case values stable because they are the API contract.
  • Environment-split registration: register a small dev command set against your test guild locally, and the full set globally in production. Gate it on a config flag rather than branching inside command classes.
  • Own the sync step. Wrap command registration/re-sync in your own Artisan command so it's part of deploy, not a one-off manual step someone forgets.
  • Register the commands you expose in a config array or tagged service so adding a command is a one-line change, not a new registration call.
  • Verify interaction signatures via the package's middleware/guard and defer any response that does more than trivial work — the 3-second ack ceiling is not negotiable.

Gotchas and Tips

  • This release note is thin. v0.15.0 says only "Enum updates," and the changelog compares v0.1.1...v0.15.0 — fourteen minor versions collapsed into one line. Treat the intermediate history as opaque; diff the Enum/ directory between tags before upgrading an existing install rather than trusting the notes.
  • Enum renames are silent breakers. Renaming or removing an enum case changes the choice values Discord has stored for your commands. Deploy code and re-sync in the same step, or users will see stale or mismatched options.
  • Never serialize ->name. Only ->value (the backed value) should reach the API. Unbacked enums will fail at serialization time; make sure every enum used for options is enum Foo: string.
  • Global command propagation. "My command didn't update" is almost always global-vs-guild. Use guild-scoped commands while debugging; keep a note of the ~1h global propagation window.
  • Partial sync failures. Command registration is not atomic — Discord can reject individual commands (bad name regex ^[-_\p{L}\p{N}]{1,32}$, description over 100 chars, too many options). Log the response body, not just a boolean.
  • Symfony assumptions leak. Bundles expect Symfony's DI container and console. If console commands from this package don't show in php artisan list, that's the cause, not a broken install.
  • Extension point: the config tree plus the enum mapping. If a newer Discord option/choice type isn't supported, adding a case to the enum and a corresponding handler is usually cheaper than forking — but pin the version while you do it, since a 0.x minor bump can move the class you just extended.
  • Pin exact-ish versions and read each changelog between 0.x tags; there are no deprecation guarantees in this range.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
abbasudo/artisan-route
mirvan/ippanel
ignibyte/aic-framework
glavweb/data-schema-bundle
glavweb/datagrid-bundle
tacticmedia/scim-server
uni-method/frame
neika-ai/sdk
adachsoft/php-code-style
pharaonic/laravel-notification-dependencies
beautinow/translug
dev-brainiac/bot-cloaked
octoberrain/html
octoberrain/extension
octoberrain/exception
octoberrain/contracts
adachsoft/api-version-bundle
cgv/localized-resource
noith/settings
kda/laravel-package