hotfix #94

Merged
李寻欢 merged 3 commits from hotfix into main 2024-08-17 13:16:26 +08:00
Showing only changes of commit 88f4069c8e - Show all commits

View File

@ -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() {