Skip to content

Commit

Permalink
[OneBot] Fixed format of get_group_list
Browse files Browse the repository at this point in the history
  • Loading branch information
Linwenxuan authored and Linwenxuan committed Nov 1, 2023
1 parent 7cbce51 commit 4eb6c16
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Lagrange.OneBot/Core/Operation/Info/GetGroupListOperation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Text.Json.Nodes;
using Lagrange.Core;
using Lagrange.Core.Common.Interface.Api;
using Lagrange.OneBot.Core.Entity;
using Lagrange.OneBot.Core.Entity.Action;

namespace Lagrange.OneBot.Core.Operation.Info;
Expand All @@ -14,12 +15,12 @@ public async Task<OneBotResult> HandleOperation(BotContext context, JsonObject?
if (payload.Deserialize<OneBotGetGroupInfo>() is { } message)
{
var result = await context.FetchGroups(message.NoCache);
return new OneBotResult(result, 0, "ok");
return new OneBotResult(result.Select(x => new OneBotGroup(x.GroupUin, x.GroupName)), 0, "ok");
}
else
{
var result = await context.FetchGroups();
return new OneBotResult(result, 0, "ok");
return new OneBotResult(result.Select(x => new OneBotGroup(x.GroupUin, x.GroupName)), 0, "ok");
}
}
}

0 comments on commit 4eb6c16

Please sign in to comment.