From 7477979bd13f58cb32c52d61eb59e285340da906 Mon Sep 17 00:00:00 2001 From: Clansty Date: Tue, 8 Mar 2022 14:53:17 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20event.prevParticipant=20=E4=B8=BA=20null?= =?UTF-8?q?=20=E6=97=B6=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/controllers/ConfigController.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/controllers/ConfigController.ts b/src/controllers/ConfigController.ts index 33be764..cc672eb 100644 --- a/src/controllers/ConfigController.ts +++ b/src/controllers/ConfigController.ts @@ -95,7 +95,8 @@ export default class ConfigController { }; private handleChannelParticipant = async (event: Api.UpdateChannelParticipant) => { - if ('userId' in event.prevParticipant && event.prevParticipant.userId.eq(this.tgBot.me.id) && + if (event.prevParticipant && 'userId' in event.prevParticipant && + event.prevParticipant.userId.eq(this.tgBot.me.id) && !event.newParticipant) { this.log.warn(`群 ${event.channelId.toString()} 删除了`); const pair = this.instance.forwardPairs.find(event.channelId);