🆕 新增每日免费AI对话次数限制
This commit is contained in:
parent
e08ad4b438
commit
88f4069c8e
@ -19,6 +19,8 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var notifyMap = make(map[string]bool)
|
||||||
|
|
||||||
// AI
|
// AI
|
||||||
// @description: AI消息
|
// @description: AI消息
|
||||||
// @param m
|
// @param m
|
||||||
@ -38,9 +40,15 @@ func AI(m *plugin.MessageContext) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
if friendInfo.AiUsedToday > 0 && friendInfo.AiUsedToday >= friendInfo.AiFreeLimit {
|
if friendInfo.AiUsedToday > 0 && friendInfo.AiUsedToday >= friendInfo.AiFreeLimit {
|
||||||
_ = utils.SendMessage(m.FromUser, "", fmt.Sprintf("本群今天的免费次数已经用完啦,明天再来找我聊天吧~\n每天限制%d次,0点自动重置", friendInfo.AiFreeLimit), 0)
|
if notifyMap[m.FromUser] {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
_ = utils.SendMessage(m.FromUser, "", fmt.Sprintf("本群今天的免费次数已经用完啦,明天再来找我聊天吧~\n每天限制%d次,0点自动重置", friendInfo.AiFreeLimit), 0)
|
||||||
|
notifyMap[m.FromUser] = true
|
||||||
|
return
|
||||||
|
} else {
|
||||||
|
notifyMap[m.FromUser] = false
|
||||||
|
}
|
||||||
|
|
||||||
var err error
|
var err error
|
||||||
defer func() {
|
defer func() {
|
||||||
|
Loading…
Reference in New Issue
Block a user