1
0
Fork 1
mirror of https://github.com/TeamOctolings/Octobot.git synced 2025-01-31 09:09:00 +03:00

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
This commit is contained in:
Octol1ttle 2023-11-22 13:29:27 +05:00 committed by GitHub
parent b446c97311
commit f908919ac9
Signed by: GitHub
GPG key ID: 4AEE18F83AFDEB23

View file

@ -72,7 +72,8 @@ public class MessageEditedResponder : IResponder<IMessageUpdate>
cacheKey, ct); cacheKey, ct);
if (!messageResult.IsDefined(out var message)) if (!messageResult.IsDefined(out var message))
{ {
return Result.FromError(messageResult); _ = _channelApi.GetChannelMessageAsync(channelId, messageId, ct);
return Result.FromSuccess();
} }
if (message.Content == newContent) if (message.Content == newContent)