From c3647aabedbb4d7a0f426fc3f54cf2778688bf67 Mon Sep 17 00:00:00 2001 From: Kyler Li Date: Fri, 8 Nov 2024 18:58:20 -0800 Subject: [PATCH] update caching to reduce memory usage --- TrickfireCheckIn/Discord/Bot.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/TrickfireCheckIn/Discord/Bot.cs b/TrickfireCheckIn/Discord/Bot.cs index 6ab76b9..594f54c 100644 --- a/TrickfireCheckIn/Discord/Bot.cs +++ b/TrickfireCheckIn/Discord/Bot.cs @@ -38,6 +38,12 @@ public Bot(string token) { DiscordClientBuilder builder = DiscordClientBuilder .CreateDefault(token, DiscordIntents.AllUnprivileged) + .ConfigureExtraFeatures((conf) => + { + conf.AbsoluteMessageCacheExpiration = TimeSpan.FromMinutes(5); + conf.SlidingMessageCacheExpiration = TimeSpan.FromMinutes(1); + conf.AlwaysCacheMembers = false; + }) .UseCommands((_, extension) => { // Configure to slash commands