This release contains breaking changes regarding messages.
Read the conversion guide for a guide on how to upgrade from v6.x to v7.
Upgraded to Discord API v9.
Added MessagBuilder
.
Added support for Discord Threads.
$message->channel
will now return a Channel
or Thread
object.Added guild feature flags.
Removed premium_since
attribute from the PresenceUpdate
object.
$message->author
is now only return an User
object and no longer return a Member
object. $message->user
is removed in favour of $message->author
Message::stickers
is now Message::sticker_items
Deprecated old permission names: (#661)
use_slash_commands
is now use_application_commands
use_public_threads
is now create_public_threads
use_private_threads
is now create_private_threads
manage_emojis
is now manage_emojis_and_stickers
Guild::region
is deprecated and may be removed in future release
Sticker use Discord\Parts\Channel\Sticker
is now use Discord\Parts\Guild\Sticker
Invite use Discord\Parts\Guild\Invite
is now use Discord\Parts\Channel\Invite
Some event handler arguments have been updated, check out the documentation.
link
attribute to Message
- #526filter
function to Collection
.Member
.member
attribute on MessageReaction
returning the wrong type.sendMessage
to Member
object - #538Embed
inside command client - #546pending
flag to Member
object - #550updateRolePositions
to Guild
to change position of roles.Activity
- #561Channel
.__toString()
function to Channel
for channel mention - #575Thank you to the following for contributions to this release:
Message::member
attribute returning a User
- #523 @davidcole1340loggerLevel
changes to changelog and conversion guide - c11af7c646
This version has also been known as v5.2.0
, however, breaking changes caused the version to be increased.
Message::reply()
now creates a "Discord reply" rather than the old way which was simply a mention with the content afterwards.Message::delayedDelete(int $ms)
to delete a message after a delay.GUILD_MEMBER
and PRESENCE_UPDATE
intents are not enabled by default.
loadAllMembers
option requires the GUILD_MEMBER
intent to be enabled.logging
, httpLogger
and loggerLevel
options have been removed.
logger
that you have passed, or the default logger.logging
to false, you can create a logger with a NullHandler
.amd64
architecture. The following platforms are now supported:
setSpeaking()
switchChannel()
setFrameSize()
setBitrate()
setVolume()
setAudioApplication()
setMuteDeaf()
pause()
unpause()
stop()
close()
getRecieveStream()
recipient_id
property to Channel
- 8b3eb0e667
8b3eb0e667
96f1ce3023
marked
version to ^2.0.0
due to security concern.Entry
object.react/socket
connector options through socket_options
.GUILD_MEMBER_*
event.discord-php
organisation on GitHub. This will not change anything unless you have the repository cloned.GUILD_UPDATE
.TYPE_STREAMING
and TYPE_COMPETING
is now allowed for bots.Channel::deleteMessages()
not working for 0 or 1 messages.allowed_mentions
option to Channel::sendMessage()
.Message::mention_channels
to use a regular expression to find actual mentioned channels rather than relying on Discord to send them (which they don't).Reaction::getUsers()
method to retrieve users that have reacted with that reaction.MESSAGE_REACTION_*
events.\Discord\imageToBase64()
to convert an image to base 64 to be uploaded to Discord.caseInsensitiveCommands
option to change whether commands should be case sensitive.PromiseInterface
to ExtendedPromiseInterface
to allow ->done()
typehinting.->then()
to ->done()
for better error handling.illuminate/support
dependency.Channel::limitDelete(n)
to delete the last n messages.$guild->leave()
as a shortcut to $discord->guilds->leave($guild)
.Old:
$message = $discord->factory(Message::class);
New:
$message = new Message($message);
Both methods are still valid.
AbstractRepository
now extends Collection
rather than having magic functions to handle calls.WebhookRepository::get()
.getColor(int $color);
contains(string $key, array $matches);
studly(string $string)
poly_strlen(string $string)
react/partial
to ^3.0
.Discord
will now emit reconnected
when the client reconnects via identify OR resume.1000
.ready
handler will now be caught, emitted via exception
and logged.
react/promise ^3.0
is released, as any uncaught exceptions inside promises are dismissed.Discord::getChannel(id)
which searches through all guilds and private channels to find a channel.Channel::deleteMessages()
now works for private channels by looping through all messages and deleting.Channel::editMessage()
.Activity::TYPE_WATCHING
and Activity::TYPE_COMPETING
.MESSAGE_DELETE
events not working correctly.VOICE_STATE_UPDATE
where members were not removed from their old channels.Collection::first()
to get the first element of the collection.AbstractRepository::delete()
with a string ID instead of solely a part.LoggerInterface
from PSR.Collection::get()
when not searching by discriminator.Webhook::execute()
.illuminate/support
8.0.Channel::deleteMessages()
will no longer fail if 0 or 1 messages is given. The promise will instantly resolve when given 0, and will delete the one message then resolve for 1 message.react/http
.react/http
.master
branch. The develop
branch will be removed and you should checkout the latest tag for the most stable version.wyrihaximus/react-guzzle-psr7
, replaced with react/http
.
Collection::set($offset, $value)
.Collection::isset($offset)
.Message::sendEmbed(Embed $embed)
as a shortcut to sending embeds.Embed::addField(Field $field)
to add fields to an embed.Activity
.Member::addRole(Role $role)
and Member::removeRole(Role $role)
now modifies the member on Discord's end.
$guild->members->save($member)
.Member::getPermissions(Channel? $channel)
to get the total permissions of the member for a guild or channel.bind_right
statement that was left over.bot = false
. This option wouldn't have worked anyway so I am not classing it as a breaking change.password
attribute from Client
.loadAllMembers
option. This option will now cause the client to initiate guild member chunking offline members.First release for many years. Contains many bug fixes and stability patches so this is the most important update since.
cachePool
option.Collection
class no longer extends Laravel collections.
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.Channel::sendMessage()
instead.allow
and deny
parameters of an overwrite are an instance of ChannelPermission
instead of int
.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.Game
class. Renamed to Activity
and new attributes added.Discord::updatePresence()
now takes an Activity
object as well as options idle
, status
and afk
.getLoop()
and getLogger()
functions to the Discord
client.Channel::createMessageColletor()
for more information.Message::createReactionCollector()
for more information.Reaction
class.Webhook
class.Intents
class for constants.intents
field in the options array, containing either an array of intents or an integer corresponding to the intents.GUILD_INTEGRATIONS_UPDATE
, INVITE_CREATE
, INVITE_DELETE
, MESSAGE_REACTION_REMOVE_EMOJI
.retrieveBans
to true
in options to retrieve on guild availability.part()
and repository()
function to bypass strpos
functions.Channel::setOverwrite()
has been added to perform the action of setPermissions()
from the previous version.Message::delayedReply()
to perform a reply after a specified duration.Message::react()
and Message::deleteReaction()
now takes an Emoji
object or a string emoji.Message::delete()
to delete a message without using the repository.Message::addEmbed()
to add an embed to the message.MessageReaction
class to represent a reaction to a message.type
parameter.animated
parameter.Emoji::toReactionString()
function to convert to a format to put in a Reaction
object.Emoji::__toString()
object for sending emojis in messages.mentionable
attribute.game
attribute now returns an Activity
part.resolve
and reject
functions from Part
s.
AbstractRepository::freshen()
now actually freshens the part, rather than being cached.GUILD_CREATE
and GUILD_MEMBERS_CHUNK
events.