mirror of
https://github.com/LLOneBot/LLOneBot.git
synced 2024-11-22 01:56:33 +00:00
feat: 获取群详情接口新增 groupAll 字段用于更详细的群信息
This commit is contained in:
parent
6c66a0116a
commit
d8a9633a00
@ -39,7 +39,7 @@ const config: ElectronViteConfig = {
|
||||
...external.map(genCpModule),
|
||||
{ src: './manifest.json', dest: 'dist' },
|
||||
{ src: './icon.webp', dest: 'dist' },
|
||||
{ src: './src/ntqqapi/native/napcat-protocol-packet/Moehoo/*', dest: 'dist/main/Moehoo' },
|
||||
// { src: './src/ntqqapi/native/napcat-protocol-packet/Moehoo/*', dest: 'dist/main/Moehoo' },
|
||||
],
|
||||
}),
|
||||
],
|
||||
|
@ -15,8 +15,16 @@ class GetGroupInfo extends BaseAction<Payload, OB11Group> {
|
||||
|
||||
protected async _handle(payload: Payload) {
|
||||
const groupCode = payload.group_id.toString()
|
||||
const group = (await this.ctx.ntGroupApi.getGroups()).find(e => e.groupCode === groupCode)
|
||||
let group = (await this.ctx.ntGroupApi.getGroups()).find(e => e.groupCode === groupCode)
|
||||
if (group) {
|
||||
try{
|
||||
const groupAllInfo = await this.ctx.ntGroupApi.getGroupAllInfo(groupCode)
|
||||
this.ctx.logger.info(groupAllInfo)
|
||||
return {...OB11Entities.group(group), ...groupAllInfo}
|
||||
}
|
||||
catch (e) {
|
||||
this.ctx.logger.error('获取群完整详细信息失败', e)
|
||||
}
|
||||
return OB11Entities.group(group)
|
||||
}
|
||||
throw new Error(`群${payload.group_id}不存在`)
|
||||
|
Loading…
x
Reference in New Issue
Block a user