add function: reload dictionary

master
alansnape 6 years ago
parent 1b88b52ed6
commit 7fc3bd06f4

@ -72,6 +72,14 @@ def solveSticker(message):
print('unknown sticker: ' + fileid)
def solveText(message):
global replyMsgArray
text = message['text']
if '/reload_dictionary_config_file' == text:
replyMsgArray = json.load(open('dictionary.json'))
print('dictionary reload.')
def signal_handler(signal, frame):
print('Keyboard interrupt.')
os._exit(0)
@ -92,6 +100,8 @@ def solveRet(jsonstr):
message = updateResult['message']
if 'sticker' in message:
solveSticker(message)
if 'text' in message:
solveText(message)
return nextid, True

Loading…
Cancel
Save