diff options
author | Kyomotoi <[email protected]> | 2020-10-07 13:03:27 +0800 |
---|---|---|
committer | Kyomotoi <[email protected]> | 2020-10-07 13:03:27 +0800 |
commit | cec804951b97bcab81551bb8c7a1a1e1c473aaa7 (patch) | |
tree | 03b7204af6ebc869e887494ab2609a6e9b7fd72c /ATRI/plugins/GetChatMSG.py | |
parent | ab467e8788b7ef8382bab63fb1a91c8b6305c501 (diff) | |
download | ATRI-cec804951b97bcab81551bb8c7a1a1e1c473aaa7.tar.gz ATRI-cec804951b97bcab81551bb8c7a1a1e1c473aaa7.tar.bz2 ATRI-cec804951b97bcab81551bb8c7a1a1e1c473aaa7.zip |
[Update]
Diffstat (limited to 'ATRI/plugins/GetChatMSG.py')
-rw-r--r-- | ATRI/plugins/GetChatMSG.py | 33 |
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 |