From 234167f305107a16f61cff2b58e64fcf5afcbfc4 Mon Sep 17 00:00:00 2001 From: idranme Date: Wed, 28 Aug 2024 16:06:40 +0800 Subject: [PATCH] fix --- src/onebot11/action/system/GetLoginInfo.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/onebot11/action/system/GetLoginInfo.ts b/src/onebot11/action/system/GetLoginInfo.ts index b38204b..98301d0 100644 --- a/src/onebot11/action/system/GetLoginInfo.ts +++ b/src/onebot11/action/system/GetLoginInfo.ts @@ -1,5 +1,5 @@ -import { OB11User } from '../../types' import BaseAction from '../BaseAction' +import { OB11User } from '../../types' import { ActionName } from '../types' import { selfInfo } from '@/common/globalVars' @@ -7,9 +7,13 @@ class GetLoginInfo extends BaseAction { actionName = ActionName.GetLoginInfo protected async _handle(payload: null) { + let nickname = selfInfo.nick + try { + nickname = await this.ctx.ntUserApi.getSelfNick(true) + } catch { } return { user_id: parseInt(selfInfo.uin), - nickname: await this.ctx.ntUserApi.getSelfNick(true) + nickname } } }