mirror of
https://github.com/ikechan8370/chatgpt-plugin.git
synced 2025-12-16 21:37:11 +00:00
fix: 增加bot校验降低claude复读可能性
This commit is contained in:
parent
aa91ddeed5
commit
a68055c11d
1 changed files with 3 additions and 1 deletions
|
|
@ -1,5 +1,6 @@
|
||||||
import { Config } from '../config.js'
|
import { Config } from '../config.js'
|
||||||
import slack from '@slack/bolt'
|
import slack from '@slack/bolt'
|
||||||
|
import delay from "delay";
|
||||||
let proxy
|
let proxy
|
||||||
if (Config.proxy) {
|
if (Config.proxy) {
|
||||||
try {
|
try {
|
||||||
|
|
@ -44,7 +45,7 @@ export class SlackClaudeClient {
|
||||||
limit: 1,
|
limit: 1,
|
||||||
oldest: ts
|
oldest: ts
|
||||||
})
|
})
|
||||||
if (replies.messages.length > 0) {
|
if (replies.messages.length > 0 && replies.messages[0].bot_profile) {
|
||||||
response = replies.messages[0].text
|
response = replies.messages[0].text
|
||||||
if (Config.debug) {
|
if (Config.debug) {
|
||||||
let text = response.replace('_Typing…_', '')
|
let text = response.replace('_Typing…_', '')
|
||||||
|
|
@ -53,6 +54,7 @@ export class SlackClaudeClient {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
await delay(500)
|
||||||
}
|
}
|
||||||
return response
|
return response
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue