From f908919ac95f261b9e8270f35c5500af88cf402e Mon Sep 17 00:00:00 2001 From: Octol1ttle Date: Wed, 22 Nov 2023 13:29:27 +0500 Subject: [PATCH] Put edited message in cache if it's not in cache already (#196) Closes #183 In addition to the fix, now no error will be returned if the message doesn't exist in the cache as that is a (relatively) normal occurrence and isn't an indicator of an issue with the bot or its configuration --- src/Responders/MessageEditedResponder.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Responders/MessageEditedResponder.cs b/src/Responders/MessageEditedResponder.cs index 7841b14..3b0a6aa 100644 --- a/src/Responders/MessageEditedResponder.cs +++ b/src/Responders/MessageEditedResponder.cs @@ -72,7 +72,8 @@ public class MessageEditedResponder : IResponder cacheKey, ct); if (!messageResult.IsDefined(out var message)) { - return Result.FromError(messageResult); + _ = _channelApi.GetChannelMessageAsync(channelId, messageId, ct); + return Result.FromSuccess(); } if (message.Content == newContent)