Fix handling replies in edited messages

This commit is contained in:
spiral
2021-03-22 07:07:33 +00:00
parent c7daea5497
commit a7189fab8c
3 changed files with 31 additions and 9 deletions

View File

@@ -53,7 +53,7 @@ namespace PluralKit.Bot
private bool IsDuplicateMessage(Message msg) =>
// We consider a message duplicate if it has the same ID as the previous message that hit the gateway
_lastMessageCache.GetLastMessage(msg.ChannelId) == msg.Id;
_lastMessageCache.GetLastMessage(msg.ChannelId)?.mid == msg.Id;
public async Task Handle(Shard shard, MessageCreateEvent evt)
{
@@ -66,7 +66,7 @@ namespace PluralKit.Bot
// Log metrics and message info
_metrics.Measure.Meter.Mark(BotMetrics.MessagesReceived);
_lastMessageCache.AddMessage(evt.ChannelId, evt.Id);
_lastMessageCache.AddMessage(evt);
// Get message context from DB (tracking w/ metrics)
MessageContext ctx;