1
0
Fork 1
mirror of https://github.com/TeamOctolings/Octobot.git synced 2025-04-19 16:33:36 +03:00

Added a condition that if the author of the modified message is a bot, the message is not output to the log channel

This commit is contained in:
neroduckale 2023-11-30 04:08:40 +05:00
parent 5fce01c15c
commit f50f0a613a
WARNING! Although there is a key with this ID in the database it does not verify this commit! This commit is SUSPICIOUS.
GPG key ID: 399E73062E1A3667

View file

@ -1,4 +1,5 @@
using System.Text;
using System.Threading.Channels;
using DiffPlex.DiffBuilder;
using JetBrains.Annotations;
using Octobot.Data;
@ -67,6 +68,11 @@ public class MessageEditedResponder : IResponder<IMessageUpdate>
return new ArgumentNullError(nameof(gatewayEvent.ID));
}
if (gatewayEvent.Author.Value.IsBot == true)
{
return Result.FromSuccess();
}
var cacheKey = new KeyHelpers.MessageCacheKey(channelId, messageId);
var messageResult = await _cacheService.TryGetValueAsync<IMessage>(
cacheKey, ct);