Skip to content

Commit

Permalink
Merge pull request #778 from SQKo/patch-68
Browse files Browse the repository at this point in the history
fix message channel error
  • Loading branch information
SQKo authored Mar 31, 2022
2 parents 9c17aa8 + 43c1877 commit b2843ea
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/Discord/Discord.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class Discord
*
* @var string Version.
*/
public const VERSION = 'v7.0.7';
public const VERSION = 'v7.0.8';

/**
* The logger.
Expand Down
8 changes: 2 additions & 6 deletions src/Discord/Parts/Channel/Message.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
}

Expand Down

0 comments on commit b2843ea

Please sign in to comment.