diff --git a/docs/src/pages/api/03_events/04_guilds.md b/docs/src/pages/api/03_events/04_guilds.md index 772212cd9..ed02c5cea 100644 --- a/docs/src/pages/api/03_events/04_guilds.md +++ b/docs/src/pages/api/03_events/04_guilds.md @@ -36,10 +36,14 @@ Called with a `Guild` object in one of the following situations: 2. The guild is unavailable due to an outage. ```php -$discord->on(Event::GUILD_DELETE, function (?Guild $guild, Discord $discord, bool $unavailable) { +$discord->on(Event::GUILD_DELETE, function ($guild, Discord $discord, bool $unavailable) { // ... if ($unavailable) { // the guild is unavailabe due to an outage + // { + // "id": "" // guild ID + // "unavailable": true + // } } else { // the Bot has been kicked from the guild } diff --git a/src/Discord/Discord.php b/src/Discord/Discord.php index 7950351b4..76fef1c58 100644 --- a/src/Discord/Discord.php +++ b/src/Discord/Discord.php @@ -86,7 +86,7 @@ class Discord * * @var string Version. */ - public const VERSION = 'v7.2.1'; + public const VERSION = 'v7.2.2'; /** * The logger. diff --git a/src/Discord/WebSockets/Events/GuildDelete.php b/src/Discord/WebSockets/Events/GuildDelete.php index 2643cb987..d3e528a9d 100644 --- a/src/Discord/WebSockets/Events/GuildDelete.php +++ b/src/Discord/WebSockets/Events/GuildDelete.php @@ -11,7 +11,6 @@ namespace Discord\WebSockets\Events; -use Discord\Parts\Guild\Guild; use Discord\WebSockets\Event; use Discord\Helpers\Deferred; @@ -25,6 +24,6 @@ class GuildDelete extends Event */ public function handle(Deferred &$deferred, $data): void { - $deferred->resolve([$this->discord->guilds->pull($data->id), $data->unavailable ?? false]); + $deferred->resolve([$this->discord->guilds->pull($data->id) ?? $data, $data->unavailable ?? false]); } }