mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 13:06:50 +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
|
|
@ -151,7 +151,10 @@ public static class ContextEntityArgumentsExt
|
|||
if (!MentionUtils.TryParseChannel(ctx.PeekArgument(), out var id))
|
||||
return null;
|
||||
|
||||
if (!(await ctx.Cache.TryGetChannel(id) is Channel channel))
|
||||
var channel = await ctx.Cache.TryGetChannel(id);
|
||||
if (channel == null)
|
||||
channel = await ctx.Rest.GetChannelOrNull(id);
|
||||
if (channel == null)
|
||||
return null;
|
||||
|
||||
if (!DiscordUtils.IsValidGuildChannel(channel))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue