diff --git a/src/onebot/action/go-cqhttp/GoCQHTTPDeleteFriend.ts b/src/onebot/action/go-cqhttp/GoCQHTTPDeleteFriend.ts index e770cb09..ea1b4c53 100644 --- a/src/onebot/action/go-cqhttp/GoCQHTTPDeleteFriend.ts +++ b/src/onebot/action/go-cqhttp/GoCQHTTPDeleteFriend.ts @@ -6,10 +6,15 @@ const SchemaData = { type: 'object', properties: { friend_id: { type: ['string', 'number'] }, + user_id: { type: ['string', 'number'] }, temp_block: { type: 'boolean' }, temp_both_del: { type: 'boolean' }, }, - required: ['friend_id'], + oneOf: [ + { required: ['friend_id'] }, + { required: ['user_id'] }, + ], + } as const satisfies JSONSchema; type Payload = FromSchema; @@ -18,7 +23,8 @@ export class GoCQHTTPDeleteFriend extends BaseAction { payloadSchema = SchemaData; async _handle(payload: Payload) { - const uid = await this.core.apis.UserApi.getUidByUinV2(payload.friend_id.toString()); + const uin = payload.friend_id ?? payload.user_id ?? ''; + const uid = await this.core.apis.UserApi.getUidByUinV2(uin.toString()); if (!uid) { return {