diff --git a/packages/engine-chronocat-api/src/handler.ts b/packages/engine-chronocat-api/src/handler.ts index 131766b..2035de4 100644 --- a/packages/engine-chronocat-api/src/handler.ts +++ b/packages/engine-chronocat-api/src/handler.ts @@ -205,7 +205,7 @@ const responseDispatcher = async ( case 'onGroupListUpdate': case 'nodeIKernelGroupListener/onGroupListUpdate': { - const { groupList } = payload as OnGroupListUpdate + const { groupList, updateType } = payload as OnGroupListUpdate for (const group of groupList) { ctx.chronocatEngineChronocatApi.msgBoxActiv.activate({ @@ -214,7 +214,9 @@ const responseDispatcher = async ( guildId: '', }) - groupMap[group.groupCode] = group + if (updateType === 1) groupMap[group.groupCode] = group + else if (updateType === 3) + if (groupMap[group.groupCode]) delete groupMap[group.groupCode] } chronoEventEmitter.emitGroupListUpdate() diff --git a/packages/red/src/redIpcEntity.ts b/packages/red/src/redIpcEntity.ts index 5b1485e..8cc618c 100644 --- a/packages/red/src/redIpcEntity.ts +++ b/packages/red/src/redIpcEntity.ts @@ -104,7 +104,11 @@ export interface OnEmojiDownloadComplete { } export interface OnGroupListUpdate { - updateType: 1 + /** + * 1 为增加,3 为退出。 + */ + updateType: 1 | 3 + groupList: Group[] }