mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-07 14:27:54 +00:00
feat: fetch from REST instead of cache for cross-cluster lookups
This commit is contained in:
parent
d0ad7abb03
commit
ae543b9c18
7 changed files with 80 additions and 19 deletions
|
|
@ -81,7 +81,10 @@ public static class ContextChecksExt
|
|||
public static async Task<bool> CheckPermissionsInGuildChannel(this Context ctx, Channel channel,
|
||||
PermissionSet neededPerms)
|
||||
{
|
||||
var guild = await ctx.Cache.GetGuild(channel.GuildId.Value);
|
||||
// this is a quick hack, should probably do it properly eventually
|
||||
var guild = await ctx.Cache.TryGetGuild(channel.GuildId.Value);
|
||||
if (guild == null)
|
||||
await ctx.Rest.GetGuild(channel.GuildId.Value);
|
||||
if (guild == null)
|
||||
return false;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue