summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ATRI/plugins/AIchangeFace.py123
-rw-r--r--ATRI/plugins/animeSearch.py (renamed from ATRI/plugins/anime_search.py)0
-rw-r--r--ATRI/plugins/chat.py451
-rw-r--r--ATRI/plugins/checkData.py (renamed from ATRI/plugins/check_data.py)0
-rw-r--r--ATRI/plugins/noobList/noobList.json2
-rw-r--r--ATRI/plugins/setu.py1
-rw-r--r--ATRI/plugins/switch.py20
-rw-r--r--ATRI/plugins/switch/switch.json2
-rw-r--r--ATRI/plugins/wordcloud/wordcloud.json2
9 files changed, 463 insertions, 138 deletions
diff --git a/ATRI/plugins/AIchangeFace.py b/ATRI/plugins/AIchangeFace.py
new file mode 100644
index 0000000..1d82e12
--- /dev/null
+++ b/ATRI/plugins/AIchangeFace.py
@@ -0,0 +1,123 @@
+import os
+import json
+import requests
+import base64
+import nonebot
+import time
+from nonebot import on_command, CommandSession
+
+import config # type: ignore
+
+
+bot = nonebot.get_bot()
+master = config.MASTER()
+key = config.FACE_KEY()
+secret = config.FACE_SECRET()
+
+
+#获取图片的人脸特征参数
+def find_face(imgpath):
+ url='https://api-cn.faceplusplus.com/facepp/v3/detect'
+ data = {'api_key':key,'api_secret':secret,'image_url':imgpath,'return_landmark':1}
+ files = {'image_file':open(imgpath,'rb')}
+ response = requests.post(url,data=data,files=files)
+ res_json = response.json()
+ faces = res_json['faces'][0]['face_rectangle'] #获取面部大小的四个值,分别为长宽高低{'width': 176, 'top': 128, 'left': 80, 'height': 176}
+ return faces
+
+
+#换脸,函数传参中number表示两张脸的相似度为99%
+def change_face(image_1, image_2, user, number=99):
+ url = "https://api-cn.faceplusplus.com/imagepp/v1/mergeface"
+ find_p1 = find_face(image_1)
+ find_p2 = find_face(image_2)
+ rectangle1 = str(str(find_p1['top'])+','+str(find_p1['left'])+','+str(find_p1['width'])+','+str(find_p1['height'])) #得到一个坐标
+ rectangle2 = str(str(find_p2['top'])+','+str(find_p2['left'])+','+str(find_p2['width'])+','+str(find_p2['height']))
+
+ page1 = open(image_1,'rb') #以二进制打开图片1
+ page1_64 = base64.b64encode(page1.read()) #将字符串转成成base64编码
+ page1.close()
+
+ page2 = open(image_2,'rb')
+ page2_64 = base64.b64encode(page2.read())
+ page2.close()
+
+ data = {'api_key':key,'api_secret':secret,'template_base64':page1_64,
+ 'template_rectangle':rectangle1,'merge_base64':page2_64,'merge_rectangele':rectangle2,'merge_rate':number}
+ response = requests.post(url,data=data).json()
+ results = response['result']
+ image = base64.b64decode(results)
+ files = f'ATRI/data/temp/face/{user}'
+ if not os.path.exists(files):
+ os.mkdir(files)
+ with open(files + '/img3.jpg','wb') as file:
+ file.write(image)
+ print('success!')
+
+
+# change_face('1.jpg','2.jpg')
+
+
+@on_command('ai_ch_face', aliases = ['AI换脸', 'ai换脸'], only_to_me = False)
+async def _(session: CommandSession):
+ user = session.event.user_id
+ with open("ATRI/plugins/switch/switch.json", 'r') as f:
+ data = json.load(f)
+
+ if data["change_face"] == 0:
+ with open('ATRI/plugins/noobList/noobList.json', 'r') as f:
+ data0 = json.load(f)
+
+ if str(user) in data0.keys():
+ pass
+ else:
+ img1 = session.get('message1', prompt = '请发送需要换脸的图片')
+ print(img1)
+ img2 = session.get('message2', prompt = '请发送素材图片')
+
+ # 我承认了,我是取名废!
+ a = img1.split(',')
+ a = a[2].replace(']', '')
+ a = a.replace('url=', '')
+ print(a)
+ imgres1 = requests.get(a)
+
+ b = img2.split(',')
+ b = b[2].replace(']', '')
+ b = b.replace('url=', '')
+ imgres2 = requests.get(b)
+
+ try:
+ file1 = f'ATRI/data/temp/face/{user}'
+ if not os.path.exists(file1):
+ os.mkdir(file1)
+ with open(file1 + '/img1.jpg', 'wb') as f:
+ f.write(imgres1.content)
+
+ file2 = f'ATRI/data/temp/face/{user}'
+ if not os.path.exists(file2):
+ os.mkdir(file2)
+ with open(file2 + '/img2.jpg', 'wb') as f:
+ f.write(imgres2.content)
+ except:
+ session.finish('请求数据貌似失败了...')
+
+ img1File = f'ATRI/data/temp/face/{user}/img1.jpg'
+ img2File = f'ATRI/data/temp/face/{user}/img2.jpg'
+
+ try:
+ change_face(img1File, img2File, user)
+ except:
+ session.finish('emm...貌似失败了呢......')
+
+ time.sleep(0.5)
+ doneIMG = f'ATRI/data/temp/face/{user}/img3.jpg'
+ img = os.path.abspath(doneIMG)
+ await session.send(f'[CQ:image,file=file:///{img}]')
+ files = f'ATRI/data/temp/face/{user}'
+ os.remove(files)
+
+
+@on_command('change_u_head', aliases = ['接头霸王'], only_to_me = False)
+async def _(session: CommandSession):
+ pass # 明天做 \ No newline at end of file
diff --git a/ATRI/plugins/anime_search.py b/ATRI/plugins/animeSearch.py
index 0ef3388..0ef3388 100644
--- a/ATRI/plugins/anime_search.py
+++ b/ATRI/plugins/animeSearch.py
diff --git a/ATRI/plugins/chat.py b/ATRI/plugins/chat.py
index 9ca5251..846694f 100644
--- a/ATRI/plugins/chat.py
+++ b/ATRI/plugins/chat.py
@@ -2,7 +2,6 @@ import os
import re
import json
import nonebot
-import random
import warnings
from pathlib import Path
import numpy as np
@@ -284,17 +283,30 @@ async def az(session: CommandSession):
if str(user) in data.keys():
pass
else:
- res = randint(1,3)
- if res == 1:
- # res = random.randint(1,10)
- img = choice(
- [
- 'AZ.jpg', 'AZ1.jpg', 'AZ2.jpg', 'AZ3.png', 'ZN.jpg'
- ]
+ if 0 <= now_time() < 5.5:
+ await session.send(
+ choice(
+ [
+ 'zzzz......',
+ 'zzzzzzzz......',
+ 'zzz...好涩哦..zzz....',
+ '别...不要..zzz..那..zzz..',
+ '嘻嘻..zzz..呐~..zzzz..'
+ ]
+ )
)
- img = Path('.') / 'ATRI' / 'data' / 'emoji' / f'{img}'
- img = os.path.abspath(img)
- await session.send(f'[CQ:image,file=file:///{img}]')
+ else:
+ res = randint(1,3)
+ if res == 1:
+ # res = random.randint(1,10)
+ img = choice(
+ [
+ 'AZ.jpg', 'AZ1.jpg', 'AZ2.jpg', 'AZ3.png', 'ZN.jpg'
+ ]
+ )
+ img = Path('.') / 'ATRI' / 'data' / 'emoji' / f'{img}'
+ img = os.path.abspath(img)
+ await session.send(f'[CQ:image,file=file:///{img}]')
@on_command('suki', patterns = [r"喜欢|爱你|爱|suki|daisuki|すき|好き|贴贴|老婆|[Mm][Uu][Aa]|亲一个"], only_to_me = True)
async def az(session: CommandSession):
@@ -305,27 +317,40 @@ async def az(session: CommandSession):
if str(user) in data.keys():
pass
else:
- res = randint(1,3)
- if res == 1:
- # res = random.randint(1,10)
- img = choice(
- [
- 'SUKI.jpg', 'SUKI1.jpg', 'SUKI2.jpg','HE1.jpg'
- ]
- )
- img = Path('.') / 'ATRI' / 'data' / 'emoji' / f'{img}'
- img = os.path.abspath(img)
- await session.send(f'[CQ:image,file=file:///{img}]')
-
- elif 2 <= res <= 3:
- img = choice(
- [
- 'TZ.jpg', 'TZ1.jpg', 'TZ1.jpg'
- ]
+ if 0 <= now_time() < 5.5:
+ await session.send(
+ choice(
+ [
+ 'zzzz......',
+ 'zzzzzzzz......',
+ 'zzz...好涩哦..zzz....',
+ '别...不要..zzz..那..zzz..',
+ '嘻嘻..zzz..呐~..zzzz..'
+ ]
+ )
)
- img = Path('.') / 'ATRI' / 'data' / 'emoji' / f'{img}'
- img = os.path.abspath(img)
- await session.send(f'[CQ:image,file=file:///{img}]')
+ else:
+ res = randint(1,3)
+ if res == 1:
+ # res = random.randint(1,10)
+ img = choice(
+ [
+ 'SUKI.jpg', 'SUKI1.jpg', 'SUKI2.png', 'HE1.jpg'
+ ]
+ )
+ img = Path('.') / 'ATRI' / 'data' / 'emoji' / f'{img}'
+ img = os.path.abspath(img)
+ await session.send(f'[CQ:image,file=file:///{img}]')
+
+ elif 2 <= res <= 3:
+ img = choice(
+ [
+ 'TZ.jpg', 'TZ1.jpg', 'TZ2.jpg'
+ ]
+ )
+ img = Path('.') / 'ATRI' / 'data' / 'emoji' / f'{img}'
+ img = os.path.abspath(img)
+ await session.send(f'[CQ:image,file=file:///{img}]')
@on_command('wenhao', patterns = [r"'?'|?"], only_to_me = False)
@@ -337,29 +362,76 @@ async def _(session: CommandSession):
if str(user) in data.keys():
pass
else:
- res = randint(1,3)
- if res == 1:
- res = randint(1,5)
- if 1 <= res < 2:
- await session.send(
- choice(
+ if 0 <= now_time() < 5.5:
+ await session.send(
+ choice(
+ [
+ 'zzzz......',
+ 'zzzzzzzz......',
+ 'zzz...好涩哦..zzz....',
+ '别...不要..zzz..那..zzz..',
+ '嘻嘻..zzz..呐~..zzzz..'
+ ]
+ )
+ )
+ else:
+ res = randint(1,3)
+ if res == 1:
+ res = randint(1,5)
+ if 1 <= res < 2:
+ await session.send(
+ choice(
+ [
+ '?', '?', '嗯?', '(。´・ω・)ん?', 'ん?'
+ ]
+ )
+ )
+
+ elif 2 <= res <= 5:
+ img = choice(
[
- '?', '?', '嗯?', '(。´・ω・)ん?', 'ん?'
+ 'WH.jpg', 'WH1.jpg', 'WH2.jpg', 'WH3.jpg', 'WH4.jpg'
]
)
+ img = Path('.') / 'ATRI' / 'data' / 'emoji' / f'{img}'
+ img = os.path.abspath(img)
+ await session.send(f'[CQ:image,file=file:///{img}]')
+
+@on_command('yn', patterns = [r"是[吗]|是否"], only_to_me = False)
+async def _(session: CommandSession):
+ user = session.event.user_id
+ with open('ATRI/plugins/noobList/noobList.json', 'r') as f:
+ data = json.load(f)
+
+ if str(user) in data.keys():
+ pass
+ else:
+ if 0 <= now_time() < 5.5:
+ await session.send(
+ choice(
+ [
+ 'zzzz......',
+ 'zzzzzzzz......',
+ 'zzz...好涩哦..zzz....',
+ '别...不要..zzz..那..zzz..',
+ '嘻嘻..zzz..呐~..zzzz..'
+ ]
)
-
- elif 2 <= res <= 5:
+ )
+ else:
+ if randint(1,3) == 1:
img = choice(
[
- 'WH.jpg', 'WH1.jpg', 'WH2.jpg', 'WH3.jpg', 'WH4.jpg'
+ 'YIQI_YES.png', 'YIQI_NO.jpg', 'KD.jpg', 'FD.jpg'
]
)
img = Path('.') / 'ATRI' / 'data' / 'emoji' / f'{img}'
img = os.path.abspath(img)
await session.send(f'[CQ:image,file=file:///{img}]')
-@on_command('yn', patterns = [r"是[吗]|是否"], only_to_me = False)
+
+
+@on_command('kouchou', patterns = [r"草你妈|操|你妈|脑瘫|废柴|fw|five|废物|战斗|爬|爪巴|sb|SB|啥[b批比逼]|傻b|2b|给👴爬|嘴臭"], only_to_me = False)
async def _(session: CommandSession):
user = session.event.user_id
with open('ATRI/plugins/noobList/noobList.json', 'r') as f:
@@ -368,19 +440,46 @@ async def _(session: CommandSession):
if str(user) in data.keys():
pass
else:
- if randint(1,3) == 1:
- img = choice(
- [
- 'YIQI_YES.png', 'YIQI_NO.jpg', 'KD.jpg', 'FD.jpg'
- ]
+ if 0 <= now_time() < 5.5:
+ await session.send(
+ choice(
+ [
+ 'zzzz......',
+ 'zzzzzzzz......',
+ 'zzz...好涩哦..zzz....',
+ '别...不要..zzz..那..zzz..',
+ '嘻嘻..zzz..呐~..zzzz..'
+ ]
+ )
)
- img = Path('.') / 'ATRI' / 'data' / 'emoji' / f'{img}'
- img = os.path.abspath(img)
- await session.send(f'[CQ:image,file=file:///{img}]')
-
+ else:
+ if randint(1,2) == 1:
+ res = randint(1,3)
+ if res == 1:
+ img = choice(
+ [
+ 'WQ.jpg', 'WQ.png', 'WQ1.jpg', 'WQ2.jpg', 'FN.jpg'
+ ]
+ )
+ img = Path('.') / 'ATRI' / 'data' / 'emoji' / f'{img}'
+ img = os.path.abspath(img)
+ await session.send(f'[CQ:image,file=file:///{img}]')
+ elif res == 2:
+ res = randint(1,3)
+ if res == 1:
+ await session.send('对嘴臭人以火箭组合必杀拳,来让他好好喝一壶!哼!')
+
+ elif res == 2:
+ await session.send('鱼雷组合拳——————————————————啊————!!!')
+
+ elif res == 3:
+ await session.send('火箭拳——————————————————————————!!!')
+
+ elif res == 3:
+ await session.send(response.request_api(KC_URL))
-@on_command('kouchou', patterns = [r"草你妈|操|你妈|脑瘫|废柴|fw|five|废物|战斗|爬|爪巴|sb|SB|啥[b批比逼]|傻b|2b|给👴爬|嘴臭"], only_to_me = False)
+@on_command('ciallo', patterns = [r"[Cc][iI][aA][lL][lL][oO]"], only_to_me = False)
async def _(session: CommandSession):
user = session.event.user_id
with open('ATRI/plugins/noobList/noobList.json', 'r') as f:
@@ -389,33 +488,35 @@ async def _(session: CommandSession):
if str(user) in data.keys():
pass
else:
- if randint(1,2) == 1:
- res = randint(1,3)
- if res == 1:
- img = choice(
+ if 0 <= now_time() < 5.5:
+ await session.send(
+ choice(
[
- 'WQ.jpg', 'WQ.png', 'WQ2.jpg', 'WQ3.jpg', 'FN.jpg'
+ 'zzzz......',
+ 'zzzzzzzz......',
+ 'zzz...好涩哦..zzz....',
+ '别...不要..zzz..那..zzz..',
+ '嘻嘻..zzz..呐~..zzzz..'
]
)
- img = Path('.') / 'ATRI' / 'data' / 'emoji' / f'{img}'
- img = os.path.abspath(img)
- await session.send(f'[CQ:image,file=file:///{img}]')
-
- elif res == 2:
- res = randint(1,3)
+ )
+ else:
+ if randint(1,2) == 1:
+ res = randint(1,2)
if res == 1:
- await session.send('对嘴臭人以火箭组合必杀拳,来让他好好喝一壶!哼!')
+ img = choice(
+ [
+ 'CIALLO.jpg', 'CIALLO1.jpg', 'CIALLO2.jpg', 'CIALLO3.jpg', 'CIALLO4.jpg', 'CIALLO5.jpg'
+ ]
+ )
+ img = Path('.') / 'ATRI' / 'data' / 'emoji' / f'{img}'
+ img = os.path.abspath(img)
+ await session.send(f'[CQ:image,file=file:///{img}]')
elif res == 2:
- await session.send('鱼雷组合拳——————————————————啊————!!!')
-
- elif res == 3:
- await session.send('火箭拳——————————————————————————!!!')
-
- elif res == 3:
- await session.send(response.request_api(KC_URL))
+ await session.send('Ciallo~(∠・ω< )⌒★')
-@on_command('ciallo', patterns = [r"[Cc][iI][aA][lL][lL][oO]"], only_to_me = False)
+@on_command('ne', patterns = [r"呐|ねえ|口内"], only_to_me = False)
async def _(session: CommandSession):
user = session.event.user_id
with open('ATRI/plugins/noobList/noobList.json', 'r') as f:
@@ -424,22 +525,61 @@ async def _(session: CommandSession):
if str(user) in data.keys():
pass
else:
- if randint(1,2) == 1:
- res = randint(1,2)
- if res == 1:
+ if 0 <= now_time() < 5.5:
+ await session.send(
+ choice(
+ [
+ 'zzzz......',
+ 'zzzzzzzz......',
+ 'zzz...好涩哦..zzz....',
+ '别...不要..zzz..那..zzz..',
+ '嘻嘻..zzz..呐~..zzzz..'
+ ]
+ )
+ )
+ else:
+ if randint(1,3) == 1:
+ await session.send(
+ choice(
+ [
+ '呐', '呐呐呐', 'ねえ', 'ねえねえ'
+ ]
+ )
+ )
+
+@on_command('kani', patterns = [r"螃蟹|🦀|カニ|[kK]ani"], only_to_me = False)
+async def _(session: CommandSession):
+ user = session.event.user_id
+ with open('ATRI/plugins/noobList/noobList.json', 'r') as f:
+ data = json.load(f)
+
+ if str(user) in data.keys():
+ pass
+ else:
+ if 0 <= now_time() < 5.5:
+ await session.send(
+ choice(
+ [
+ 'zzzz......',
+ 'zzzzzzzz......',
+ 'zzz...好涩哦..zzz....',
+ '别...不要..zzz..那..zzz..',
+ '嘻嘻..zzz..呐~..zzzz..'
+ ]
+ )
+ )
+ else:
+ if randint(1,2) == 1:
img = choice(
[
- 'CIALLO.jpg', 'CIALLO1.jpg', 'CIALLO2.jpg', 'CIALLO3.jpg', 'CIALLO4.jpg', 'CIALLO5.jpg'
+ 'KN.png', 'KN.jpg', 'KN1.jpg', 'KN2.jpg', 'KN3.png'
]
)
img = Path('.') / 'ATRI' / 'data' / 'emoji' / f'{img}'
img = os.path.abspath(img)
await session.send(f'[CQ:image,file=file:///{img}]')
-
- elif res == 2:
- await session.send('Ciallo~(∠・ω< )⌒★')
-@on_command('ne', patterns = [r"呐|ねえ|口内"], only_to_me = False)
+@on_command('qingjie', patterns = [r"青[洁结]"], only_to_me = False)
async def _(session: CommandSession):
user = session.event.user_id
with open('ATRI/plugins/noobList/noobList.json', 'r') as f:
@@ -448,16 +588,25 @@ async def _(session: CommandSession):
if str(user) in data.keys():
pass
else:
- if randint(1,3) == 1:
+ if 0 <= now_time() < 5.5:
await session.send(
choice(
[
- '呐', '呐呐呐', 'ねえ', 'ねえねえ'
+ 'zzzz......',
+ 'zzzzzzzz......',
+ 'zzz...好涩哦..zzz....',
+ '别...不要..zzz..那..zzz..',
+ '嘻嘻..zzz..呐~..zzzz..'
]
)
)
+ else:
+ if randint(1,2) == 1:
+ img = Path('.') / 'ATRI' / 'data' / 'emoji' / 'H.jpg'
+ img = os.path.abspath(img)
+ await session.send(f'[CQ:image,file=file:///{img}]')
-@on_command('kani', patterns = [r"螃蟹|🦀|カニ|[kK]ani"], only_to_me = False)
+@on_command('jz', patterns = [r"就这"], only_to_me = False)
async def _(session: CommandSession):
user = session.event.user_id
with open('ATRI/plugins/noobList/noobList.json', 'r') as f:
@@ -466,17 +615,30 @@ async def _(session: CommandSession):
if str(user) in data.keys():
pass
else:
- if randint(1,2) == 1:
- img = choice(
- [
- 'KN.png', 'KN.jpg', 'KN1.jpg', 'KN2.jpg', 'KN3.png'
- ]
+ if 0 <= now_time() < 5.5:
+ await session.send(
+ choice(
+ [
+ 'zzzz......',
+ 'zzzzzzzz......',
+ 'zzz...好涩哦..zzz....',
+ '别...不要..zzz..那..zzz..',
+ '嘻嘻..zzz..呐~..zzzz..'
+ ]
+ )
)
- img = Path('.') / 'ATRI' / 'data' / 'emoji' / f'{img}'
- img = os.path.abspath(img)
- await session.send(f'[CQ:image,file=file:///{img}]')
+ else:
+ if randint(1,2) == 1:
+ img = choice(
+ [
+ 'JZ.png', 'JZ1.png'
+ ]
+ )
+ img = Path('.') / 'ATRI' / 'data' / 'emoji' / f'{img}'
+ img = os.path.abspath(img)
+ await session.send(f'[CQ:image,file=file:///{img}]')
-@on_command('hai', patterns = [r"青[洁结]"], only_to_me = False)
+@on_command('hai', patterns = [r"害|嗐"], only_to_me = False)
async def _(session: CommandSession):
user = session.event.user_id
with open('ATRI/plugins/noobList/noobList.json', 'r') as f:
@@ -485,12 +647,26 @@ async def _(session: CommandSession):
if str(user) in data.keys():
pass
else:
- if randint(1,2) == 1:
- img = Path('.') / 'ATRI' / 'data' / 'emoji' / 'H.jpg'
- await session.send(f'[CQ:image,file=file:///{img}]')
+ if 0 <= now_time() < 5.5:
+ await session.send(
+ choice(
+ [
+ 'zzzz......',
+ 'zzzzzzzz......',
+ 'zzz...好涩哦..zzz....',
+ '别...不要..zzz..那..zzz..',
+ '嘻嘻..zzz..呐~..zzzz..'
+ ]
+ )
+ )
+ else:
+ if randint(1,2) == 1:
+ img = Path('.') / 'ATRI' / 'data' / 'emoji' / 'H.jpg'
+ img = os.path.abspath(img)
+ await session.send(f'[CQ:image,file=file:///{img}]')
noobList = []
-@on_command('ntr', patterns = [r"[nN][tT][rR]|[牛🐂]头人"], only_to_me = False)
+@on_command('ntr', patterns = [r"[nNηиɴИ][tT][rR]|[牛🐂]头人"], only_to_me = False)
async def _(session: CommandSession):
global noobList
user = session.event.user_id
@@ -500,40 +676,53 @@ async def _(session: CommandSession):
if str(user) in data.keys():
pass
else:
- msg = str(session.event.message)
- bL = {}
- pattern = r"[nN][tT][rR]|[牛🐂]头人"
- if re.findall(pattern, msg):
- await session.send('你妈的,牛头人,' + response.request_api(KC_URL))
- noobList.append(user)
- print(noobList)
- print(countX(noobList, user))
- if countX(noobList, user) == 5:
- if user == master:
- await session.send('是主人的话...那算了...呜呜\n即使到达了ATRI的最低忍耐限度......')
- noobList = list(set(noobList))
- pass
+ if 0 <= now_time() < 5.5:
+ await session.send(
+ choice(
+ [
+ 'zzzz......',
+ 'zzzzzzzz......',
+ 'zzz...好涩哦..zzz....',
+ '别...不要..zzz..那..zzz..',
+ '嘻嘻..zzz..呐~..zzzz..'
+ ]
+ )
+ )
+ else:
+ msg = str(session.event.message)
+ bL = {}
+ pattern = r"[nNηиɴИ][tT][rR]|[牛🐂]头人"
+ if re.findall(pattern, msg):
+ await session.send('你妈的,牛头人,' + response.request_api(KC_URL))
+ noobList.append(user)
+ print(noobList)
+ print(countX(noobList, user))
+ if countX(noobList, user) == 5:
+ if user == master:
+ await session.send('是主人的话...那算了...呜呜\n即使到达了ATRI的最低忍耐限度......')
+ noobList = list(set(noobList))
+ pass
+
+ else:
+ await session.send(f'[CQ:at,qq={user}]哼!接下来10分钟别想让我理你!')
+ bL[f"{user}"] = f"{user}"
+ file = Path('.') / 'ATRI' / 'plugins' / 'noobList' / 'noobList.json'
+ f = open(file, 'w')
+ f.write(json.dumps(bL))
+ f.close()
+ noobList = list(set(noobList))
+ print(noobList)
+ delta = timedelta(minutes = 10)
+ trigger = DateTrigger(
+ run_date = datetime.now() + delta
+ )
+
+ scheduler.add_job( #type: ignore
+ func = rmQQfromNoobLIST,
+ trigger = trigger,
+ args = (user),
+ misfire_grace_time = 60,
+ )
else:
- await session.send(f'[CQ:at,qq={user}]哼!接下来10分钟别想让我理你!')
- bL[f"{user}"] = f"{user}"
- file = Path('.') / 'ATRI' / 'plugins' / 'noobList' / 'noobList.json'
- f = open(file, 'w')
- f.write(json.dumps(bL))
- f.close()
- noobList = list(set(noobList))
- print(noobList)
- delta = timedelta(minutes = 10)
- trigger = DateTrigger(
- run_date = datetime.now() + delta
- )
-
- scheduler.add_job( #type: ignore
- func = rmQQfromNoobLIST,
- trigger = trigger,
- args = (user),
- misfire_grace_time = 60,
- )
-
- else:
- pass \ No newline at end of file
+ pass \ No newline at end of file
diff --git a/ATRI/plugins/check_data.py b/ATRI/plugins/checkData.py
index 0fd7217..0fd7217 100644
--- a/ATRI/plugins/check_data.py
+++ b/ATRI/plugins/checkData.py
diff --git a/ATRI/plugins/noobList/noobList.json b/ATRI/plugins/noobList/noobList.json
index 6e1ba39..97784a6 100644
--- a/ATRI/plugins/noobList/noobList.json
+++ b/ATRI/plugins/noobList/noobList.json
@@ -1 +1 @@
-{"123": "123"} \ No newline at end of file
+{"2827187244": "2827187244"} \ No newline at end of file
diff --git a/ATRI/plugins/setu.py b/ATRI/plugins/setu.py
index d7f6c40..fecba94 100644
--- a/ATRI/plugins/setu.py
+++ b/ATRI/plugins/setu.py
@@ -129,6 +129,7 @@ async def setu(session: CommandSession):
]
)
img = Path('.') / 'ATRI' / 'data' / 'img' / 'niceIMG' / f'{img}'
+ img = os.path.abspath(img)
await session.send(f'[CQ:image,file=file:///{img}]')
else:
diff --git a/ATRI/plugins/switch.py b/ATRI/plugins/switch.py
index 810dac8..efc84f2 100644
--- a/ATRI/plugins/switch.py
+++ b/ATRI/plugins/switch.py
@@ -19,13 +19,13 @@ async def _(session: CommandSession):
com = command[1]
if switch == '开启':
- if com == 'p站搜图':
+ if com == 'p站搜图' or 'P站搜图':
data["pixiv_seach_img"] = 0
elif com == '画师':
data["pixiv_seach_author"] = 0
- elif com == 'P站排行榜':
+ elif com == 'P站排行榜' or 'P站排行榜':
data["pixiv_daily_rank"] = 0
elif com == '好友添加':
@@ -40,17 +40,23 @@ async def _(session: CommandSession):
elif com == '本子':
data["hbook"] = 0
+ elif com == 'AI换脸' or 'ai换脸':
+ data["change_face"] = 0
+
+ elif com == '接头霸王':
+ data["chouYou"] = 0
+
else:
pass
elif switch == '关闭':
- if com == 'p站搜图':
+ if com == 'p站搜图' or 'P站搜图':
data["pixiv_seach_img"] = 1
elif com == '画师':
data["pixiv_seach_author"] = 1
- elif com == 'P站排行榜':
+ elif com == 'P站排行榜' or 'p站排行榜':
data["pixiv_daily_rank"] = 1
elif com == '好友添加':
@@ -65,6 +71,12 @@ async def _(session: CommandSession):
elif com == '本子':
data["hbook"] = 1
+ elif com == 'AI换脸' or 'ai换脸':
+ data["change_face"] = 1
+
+ elif com == '接头霸王':
+ data["chouYou"] = 1
+
else:
pass
diff --git a/ATRI/plugins/switch/switch.json b/ATRI/plugins/switch/switch.json
index 99d82c4..45cbf5b 100644
--- a/ATRI/plugins/switch/switch.json
+++ b/ATRI/plugins/switch/switch.json
@@ -1 +1 @@
-{"pixiv_seach_img": 0, "pixiv_seach_author": 1, "pixiv_daily_rank": 0, "approve_friend_add": 0, "approve_invite_join_group": 0, "setu": 0, "hbook": 0} \ No newline at end of file
+{"pixiv_seach_img": 0, "pixiv_seach_author": 1, "pixiv_daily_rank": 0, "approve_friend_add": 0, "approve_invite_join_group": 0, "setu": 0, "hbook": 0, "change_face": 0} \ No newline at end of file
diff --git a/ATRI/plugins/wordcloud/wordcloud.json b/ATRI/plugins/wordcloud/wordcloud.json
index fb478b5..251f666 100644
--- a/ATRI/plugins/wordcloud/wordcloud.json
+++ b/ATRI/plugins/wordcloud/wordcloud.json
@@ -1 +1 @@
-{"test": ["TesT is SuccEss!", 1]} \ No newline at end of file
+{"test": ["TesT is SuccEss!", 1], "\u4e09\u6b21\u5143\u722c": ["\u4e09\u6b21\u5143\u722c", 5]} \ No newline at end of file