Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions doc/更新日志.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
V7.12.7
更新时间 2026-04-28

* OneBot 支持 _get_group_notice API 获取群公告是否发送给新成员
* OneBot 支持 _send_group_notice API 设置群公告是否发送给新成员

=================
V7.12.6
更新时间 2026-04-28

Expand Down
2 changes: 1 addition & 1 deletion package-dist.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"name":"llonebot-dist","version":"7.12.6","type":"module","description":"","main":"llbot.js","author":"linyuchen","repository":{"type":"git","url":"https://github.com/LLOneBot/LuckyLilliaBot"}}
{"name":"llonebot-dist","version":"7.12.7","type":"module","description":"","main":"llbot.js","author":"linyuchen","repository":{"type":"git","url":"https://github.com/LLOneBot/LuckyLilliaBot"}}
3 changes: 2 additions & 1 deletion src/ntqqapi/api/webapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,8 @@ export class NTQQWebApi extends Service {
imgHeight: imgHeight?.toString()
}

const res = await fetch('https://web.qun.qq.com/cgi-bin/announce/add_qun_notice', {
const url = type === 20 ? 'https://web.qun.qq.com/cgi-bin/announce/add_qun_instruction' : 'https://web.qun.qq.com/cgi-bin/announce/add_qun_notice'
const res = await fetch(url, {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
Expand Down
4 changes: 3 additions & 1 deletion src/onebot11/action/go-cqhttp/GetGroupNotice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ interface Notice {
tip_window: boolean
confirm_required: boolean
pinned: boolean
send_new_member: boolean
}
}

Expand Down Expand Up @@ -53,7 +54,8 @@ export class GetGroupNotice extends BaseAction<Payload, Notice[]> {
is_show_edit_card: !!feed.settings.isShowEditCard,
tip_window: !feed.settings.tipWindowType,
confirm_required: !!feed.settings.confirmRequired,
pinned: !!feed.pinned
pinned: !!feed.pinned,
send_new_member: feed.type === 20
}
})
}
Expand Down
18 changes: 8 additions & 10 deletions src/onebot11/action/go-cqhttp/SendGroupNotice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ interface Payload {
confirm_required: boolean
is_show_edit_card: boolean
tip_window: boolean
send_new_member: boolean
}

export class SendGroupNotice extends BaseAction<Payload, null> {
Expand All @@ -23,15 +24,12 @@ export class SendGroupNotice extends BaseAction<Payload, null> {
pinned: Schema.union([Boolean, Schema.transform(String, parseBool)]).default(false),
confirm_required: Schema.union([Boolean, Schema.transform(String, parseBool)]).default(true),
is_show_edit_card: Schema.union([Boolean, Schema.transform(String, parseBool)]).default(false),
tip_window: Schema.union([Boolean, Schema.transform(String, parseBool)]).default(false)
tip_window: Schema.union([Boolean, Schema.transform(String, parseBool)]).default(false),
send_new_member: Schema.union([Boolean, Schema.transform(String, parseBool)]).default(false)
})

async _handle(payload: Payload) {
const groupCode = payload.group_id.toString()
const pinned = +payload.pinned
const confirmRequired = +payload.confirm_required
const isShowEditCard = +payload.is_show_edit_card
const tipWindowType = +!payload.tip_window

let picInfo: { id: string, width: number, height: number } | undefined
if (payload.image) {
Expand All @@ -52,11 +50,11 @@ export class SendGroupNotice extends BaseAction<Payload, null> {
const res = await this.ctx.ntWebApi.publishGroupBulletin(
groupCode,
payload.content,
pinned,
1,
isShowEditCard,
tipWindowType,
confirmRequired,
+payload.pinned,
payload.send_new_member ? 20 : 1,
+payload.is_show_edit_card,
+!payload.tip_window,
+payload.confirm_required,
picInfo?.id,
picInfo?.width,
picInfo?.height
Expand Down
7 changes: 4 additions & 3 deletions src/onebot11/action/group/GetGroupMemberInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,17 @@ 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)
if (fetchInfo) {
info = fetchInfo.detail.get(member.uid)
}
info = fetchInfo.detail.get(member.uid)
this.ctx.logger.info('fetchUserDetailInfo')
} catch (e) {
}
}
if (info) {
this.ctx.logger.info(info.simpleInfo.baseInfo)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚨 suggestion (security): 建议降低该日志的级别或移除这条日志,以避免产生过于冗长或包含大量个人敏感信息(PII)的输出。

当前在每次调用时,会以 info 级别记录完整的 info.simpleInfo.baseInfo 对象,该对象可能较大,并可能包含敏感的用户数据。如果这主要用于调试,请考虑将级别降低到 debug/trace,或者只记录最小化的标识信息(例如 UID),以减少噪声并降低隐私风险。

Original comment in English

🚨 suggestion (security): Consider lowering the log level or removing this log to avoid verbose/PII-heavy output.

This logs the full info.simpleInfo.baseInfo object at info level on every call, which can be large and may include sensitive user data. If this is primarily for debugging, please either lower the level (debug/trace) or log only a minimal identifier (e.g., UID) to reduce noise and privacy risk.

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
Expand Down
2 changes: 1 addition & 1 deletion src/version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const version = '7.12.6'
export const version = '7.12.7'
Loading