diff --git a/main/src/constants/commands.ts b/main/src/constants/commands.ts index bdc4a70..2b2f703 100644 --- a/main/src/constants/commands.ts +++ b/main/src/constants/commands.ts @@ -7,8 +7,24 @@ const preSetupCommands = [ }), ]; +const commonPrivateCommands = [ + new Api.BotCommand({ + command: 'login', + description: '当 QQ 处于下线状态时,使用此命令重新登录 QQ', + }), + new Api.BotCommand({ + command: 'flags', + description: 'WARNING: EXPERIMENTAL FEATURES AHEAD!', + }), + new Api.BotCommand({ + command: 'alive', + description: '状态信息', + }), +] + // 这里的 group 指群组模式,Private 指在与机器人的私聊会话中 const groupPrivateCommands = [ + ...commonPrivateCommands, new Api.BotCommand({ command: 'add', description: '添加新的群转发', @@ -16,6 +32,7 @@ const groupPrivateCommands = [ ]; const personalPrivateCommands = [ + ...commonPrivateCommands, new Api.BotCommand({ command: 'addfriend', description: '添加新的好友转发', @@ -24,14 +41,6 @@ const personalPrivateCommands = [ command: 'addgroup', description: '添加新的群转发', }), - new Api.BotCommand({ - command: 'login', - description: '当 QQ 处于下线状态时,使用此命令重新登录 QQ', - }), - new Api.BotCommand({ - command: 'flags', - description: 'WARNING: EXPERIMENTAL FEATURES AHEAD!', - }), ]; // 服务器零号实例的管理员 diff --git a/main/src/controllers/AliveCheckController.ts b/main/src/controllers/AliveCheckController.ts index 93273fb..82ab7d4 100644 --- a/main/src/controllers/AliveCheckController.ts +++ b/main/src/controllers/AliveCheckController.ts @@ -41,7 +41,7 @@ export default class AliveCheckController { 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}`, + `Instance #${instance.id} (${instance.workMode}) ${instance.isInit ? '' : '初始化未完成'}`, `QQ ${instance.qqUin} (${oicq.constructor.name})\t` + `${boolToStr(await oicq.isOnline())}`, diff --git a/main/src/models/Instance.ts b/main/src/models/Instance.ts index 43b56fc..79d3112 100644 --- a/main/src/models/Instance.ts +++ b/main/src/models/Instance.ts @@ -42,6 +42,7 @@ export default class Instance { public tgBot: Telegram; public tgUser: Telegram; public oicq: QQClient; + public isInit = false; private _ownerChat: TelegramChat; @@ -165,6 +166,7 @@ export default class Instance { this.hugController = new HugController(this, this.tgBot, this.oicq); } this.fileAndFlashPhotoController = new FileAndFlashPhotoController(this, this.tgBot, this.oicq); + this.isInit = true; })() .then(() => this.log.info('初始化已完成')); }