diff --git a/ChatClass.py b/ChatClass.py index 5f65f6e..e531178 100644 --- a/ChatClass.py +++ b/ChatClass.py @@ -5,10 +5,11 @@ import threading import time import traceback +import platform import simuse -version = '2.8.0' +version = '2.8.1' # 控制台指令类 diff --git a/ChatFilter.py b/ChatFilter.py index ad59d80..21eb689 100644 --- a/ChatFilter.py +++ b/ChatFilter.py @@ -542,6 +542,8 @@ def Merge_Filter(): Filterconfiglist = list(set(Filterconfiglist)) except: print(filename, '合并错误') + else: + print(filename, '合并完成') FilterConfig = blackcheck() Filterlist_origin = FilterConfig['filter'] Filterlist_origin.extend(Filterconfiglist) @@ -550,5 +552,3 @@ def Merge_Filter(): file = open('Filter.clc', 'w', encoding='utf-8-sig') file.write(str(FilterConfig)) file.close() - if Filterlist != []: - print('合并完成') diff --git a/ChatReply.py b/ChatReply.py index 0d173a3..99ff6f7 100644 --- a/ChatReply.py +++ b/ChatReply.py @@ -29,8 +29,12 @@ def DelType(tempdict, answerlist): try: questiondict = tempdict[str(answertext)] except: - new_answerlist.remove(answerdict) - continue + try: + new_answerlist.remove(answerdict) + except: + pass + num += 1 + deltype = deltype + i['type'] + ' ' try: if questiondict['freq'] < freqdict[i['type']]: new_answerlist.remove(answerdict) @@ -40,7 +44,7 @@ def DelType(tempdict, answerlist): except: continue if num != 0: - print('已过滤{}个不符合发送要求的{}'.format(num, deltype)) + print('已过滤{}个不符合发送要求的{}'.format(num, ','.join(set(deltype.split())))) return new_answerlist diff --git a/Chatmain.py b/Chatmain.py index f1cac2f..42f50cc 100644 --- a/Chatmain.py +++ b/Chatmain.py @@ -41,7 +41,7 @@ def hello(): ClChange() config['version'] = '2.7.0' Cl_version(config['version']) - config=Config_version(config['version']) + config = Config_version(config['version']) config['version'] = Version() file = open('config.clc', 'w', encoding='utf-8-sig') file.write(str(config)) @@ -1417,6 +1417,7 @@ def commandchoice(command, fromchat=0): global adminsign global voicereplysign command = command.lower() + command = ' '.join(command.split()) commandlist = commandclass(data, command) if command[:8] == 'learning': if command == 'learning':