fix(bot): check message type in message update events

This commit is contained in:
rladenson 2025-04-28 05:56:21 -06:00
parent 35090babd4
commit 94a3276979
2 changed files with 3 additions and 5 deletions

View file

@ -10,6 +10,8 @@ public record MessageUpdateEvent(ulong Id, ulong ChannelId): IGatewayEvent
public Optional<GuildMemberPartial> Member { get; init; }
public Optional<Message.Attachment[]> Attachments { get; init; }
public Message.MessageType Type { get; init; }
public Optional<ulong?> GuildId { get; init; }
// TODO: lots of partials
}

View file

@ -107,10 +107,6 @@ public class MessageEdited: IEventHandler<MessageUpdateEvent>
? new Message.Reference(channel.GuildId, evt.ChannelId, lastMessage.ReferencedMessage.Value)
: null;
var messageType = lastMessage.ReferencedMessage != null
? Message.MessageType.Reply
: Message.MessageType.Default;
// TODO: is this missing anything?
var equivalentEvt = new MessageCreateEvent
{
@ -123,7 +119,7 @@ public class MessageEdited: IEventHandler<MessageUpdateEvent>
Attachments = evt.Attachments.Value ?? Array.Empty<Message.Attachment>(),
MessageReference = messageReference,
ReferencedMessage = referencedMessage,
Type = messageType,
Type = evt.Type,
};
return equivalentEvt;
}