From fd54658e53c06e3f513f25e4cd8ab616e2144158 Mon Sep 17 00:00:00 2001 From: linyuchen Date: Mon, 15 Apr 2024 22:42:31 +0800 Subject: [PATCH] todo: retry get groups if groups length is 0 --- src/onebot11/action/group/GetGroupList.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/onebot11/action/group/GetGroupList.ts b/src/onebot11/action/group/GetGroupList.ts index 24d1c8a3..80d92669 100644 --- a/src/onebot11/action/group/GetGroupList.ts +++ b/src/onebot11/action/group/GetGroupList.ts @@ -3,16 +3,18 @@ import { OB11Constructor } from '../../constructor'; import BaseAction from '../BaseAction'; import { ActionName } from '../types'; import { groups } from '@/common/data'; +import {NTQQGroupApi} from "@/core/qqnt/apis"; class GetGroupList extends BaseAction { actionName = ActionName.GetGroupList; protected async _handle(payload: null) { - // if (groups.length === 0) { - // const groups = await NTQQGroupApi.getGroups(true) - // log("get groups", groups) - // } + if (groups.size === 0) { + //todo: get groups + // const groups = await NTQQGroupApi.getGroups(true) + // log("get groups", groups) + } return OB11Constructor.groups(Array.from(groups.values())); } }