mirror of
https://github.com/ikechan8370/chatgpt-plugin.git
synced 2025-12-17 22:07:10 +00:00
修复trss不支持sendPrivateMsg的问题
This commit is contained in:
parent
880edace8a
commit
5d5535ed6e
2 changed files with 16 additions and 4 deletions
|
|
@ -118,7 +118,11 @@ async function mediaLink() {
|
||||||
case 'register':
|
case 'register':
|
||||||
if (data.state) {
|
if (data.state) {
|
||||||
let master = (await getMasterQQ())[0]
|
let master = (await getMasterQQ())[0]
|
||||||
Bot.sendPrivateMsg(master, `当前chatgpt插件服务无法被外网访问,已启用代理链接,访问代码:${data.token}`, false)
|
if (Array.isArray(Bot.uin)) {
|
||||||
|
Bot.pickFriend(master).sendMsg(`当前chatgpt插件服务无法被外网访问,已启用代理链接,访问代码:${data.token}`)
|
||||||
|
} else {
|
||||||
|
Bot.sendPrivateMsg(master, `当前chatgpt插件服务无法被外网访问,已启用代理链接,访问代码:${data.token}`, false)
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
console.log('注册区域失败')
|
console.log('注册区域失败')
|
||||||
}
|
}
|
||||||
|
|
@ -189,7 +193,7 @@ export async function createServer() {
|
||||||
if (body.code) {
|
if (body.code) {
|
||||||
const pattern = /^[a-zA-Z0-9]+$/
|
const pattern = /^[a-zA-Z0-9]+$/
|
||||||
if (!pattern.test(body.code)) {
|
if (!pattern.test(body.code)) {
|
||||||
reply.send({error: 'bad request'})
|
reply.send({ error: 'bad request' })
|
||||||
}
|
}
|
||||||
const dir = 'resources/ChatGPTCache/page'
|
const dir = 'resources/ChatGPTCache/page'
|
||||||
const filename = body.code + '.json'
|
const filename = body.code + '.json'
|
||||||
|
|
@ -342,7 +346,11 @@ export async function createServer() {
|
||||||
if (data.group) {
|
if (data.group) {
|
||||||
Bot.sendGroupMsg(parseInt(data.id), data.message, data.quotable)
|
Bot.sendGroupMsg(parseInt(data.id), data.message, data.quotable)
|
||||||
} else {
|
} else {
|
||||||
Bot.sendPrivateMsg(parseInt(data.id), data.message, data.quotable)
|
if (Array.isArray(Bot.uin)) {
|
||||||
|
Bot.pickFriend(parseInt(data.id)).sendMsg(data.message)
|
||||||
|
} else {
|
||||||
|
Bot.sendPrivateMsg(parseInt(data.id), data.message, data.quotable)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
await connection.socket.send(JSON.stringify({ command: data.command, state: true, }))
|
await connection.socket.send(JSON.stringify({ command: data.command, state: true, }))
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,11 @@ async function User(fastify, options) {
|
||||||
{ EX: 60000 }
|
{ EX: 60000 }
|
||||||
)
|
)
|
||||||
const master = (await getMasterQQ())[0]
|
const master = (await getMasterQQ())[0]
|
||||||
Bot.sendPrivateMsg(master, `收到工具箱快捷登录请求,1分钟内有效:${otp}`, false)
|
if (Array.isArray(Bot.uin)) {
|
||||||
|
Bot.pickFriend(master).sendMsg(`收到工具箱快捷登录请求,1分钟内有效:${otp}`)
|
||||||
|
} else {
|
||||||
|
Bot.sendPrivateMsg(master, `收到工具箱快捷登录请求,1分钟内有效:${otp}`, false)
|
||||||
|
}
|
||||||
reply.send({ state: true })
|
reply.send({ state: true })
|
||||||
return reply
|
return reply
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue