feat: role delete logging, used invite logging, also some random changes
This commit is contained in:
parent
4f54077c68
commit
c906a4d6b6
18 changed files with 386 additions and 76 deletions
|
|
@ -6,14 +6,15 @@ namespace Catalogger.Backend.Cache.InMemoryCache;
|
|||
|
||||
public class InMemoryInviteCache : IInviteCache
|
||||
{
|
||||
private readonly ConcurrentDictionary<Snowflake, IEnumerable<IInvite>> _invites = new();
|
||||
private readonly ConcurrentDictionary<Snowflake, IEnumerable<IInviteWithMetadata>> _invites =
|
||||
new();
|
||||
|
||||
public Task<IEnumerable<IInvite>> TryGetAsync(Snowflake guildId) =>
|
||||
public Task<IEnumerable<IInviteWithMetadata>> TryGetAsync(Snowflake guildId) =>
|
||||
_invites.TryGetValue(guildId, out var invites)
|
||||
? Task.FromResult(invites)
|
||||
: Task.FromResult<IEnumerable<IInvite>>([]);
|
||||
: Task.FromResult<IEnumerable<IInviteWithMetadata>>([]);
|
||||
|
||||
public Task SetAsync(Snowflake guildId, IEnumerable<IInvite> invites)
|
||||
public Task SetAsync(Snowflake guildId, IEnumerable<IInviteWithMetadata> invites)
|
||||
{
|
||||
_invites[guildId] = invites;
|
||||
return Task.CompletedTask;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue