mirror of
https://github.com/jie65535/JChatGPT.git
synced 2025-07-28 18:59:20 +08:00
Change to subject lock
This commit is contained in:
parent
ea4e6123b3
commit
679bf15be5
@ -309,8 +309,8 @@ object JChatGPT : KotlinPlugin(
|
|||||||
private val thinkRegex = Regex("<think>[\\s\\S]*?</think>")
|
private val thinkRegex = Regex("<think>[\\s\\S]*?</think>")
|
||||||
|
|
||||||
private suspend fun startChat(event: MessageEvent) {
|
private suspend fun startChat(event: MessageEvent) {
|
||||||
if (!requestMap.add(event.sender.id)) {
|
if (!requestMap.add(event.subject.id)) {
|
||||||
event.subject.sendMessage("再等等...")
|
logger.warning("The current Contact is busy!")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -397,8 +397,8 @@ object JChatGPT : KotlinPlugin(
|
|||||||
} finally {
|
} finally {
|
||||||
// 一段时间后才允许再次提问,防止高频对话
|
// 一段时间后才允许再次提问,防止高频对话
|
||||||
launch {
|
launch {
|
||||||
delay(5.seconds)
|
delay(3.seconds)
|
||||||
requestMap.remove(event.sender.id)
|
requestMap.remove(event.subject.id)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user