mirror of
https://github.com/ikechan8370/chatgpt-plugin.git
synced 2025-12-17 13:57:10 +00:00
fix: claude加入首条消息检测应对claude不说话的情况
This commit is contained in:
parent
a68055c11d
commit
1e5010e9f1
1 changed files with 6 additions and 1 deletions
|
|
@ -1,6 +1,6 @@
|
|||
import { Config } from '../config.js'
|
||||
import slack from '@slack/bolt'
|
||||
import delay from "delay";
|
||||
import delay from 'delay'
|
||||
let proxy
|
||||
if (Config.proxy) {
|
||||
try {
|
||||
|
|
@ -38,6 +38,7 @@ export class SlackClaudeClient {
|
|||
})
|
||||
let ts = sendResponse.ts
|
||||
let response = '_Typing…_'
|
||||
let tryTimes = 0
|
||||
while (response.trim().endsWith('_Typing…_')) {
|
||||
let replies = await this.app.client.conversations.history({
|
||||
token: this.config.slackUserToken,
|
||||
|
|
@ -55,6 +56,10 @@ export class SlackClaudeClient {
|
|||
}
|
||||
}
|
||||
await delay(500)
|
||||
if (tryTimes > 10 && response === '_Typing…_') {
|
||||
// 过了5秒还没任何回复,就重新发一下试试
|
||||
return await this.sendMessage(prompt)
|
||||
}
|
||||
}
|
||||
return response
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue