Skip to content

Commit

Permalink
[OneBot] Force cast MessageId for ReplySegment.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
Linwenxuan authored Feb 12, 2024
1 parent 4a4996a commit e90131a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Lagrange.OneBot/Core/Message/Entity/ReplySegment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public override void Build(MessageBuilder builder, SegmentBase segment)
{
if (segment is ReplySegment reply && Database is not null)
{
reply.TargetChain ??= (MessageChain)Database.GetCollection<MessageRecord>().FindOne(x => x.MessageHash == uint.Parse(reply.MessageId));
reply.TargetChain ??= (MessageChain)Database.GetCollection<MessageRecord>().FindOne(x => x.MessageHash == (uint)int.Parse(reply.MessageId));
builder.Forward(reply.TargetChain);
}
}
Expand All @@ -47,7 +47,7 @@ public override SegmentBase FromEntity(MessageChain chain, IMessageEntity entity

return new ReplySegment
{
MessageId = target.MessageHash.ToString()
MessageId = ((int)target.MessageHash).ToString()
};
}
}

0 comments on commit e90131a

Please sign in to comment.