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:
parent
5fce01c15c
commit
f50f0a613a
1 changed files with 6 additions and 0 deletions
|
@ -1,4 +1,5 @@
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
using System.Threading.Channels;
|
||||||
using DiffPlex.DiffBuilder;
|
using DiffPlex.DiffBuilder;
|
||||||
using JetBrains.Annotations;
|
using JetBrains.Annotations;
|
||||||
using Octobot.Data;
|
using Octobot.Data;
|
||||||
|
@ -67,6 +68,11 @@ public class MessageEditedResponder : IResponder<IMessageUpdate>
|
||||||
return new ArgumentNullError(nameof(gatewayEvent.ID));
|
return new ArgumentNullError(nameof(gatewayEvent.ID));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (gatewayEvent.Author.Value.IsBot == true)
|
||||||
|
{
|
||||||
|
return Result.FromSuccess();
|
||||||
|
}
|
||||||
|
|
||||||
var cacheKey = new KeyHelpers.MessageCacheKey(channelId, messageId);
|
var cacheKey = new KeyHelpers.MessageCacheKey(channelId, messageId);
|
||||||
var messageResult = await _cacheService.TryGetValueAsync<IMessage>(
|
var messageResult = await _cacheService.TryGetValueAsync<IMessage>(
|
||||||
cacheKey, ct);
|
cacheKey, ct);
|
||||||
|
|
Loading…
Add table
Reference in a new issue