Skip to content

Commit

Permalink
Merge branch 'v2' of github.com:ikechan8370/chatgpt-plugin into v2
Browse files Browse the repository at this point in the history
  • Loading branch information
ikechan8370 committed Dec 10, 2023
2 parents 247f3e1 + ae23e6d commit 699d2c8
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion server/modules/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ async function User (fastify, options) {
// 快速登录
fastify.post('/quick', async (request, reply) => {
const otp = randomString(6)
const isTrss = Array.isArray(Bot.uin)
await redis.set(
'CHATGPT:SERVER_QUICK',
otp,
Expand All @@ -65,7 +66,15 @@ async function User (fastify, options) {
const master = (await getMasterQQ())[0]
let bots = getBots()
for (let bot of bots) {
bot.pickUser(master).sendMsg(`收到工具箱快捷登录请求,1分钟内有效:${otp}`)
if(isTrss) {
try {
bot.pickFriend(master).sendMsg(`收到工具箱快捷登录请求,1分钟内有效:${otp}`)
} catch (error) {
logger.error(error)
}
} else {
bot.pickUser(master).sendMsg(`收到工具箱快捷登录请求,1分钟内有效:${otp}`)
}
}
reply.send({ state: true })
return reply
Expand Down

0 comments on commit 699d2c8

Please sign in to comment.