mirror of
https://github.com/ikechan8370/chatgpt-plugin.git
synced 2025-12-16 13:27:08 +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':
|
||||
if (data.state) {
|
||||
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 {
|
||||
console.log('注册区域失败')
|
||||
}
|
||||
|
|
@ -189,7 +193,7 @@ export async function createServer() {
|
|||
if (body.code) {
|
||||
const pattern = /^[a-zA-Z0-9]+$/
|
||||
if (!pattern.test(body.code)) {
|
||||
reply.send({error: 'bad request'})
|
||||
reply.send({ error: 'bad request' })
|
||||
}
|
||||
const dir = 'resources/ChatGPTCache/page'
|
||||
const filename = body.code + '.json'
|
||||
|
|
@ -342,7 +346,11 @@ export async function createServer() {
|
|||
if (data.group) {
|
||||
Bot.sendGroupMsg(parseInt(data.id), data.message, data.quotable)
|
||||
} 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, }))
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -46,7 +46,11 @@ async function User(fastify, options) {
|
|||
{ EX: 60000 }
|
||||
)
|
||||
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 })
|
||||
return reply
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue