From daad7332f55c334b87145325c4a626564e958723 Mon Sep 17 00:00:00 2001 From: SpadeLushen <7971040+SpadeLushen@users.noreply.github.com> Date: Sun, 14 Jan 2024 21:42:38 +0800 Subject: [PATCH] Fix joinTime & lastMsgTime conversion errors in get_group_member_info and get_group_member_list --- .../Core/Operation/Info/GetGroupMemberInfoOperation.cs | 4 ++-- .../Core/Operation/Info/GetGroupMemberListOperation.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Lagrange.OneBot/Core/Operation/Info/GetGroupMemberInfoOperation.cs b/Lagrange.OneBot/Core/Operation/Info/GetGroupMemberInfoOperation.cs index 1a6598a6c..4038532ba 100644 --- a/Lagrange.OneBot/Core/Operation/Info/GetGroupMemberInfoOperation.cs +++ b/Lagrange.OneBot/Core/Operation/Info/GetGroupMemberInfoOperation.cs @@ -22,8 +22,8 @@ public async Task HandleOperation(BotContext context, JsonObject? result.Uin, result.Permission.ToString().ToLower(), result.GroupLevel.ToString(), result.MemberCard, result.MemberName, - (uint)new DateTimeOffset(result.JoinTime).ToUnixTimeMilliseconds(), - (uint)new DateTimeOffset(result.LastMsgTime).ToUnixTimeMilliseconds()), + (uint)new DateTimeOffset(result.JoinTime).ToUnixTimeSeconds(), + (uint)new DateTimeOffset(result.LastMsgTime).ToUnixTimeSeconds()), 0, "ok"); } diff --git a/Lagrange.OneBot/Core/Operation/Info/GetGroupMemberListOperation.cs b/Lagrange.OneBot/Core/Operation/Info/GetGroupMemberListOperation.cs index 6b1150c4d..0007401a5 100644 --- a/Lagrange.OneBot/Core/Operation/Info/GetGroupMemberListOperation.cs +++ b/Lagrange.OneBot/Core/Operation/Info/GetGroupMemberListOperation.cs @@ -15,7 +15,7 @@ public async Task HandleOperation(BotContext context, JsonObject? if (payload.Deserialize() is { } message) { var result = await context.FetchMembers(message.GroupId, message.NoCache); - return new OneBotResult(result.Select(x => new OneBotGroupMember(message.GroupId, x.Uin, x.Permission.ToString().ToLower(), x.GroupLevel.ToString(), x.MemberCard, x.MemberName, (uint)new DateTimeOffset(x.JoinTime).ToUnixTimeMilliseconds(), (uint)new DateTimeOffset(x.LastMsgTime).ToUnixTimeMilliseconds())), 0, "ok"); + return new OneBotResult(result.Select(x => new OneBotGroupMember(message.GroupId, x.Uin, x.Permission.ToString().ToLower(), x.GroupLevel.ToString(), x.MemberCard, x.MemberName, (uint)new DateTimeOffset(x.JoinTime).ToUnixTimeSeconds(), (uint)new DateTimeOffset(x.LastMsgTime).ToUnixTimeSeconds())), 0, "ok"); } throw new Exception();