Cache account lookup in memory when proxying

This commit is contained in:
Ske
2019-08-12 03:48:08 +02:00
parent 5aa47278cb
commit 423d23faf7
5 changed files with 96 additions and 18 deletions

View File

@@ -15,6 +15,8 @@ namespace PluralKit.Bot.Commands
public SystemStore Systems { get; set; }
public MemberStore Members { get; set; }
public EmbedService Embeds { get; set; }
public ProxyCacheService ProxyCache { get; set; }
public override string Prefix => "member";
public override string ContextNoun => "member";
@@ -170,6 +172,8 @@ namespace PluralKit.Bot.Commands
ContextEntity.Suffix = prefixAndSuffix[1].Length > 0 ? prefixAndSuffix[1] : null;
await Members.Save(ContextEntity);
await Context.Channel.SendMessageAsync($"{Emojis.Success} Member proxy tags changed to `{ContextEntity.ProxyString.Sanitize()}`. Try proxying now!");
ProxyCache.InvalidateResultsForSystem(Context.SenderSystem);
}
[Command("delete")]