Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,12 @@ protected override ValueTask<FetchStrangerEventResp> Parse(ReadOnlyMemory<byte>
property => property.Value
);

// Check exists
if (!bytes.TryGetValue(20002, out byte[]? nicknameBytes))
{
throw new OperationException(-1, "Stranger not found");
}

// Birthday
byte[] birthday = bytes[20031];
int year = BinaryPrimitives.ReadUInt16BigEndian(birthday.AsSpan(0, 2));
Expand All @@ -99,7 +105,7 @@ protected override ValueTask<FetchStrangerEventResp> Parse(ReadOnlyMemory<byte>

return ValueTask.FromResult(new FetchStrangerEventResp(new BotStranger(
response.Body.Uin,
Encoding.UTF8.GetString(bytes[20002]),
Encoding.UTF8.GetString(nicknameBytes),
string.Empty, // Can't not get uid
Encoding.UTF8.GetString(bytes[102]),
Encoding.UTF8.GetString(bytes[103]),
Expand Down
Loading