summaryrefslogtreecommitdiff
path: root/ATRI/plugins/GetChatMSG.py
diff options
context:
space:
mode:
Diffstat (limited to 'ATRI/plugins/GetChatMSG.py')
-rw-r--r--ATRI/plugins/GetChatMSG.py33
1 files changed, 0 insertions, 33 deletions
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()
-
-
[email protected]_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