feat(onebot): support moving friends between categories

Add the set_friends_category action with either an existing category ID or an exact unique category name.

Validate the current friend and category roster before applying a change, reject missing or ambiguous targets, and surface failed updates instead of reporting false success. Expose the action through the SDK types and cover validation, successful updates, repeat requests, service rejection, and registry completeness.

Closes #297
This commit is contained in:
DrSmoothl committed 2026-07-30 10:37:16 +08:00
1 parent a3b790d472
commit f0ff8da2fa
10 files changed
+429 -3

No files matched your search

+2
View File
@@ -42,6 +42,7 @@ import type {
SendPrivateMsgParams,
SetFriendAddRequestParams,
SetFriendRemarkParams,
SetFriendsCategoryParams,
SetGroupAddRequestParams,
SetGroupAddOptionParams,
SetGroupAdminParams,
@@ -202,6 +203,7 @@ export interface SnowLumaActionMap {
get_emoji_likes: { params: GetEmojiLikesParams; data: JsonObject };
fetch_emoji_like: { params: FetchEmojiLikeParams; data: JsonObject };
get_friends_with_category: { params: JsonObject; data: FriendCategoryResult[] };
set_friends_category: { params: SetFriendsCategoryParams; data: EmptyData };
get_online_clients: { params: GetOnlineClientsParams; data: OnlineClientsInfo };
_get_model_show: { params: JsonObject; data: { variants: JsonArray } };
_set_model_show: { params: JsonObject; data: EmptyData };
+5
View File
@@ -103,6 +103,11 @@ export interface SetGroupSpecialTitleParams extends GroupIdParams {
special_title?: string;
}
export type SetFriendsCategoryParams = JsonObject & (
| { uin: number; categoryId: number; categoryName?: never }
| { uin: number; categoryId?: never; categoryName: string }
);
export interface UploadGroupFileParams extends GroupIdParams {
file: string;
name?: string;