using System.Collections.Concurrent; namespace Catalogger.Backend.Cache.InMemoryCache; public class InMemoryWebhookCache : IWebhookCache { private readonly ConcurrentDictionary _cache = new(); public Task GetWebhookAsync(ulong channelId) { return _cache.TryGetValue(channelId, out var webhook) ? Task.FromResult(webhook) : Task.FromResult(null); } public Task SetWebhookAsync(ulong channelId, Webhook webhook) { _cache[channelId] = webhook; return Task.CompletedTask; } }