fix(onebot): restore group and doubt request accounts
get_group_system_msg now keeps join and invite records, reports the inviter, and fills a missing requester nick from the user profile. get_doubt_friends_add_request returns the QQ number plus the request message, source, and time that QQ actually sends. Closes #400 Closes #401 Closes #402 Closes #403
This commit is contained in:
13 files changed
+418
-79
No files matched your search
@@ -996,12 +996,10 @@ export const actions = [
|
||||
params: {
|
||||
nickname: f.string().optional(),
|
||||
personal_note: f.string().optional(),
|
||||
sex: f.int({ min: 0, max: 2 }).optional().describe('0 未知,1 男,2 女'),
|
||||
},
|
||||
run: async (p, ctx) => {
|
||||
const nickname = p.nickname;
|
||||
const personalNote = p.personal_note;
|
||||
|
||||
await ctx.bridge.apis.profile.setProfile(nickname, personalNote);
|
||||
await ctx.bridge.apis.profile.setProfile(p.nickname, p.personal_note, p.sex);
|
||||
return okResponse();
|
||||
},
|
||||
}),
|
||||
@@ -1400,6 +1398,41 @@ export const actions = [
|
||||
},
|
||||
}),
|
||||
|
||||
defineAction({
|
||||
name: 'get_msg_emoji_likes',
|
||||
summary: '获取一条消息的全部表情回应',
|
||||
readOnly: true,
|
||||
returns: '该消息上每个表情回应的编号、数量与用户列表。',
|
||||
returnsSchema: {
|
||||
type: 'array',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
emoji_id: { type: 'string', description: '表情编号' },
|
||||
emoji_type: { type: 'integer', description: '表情类型' },
|
||||
count: { type: 'integer', description: '回应数量' },
|
||||
last_reaction_time: { type: 'integer', description: '最近一次回应时间' },
|
||||
users: {
|
||||
type: 'array',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: { user_id: { type: 'integer', description: '用户 QQ 号' } },
|
||||
required: ['user_id'],
|
||||
},
|
||||
},
|
||||
},
|
||||
required: ['emoji_id', 'emoji_type', 'count', 'last_reaction_time', 'users'],
|
||||
},
|
||||
},
|
||||
params: { message_id: f.messageId() },
|
||||
run: async (p, ctx) => {
|
||||
if (!ctx.fetchEmojiLikeSummary) {
|
||||
return failedResponse(RETCODE.ACTION_FAILED, 'emoji reaction summary is unavailable');
|
||||
}
|
||||
return okResponse(await ctx.fetchEmojiLikeSummary(p.message_id));
|
||||
},
|
||||
}),
|
||||
|
||||
defineAction({
|
||||
name: 'get_friends_with_category',
|
||||
summary: '获取分组好友列表',
|
||||
@@ -1746,12 +1779,15 @@ export const actions = [
|
||||
type: 'object',
|
||||
properties: {
|
||||
uid: { type: 'string', description: '申请人 uid(回传作 set_doubt_friends_add_request 的 flag)' },
|
||||
user_id: { type: 'integer', description: '申请人 QQ 号' },
|
||||
nick: { type: 'string', description: '申请人昵称' },
|
||||
source: { type: 'string', description: '申请来源' },
|
||||
reason: { type: 'string', description: '附加说明' },
|
||||
msg: { type: 'string', description: '验证留言' },
|
||||
group_code: { type: 'string', description: '来源群号,无则为空串' },
|
||||
reqTime: { type: 'integer', description: '申请时间戳' },
|
||||
},
|
||||
required: ['uid', 'nick', 'source', 'msg', 'reqTime'],
|
||||
required: ['uid', 'user_id', 'nick', 'source', 'reason', 'msg', 'group_code', 'reqTime'],
|
||||
},
|
||||
},
|
||||
params: { count: f.int({ min: 0 }).default(50) },
|
||||
|
||||
@@ -224,13 +224,16 @@ export const actions = [
|
||||
request_id: { type: 'integer', description: '请求序列号' },
|
||||
requester_uin: { type: 'integer', description: '申请人 QQ 号' },
|
||||
requester_nick: { type: 'string', description: '申请人昵称' },
|
||||
invitor_uin: { type: 'integer', description: '邀请人 QQ 号,无邀请时为 0' },
|
||||
invitor_nick: { type: 'string', description: '邀请人昵称' },
|
||||
message: { type: 'string', description: '验证留言' },
|
||||
checked: { type: 'boolean', description: '是否已处理' },
|
||||
flag: { type: 'string', description: '处理请求使用的规范 flag' },
|
||||
},
|
||||
required: [
|
||||
'group_id', 'group_name', 'request_id', 'requester_uin',
|
||||
'requester_nick', 'message', 'checked', 'flag',
|
||||
'requester_nick', 'invitor_uin', 'invitor_nick',
|
||||
'message', 'checked', 'flag',
|
||||
],
|
||||
},
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user