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 Bundle Laravel Package

mrgoodbytes8667/discord-bundle

Integrate Discord into your Laravel/PHP application with this bundle: OAuth2 login, bot API access, webhook handling, and channel notifications. Install via Composer, add your bot token and client credentials, then authenticate users or post messages through a simple, framework-friendly API.

View on GitHub
Deep Wiki
Context7

Getting Started

This package has been renamed and moved. The maintained package is now mrgoodbytes8667/discord-client-bundle on Packagist and GitHub. Do not start new work against mrgoodbytes8667/discord-bundle; update your composer.json to require the new package name and follow the new repository’s README for installation.

Minimal steps:

  1. composer require mrgoodbytes8667/discord-client-bundle
  2. Publish any package config: php artisan vendor:publish --provider="MrGoodBytes8667\DiscordClientBundle\DiscordClientBundleServiceProvider" (verify the provider name in the new README).
  3. Add Discord credentials to .env (bot token, guild/channel IDs, webhook URLs as applicable).
  4. Resolve the Discord client from the container and make a simple call, such as fetching a guild or sending a channel message.

First use case: inject the client into a console command or service and send a test message to a configured channel. This validates credentials, HTTP connectivity, and rate-limit behaviour before wiring it into application flows.

Implementation Patterns

  • Dependency injection over manual construction. Resolve the Discord client through Laravel’s container. This keeps configuration and HTTP transport swappable and makes testing easier.
  • Wrap Discord calls in application services. Do not scatter raw client calls across controllers. Create a DiscordService or dedicated action classes so retries, logging, and rate-limit handling live in one place.
  • Use queued jobs for outbound messages. Discord rate limits are real. Dispatch a job with backoff and retry settings rather than sending synchronously in a request cycle.
  • Drive IDs from config. Store guild IDs, channel IDs, and role IDs in config/discord.php or environment variables. Avoid hard-coding snowflakes in application code.
  • Integrate with Laravel notifications. If the package exposes a notification channel, use it for user-facing alerts. Otherwise, call your DiscordService from a custom notification channel.
  • Test with fakes or container swaps. Bind a fake client implementation in tests, or use Laravel’s HTTP client fakes if the package is built on Illuminate\Support\Facades\Http. Assert that jobs dispatch and payloads are shaped correctly without hitting Discord.
  • Handle inbound webhooks separately. If you receive Discord interactions or webhook events, verify signatures/headers before dispatching internal events. Keep the HTTP entrypoint thin.

Gotchas and Tips

  • The rename is the main breaking change. The old package name will not receive updates. Search your codebase and CI configs for mrgoodbytes8667/discord-bundle and replace it. Check whether namespaces or config file names changed in the new package; update imports and published config accordingly.
  • Do not assume API parity after the move. Read the new package’s README and changelog. The rename may coincide with namespace changes, config key changes, or a different service provider class.
  • Rate limits and 429 responses. Discord returns rate-limit headers. Use queued jobs with exponential backoff and respect Retry-After. Avoid tight loops when sending multiple messages.
  • Token handling. Never commit bot tokens or webhook URLs. Use .env and Laravel’s config caching. Remember to re-run php artisan config:clear after changing Discord credentials locally.
  • Timeouts and HTTP debugging. Set explicit timeouts on the underlying HTTP client. If requests fail silently, enable HTTP client logging or package logging to inspect request/response bodies.
  • Extension points. Look for container bindings and interfaces in the new package. If the client is bound as a singleton, you can swap it in a service provider for testing or custom behaviour.
  • Laravel version compatibility. Confirm the new package supports your Laravel and PHP versions before upgrading. The move may include a minimum-version bump.
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.
elsayed85/laravel-api-exceptions
ouhssini/laravel-demo-mode
daworks/ncloud-outbound-mailer-driver
gp247/cms
ignibyte/aic-gates
nexa-merchant/blog
novasa/laravel-language-center
opencage/geocode
adolfoholzer/parameters
livenetworks/ln-starter
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
cgv/localized-resource