refactor(agent): remove obsolete compatibility paths
This commit is contained in:
@@ -79,15 +79,6 @@ public static partial class WechatChatClient
|
||||
item.DoubleClick();
|
||||
}
|
||||
|
||||
/// <summary>Compatibility name: returns database-known groups, not a recency-ordered session list.</summary>
|
||||
public static async Task<IReadOnlyList<string>> GetRecentGroupsAsync(CancellationToken cancellationToken = default)
|
||||
{
|
||||
var page = await GetContactsPageAsync(limit: 10000, groupsOnly: true, cancellationToken: cancellationToken).ConfigureAwait(false);
|
||||
if (page.HasMore)
|
||||
throw new WxAgentException(WxAgentErrorCode.InvalidOperationState, "Group list exceeds the compatibility API limit; use GetContactsPageAsync to paginate.");
|
||||
return page.Contacts.Select(contact => contact.DisplayName).ToArray();
|
||||
}
|
||||
|
||||
public static async Task<WechatContactPage> GetContactsPageAsync(int limit = 200, int offset = 0,
|
||||
string? contains = null, bool? groupsOnly = null, string? accountId = null, string? keyFile = null,
|
||||
CancellationToken cancellationToken = default)
|
||||
@@ -265,14 +256,6 @@ public static partial class WechatChatClient
|
||||
public static Task<WechatOperationResult> SetMyNicknameInGroupAsync(string group, string value, string confirmation, CancellationToken cancellationToken = default) =>
|
||||
SetGroupTextAsync(group, new[] { "我在本群的昵称", "群昵称" }, value, "set group nickname", confirmation, cancellationToken);
|
||||
|
||||
public static async Task<IReadOnlyList<WechatGroupMemberSnapshot>> GetGroupMembersAsync(string group, CancellationToken cancellationToken = default)
|
||||
{
|
||||
var page = await GetGroupMembersPageAsync(group, 10000, cancellationToken: cancellationToken).ConfigureAwait(false);
|
||||
if (page.HasMore)
|
||||
throw new WxAgentException(WxAgentErrorCode.InvalidOperationState, "Group member list exceeds the compatibility API limit; use GetGroupMembersPageAsync.");
|
||||
return page.Members.Select(member => new WechatGroupMemberSnapshot(member.DisplayName, IsOwner: member.IsOwner)).ToArray();
|
||||
}
|
||||
|
||||
public static async Task<WechatGroupMemberPage> GetGroupMembersPageAsync(string group, int limit = 500, int offset = 0,
|
||||
string? accountId = null, string? keyFile = null, CancellationToken cancellationToken = default)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user