mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2024-11-21 09:36:35 +00:00
fix: #498
This commit is contained in:
parent
49ca698ab9
commit
bdec16266e
@ -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<typeof SchemaData>;
|
||||
|
||||
@ -18,7 +23,8 @@ export class GoCQHTTPDeleteFriend extends BaseAction<Payload, any> {
|
||||
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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user