Skip to content

Commit

Permalink
版本推进至0.2.12,引入DICE-前缀注册
Browse files Browse the repository at this point in the history
  • Loading branch information
lunzhiPenxil committed Jun 20, 2023
1 parent 359df22 commit f6e28c0
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 5 deletions.
4 changes: 2 additions & 2 deletions ChanceCustom/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -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" : [
Expand Down
4 changes: 2 additions & 2 deletions ChanceCustom/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@

import platform

version = '0.2.11'
svn = 26
version = '0.2.12'
svn = 27

version_full = '%s(%d)' % (version, svn)

Expand Down
22 changes: 21 additions & 1 deletion ChanceCustom/replyOlivaDice.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions ChanceCustom/replyReg.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@
['解锁人物卡', [], ChanceCustom.replyOlivaDice.PcLockSetFunTemp(action = 'unlock')],

['DICE-指令注册', ['指令前缀'], ChanceCustom.replyOlivaDice.CommandRegFunTemp()],
['DICE-前缀注册', ['屏蔽前缀'], ChanceCustom.replyOlivaDice.PrefixRegFunTemp()],

# >算法计算<
['计算', ['计算公式'], ChanceCustom.replyEval.evalExprFunTemp()],
Expand Down

0 comments on commit f6e28c0

Please sign in to comment.