Weave Code
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 Php Laravel Package

team-reflex/discord-php

DiscordPHP is a PHP wrapper for Discord’s REST, Gateway, and Voice APIs. Build Discord bots and integrations in CLI using an event-driven approach (ReactPHP). Includes guides and class reference; community Laravel integration available via Laracord.

View on GitHub
Deep Wiki
Context7
Version

First release for many years. Contains many bug fixes and stability patches so this is the most important update since.

Breaking Changes

  • PHP 7.0 is now required. PHP 5.x is no longer supported.
  • Package versions:
    • illuminate/support: now supports Laravel 6.x and 7.x
    • nesbot/carbon: was ^1.18, now ^2.38
    • symfony/options-resolver: was ^3.0, now ^5.1.3
    • monolog/monolog: was ^1.19, now ^2.1
  • Cache adapters such as apc, memcache and redis are no longer supported. There is no longer a cachePool option.
  • ext-libevent is no longer supported as it only applies for PHP 5.x.
  • The Collection class no longer extends Laravel collections.
    • As such, some functions are no longer present.
    • Feel free to add an issue if you would like to see a function added.
  • Channels:
    • Channel::setPermissions() function now takes a role or member as well as two arrays: one array of allow permissions and one array of deny permissions.
    • Channel::createInvite() now takes an array of options. See the Discord developer docs for a list of valid options.
    • Messages can no longer be created using the message repository as part of the channel. Use Channel::sendMessage() instead.
  • Overwrites:
    • The allow and deny parameters of an overwrite are an instance of ChannelPermission instead of int.
  • Guilds:
    • Removed old region constants. Added the Guild::getVoiceRegions() function to get an array of valid regions.
    • Guild::validateRegion() now has to perform an async HTTP request to validate the region. Only use this if nessasary.
  • Removed the Game class. Renamed to Activity and new attributes added.
  • Discord::updatePresence() now takes an Activity object as well as options idle, status and afk.

Features

  • Added getLoop() and getLogger() functions to the Discord client.
  • Collectors:
    • Channels now have message collectors. See the phpdoc of Channel::createMessageColletor() for more information.
    • Messages now have reaction collectors. See the phpdoc of Message::createReactionCollector() for more information.
  • Added the Reaction class.
  • Added the Webhook class.
  • Implemented gateway intents:
    • See the Intents class for constants.
    • User can specify an intents field in the options array, containing either an array of intents or an integer corresponding to the intents.

Changes

  • WebSocket:
    • Added new events: GUILD_INTEGRATIONS_UPDATE, INVITE_CREATE, INVITE_DELETE, MESSAGE_REACTION_REMOVE_EMOJI.
    • Client will not retrieve guild bans by default anymore. Set retrieveBans to true in options to retrieve on guild availability.
  • Command client:
    • Help command now prints a rich embed (#305 thanks @oliverschloebe)
    • Commands have a short and long description.
    • Commands have a cooldown option.
  • Factory now has a part() and repository() function to bypass strpos functions.
  • Channels:
  • Messages:
    • Added new attributes.
    • Added new message types.
    • Added Message::delayedReply() to perform a reply after a specified duration.
    • Message::react() and Message::deleteReaction() now takes an Emoji object or a string emoji.
    • Added Message::delete() to delete a message without using the repository.
    • Added Message::addEmbed() to add an embed to the message.
    • Added the MessageReaction class to represent a reaction to a message.
  • Embeds:
    • Added the type parameter.
  • Emojis:
    • Added the animated parameter.
    • Added the Emoji::toReactionString() function to convert to a format to put in a Reaction object.
    • Added the Emoji::__toString() object for sending emojis in messages.
  • Guilds:
    • Guild region is no longer checked before saving. Make sure to handle any exceptions from Discord servers and do not spam.
    • Roles can now update their mentionable attribute.
  • Permissions:
  • Members:
  • Presence updates:
  • Typing updates:
  • Voice state updates:

Bug Fixes

  • Improved memory usage by removing resolve and reject functions from Parts.
    • Memory leak has been improved but is still preset.
  • AbstractRepository::freshen() now actually freshens the part, rather than being cached.
  • Voice client has been updated to use the correct UDP server given by the web socket.
  • Events should update their corresponding repositories more consistently.
  • Improved the processing speed of GUILD_CREATE and GUILD_MEMBERS_CHUNK events.
  • Added new gateway operation and close codes.
  • Client will not attempt to reconnect to Discord servers if it receives a "critical" opcode (one that cannot be resolved by the bot).
Breaking
  • PHP 7.4 is now the lowest supported version of PHP.
    • Versions as low as PHP 7.2 may still work, however, no support will be provided.
    • PHP 8.0 is now recommended, and CI is run on PHP 7.4 and 8.0.
  • With the update to gateway version 8, the GUILD_MEMBER and PRESENCE_UPDATE intents are not enabled by default.
    • You must first enable these in your Discord developer portal before enabling them in DiscordPHP. See the documentation for an example.
    • The loadAllMembers option requires the GUILD_MEMBER intent to be enabled.
  • The logging, httpLogger and loggerLevel options have been removed.
    • All HTTP logging information is now redirected to the logger that you have passed, or the default logger.
    • For people that disabled logging by setting logging to false, you can create a logger with a NullHandler.
  • For voice client users, see the section below for breaking changes.

HTTP Client

  • HTTP client has been moved to a seperate package: DiscordPHP-Http
  • Improved rate limits by grouping requests by major parameters.

Voice Client

  • The voice client now requires at least PHP 7.4 to operate. It will not attempt to start on any version lower.
  • The voice client can now run on Windows, thanks to the introduction of socker pair descriptors in PHP 8.0 (see reactphp/child-process#85). As such, PHP 8.0 is required to run the voice client on Windows.
  • DCA has been rebuilt and refactored for better use with DiscordPHP. Note that the binaries have only been rebuilt for the amd64 architecture. The following platforms are now supported:
    • Windows AMD64
    • macOS AMD64
    • Linux AMD64
    • I'm happy to support DCA for other platforms if requested. Please ensure that your platform is supported by the Go compiler, see the supported list here.
  • The following functions no longer return promises, rather they throw exceptions and will return void. This is because none of these functions actually did any async work, therefore promises were redundant in this situation.
    • setSpeaking()
    • switchChannel()
    • setFrameSize()
    • setBitrate()
    • setVolume()
    • setAudioApplication()
    • setMuteDeaf()
    • pause()
    • unpause()
    • stop()
    • close()
    • getRecieveStream()
  • Expect a voice client refactor in a future release.
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.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport
twbs/bootstrap4