Releases: discord-php/DiscordPHP
Releases · discord-php/DiscordPHP
Version 5.0.1
- Removed option for
bot = false. This option wouldn't have worked anyway so I am not classing it as a breaking change. - Converted all getter and setter functions in parts to protected. Again, shouldn't be a breaking change as these function aren't meant to be used outside of the library.
- Webhooks:
- Added phpdoc to webhook part.
- Added webhook type constants
- Guilds:
- Added new guild attributes.
- Removed unused attributes cache from part.
- Removed
passwordattribute fromClient. - Added new user attributes and flags.
- Voice client now handles websocket closes better.
- Client will now load online users regardless of
loadAllMembersoption. This option will now cause the client to initiate guild member chunking offline members.
Version 5.0.0
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. Expect PHP 7.1 to be required in the near future.
- 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
cachePooloption. - ext-libevent is no longer supported as it only applies for PHP 5.x.
- The
Collectionclass 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
allowanddenyparameters of an overwrite are an instance ofChannelPermissioninstead ofint.
- The
- 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 old region constants. Added the
- Removed the
Gameclass. Renamed toActivityand new attributes added. Discord::updatePresence()now takes anActivityobject as well as optionsidle,statusandafk.
Features
- Added
getLoop()andgetLogger()functions to theDiscordclient. - 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.
- Channels now have message collectors. See the phpdoc of
- Added the
Reactionclass. - Added the
Webhookclass. - Implemented gateway intents:
- See the
Intentsclass for constants. - User can specify an
intentsfield in the options array, containing either an array of intents or an integer corresponding to the intents.
- See the
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
retrieveBanstotruein options to retrieve on guild availability.
- Added new events:
- 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()andrepository()function to bypassstrposfunctions. - Channels:
- Added new attributes.
- Added new channel types.
- Added webhook classes and repositories.
Channel::setOverwrite()has been added to perform the action ofsetPermissions()from the previous version.
- Messages:
- Added new attributes.
- Added new message types.
- Added
Message::delayedReply()to perform a reply after a specified duration. Message::react()andMessage::deleteReaction()now takes anEmojiobject 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
MessageReactionclass to represent a reaction to a message.
- Embeds:
- Added the
typeparameter.
- Added the
- Emojis:
- Added the
animatedparameter. - Added the
Emoji::toReactionString()function to convert to a format to put in aReactionobject. - Added the
Emoji::__toString()object for sending emojis in messages.
- Added the
- 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
mentionableattribute.
- Permissions:
- Members:
- Added new attributes.
- The
gameattribute now returns anActivitypart.
- Presence updates:
- Typing updates:
- Voice state updates:
Bug Fixes
- Improved memory usage by removing
resolveandrejectfunctions fromParts.- 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_CREATEandGUILD_MEMBERS_CHUNKevents. - 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).
Version 4.0.4
v4.0.4 Updated readme and incremented version
Version 4.0.3
- Disabled HTTP/1.1
- Fixing adding bot with permissions
- Hide the token while debugging
- Fixed nicknames not saving
- Implemented embeds
- Added the
aroundparameter to getMessageHistory - Allow presence updates to get user objects from the cache
Release 4.0.2
- Fix User typehint in Member.
- Fixed nickname mention.
- Cleaned up HTTP client and allowed access to HTTP client.
- Fixed banning of members.
- Fixed RuntimeException errors.
- Cleaned up Voice Client requirement checker.
- Implemented basic emojis.
- Allowed speech marks in commands.
Version 4.0.1
- Fixed various errors.
- Added
getInvites()to Guild. - Added
getPrivateChannel()to User. - Fixed role colors and permissions.
- Fixed sending files.
- Fixed channel create with PMs.
- Fixed help command.
- Fixed role updating.
- Added new rate limit.
Version 4.0.0
Warning: Version 4 will break your code. The library has had a major rewrite of most of the core functions. Please read the conversion guide.
- Implemented async HTTP requests.
- Implemented promises.
- Heaps more cool stuff!
Version 3.2.4
- Allowed Traversable objects to be passed to
Channel->deleteMesssages(Collections etc.) - Fixed
Channel->deleteMessagesthrowing unexpected exceptions. - Added the
mentionableattribute to Role. - Added the
nickandguildattributes to Member. - Only send UDP heartbeat if PHP is not 32-bit. Receiving audio will not work on 32-bit.
- Added new close codes.
- Implemented Gateway Version 5.
This is the last update before DiscordPHP Version 4.0.0 will be released.
Version 3.2.3
- Fixed issue with session resuming.
Version 3.2.2
- Converted ByteBuffer to v0.3.
- Implemented the
getAll(query)function on the cache. - Implemented global users and channel caches through
$discord->channelsand$discord->users. - Implemented sharding of the client.
- Implemented bulk deletion of messages.
- Implemented the
Channel->getMessageHistory()function. - Added the
mention_rolesattribute toMessage. - Converted the guild asset links to use CDN.
- Converted
manage_rolestoadministratorand addedchange_nickname,manage_nicknamesand the newmanage_rolesto permissions. - Added the
Gamepart. - Fixed up some issues with caching.
- Fixed an issue with ETF.
- Added the
WebSocket->updatePresence()function. - Updated DCA to a custom version and added 32-bit OS support.
- Removed caching from invites.
- Disabled ETF by default.
- Cleaned up sending files.
🔥 its lit