mirror of
https://github.com/ikechan8370/chatgpt-plugin.git
synced 2025-12-18 06:17:06 +00:00
修复server初始化消息错误
This commit is contained in:
parent
471da4f3b1
commit
42bad1cb47
1 changed files with 7 additions and 2 deletions
|
|
@ -360,9 +360,13 @@ export async function createServer() {
|
||||||
await connection.socket.send(JSON.stringify({ command: data.command, state: true, error: '普通用户无需进行初始化' }))
|
await connection.socket.send(JSON.stringify({ command: data.command, state: true, error: '普通用户无需进行初始化' }))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
const groupList = await Bot[user.user].getGroupList()
|
let _Bot = Bot
|
||||||
|
if (isTrss) {
|
||||||
|
_Bot = Bot[user.user]
|
||||||
|
}
|
||||||
|
const groupList = await _Bot.getGroupList()
|
||||||
groupList.forEach(async (item) => {
|
groupList.forEach(async (item) => {
|
||||||
const group = Bot[user.user].pickGroup(item.group_id)
|
const group = _Bot.pickGroup(item.group_id)
|
||||||
const groupMessages = await group.getChatHistory()
|
const groupMessages = await group.getChatHistory()
|
||||||
groupMessages.forEach(async (e) => {
|
groupMessages.forEach(async (e) => {
|
||||||
const messageData = {
|
const messageData = {
|
||||||
|
|
@ -387,6 +391,7 @@ export async function createServer() {
|
||||||
await connection.socket.send(JSON.stringify(messageData))
|
await connection.socket.send(JSON.stringify(messageData))
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
break
|
break
|
||||||
default:
|
default:
|
||||||
await connection.socket.send(JSON.stringify({ "data": data }))
|
await connection.socket.send(JSON.stringify({ "data": data }))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue