From cec804951b97bcab81551bb8c7a1a1e1c473aaa7 Mon Sep 17 00:00:00 2001 From: Kyomotoi <1172294279@qq.com> Date: Wed, 7 Oct 2020 13:03:27 +0800 Subject: [Update] --- ATRI/plugins/GetChatMSG.py | 33 --------------------------------- 1 file changed, 33 deletions(-) delete mode 100644 ATRI/plugins/GetChatMSG.py (limited to 'ATRI/plugins/GetChatMSG.py') diff --git a/ATRI/plugins/GetChatMSG.py b/ATRI/plugins/GetChatMSG.py deleted file mode 100644 index 9b4adb8..0000000 --- a/ATRI/plugins/GetChatMSG.py +++ /dev/null @@ -1,33 +0,0 @@ -import os -import json -import nonebot -from pathlib import Path - - -bot = nonebot.get_bot() - - -@bot.on_message('group') -async def _(ctx): - group = ctx['group_id'] - user = ctx['user_id'] - msgID = ctx['message_id'] - RAWmsg = ctx['message'] - - try: - with open(Path('.') / 'ATRI' / 'data' / 'groupData' / f'{group}' / 'msgData.json', 'r') as f: - data = json.load(f) - except: - data = {} - - data[f'{msgID}'] = {"msg": f"{RAWmsg}", "user_id": f"{user}"} - - try: - with open(Path('.') / 'ATRI' / 'data' / 'groupData' / f'{group}' / 'msgData.json', 'w') as f: - f.write(json.dumps(data)) - f.close() - except: - os.mkdir(Path('.') / 'ATRI' / 'data' / 'groupData' / f'{group}') - with open(Path('.') / 'ATRI' / 'data' / 'groupData' / f'{group}' / 'msgData.json', 'w') as f: - f.write(json.dumps(data)) - f.close() \ No newline at end of file -- cgit v1.2.3