Skip to content

Commit c5a53a9

Browse files
LinwenxuanLinwenxuan
authored andcommitted
[OneBot] Fixed Type of MessageId in ReplySegment.cs
1 parent 7679845 commit c5a53a9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Lagrange.OneBot/Core/Message/Entity/ReplySegment.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public partial class ReplySegment(uint messageId)
1111
{
1212
public ReplySegment() : this(0) { }
1313

14-
[JsonPropertyName("id")] [CQProperty] public uint MessageId { get; set; } = messageId;
14+
[JsonPropertyName("id")] [CQProperty] public string MessageId { get; set; } = messageId.ToString();
1515
}
1616

1717
[SegmentSubscriber(typeof(ForwardEntity), "reply")]
@@ -25,7 +25,7 @@ public override void Build(MessageBuilder builder, SegmentBase segment)
2525
{
2626
if (segment is ReplySegment reply && Database is not null)
2727
{
28-
reply.TargetChain ??= (MessageChain)Database.GetCollection<MessageRecord>().FindOne(x => x.MessageHash == reply.MessageId);
28+
reply.TargetChain ??= (MessageChain)Database.GetCollection<MessageRecord>().FindOne(x => x.MessageHash == uint.Parse(reply.MessageId));
2929
builder.Forward(reply.TargetChain);
3030
}
3131
}
@@ -41,7 +41,7 @@ public override SegmentBase FromEntity(MessageChain chain, IMessageEntity entity
4141

4242
return new ReplySegment
4343
{
44-
MessageId = target.MessageHash
44+
MessageId = target.MessageHash.ToString()
4545
};
4646
}
4747
}

0 commit comments

Comments
 (0)