mirror of
https://github.com/ikechan8370/chatgpt-plugin.git
synced 2025-12-18 06:17:06 +00:00
fix: getGroupList兼容trss-onebot array处理为数组
This commit is contained in:
parent
04b331af71
commit
2645292dd1
7 changed files with 28 additions and 41 deletions
|
|
@ -832,6 +832,21 @@ export function getUin (e) {
|
|||
} else return Bot.uin
|
||||
}
|
||||
|
||||
export async function getGroupList (e) {
|
||||
let groupList
|
||||
try {
|
||||
groupList = await e.bot.getGroupList()
|
||||
} catch (err) {
|
||||
groupList = e.bot.gl
|
||||
}
|
||||
//onebot getGroupList方法返回的array,需要转换为map 等同于e.bot.gl
|
||||
if (Array.isArray(groupList)) {
|
||||
return e.bot.gl
|
||||
} else {
|
||||
return groupList
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成当前语音模式下可发送的音频信息
|
||||
* @param e - 上下文对象
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue