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
|
|
@ -1,6 +1,6 @@
|
|||
import { AbstractTool } from './AbstractTool.js'
|
||||
import { convertFaces } from '../face.js'
|
||||
import {getMasterQQ} from '../common.js'
|
||||
import {getMasterQQ, getGroupList} from '../common.js'
|
||||
import {Config} from '../config.js'
|
||||
|
||||
export class SendMessageToSpecificGroupOrUserTool extends AbstractTool {
|
||||
|
|
@ -27,12 +27,7 @@ export class SendMessageToSpecificGroupOrUserTool extends AbstractTool {
|
|||
? defaultTarget
|
||||
: parseInt(targetGroupIdOrQQNumber) === e.bot.uin ? defaultTarget : parseInt(targetGroupIdOrQQNumber)
|
||||
|
||||
let groupList
|
||||
try {
|
||||
groupList = await e.bot.getGroupList()
|
||||
} catch (err) {
|
||||
groupList = e.bot.gl
|
||||
}
|
||||
let groupList = await getGroupList(e)
|
||||
try {
|
||||
if (groupList.get(target)) {
|
||||
let group = await e.bot.pickGroup(target)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue