From 88f4069c8e342e6e28e178dafc1aae964df89eab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=AF=BB=E6=AC=A2?= Date: Sat, 17 Aug 2024 13:16:05 +0800 Subject: [PATCH] =?UTF-8?q?:new:=20=E6=96=B0=E5=A2=9E`=E6=AF=8F=E6=97=A5?= =?UTF-8?q?=E5=85=8D=E8=B4=B9AI=E5=AF=B9=E8=AF=9D=E6=AC=A1=E6=95=B0?= =?UTF-8?q?=E9=99=90=E5=88=B6`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugin/plugins/ai.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/plugin/plugins/ai.go b/plugin/plugins/ai.go index 7d907b0..814a307 100644 --- a/plugin/plugins/ai.go +++ b/plugin/plugins/ai.go @@ -19,6 +19,8 @@ import ( "time" ) +var notifyMap = make(map[string]bool) + // AI // @description: AI消息 // @param m @@ -38,8 +40,14 @@ func AI(m *plugin.MessageContext) { return } if friendInfo.AiUsedToday > 0 && friendInfo.AiUsedToday >= friendInfo.AiFreeLimit { + if notifyMap[m.FromUser] { + 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