fix: getGroupList兼容trss-onebot array处理为数组

This commit is contained in:
127Wzc 2025-04-02 23:57:45 +08:00
parent 04b331af71
commit 2645292dd1
7 changed files with 28 additions and 41 deletions

View file

@ -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 - 上下文对象