-
Notifications
You must be signed in to change notification settings - Fork 257
chore: update version to 7.12.9 #749
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| {"name":"llonebot-dist","version":"7.12.8","type":"module","description":"","main":"llbot.js","author":"linyuchen","repository":{"type":"git","url":"https://github.com/LLOneBot/LuckyLilliaBot"}} | ||
| {"name":"llonebot-dist","version":"7.12.9","type":"module","description":"","main":"llbot.js","author":"linyuchen","repository":{"type":"git","url":"https://github.com/LLOneBot/LuckyLilliaBot"}} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -28,23 +28,25 @@ class GetGroupMemberInfo extends BaseAction<Payload, OB11GroupMember> { | |
| let info: UserDetailInfo | undefined | ||
| try { | ||
| info = await this.ctx.ntUserApi.getUserDetailInfoWithBizInfo(member.uid) | ||
| this.ctx.logger.info('getUserDetailInfoWithBizInfo') | ||
| } catch (e) { | ||
| try { | ||
| const fetchInfo = await this.ctx.ntUserApi.fetchUserDetailInfo(member.uid) | ||
| info = fetchInfo.detail.get(member.uid) | ||
| this.ctx.logger.info('fetchUserDetailInfo') | ||
| } catch (e) { | ||
| } | ||
| } | ||
| if (info) { | ||
| this.ctx.logger.info(info) | ||
| if (info?.commonExt) { | ||
| ret.sex = OB11Entities.sex(info.simpleInfo.baseInfo.sex) | ||
| ret.qq_level = info.commonExt?.qqLevel && calcQQLevel(info.commonExt.qqLevel) || 0 | ||
| ret.age = info.simpleInfo.baseInfo.age ?? 0 | ||
| } | ||
| if (ret.qq_level === 0) { | ||
| ret.qq_level = (await this.ctx.pmhq.fetchUserInfo(+payload.user_id)).level | ||
| ret.qq_level = calcQQLevel(info.commonExt.qqLevel) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. issue: 在调用 之前的版本会在 Original comment in Englishissue: Handle cases where The previous version short-circuited on |
||
| ret.age = info.simpleInfo.baseInfo.age | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. issue (bug_risk): 建议为 之前通过 Original comment in Englishissue (bug_risk): Consider providing a default value for Previously |
||
| if (ret.qq_level === 0) { | ||
| ret.qq_level = (await this.ctx.pmhq.fetchUserInfo(+payload.user_id)).level | ||
| } | ||
| } else { | ||
| const info = await this.ctx.pmhq.fetchUserInfo(+payload.user_id) | ||
| ret.sex = OB11Entities.sex(info.sex) | ||
| ret.qq_level = info.level | ||
| ret.age = info.age | ||
| } | ||
| return ret | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| export const version = '7.12.8' | ||
| export const version = '7.12.9' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue (bug_risk): 请在
lists本身上使用可选链,以避免在其缺失或为空时出现运行时错误。business?.body.lists[0]仍然假定lists存在且可索引;如果body.lists为undefined或不是数组,就会抛异常。请改为使用business?.body.lists?.[0](其它位置同理),或者先赋值const first = business?.body.lists?.[0],然后在isVip、isYearsVip和vipLevel中复用first,以便在 proto 数据异常时也能安全处理。Original comment in English
issue (bug_risk): Use optional chaining on
listsitself to avoid possible runtime errors when it is missing or empty.business?.body.lists[0]still assumeslistsexists and is indexable; ifbody.listsisundefinedor not an array, this will throw. Please either usebusiness?.body.lists?.[0](and similarly elsewhere) or assignconst first = business?.body.lists?.[0]and reusefirstforisVip,isYearsVip, andvipLevelto safely handle malformed proto data.