PHP 7.4 is now required. Please update to at least PHP 7.4, but we recommend PHP 8.x for the best performance.
The logging
, httpLogger
and loggerLevel
options have been removed. Any logs that went to the HTTP logger are now sent to the default logger
.
If you were using the logging
option to disable logging, you can do the same by creating a null logger:
<?php
use Discord\Discord;
use Monolog\Logger;
use Monolog\Handler\NullLogger;
$logger = new Logger('Logger');
$logger->pushHandler(new NullHandler());
$discord = new Discord([
// ...
'logger' => $logger,
]);
If you were using the loggerLevel
option to change the logger level, you can do the same by creating a logger and changing the level of the handler:
<?php
use Discord\Discord;
use Monolog\Logger;
use Monolog\Handler\StreamHandler;
$logger = new Logger('Logger');
$logger->pushHandler(new StreamHandler('php://stdout'), Logger::DEBUG); // Change the second parameter of this function call.
$discord = new Discord([
// ...
'logger' => $logger,
]);
Alongside the loadAllMembers
option, you now must enable the GUILD_MEMBERS
intent. You can do this by specifying the intents
option in the options array:
<?php
use Discord\Discord;
use Discord\WebSockets\Intents;
$discord = new Discord([
// ...
'intents' => Intents::getDefaultIntents() | Intents::GUILD_MEMBERS,
]);
Note that your bot will not be able to connect to the gateway if you have not enabled this intent in the Discord developer portal.
If you use the PRESENCE_UPDATE
event, you must enable the intent in your Discord options array:
<?php
use Discord\Discord;
use Discord\WebSockets\Intents;
$discord = new Discord([
// ...
'intents' => Intents::getDefaultIntents() | Intents::GUILD_PRESENCES,
]);
Note that your bot will not be able to connect to the gateway if you have not enabled this intent in the Discord developer portal.
If you were using the $message->reply()
function, this now returns a Discord reply rather than a 'quote'. If you want to keep the old functionality, use $message->channel->sendMessage()
.
Copied from the changelog:
amd64
architecture. The following platforms are now supported:
setSpeaking()
switchChannel()
setFrameSize()
setBitrate()
setVolume()
setAudioApplication()
setMuteDeaf()
pause()
unpause()
stop()
close()
getRecieveStream()