Skip to content

Commit

Permalink
[OneBot] UserId nullable
Browse files Browse the repository at this point in the history
  • Loading branch information
Linwenxuan authored and Linwenxuan committed Nov 17, 2023
1 parent 20d9527 commit 39e0795
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Lagrange.OneBot/Core/Entity/Action/OneBotMessage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public class OneBotMessage
{
[JsonPropertyName("message_type")] public string MessageType { get; set; } = "";

[JsonPropertyName("user_id")] public uint UserId { get; set; }
[JsonPropertyName("user_id")] public uint? UserId { get; set; }

[JsonPropertyName("group_id")] public uint? GroupId { get; set; }

Expand Down
2 changes: 1 addition & 1 deletion Lagrange.OneBot/Core/Operation/Message/MessageCommon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ static MessageCommon()
public static MessageBuilder ParseChain(OneBotMessage message)
{
var builder = message.MessageType == "private"
? MessageBuilder.Friend(message.UserId)
? MessageBuilder.Friend(message.UserId ?? 0)
: MessageBuilder.Group(message.GroupId ?? 0);
BuildMessages(builder, message.Messages);

Expand Down

0 comments on commit 39e0795

Please sign in to comment.