mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2025-07-19 12:03:37 +00:00
fix: #883
This commit is contained in:
@@ -6,7 +6,8 @@ import { Type, Static } from '@sinclair/typebox';
|
|||||||
const SchemaData = Type.Object({
|
const SchemaData = Type.Object({
|
||||||
user_id: Type.Optional(Type.Union([Type.Number(), Type.String()])),
|
user_id: Type.Optional(Type.Union([Type.Number(), Type.String()])),
|
||||||
start: Type.Union([Type.Number(), Type.String()], { default: 0 }),
|
start: Type.Union([Type.Number(), Type.String()], { default: 0 }),
|
||||||
count: Type.Union([Type.Number(), Type.String()], { default: 10 })
|
count: Type.Union([Type.Number(), Type.String()], { default: 10 }),
|
||||||
|
type: Type.Union([Type.Number(), Type.String()], { default: 2 })
|
||||||
});
|
});
|
||||||
|
|
||||||
type Payload = Static<typeof SchemaData>;
|
type Payload = Static<typeof SchemaData>;
|
||||||
@@ -33,8 +34,7 @@ export class GetProfileLike extends OneBotAction<Payload, {
|
|||||||
async _handle(payload: Payload) {
|
async _handle(payload: Payload) {
|
||||||
const isSelf = this.core.selfInfo.uin === payload.user_id || !payload.user_id;
|
const isSelf = this.core.selfInfo.uin === payload.user_id || !payload.user_id;
|
||||||
const userUid = isSelf || !payload.user_id ? this.core.selfInfo.uid : await this.core.apis.UserApi.getUidByUinV2(payload.user_id.toString());
|
const userUid = isSelf || !payload.user_id ? this.core.selfInfo.uid : await this.core.apis.UserApi.getUidByUinV2(payload.user_id.toString());
|
||||||
const type = isSelf ? 2 : 1;
|
const ret = await this.core.apis.UserApi.getProfileLike(userUid ?? this.core.selfInfo.uid, +payload.start, +payload.count, +payload.type);
|
||||||
const ret = await this.core.apis.UserApi.getProfileLike(userUid ?? this.core.selfInfo.uid, +payload.start, +payload.count, type);
|
|
||||||
const data = ret.info.userLikeInfos[0];
|
const data = ret.info.userLikeInfos[0];
|
||||||
if (!data) {
|
if (!data) {
|
||||||
throw new Error('get info error');
|
throw new Error('get info error');
|
||||||
|
Reference in New Issue
Block a user