mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-13 17:20:14 +00:00
Merge pull request #214 from dev-kittens/fix-getchannel
fix GetChannel where guildId is not passed
This commit is contained in:
commit
6c1e47e857
1 changed files with 2 additions and 2 deletions
|
|
@ -271,8 +271,8 @@ namespace PluralKit.Bot
|
||||||
{
|
{
|
||||||
// we need to know the channel's guild ID to get the cached guild object, so we grab it from the API
|
// we need to know the channel's guild ID to get the cached guild object, so we grab it from the API
|
||||||
if (guildId == null) {
|
if (guildId == null) {
|
||||||
var guild = await WrapDiscordCall(client.ShardClients.Values.FirstOrDefault().GetChannelAsync(id));
|
var channel = await WrapDiscordCall(client.ShardClients.Values.FirstOrDefault().GetChannelAsync(id));
|
||||||
if (guild != null) guildId = guild.Id;
|
if (channel != null) guildId = channel.GuildId;
|
||||||
else return null; // we probably don't have the guild in cache if the API doesn't give it to us
|
else return null; // we probably don't have the guild in cache if the API doesn't give it to us
|
||||||
}
|
}
|
||||||
return client.GetGuild(guildId.Value).GetChannel(id);
|
return client.GetGuild(guildId.Value).GetChannel(id);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue