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 suspend fun startChat(event: MessageEvent) {
|
||||
if (!requestMap.add(event.sender.id)) {
|
||||
event.subject.sendMessage("再等等...")
|
||||
if (!requestMap.add(event.subject.id)) {
|
||||
logger.warning("The current Contact is busy!")
|
||||
return
|
||||
}
|
||||
|
||||
@ -397,8 +397,8 @@ object JChatGPT : KotlinPlugin(
|
||||
} finally {
|
||||
// 一段时间后才允许再次提问,防止高频对话
|
||||
launch {
|
||||
delay(5.seconds)
|
||||
requestMap.remove(event.sender.id)
|
||||
delay(3.seconds)
|
||||
requestMap.remove(event.subject.id)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user