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

@@ -196,10 +196,10 @@ namespace PluralKit.Bot
public static string EventType(this IGatewayEvent evt) =>
evt.GetType().Name.Replace("Event", "");
public static bool HasReactionPermissions(Context ctx)
public static async Task<bool> HasReactionPermissions(Context ctx)
{
var neededPermissions = PermissionSet.AddReactions | PermissionSet.ReadMessageHistory;
return ((ctx.BotPermissions & neededPermissions) == neededPermissions);
return ((await ctx.BotPermissions & neededPermissions) == neededPermissions);
}
public static bool IsValidGuildChannel(Channel channel) =>