From 64ff69723cc588ce58eb2696799a145641128d37 Mon Sep 17 00:00:00 2001 From: alyssa Date: Sat, 29 Mar 2025 12:20:11 +0000 Subject: [PATCH] fix(bot): prefix command_message keys --- PluralKit.Bot/Services/CommandMessageService.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/PluralKit.Bot/Services/CommandMessageService.cs b/PluralKit.Bot/Services/CommandMessageService.cs index 796f7f0a..440670ab 100644 --- a/PluralKit.Bot/Services/CommandMessageService.cs +++ b/PluralKit.Bot/Services/CommandMessageService.cs @@ -27,7 +27,7 @@ public class CommandMessageService messageId, authorId, channelId ); - await _redis.Connection.GetDatabase().StringSetAsync(messageId.ToString(), $"{authorId}-{channelId}-{guildId}", expiry: CommandMessageRetention); + await _redis.Connection.GetDatabase().StringSetAsync("command_message:" + messageId.ToString(), $"{authorId}-{channelId}-{guildId}", expiry: CommandMessageRetention); } public async Task GetCommandMessage(ulong messageId) @@ -38,6 +38,12 @@ public class CommandMessageService var split = ((string)str).Split("-"); return new CommandMessage(ulong.Parse(split[0]), ulong.Parse(split[1]), ulong.Parse(split[2])); } + str = await _redis.Connection.GetDatabase().StringGetAsync("command_message:" + messageId.ToString()); + if (str.HasValue) + { + var split = ((string)str).Split("-"); + return new CommandMessage(ulong.Parse(split[0]), ulong.Parse(split[1]), ulong.Parse(split[2])); + } return null; } }