From 575f3284b0a8c2613e88fffac7a397def0acd41f Mon Sep 17 00:00:00 2001 From: Nofated095 Date: Wed, 31 Jan 2024 21:41:13 +0800 Subject: [PATCH] fix tgUser in AliveCheckController --- src/controllers/AliveCheckController.ts | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/src/controllers/AliveCheckController.ts b/src/controllers/AliveCheckController.ts index 2f3f3b66..809e1de2 100644 --- a/src/controllers/AliveCheckController.ts +++ b/src/controllers/AliveCheckController.ts @@ -6,7 +6,6 @@ import { Api } from 'telegram'; export default class AliveCheckController { constructor(private readonly instance: Instance, private readonly tgBot: Telegram, - private readonly tgUser: Telegram, private readonly oicq: OicqClient) { tgBot.addNewMessageEventHandler(this.handleMessage); } @@ -33,20 +32,6 @@ export default class AliveCheckController { for (const instance of instances) { const oicq = instance.oicq; const tgBot = instance.tgBot; - const tgUser = instance.tgUser; - - const tgUserName = (tgUser.me.username || tgUser.me.usernames.length) ? - '@' + (tgUser.me.username || tgUser.me.usernames[0].username) : tgUser.me.firstName; - messageParts.push([ - `Instance #${instance.id}`, - - `QQ ${instance.qqUin}\t` + - `${boolToStr(oicq.isOnline())}\t${oicq.stat.msg_cnt_per_min} msg/min`, - - `TG @${tgBot.me.username}\t${boolToStr(tgBot.isOnline)}`, - - `TG User ${tgUserName}\t${boolToStr(tgBot.isOnline)}`, - ].join('\n')); } return messageParts.join('\n\n');