From f6e28c01b4e6039f8b5b0eff089723a6c3e4916f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BB=91=E8=B4=A8?= Date: Tue, 20 Jun 2023 10:54:01 +0800 Subject: [PATCH] =?UTF-8?q?=E7=89=88=E6=9C=AC=E6=8E=A8=E8=BF=9B=E8=87=B30.?= =?UTF-8?q?2.12=EF=BC=8C=E5=BC=95=E5=85=A5DICE-=E5=89=8D=E7=BC=80=E6=B3=A8?= =?UTF-8?q?=E5=86=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ChanceCustom/app.json | 4 ++-- ChanceCustom/main.py | 4 ++-- ChanceCustom/replyOlivaDice.py | 22 +++++++++++++++++++++- ChanceCustom/replyReg.py | 1 + 4 files changed, 26 insertions(+), 5 deletions(-) diff --git a/ChanceCustom/app.json b/ChanceCustom/app.json index 403ef75..87e714b 100644 --- a/ChanceCustom/app.json +++ b/ChanceCustom/app.json @@ -4,8 +4,8 @@ "namespace" : "ChanceCustom", "info" : "以自定义回复为核心,附带群管、监控、词库、语音、图片、调用接口、对接网站、黑白名单、定时任务、网页爬虫、简单编程、入群验证、发言限制、简易QQ、Web服务器、制作接口等功能。交流群661366095", "priority" : 40000, - "version" : "0.2.11", - "svn" : 26, + "version" : "0.2.12", + "svn" : 27, "compatible_svn" : 101, "message_mode" : "old_string", "support" : [ diff --git a/ChanceCustom/main.py b/ChanceCustom/main.py index 89a6621..126a598 100644 --- a/ChanceCustom/main.py +++ b/ChanceCustom/main.py @@ -18,8 +18,8 @@ import platform -version = '0.2.11' -svn = 26 +version = '0.2.12' +svn = 27 version_full = '%s(%d)' % (version, svn) diff --git a/ChanceCustom/replyOlivaDice.py b/ChanceCustom/replyOlivaDice.py index 242560d..3050cc4 100644 --- a/ChanceCustom/replyOlivaDice.py +++ b/ChanceCustom/replyOlivaDice.py @@ -274,9 +274,29 @@ def CommandReg_f(matched:'re.Match|dict'): ChanceCustom.replyBase.getCharRegTotal(resDict, '指令前缀', '', groupDict, valDict) commandPrefix = resDict['指令前缀'] - if 'replyContextFliter' in OlivaDiceCore.crossHook.dictHookList: + if 'replyContextFliter' in OlivaDiceCore.crossHook.dictHookList \ + and len(commandPrefix) > 0: OlivaDiceCore.crossHook.dictHookList['replyContextFliter'].append(commandPrefix) return res return CommandReg_f return CommandRegFun + +def PrefixRegFunTemp(): + def PrefixRegFun(valDict): + def PrefixReg_f(matched:'re.Match|dict'): + groupDict = ChanceCustom.replyBase.getGroupDictInit(matched) + res = '' + if 'OlivaDiceCore' in ChanceCustom.load.listPlugin: + import OlivaDiceCore + resDict = {} + ChanceCustom.replyBase.getCharRegTotal(resDict, '屏蔽前缀', '', groupDict, valDict) + commandPrefix = resDict['屏蔽前缀'] + + if 'replyContextFliter' in OlivaDiceCore.crossHook.dictHookList \ + and len(commandPrefix) > 0: + OlivaDiceCore.crossHook.dictHookList['replyContextPrefixFliter'].append(commandPrefix) + + return res + return PrefixReg_f + return PrefixRegFun diff --git a/ChanceCustom/replyReg.py b/ChanceCustom/replyReg.py index 9176560..ab8944d 100644 --- a/ChanceCustom/replyReg.py +++ b/ChanceCustom/replyReg.py @@ -153,6 +153,7 @@ ['解锁人物卡', [], ChanceCustom.replyOlivaDice.PcLockSetFunTemp(action = 'unlock')], ['DICE-指令注册', ['指令前缀'], ChanceCustom.replyOlivaDice.CommandRegFunTemp()], + ['DICE-前缀注册', ['屏蔽前缀'], ChanceCustom.replyOlivaDice.PrefixRegFunTemp()], # >算法计算< ['计算', ['计算公式'], ChanceCustom.replyEval.evalExprFunTemp()],