feat: async cache

this breaks logging bot permissions to Sentry.

we haven't had a need to check those recently (permissions issues were because of broken cache), so this is fine for now
this should be re-added in the future though
This commit is contained in:
spiral
2021-11-17 20:41:02 -05:00
parent 45258d519e
commit e7f36eb31f
24 changed files with 134 additions and 126 deletions

View File

@@ -56,7 +56,7 @@ namespace PluralKit.Bot
if (!ShouldProxy(channel, message, ctx))
return false;
var rootChannel = _cache.GetRootChannel(message.ChannelId);
var rootChannel = await _cache.GetRootChannel(message.ChannelId);
List<ProxyMember> members;
// Fetch members and try to match to a specific member
@@ -143,10 +143,10 @@ namespace PluralKit.Bot
var content = match.ProxyContent;
if (!allowEmbeds) content = content.BreakLinkEmbeds();
var messageChannel = _cache.GetChannel(trigger.ChannelId);
var rootChannel = _cache.GetRootChannel(trigger.ChannelId);
var messageChannel = await _cache.GetChannel(trigger.ChannelId);
var rootChannel = await _cache.GetRootChannel(trigger.ChannelId);
var threadId = messageChannel.IsThread() ? messageChannel.Id : (ulong?)null;
var guild = _cache.GetGuild(trigger.GuildId.Value);
var guild = await _cache.GetGuild(trigger.GuildId.Value);
var proxyMessage = await _webhookExecutor.ExecuteWebhook(new ProxyRequest
{