diff --git a/src/Discord/Discord.php b/src/Discord/Discord.php index 41b550ae7..b5fa68aad 100644 --- a/src/Discord/Discord.php +++ b/src/Discord/Discord.php @@ -86,7 +86,7 @@ class Discord * * @var string Version. */ - public const VERSION = 'v7.0.7'; + public const VERSION = 'v7.0.8'; /** * The logger. diff --git a/src/Discord/Parts/Channel/Message.php b/src/Discord/Parts/Channel/Message.php index a0bce3511..86f47d91c 100644 --- a/src/Discord/Parts/Channel/Message.php +++ b/src/Discord/Parts/Channel/Message.php @@ -363,14 +363,10 @@ protected function getGuildAttribute(): ?Guild return $guild; } - if ($guild = $this->channel->guild) { - return $guild; - } - + // Workaround for Channel::sendMessage() no guild_id if ($this->channel_id) { - // Workaround for Channel::sendMessage() no guild_id return $this->discord->guilds->find(function (Guild $guild) { - return $guild->channels->has($this->channel_id); + return $guild->channels->offsetExists($this->channel_id); }); }