diff options
Diffstat (limited to 'ATRI')
120 files changed, 895 insertions, 44 deletions
diff --git a/ATRI/data/emoji/AZ.jpg b/ATRI/data/emoji/AZ.jpg Binary files differnew file mode 100644 index 0000000..c326755 --- /dev/null +++ b/ATRI/data/emoji/AZ.jpg diff --git a/ATRI/data/emoji/AZ1.jpg b/ATRI/data/emoji/AZ1.jpg Binary files differnew file mode 100644 index 0000000..a57948a --- /dev/null +++ b/ATRI/data/emoji/AZ1.jpg diff --git a/ATRI/data/emoji/AZ2.jpg b/ATRI/data/emoji/AZ2.jpg Binary files differnew file mode 100644 index 0000000..e9f1636 --- /dev/null +++ b/ATRI/data/emoji/AZ2.jpg diff --git a/ATRI/data/emoji/AZ3.png b/ATRI/data/emoji/AZ3.png Binary files differnew file mode 100644 index 0000000..cfc55f8 --- /dev/null +++ b/ATRI/data/emoji/AZ3.png diff --git a/ATRI/data/emoji/CF.jpg b/ATRI/data/emoji/CF.jpg Binary files differnew file mode 100644 index 0000000..798ef6a --- /dev/null +++ b/ATRI/data/emoji/CF.jpg diff --git a/ATRI/data/emoji/CG.gif b/ATRI/data/emoji/CG.gif Binary files differnew file mode 100644 index 0000000..5e82252 --- /dev/null +++ b/ATRI/data/emoji/CG.gif diff --git a/ATRI/data/emoji/CG1.jpg b/ATRI/data/emoji/CG1.jpg Binary files differnew file mode 100644 index 0000000..058abaa --- /dev/null +++ b/ATRI/data/emoji/CG1.jpg diff --git a/ATRI/data/emoji/CIALLO.jpg b/ATRI/data/emoji/CIALLO.jpg Binary files differnew file mode 100644 index 0000000..3d72a7b --- /dev/null +++ b/ATRI/data/emoji/CIALLO.jpg diff --git a/ATRI/data/emoji/CIALLO1.jpg b/ATRI/data/emoji/CIALLO1.jpg Binary files differnew file mode 100644 index 0000000..62143ef --- /dev/null +++ b/ATRI/data/emoji/CIALLO1.jpg diff --git a/ATRI/data/emoji/CIALLO2.jpg b/ATRI/data/emoji/CIALLO2.jpg Binary files differnew file mode 100644 index 0000000..8397697 --- /dev/null +++ b/ATRI/data/emoji/CIALLO2.jpg diff --git a/ATRI/data/emoji/CIALLO3.jpg b/ATRI/data/emoji/CIALLO3.jpg Binary files differnew file mode 100644 index 0000000..938e3b5 --- /dev/null +++ b/ATRI/data/emoji/CIALLO3.jpg diff --git a/ATRI/data/emoji/CIALLO4.jpg b/ATRI/data/emoji/CIALLO4.jpg Binary files differnew file mode 100644 index 0000000..ebcf808 --- /dev/null +++ b/ATRI/data/emoji/CIALLO4.jpg diff --git a/ATRI/data/emoji/CIALLO5.jpg b/ATRI/data/emoji/CIALLO5.jpg Binary files differnew file mode 100644 index 0000000..f2b0725 --- /dev/null +++ b/ATRI/data/emoji/CIALLO5.jpg diff --git a/ATRI/data/emoji/D.jpg b/ATRI/data/emoji/D.jpg Binary files differnew file mode 100644 index 0000000..a9cf203 --- /dev/null +++ b/ATRI/data/emoji/D.jpg diff --git a/ATRI/data/emoji/D1.jpg b/ATRI/data/emoji/D1.jpg Binary files differnew file mode 100644 index 0000000..2ffa1cc --- /dev/null +++ b/ATRI/data/emoji/D1.jpg diff --git a/ATRI/data/emoji/FD.jpg b/ATRI/data/emoji/FD.jpg Binary files differnew file mode 100644 index 0000000..9eee810 --- /dev/null +++ b/ATRI/data/emoji/FD.jpg diff --git a/ATRI/data/emoji/FN.jpg b/ATRI/data/emoji/FN.jpg Binary files differnew file mode 100644 index 0000000..b1b74f5 --- /dev/null +++ b/ATRI/data/emoji/FN.jpg diff --git a/ATRI/data/emoji/H.jpg b/ATRI/data/emoji/H.jpg Binary files differnew file mode 100644 index 0000000..76c936b --- /dev/null +++ b/ATRI/data/emoji/H.jpg diff --git a/ATRI/data/emoji/HE.jpg b/ATRI/data/emoji/HE.jpg Binary files differnew file mode 100644 index 0000000..37622f2 --- /dev/null +++ b/ATRI/data/emoji/HE.jpg diff --git a/ATRI/data/emoji/HE1.jpg b/ATRI/data/emoji/HE1.jpg Binary files differnew file mode 100644 index 0000000..d5ea243 --- /dev/null +++ b/ATRI/data/emoji/HE1.jpg diff --git a/ATRI/data/emoji/JC.jpg b/ATRI/data/emoji/JC.jpg Binary files differnew file mode 100644 index 0000000..3052c34 --- /dev/null +++ b/ATRI/data/emoji/JC.jpg diff --git a/ATRI/data/emoji/JD.gif b/ATRI/data/emoji/JD.gif Binary files differnew file mode 100644 index 0000000..707009f --- /dev/null +++ b/ATRI/data/emoji/JD.gif diff --git a/ATRI/data/emoji/JW.jpg b/ATRI/data/emoji/JW.jpg Binary files differnew file mode 100644 index 0000000..57628bd --- /dev/null +++ b/ATRI/data/emoji/JW.jpg diff --git a/ATRI/data/emoji/JY.jpg b/ATRI/data/emoji/JY.jpg Binary files differnew file mode 100644 index 0000000..38a5f5b --- /dev/null +++ b/ATRI/data/emoji/JY.jpg diff --git a/ATRI/data/emoji/KD.jpg b/ATRI/data/emoji/KD.jpg Binary files differnew file mode 100644 index 0000000..64ec370 --- /dev/null +++ b/ATRI/data/emoji/KD.jpg diff --git a/ATRI/data/emoji/KN.jpg b/ATRI/data/emoji/KN.jpg Binary files differnew file mode 100644 index 0000000..f11a1a5 --- /dev/null +++ b/ATRI/data/emoji/KN.jpg diff --git a/ATRI/data/emoji/KN.png b/ATRI/data/emoji/KN.png Binary files differnew file mode 100644 index 0000000..140027d --- /dev/null +++ b/ATRI/data/emoji/KN.png diff --git a/ATRI/data/emoji/KN1.jpg b/ATRI/data/emoji/KN1.jpg Binary files differnew file mode 100644 index 0000000..fac2a7c --- /dev/null +++ b/ATRI/data/emoji/KN1.jpg diff --git a/ATRI/data/emoji/KN2.jpg b/ATRI/data/emoji/KN2.jpg Binary files differnew file mode 100644 index 0000000..05a2ee5 --- /dev/null +++ b/ATRI/data/emoji/KN2.jpg diff --git a/ATRI/data/emoji/KN3.png b/ATRI/data/emoji/KN3.png Binary files differnew file mode 100644 index 0000000..c7d22f1 --- /dev/null +++ b/ATRI/data/emoji/KN3.png diff --git a/ATRI/data/emoji/LEARN.jpg b/ATRI/data/emoji/LEARN.jpg Binary files differnew file mode 100644 index 0000000..86ea01b --- /dev/null +++ b/ATRI/data/emoji/LEARN.jpg diff --git a/ATRI/data/emoji/SJ.jpg b/ATRI/data/emoji/SJ.jpg Binary files differnew file mode 100644 index 0000000..34c2f50 --- /dev/null +++ b/ATRI/data/emoji/SJ.jpg diff --git a/ATRI/data/emoji/SJ1.jpg b/ATRI/data/emoji/SJ1.jpg Binary files differnew file mode 100644 index 0000000..e6998bb --- /dev/null +++ b/ATRI/data/emoji/SJ1.jpg diff --git a/ATRI/data/emoji/SP.jpg b/ATRI/data/emoji/SP.jpg Binary files differnew file mode 100644 index 0000000..205fada --- /dev/null +++ b/ATRI/data/emoji/SP.jpg diff --git a/ATRI/data/emoji/SP1.jpg b/ATRI/data/emoji/SP1.jpg Binary files differnew file mode 100644 index 0000000..a5d4388 --- /dev/null +++ b/ATRI/data/emoji/SP1.jpg diff --git a/ATRI/data/emoji/SP2.jpg b/ATRI/data/emoji/SP2.jpg Binary files differnew file mode 100644 index 0000000..86e2374 --- /dev/null +++ b/ATRI/data/emoji/SP2.jpg diff --git a/ATRI/data/emoji/SUKI.jpg b/ATRI/data/emoji/SUKI.jpg Binary files differnew file mode 100644 index 0000000..07dfc04 --- /dev/null +++ b/ATRI/data/emoji/SUKI.jpg diff --git a/ATRI/data/emoji/SUKI1.jpg b/ATRI/data/emoji/SUKI1.jpg Binary files differnew file mode 100644 index 0000000..133d62c --- /dev/null +++ b/ATRI/data/emoji/SUKI1.jpg diff --git a/ATRI/data/emoji/SY.jpg b/ATRI/data/emoji/SY.jpg Binary files differnew file mode 100644 index 0000000..b0f4deb --- /dev/null +++ b/ATRI/data/emoji/SY.jpg diff --git a/ATRI/data/emoji/TZ.jpg b/ATRI/data/emoji/TZ.jpg Binary files differnew file mode 100644 index 0000000..325eadd --- /dev/null +++ b/ATRI/data/emoji/TZ.jpg diff --git a/ATRI/data/emoji/TZ1.jpg b/ATRI/data/emoji/TZ1.jpg Binary files differnew file mode 100644 index 0000000..a5b0b50 --- /dev/null +++ b/ATRI/data/emoji/TZ1.jpg diff --git a/ATRI/data/emoji/TZ2.jpg b/ATRI/data/emoji/TZ2.jpg Binary files differnew file mode 100644 index 0000000..73adaef --- /dev/null +++ b/ATRI/data/emoji/TZ2.jpg diff --git a/ATRI/data/emoji/WH.jpg b/ATRI/data/emoji/WH.jpg Binary files differnew file mode 100644 index 0000000..66b986a --- /dev/null +++ b/ATRI/data/emoji/WH.jpg diff --git a/ATRI/data/emoji/WH1.jpg b/ATRI/data/emoji/WH1.jpg Binary files differnew file mode 100644 index 0000000..bee54b7 --- /dev/null +++ b/ATRI/data/emoji/WH1.jpg diff --git a/ATRI/data/emoji/WH2.jpg b/ATRI/data/emoji/WH2.jpg Binary files differnew file mode 100644 index 0000000..39145be --- /dev/null +++ b/ATRI/data/emoji/WH2.jpg diff --git a/ATRI/data/emoji/WH3.jpg b/ATRI/data/emoji/WH3.jpg Binary files differnew file mode 100644 index 0000000..75dac64 --- /dev/null +++ b/ATRI/data/emoji/WH3.jpg diff --git a/ATRI/data/emoji/WH4.jpg b/ATRI/data/emoji/WH4.jpg Binary files differnew file mode 100644 index 0000000..3cd878b --- /dev/null +++ b/ATRI/data/emoji/WH4.jpg diff --git a/ATRI/data/emoji/WQ.jpg b/ATRI/data/emoji/WQ.jpg Binary files differnew file mode 100644 index 0000000..2a4f25d --- /dev/null +++ b/ATRI/data/emoji/WQ.jpg diff --git a/ATRI/data/emoji/WQ.png b/ATRI/data/emoji/WQ.png Binary files differnew file mode 100644 index 0000000..6a7dc33 --- /dev/null +++ b/ATRI/data/emoji/WQ.png diff --git a/ATRI/data/emoji/WQ1.jpg b/ATRI/data/emoji/WQ1.jpg Binary files differnew file mode 100644 index 0000000..79be736 --- /dev/null +++ b/ATRI/data/emoji/WQ1.jpg diff --git a/ATRI/data/emoji/WQ2.jpg b/ATRI/data/emoji/WQ2.jpg Binary files differnew file mode 100644 index 0000000..c557d29 --- /dev/null +++ b/ATRI/data/emoji/WQ2.jpg diff --git a/ATRI/data/emoji/WQ3.jpg b/ATRI/data/emoji/WQ3.jpg Binary files differnew file mode 100644 index 0000000..4d812f6 --- /dev/null +++ b/ATRI/data/emoji/WQ3.jpg diff --git a/ATRI/data/emoji/WYY.gif b/ATRI/data/emoji/WYY.gif Binary files differnew file mode 100644 index 0000000..91d472f --- /dev/null +++ b/ATRI/data/emoji/WYY.gif diff --git a/ATRI/data/emoji/XX.jpg b/ATRI/data/emoji/XX.jpg Binary files differnew file mode 100644 index 0000000..79bd68a --- /dev/null +++ b/ATRI/data/emoji/XX.jpg diff --git a/ATRI/data/emoji/YIQI_NO.jpg b/ATRI/data/emoji/YIQI_NO.jpg Binary files differnew file mode 100644 index 0000000..331c6da --- /dev/null +++ b/ATRI/data/emoji/YIQI_NO.jpg diff --git a/ATRI/data/emoji/YIQI_YES.png b/ATRI/data/emoji/YIQI_YES.png Binary files differnew file mode 100644 index 0000000..c6ebae3 --- /dev/null +++ b/ATRI/data/emoji/YIQI_YES.png diff --git a/ATRI/data/emoji/YLQ.png b/ATRI/data/emoji/YLQ.png Binary files differnew file mode 100644 index 0000000..d0da83e --- /dev/null +++ b/ATRI/data/emoji/YLQ.png diff --git a/ATRI/data/emoji/ZN.jpg b/ATRI/data/emoji/ZN.jpg Binary files differnew file mode 100644 index 0000000..40f6aaa --- /dev/null +++ b/ATRI/data/emoji/ZN.jpg diff --git a/ATRI/data/emoji/ZZ.jpg b/ATRI/data/emoji/ZZ.jpg Binary files differnew file mode 100644 index 0000000..a785a99 --- /dev/null +++ b/ATRI/data/emoji/ZZ.jpg diff --git a/ATRI/data/emoji/ZZ1.jpg b/ATRI/data/emoji/ZZ1.jpg Binary files differnew file mode 100644 index 0000000..ceb0eb7 --- /dev/null +++ b/ATRI/data/emoji/ZZ1.jpg diff --git a/ATRI/data/emoji/ZZ2.jpg b/ATRI/data/emoji/ZZ2.jpg Binary files differnew file mode 100644 index 0000000..d64d240 --- /dev/null +++ b/ATRI/data/emoji/ZZ2.jpg diff --git a/ATRI/data/emoji/zzz.jpg b/ATRI/data/emoji/zzz.jpg Binary files differnew file mode 100644 index 0000000..afc40ce --- /dev/null +++ b/ATRI/data/emoji/zzz.jpg diff --git a/ATRI/data/img/niceIMG/GDZ.png b/ATRI/data/img/niceIMG/GDZ.png Binary files differnew file mode 100644 index 0000000..eb4163e --- /dev/null +++ b/ATRI/data/img/niceIMG/GDZ.png diff --git a/ATRI/data/img/niceIMG/README.md b/ATRI/data/img/niceIMG/README.md new file mode 100644 index 0000000..98c38bf --- /dev/null +++ b/ATRI/data/img/niceIMG/README.md @@ -0,0 +1 @@ +# 涩批给爷爪巴!
\ No newline at end of file diff --git a/ATRI/data/img/niceIMG/SHZY1.jpg b/ATRI/data/img/niceIMG/SHZY1.jpg Binary files differnew file mode 100644 index 0000000..873d890 --- /dev/null +++ b/ATRI/data/img/niceIMG/SHZY1.jpg diff --git a/ATRI/data/img/niceIMG/SHZY2.jpg b/ATRI/data/img/niceIMG/SHZY2.jpg Binary files differnew file mode 100644 index 0000000..e03c488 --- /dev/null +++ b/ATRI/data/img/niceIMG/SHZY2.jpg diff --git a/ATRI/data/img/niceIMG/SHZY3.jpg b/ATRI/data/img/niceIMG/SHZY3.jpg Binary files differnew file mode 100644 index 0000000..b7f8143 --- /dev/null +++ b/ATRI/data/img/niceIMG/SHZY3.jpg diff --git a/ATRI/data/img/niceIMG/SHZY4.jpg b/ATRI/data/img/niceIMG/SHZY4.jpg Binary files differnew file mode 100644 index 0000000..49c6ee5 --- /dev/null +++ b/ATRI/data/img/niceIMG/SHZY4.jpg diff --git a/ATRI/data/img/niceIMG/SHZY5.jpg b/ATRI/data/img/niceIMG/SHZY5.jpg Binary files differnew file mode 100644 index 0000000..4ea21eb --- /dev/null +++ b/ATRI/data/img/niceIMG/SHZY5.jpg diff --git a/ATRI/data/img/niceIMG/SHZY6.jpg b/ATRI/data/img/niceIMG/SHZY6.jpg Binary files differnew file mode 100644 index 0000000..e7b2386 --- /dev/null +++ b/ATRI/data/img/niceIMG/SHZY6.jpg diff --git a/ATRI/data/sqlite/cloudmusic/cloudmusic.db b/ATRI/data/sqlite/cloudmusic/cloudmusic.db Binary files differnew file mode 100644 index 0000000..98c9541 --- /dev/null +++ b/ATRI/data/sqlite/cloudmusic/cloudmusic.db diff --git a/ATRI/data/sqlite/setu/nearR18.db b/ATRI/data/sqlite/setu/nearR18.db Binary files differnew file mode 100644 index 0000000..7e8d3fd --- /dev/null +++ b/ATRI/data/sqlite/setu/nearR18.db diff --git a/ATRI/data/sqlite/setu/normal.db b/ATRI/data/sqlite/setu/normal.db Binary files differnew file mode 100644 index 0000000..476e9de --- /dev/null +++ b/ATRI/data/sqlite/setu/normal.db diff --git a/ATRI/data/sqlite/setu/r18.db b/ATRI/data/sqlite/setu/r18.db Binary files differnew file mode 100644 index 0000000..2319292 --- /dev/null +++ b/ATRI/data/sqlite/setu/r18.db diff --git a/ATRI/data/voice/ATR_b402_027.mp3 b/ATRI/data/voice/ATR_b402_027.mp3 Binary files differnew file mode 100644 index 0000000..7c015c0 --- /dev/null +++ b/ATRI/data/voice/ATR_b402_027.mp3 diff --git a/ATRI/data/voice/CombinationTorpedoFist.mp3 b/ATRI/data/voice/CombinationTorpedoFist.mp3 Binary files differnew file mode 100644 index 0000000..3d2d40b --- /dev/null +++ b/ATRI/data/voice/CombinationTorpedoFist.mp3 diff --git a/ATRI/data/voice/PX1.mp3 b/ATRI/data/voice/PX1.mp3 Binary files differnew file mode 100644 index 0000000..c55df2c --- /dev/null +++ b/ATRI/data/voice/PX1.mp3 diff --git a/ATRI/data/voice/PX2.mp3 b/ATRI/data/voice/PX2.mp3 Binary files differnew file mode 100644 index 0000000..8162af0 --- /dev/null +++ b/ATRI/data/voice/PX2.mp3 diff --git a/ATRI/data/voice/PX3.mp3 b/ATRI/data/voice/PX3.mp3 Binary files differnew file mode 100644 index 0000000..d31af19 --- /dev/null +++ b/ATRI/data/voice/PX3.mp3 diff --git a/ATRI/data/voice/PX4.mp3 b/ATRI/data/voice/PX4.mp3 Binary files differnew file mode 100644 index 0000000..a1f2e3c --- /dev/null +++ b/ATRI/data/voice/PX4.mp3 diff --git a/ATRI/data/voice/PX5.mp3 b/ATRI/data/voice/PX5.mp3 Binary files differnew file mode 100644 index 0000000..c8f1714 --- /dev/null +++ b/ATRI/data/voice/PX5.mp3 diff --git a/ATRI/data/voice/PX6.mp3 b/ATRI/data/voice/PX6.mp3 Binary files differnew file mode 100644 index 0000000..a23f4e0 --- /dev/null +++ b/ATRI/data/voice/PX6.mp3 diff --git a/ATRI/data/voice/RocketPunch.mp3 b/ATRI/data/voice/RocketPunch.mp3 Binary files differnew file mode 100644 index 0000000..63cb3fe --- /dev/null +++ b/ATRI/data/voice/RocketPunch.mp3 diff --git a/ATRI/data/voice/ohayo1.mp3 b/ATRI/data/voice/ohayo1.mp3 Binary files differnew file mode 100644 index 0000000..1f3cb97 --- /dev/null +++ b/ATRI/data/voice/ohayo1.mp3 diff --git a/ATRI/data/voice/ohayo2.mp3 b/ATRI/data/voice/ohayo2.mp3 Binary files differnew file mode 100644 index 0000000..effba4c --- /dev/null +++ b/ATRI/data/voice/ohayo2.mp3 diff --git a/ATRI/data/voice/ohayo3.mp3 b/ATRI/data/voice/ohayo3.mp3 Binary files differnew file mode 100644 index 0000000..38030e4 --- /dev/null +++ b/ATRI/data/voice/ohayo3.mp3 diff --git a/ATRI/data/voice/ohayo4.mp3 b/ATRI/data/voice/ohayo4.mp3 Binary files differnew file mode 100644 index 0000000..047b07c --- /dev/null +++ b/ATRI/data/voice/ohayo4.mp3 diff --git a/ATRI/data/voice/oyasuminasai.mp3 b/ATRI/data/voice/oyasuminasai.mp3 Binary files differnew file mode 100644 index 0000000..2c0b3e9 --- /dev/null +++ b/ATRI/data/voice/oyasuminasai.mp3 diff --git a/ATRI/data/voice/suki1.mp3 b/ATRI/data/voice/suki1.mp3 Binary files differnew file mode 100644 index 0000000..2fab3b3 --- /dev/null +++ b/ATRI/data/voice/suki1.mp3 diff --git a/ATRI/data/voice/suki2.mp3 b/ATRI/data/voice/suki2.mp3 Binary files differnew file mode 100644 index 0000000..f90a4f4 --- /dev/null +++ b/ATRI/data/voice/suki2.mp3 diff --git a/ATRI/data/voice/tip.txt b/ATRI/data/voice/tip.txt new file mode 100644 index 0000000..33a4ce6 --- /dev/null +++ b/ATRI/data/voice/tip.txt @@ -0,0 +1 @@ +ATR_b402_027 对坏人以火箭组合必杀拳,来让他好好喝一壶!哼!
\ No newline at end of file diff --git a/ATRI/modules/b64/__init__.py b/ATRI/modules/b64/__init__.py new file mode 100644 index 0000000..2c800a0 --- /dev/null +++ b/ATRI/modules/b64/__init__.py @@ -0,0 +1,40 @@ +import os +import time +import base64 +import requests +from pathlib import Path +from PIL import Image, ImageGrab + + +path_emoji = Path('.') / 'ATRI' / 'data' / 'emoji' +path_temp_img = Path('.') / 'ATRI' / 'data' / 'temp' / 'img' +path_img = Path('.') / 'ATRI' / 'data' / 'img' + + +def b64_str_emoji(file_name: str): + find_file = os.path.join(str(path_emoji) + '/' + file_name) + with open(find_file, 'rb') as f: + content = f.read() + b64_str = base64.b64encode(content).decode() + return b64_str + +# def b64_str_img_url(url: str): +# img_d = requests.get(url) +# name = 'temp.jpg' +# with open(str(path_temp_img) + '/' + name, 'wb') as f: +# f.write(img_d.content) +# find_img = os.path.join(str(path_temp_img) + '/' + name) +# with open(find_img, 'rb') as f: +# content = f.read() +# img = ImageGrab. +# b64_str = base64.b64encode(content).decode() +# time.sleep(1) +# os.remove(str(path_temp_img) + '/' + name) +# return b64_str + +def b64_str_img_path(file_name: str): + find_file = os.path.join(str(path_img) + '/' + file_name) + with open(find_file, 'rb') as f: + content = f.read() + b64_str = base64.b64encode(content).decode() + return b64_str
\ No newline at end of file diff --git a/ATRI/modules/b64/__pycache__/__init__.cpython-38.pyc b/ATRI/modules/b64/__pycache__/__init__.cpython-38.pyc Binary files differnew file mode 100644 index 0000000..5b3821c --- /dev/null +++ b/ATRI/modules/b64/__pycache__/__init__.cpython-38.pyc diff --git a/ATRI/plugins/__pycache__/audio.cpython-38.pyc b/ATRI/plugins/__pycache__/audio.cpython-38.pyc Binary files differnew file mode 100644 index 0000000..93235c9 --- /dev/null +++ b/ATRI/plugins/__pycache__/audio.cpython-38.pyc diff --git a/ATRI/plugins/__pycache__/bilibili.cpython-38.pyc b/ATRI/plugins/__pycache__/bilibili.cpython-38.pyc Binary files differindex 92adcfc..b950fbb 100644 --- a/ATRI/plugins/__pycache__/bilibili.cpython-38.pyc +++ b/ATRI/plugins/__pycache__/bilibili.cpython-38.pyc diff --git a/ATRI/plugins/__pycache__/chat.cpython-38.pyc b/ATRI/plugins/__pycache__/chat.cpython-38.pyc Binary files differnew file mode 100644 index 0000000..2710e1a --- /dev/null +++ b/ATRI/plugins/__pycache__/chat.cpython-38.pyc diff --git a/ATRI/plugins/__pycache__/cloudmusic.cpython-38.pyc b/ATRI/plugins/__pycache__/cloudmusic.cpython-38.pyc Binary files differindex ec145a4..b907dbd 100644 --- a/ATRI/plugins/__pycache__/cloudmusic.cpython-38.pyc +++ b/ATRI/plugins/__pycache__/cloudmusic.cpython-38.pyc diff --git a/ATRI/plugins/__pycache__/dynamic_config.cpython-38.pyc b/ATRI/plugins/__pycache__/dynamic_config.cpython-38.pyc Binary files differnew file mode 100644 index 0000000..5670095 --- /dev/null +++ b/ATRI/plugins/__pycache__/dynamic_config.cpython-38.pyc diff --git a/ATRI/plugins/__pycache__/hbook.cpython-38.pyc b/ATRI/plugins/__pycache__/hbook.cpython-38.pyc Binary files differindex ec17b05..25b8a9a 100644 --- a/ATRI/plugins/__pycache__/hbook.cpython-38.pyc +++ b/ATRI/plugins/__pycache__/hbook.cpython-38.pyc diff --git a/ATRI/plugins/__pycache__/hitokoto.cpython-38.pyc b/ATRI/plugins/__pycache__/hitokoto.cpython-38.pyc Binary files differindex 38d950b..5d59df2 100644 --- a/ATRI/plugins/__pycache__/hitokoto.cpython-38.pyc +++ b/ATRI/plugins/__pycache__/hitokoto.cpython-38.pyc diff --git a/ATRI/plugins/__pycache__/img_search.cpython-38.pyc b/ATRI/plugins/__pycache__/img_search.cpython-38.pyc Binary files differnew file mode 100644 index 0000000..12163bb --- /dev/null +++ b/ATRI/plugins/__pycache__/img_search.cpython-38.pyc diff --git a/ATRI/plugins/__pycache__/other.cpython-38.pyc b/ATRI/plugins/__pycache__/other.cpython-38.pyc Binary files differindex 65d379a..b3ad7ac 100644 --- a/ATRI/plugins/__pycache__/other.cpython-38.pyc +++ b/ATRI/plugins/__pycache__/other.cpython-38.pyc diff --git a/ATRI/plugins/__pycache__/pixiv.cpython-38.pyc b/ATRI/plugins/__pycache__/pixiv.cpython-38.pyc Binary files differindex 697407e..b085eca 100644 --- a/ATRI/plugins/__pycache__/pixiv.cpython-38.pyc +++ b/ATRI/plugins/__pycache__/pixiv.cpython-38.pyc diff --git a/ATRI/plugins/__pycache__/send.cpython-38.pyc b/ATRI/plugins/__pycache__/send.cpython-38.pyc Binary files differnew file mode 100644 index 0000000..2fe961f --- /dev/null +++ b/ATRI/plugins/__pycache__/send.cpython-38.pyc diff --git a/ATRI/plugins/__pycache__/setu.cpython-38.pyc b/ATRI/plugins/__pycache__/setu.cpython-38.pyc Binary files differindex 3231cd6..b661646 100644 --- a/ATRI/plugins/__pycache__/setu.cpython-38.pyc +++ b/ATRI/plugins/__pycache__/setu.cpython-38.pyc diff --git a/ATRI/plugins/__pycache__/switch.cpython-38.pyc b/ATRI/plugins/__pycache__/switch.cpython-38.pyc Binary files differindex d08619c..2e3ae9e 100644 --- a/ATRI/plugins/__pycache__/switch.cpython-38.pyc +++ b/ATRI/plugins/__pycache__/switch.cpython-38.pyc diff --git a/ATRI/plugins/__pycache__/upload_setu.cpython-38.pyc b/ATRI/plugins/__pycache__/upload_setu.cpython-38.pyc Binary files differnew file mode 100644 index 0000000..1847b9f --- /dev/null +++ b/ATRI/plugins/__pycache__/upload_setu.cpython-38.pyc diff --git a/ATRI/plugins/__pycache__/upload_sqlite.cpython-38.pyc b/ATRI/plugins/__pycache__/upload_sqlite.cpython-38.pyc Binary files differnew file mode 100644 index 0000000..7b4ed2b --- /dev/null +++ b/ATRI/plugins/__pycache__/upload_sqlite.cpython-38.pyc diff --git a/ATRI/plugins/__pycache__/voice.cpython-38.pyc b/ATRI/plugins/__pycache__/voice.cpython-38.pyc Binary files differnew file mode 100644 index 0000000..b051a68 --- /dev/null +++ b/ATRI/plugins/__pycache__/voice.cpython-38.pyc diff --git a/ATRI/plugins/__pycache__/welcome.cpython-38.pyc b/ATRI/plugins/__pycache__/welcome.cpython-38.pyc Binary files differindex 4bd27aa..c1b5046 100644 --- a/ATRI/plugins/__pycache__/welcome.cpython-38.pyc +++ b/ATRI/plugins/__pycache__/welcome.cpython-38.pyc diff --git a/ATRI/plugins/bilibili.py b/ATRI/plugins/bilibili.py new file mode 100644 index 0000000..e415048 --- /dev/null +++ b/ATRI/plugins/bilibili.py @@ -0,0 +1,108 @@ +# -*- coding:utf-8 -*- +import json +import nonebot +from orjson import loads +from html import unescape +import aiocqhttp + +from nonebot import on_command, CommandSession + +from ATRI.modules import response # type: ignore + + +REPORT_FORMAT = """({aid})信息如下: +Title: {title} +aid: {aid} +bid: {bid} +观看: {view} 点赞: {like} +投币: {coin} 转发: {share} +观看链接: +{aid_link} +{bid_link}""" + + +table='fZodR9XQDSUm21yCkr6zBqiveYah8bt4xsWpHnJE7jL5VG3guMTKNPAwcF' +tr={} +for i in range(58): + tr[table[i]]=i +s=[11,10,3,8,4,6] +xor=177451812 +add=8728348608 + +def dec(x): + r=0 + for i in range(6): + r+=tr[x[s[i]]]*58**i + return (r-add)^xor + +def enc(x): + x=(x^xor)+add + r=list('BV1 4 1 7 ') + for i in range(6): + r[s[i]]=table[x//58**i%58] + return ''.join(r) + + +def check(string, sub_str): + if (string.find(sub_str) == -1): + ch = 0 + return ch + else: + ch = 1 + return ch + + [email protected]_natural_language(only_to_me = False, only_short_message = False) +async def fk_tx_app_bilibili(session: nonebot.NLPSession): + rich_message = [x for x in session.event['message'] if x.get('type') == 'rich'] + + if not rich_message: + return + + rich_message = rich_message[0]['data'] + print(rich_message) + + xch = '小程序' + bili = '哔哩哔哩' + if check(rich_message['text'], xch) == 0: + return + if check(rich_message['text'], bili) == 0: + return + + print(rich_message['text']) + + rich_message = rich_message['content'] + data = loads(unescape(rich_message)) + + if 'detail_1' not in str(rich_message): + return + + URL = data['detail_1']['qqdocurl'] + rep = URL.replace('?', '/') + rep = rep.split('/') + biv = rep[4] + + aid = str(dec(biv)) + + url = f'https://api.imjad.cn/bilibili/v2/?aid={aid}' + ad = 'av' + aid + + dc = json.loads(response.request_api(url)) + + pic = dc["data"]["pic"] + + await session.send(REPORT_FORMAT.format( + title = dc["data"]["title"], + + view = dc["data"]["stat"]["view"], + coin = dc["data"]["stat"]["coin"], + share = dc["data"]["stat"]["share"], + like = dc["data"]["stat"]["like"], + + bid = biv, + bid_link = dc["data"]["short_link"], + + aid = ad, + aid_link = f'https://b23.tv/{ad}' + ) + )
\ No newline at end of file diff --git a/ATRI/plugins/chat.py b/ATRI/plugins/chat.py new file mode 100644 index 0000000..1adee0f --- /dev/null +++ b/ATRI/plugins/chat.py @@ -0,0 +1,369 @@ +import os +import nonebot +import random +from pathlib import Path +from random import randint, choice +from datetime import datetime +from nonebot import CommandSession +from nonebot import on_command + + +bot = nonebot.get_bot() + + [email protected]_job( + 'cron', + day_of_week = "mon,tue,wed,thu,fri,sat,sun", + hour = 7 +) +async def _(): + '''早安''' + try: + group_list = await bot.get_group_list() #type: ignore + groups = [group['group_id'] for group in group_list] + res = randint(1,2) + if res == 1: + msg = random.choice( + [ + '啊......早上好...(哈欠)', + '唔......吧唧...早上...哈啊啊~~~\n早上好......', + '早上好......', + '早上好呜......呼啊啊~~~~', + '啊......早上好。\n昨晚也很激情呢!', + '吧唧吧唧......怎么了...已经早上了么...', + '早上好!', + '......看起来像是傍晚,其实已经早上了吗?', + '早上好......欸~~~脸好近呢' + '......(打瞌睡)', + ] + ) + + elif res == 2: + img = Path('.') / 'ATRI' / 'data' / 'voice' / 'SY.jpg' + msg = f'[CQ:image,file=file:///{os.path.abspath(img)}]' + + for group in groups: + await bot.send_group_msg(group_id = group, message = msg) #type: ignore + + except: + pass + + [email protected]_job( + 'cron', + day_of_week = "mon,tue,wed,thu,fri,sat,sun", + hour = 22 +) +async def _(): + '''晚安''' + try: + group_list = await bot.get_group_list() #type: ignore + groups = [group['group_id'] for group in group_list] + res = randint(1,2) + if res == 1: + msg = random.choice( + [ + '忙累了一天,快休息吧', + '辛苦了一天,准备睡觉吧', + '一起睡觉吧~~~~~', + '......该睡觉了', + '还不睡等着猝死?嗯!?' + + ] + ) + + elif res == 2: + img = choice( + [ + 'SJ.jpg', 'SJ1.jpg' + ] + ) + img = Path('.') / 'ATRI' / 'data' / 'voice' / f'{img}' + msg = f'[CQ:image,file=file:///{os.path.abspath(img)}]' + + for group in groups: + await bot.send_group_msg(group_id = group, message = msg) #type: ignore + + except: + pass + + +def now_time(): + now_ = datetime.now() + hour = now_.hour + minute = now_.minute + now = hour + minute / 60 + return now + + +@on_command('morning', patterns = [r"早[安哇]|早上好|ohayo|哦哈哟|お早う"], only_to_me = False) +async def az(session: CommandSession): + if 5.5 <= now_time() < 9: + await session.send( + choice( + [ + '啊......早上好...(哈欠)', + '唔......吧唧...早上...哈啊啊~~~\n早上好......', + '早上好......', + '早上好呜......呼啊啊~~~~', + '啊......早上好。\n昨晚也很激情呢!', + '吧唧吧唧......怎么了...已经早上了么...', + '早上好!', + '......看起来像是傍晚,其实已经早上了吗?', + '早上好......欸~~~脸好近呢' + ] + ) + ) + + elif 9 <= now_time() < 18: + await session.send( + choice( + [ + '哼!这个点还早啥,昨晚干啥去了!?', + '熬夜了对吧熬夜了对吧熬夜了对吧???!', + '是不是熬夜是不是熬夜是不是熬夜?!' + ] + ) + ) + + elif 18 <= now_time() < 24: + await session.send( + choice( + [ + '早个啥?哼唧!我都准备洗洗睡了!', + '不是...你看看几点了,哼!', + '晚上好哇' + ] + ) + ) + + elif 0 <= now_time() < 5.5: + await session.send( + choice( + [ + 'zzzz......', + 'zzzzzzzz......', + 'zzz...好涩哦..zzz....', + '别...不要..zzz..那..zzz..', + '嘻嘻..zzz..呐~..zzzz..', + '...zzz....哧溜哧溜....' + ] + ) + ) + +@on_command('noon', patterns = [r"中午好|午安"], only_to_me = False) +async def _(session: CommandSession): + if 11 <= now_time() <= 15: + await session.send( + choice( + [ + '午安w','午觉要好好睡哦,ATRI会陪伴在你身旁的w', + '嗯哼哼~睡吧,就像平常一样安眠吧~o(≧▽≦)o', + '睡你午觉去!哼唧!!' + ] + ) + ) + + +@on_command('night', patterns = [r"晚安|oyasuminasai|おやすみなさい"], only_to_me = False) +async def az(session: CommandSession): + if 5.5 <= now_time() < 11: + await session.send( + choice( + [ + '你可猝死算了吧!', + '?啊这', + '亲,这边建议赶快去睡觉呢~~~', + '不可忍不可忍不可忍!!为何这还不猝死!!' + ] + ) + ) + + elif 11 <= now_time() < 15: + await session.send( + choice( + [ + '午安w','午觉要好好睡哦,ATRI会陪伴在你身旁的w', + '嗯哼哼~睡吧,就像平常一样安眠吧~o(≧▽≦)o', + '睡你午觉去!哼唧!!' + ] + ) + ) + + elif 15 <= now_time() < 19: + await session.send( + choice( + [ + '难不成??晚上不想睡觉??现在休息', + '就......挺离谱的...现在睡觉', + '现在还是白天哦,睡觉还太早了' + ] + ) + ) + + elif 19 <= now_time() < 24: + await session.send( + choice( + [ + '嗯哼哼~睡吧,就像平常一样安眠吧~o(≧▽≦)o', + '......(打瞌睡)', + '呼...呼...已经睡着了哦~...呼......', + '......我、我会在这守着你的,请务必好好睡着' + ] + ) + ) + + elif 0 <= now_time() < 5.5: + await session.send( + choice( + [ + 'zzzz......', + 'zzzzzzzz......', + 'zzz...好涩哦..zzz....', + '别...不要..zzz..那..zzz..', + '嘻嘻..zzz..呐~..zzzz..' + ] + ) + ) + + +@on_command('az', patterns = [r"[aA][zZ]|[阿啊]这"], only_to_me = False) +async def az(session: CommandSession): + 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): + res = randint(1,3) + if res == 1: + # res = random.randint(1,10) + img = choice( + [ + 'SUKI.jpg', 'SUKI1.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' + ] + ) + 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) +async def az(session: CommandSession): + 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 az(session: CommandSession): + if randint(1,3) == 1: + img = choice( + [ + '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('kouchou', patterns = [r"草你妈|操|你妈|脑瘫|废柴|fw|five|废物|战斗|爬|爪巴|sb|SB|啥[b批比逼]|傻b|2b"], only_to_me = False) +async def az(session: CommandSession): + if randint(1,2) == 1: + if randint(1,2) == 1: + img = choice( + [ + 'WQ.jpg', 'WQ.png', 'WQ2.jpg', 'WQ3.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 randint(1,2) == 2: + res = randint(1,3) + if res == 1: + await session.send('对嘴臭人以火箭组合必杀拳,来让他好好喝一壶!哼!') + + elif res == 2: + await session.send('鱼雷组合拳——————————————————啊————!!!') + + elif res == 3: + await session.send('火箭拳——————————————————————————!!!') + +@on_command('ciallo', patterns = [r"[Cc][iI][aA][lL][lL][oO]"], only_to_me = False) +async def az(session: CommandSession): + if randint(1,2) == 1: + res = randint(1,2) + if res == 1: + 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('Ciallo~(∠・ω< )⌒★') + +@on_command('ne', patterns = [r"呐|ねえ|口内"], only_to_me = False) +async def az(session: CommandSession): + if randint(1,3) == 1: + await session.send( + choice( + [ + '呐', '呐呐呐', 'ねえ', 'ねえねえ' + ] + ) + ) + +@on_command('kani', patterns = [r"螃蟹|🦀|カニ|[kK]ani"], only_to_me = False) +async def az(session: CommandSession): + if random.randint(1,2) == 1: + img = choice( + [ + '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}]')
\ No newline at end of file diff --git a/ATRI/plugins/cloudmusic.py b/ATRI/plugins/cloudmusic.py new file mode 100644 index 0000000..73e8316 --- /dev/null +++ b/ATRI/plugins/cloudmusic.py @@ -0,0 +1,85 @@ +# -*- coding:utf-8 -*- +import json +import nonebot +from orjson import loads +from html import unescape + +from ATRI.modules import response # type: ignore + +REPORT_FORMAT = """Status: {status} +Song id: {id} +Br: {br} +Download: {url} +MD5: {md5}""" + + [email protected]_natural_language(only_to_me = False) +async def fk_tx_app_cloudmusic(session: nonebot.NLPSession): + rich_message = [x for x in session.event['message'] if x.get('CQ') == 'rich'] + + if not rich_message: + return + + rich_message = rich_message[0]['data'] + print(rich_message) + + if '网易云音乐' not in str(rich_message): + return + + if 'music' not in str(rich_message): + return + + data = loads(unescape(rich_message)) + print(data + ) + + URL = data['music']['jumpUrl'] + rep = URL.split('/') + wid = rep[4] + + url = f'https://api.imjad.cn/cloudmusic/?type=song&id={wid}&br=320000' + print(url) + + dc = json.loads(response.request_api(url)) + + await session.send( + REPORT_FORMAT.format( + status = dc["code"], + id = dc["data"][0]["id"], + br = dc["data"][0]["br"], + url = dc["data"][0]["url"], + md5 = dc["data"][0]["md5"], + ) + ) + + [email protected]_natural_language(only_to_me = False) +async def cloudmusic_link(session: nonebot.NLPSession): + share_message = [x for x in session.ctx['message'] if x.get('type') == 'share'] + + if not share_message: + return + + share_message = share_message[0]['data']['url'] + + if 'music.163.com' not in str(share_message): + return + + rep = share_message.replace('=', '/') + rep = rep.replace('&', '/') + wid = rep[4] + + url = f'https://api.imjad.cn/cloudmusic/?type=song&id={wid}&br=320000' + print(url) + + dc = json.loads(response.request_api(url)) + + await session.send( + REPORT_FORMAT.format( + status = dc["code"], + id = dc["data"][0]["id"], + br = dc["data"][0]["br"], + url = dc["data"][0]["url"], + md5 = dc["data"][0]["md5"], + ) + )
\ No newline at end of file diff --git a/ATRI/plugins/hbook.py b/ATRI/plugins/hbook.py index d1a79bc..52a3098 100644 --- a/ATRI/plugins/hbook.py +++ b/ATRI/plugins/hbook.py @@ -7,29 +7,38 @@ from nonebot import on_command, CommandSession from ATRI.modules import response # type: ignore -@on_command('hbook', aliases = ['本子', '本子搜索', '本子查询'], only_to_me = False) +pattern = r"来(.*?)[点丶份张幅](.*?)的?本子" + +@on_command('hbook', patterns = [r"来(.*?)[点丶份张幅](.*?)的本子"], only_to_me = False) async def _(session: CommandSession): with open('ATRI/plugins/switch/switch.json', 'r') as f: data = json.load(f) if data["hbook"] == 0: + num = 1 + tag = '' start = time.perf_counter() - h_msg = session.current_arg.strip() + h_msg = str(session.event.message) - if not h_msg: - h_msg = session.get('message', prompt='要冲了吗?速发关键词') + info = re.findall(pattern, h_msg) + if info: + num = int(info[0][0] or 1) + tag = info[0][1] + if num > 5: + await session.send('你是不是涩批啊!要那么多干啥?!我最多发5份!') + num = 5 h_type = session.event.detail_type h_user = session.event.user_id header = {'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36'} - keyword = {'show':'title,titleen,tags','keyboard':h_msg} + keyword = {'show':'title,titleen,tags','keyboard':f'{tag}'} res = await response.post_bytes('https://b-upp.com/search/', headers=header, data=keyword) res = res.decode() if '没有搜索到相关的内容' in res: - n_msg = '...似乎没有找到[{}]相关的本子呢'.format(h_msg) + n_msg = '...似乎没有找到[{}]相关的本子呢'.format(tag) await session.send(message=n_msg) else: @@ -38,17 +47,17 @@ async def _(session: CommandSession): n = len(data) if h_type == 'group': - limit = 3 + limit = num elif h_type == 'private': - limit = 10 + limit = num if n > limit: # type: ignore n = limit # type: ignore - msg = f'根据提供信息,已查询到{n}本关键词为[{h_msg}]的本子:' + msg = f'根据提供信息,已查询到{n}本关键词为[{tag}]的本子:' if h_type == 'group': - msg = f'[CQ:at,qq={h_user}]\n根据提供信息,已查询到{n}本关键词为[{h_msg}]的本子:' + msg = f'[CQ:at,qq={h_user}]\n根据提供信息,已查询到{n}本关键词为[{tag}]的本子:' for i in range(n): msg0 = ('\n——————————\n本子链接:https://b-upp.com%s \n本子标题:%s '%(data[i])) msg += msg0 diff --git a/ATRI/plugins/other.py b/ATRI/plugins/other.py index 1b30575..9ad7266 100644 --- a/ATRI/plugins/other.py +++ b/ATRI/plugins/other.py @@ -5,9 +5,11 @@ import nonebot from nonebot import on_command, CommandSession from nonebot.helpers import render_expression +import config # type: ignore + bot = nonebot.get_bot() -master = bot.config.SUPERUSERS +master = config.MASTER() HELP_REPLY = ( @@ -19,28 +21,30 @@ HELP_REPLY = ( MENU_REPO = ''' -===================== +====================== ATRI 使用说明 -===================== +====================== * 发送[]内的关键词以激活相关指令 +* 命令前带'@'表示需要atBOT +* 命令前带'FIX'表示暂时失效 +* 管理类使用方法会附在网页版的使用手册 -====[基本功能]==== +======[基本功能]====== [以图搜番] 字面意思 -[本子] 搜索本子 +[FIX 本子] 搜索本子 [一言] 字面意思 [P站搜图] 以Pid码搜索P站的图片 [画师] 以画师ID搜索P站画师的作品 [P站排行榜] 获取实时更新的P站排行榜 -[涩图] 获取一张涩图 -======[HELP]====== +[来份涩图] 获取一张涩图 +========[HELP]======== [帮助] 获取网页版使用手册 [菜单] 打开本页面 [关于] 获取项目、作者信息 -=====[小功能]===== +[@ 来杯红茶] 向作者反馈 +=======[小功能]======= [掷骰子] 1~6的随机数 [抽签] 抽取今日运势 - -* 管理类使用方法会附在网页版的使用手册 '''.strip() MENU_AND = ''' @@ -142,3 +146,22 @@ async def _(session: CommandSession): await session.send(MENU_REPO) time.sleep(0.5) await session.send(MENU_AND) + +@on_command( + 'report', + aliases = [ + '来杯红茶' + ], + only_to_me = True +) +async def _(session: CommandSession): + msg = session.current_arg.strip() + user = session.event.user_id + group = session.event.group_id + if not msg: + msg = session.get('message', prompt='请键入需要反馈的信息') + + await bot.send_private_msg( + user_id = master, + message = f"来自群[{group}],用户[{user}]的反馈:\n{msg}" + ) # type: ignore
\ No newline at end of file diff --git a/ATRI/plugins/send.py b/ATRI/plugins/send.py index 6cb1905..3253727 100644 --- a/ATRI/plugins/send.py +++ b/ATRI/plugins/send.py @@ -20,6 +20,7 @@ async def send_all_group(session: CommandSession): msg = session.get('message', prompt='请告诉吾辈需要群发的内容~!') group_list = await session.bot.get_group_list() # type: ignore + g_list = len(group_list) for group in group_list: @@ -33,7 +34,7 @@ async def send_all_group(session: CommandSession): end = time.perf_counter() - await session.send(f'推送完成!\n耗时:{round(end - start, 3)}') + await session.send(f'已推送到[{g_list}]个群\n耗时:{round(end - start, 3)}') @on_command('send_to_group', aliases=['对群'], only_to_me=False) diff --git a/ATRI/plugins/setu.py b/ATRI/plugins/setu.py index b178fef..8c2f29e 100644 --- a/ATRI/plugins/setu.py +++ b/ATRI/plugins/setu.py @@ -1,17 +1,19 @@ # -*- coding:utf-8 -*- +import os import time import json +from random import choice, randint +from pathlib import Path import nonebot from nonebot import on_command, CommandSession -from nonebot import NLPSession -from nonebot.natural_language import NLPResult -from nonebot.plugin import on_natural_language +from nonebot import MessageSegment +import config # type: ignore from ATRI.modules import response # type: ignore bot = nonebot.get_bot() -master = bot.config.SUPERUSERS +master = config.MASTER() apikey = bot.config.LOLICONAPI # type: ignore URL = 'https://api.lolicon.app/setu/' @@ -20,12 +22,13 @@ SETU_REPLY = """Title: {title} Pid: {pid} {setu} --------------- -完成时间:{time}s""" +Complete time:{time}s""" -@on_command('setu', aliases = ['图来', '涩图', '涩图来'], only_to_me = False) +@on_command('setu', patterns = (r"来[点丶张份副个幅][涩色瑟][图圖]|[涩色瑟][图圖]来|[涩色瑟][图圖][gkd|GKD|搞快点]|[gkd|GKD|搞快点][涩色瑟][图圖]|[图圖]来|[我你她他它]想要[点丶张份副][涩色瑟][图圖]|我想要[1一][张份幅副个只][涩色瑟][图圖]|[我你她他它]想[看|look][涩涩|色色]的东西"), only_to_me = False) async def setu(session: CommandSession): - with open('ATRI/plugins/switch/switch.json', 'r') as f: + group = session.event.group_id + with open(Path('.') / 'ATRI' / 'plugins' / 'switch' / 'switch.json', 'r') as f: data = json.load(f) if data["setu"] == 0: @@ -37,21 +40,59 @@ async def setu(session: CommandSession): "num": "1" } - dc = json.loads(response.request_api_params(URL, values)) - end = time.perf_counter() + res = randint(1,10) + if 1 <= res <= 9: + res = randint(1,4) + if 1 <= res <= 3: + try: + dc = json.loads(response.request_api_params(URL, values)) + title = dc["data"][0]["title"] + pid = dc["data"][0]["pid"] + setu = dc["data"][0]["url"] #b64.b64_str_img_url(dc["data"][0]["url"]) + except: + await session.send('失败了失败了失败了失...') + return + - await session.send( - SETU_REPLY.format( - title=dc["data"][0]["title"], - pid=dc["data"][0]["pid"], - setu=dc["data"][0]["url"], - time = round(end - start, 3) + res = randint(1,3) + if 1 <= res <= 2: + end = time.perf_counter() + await session.send( + SETU_REPLY.format( + title = title, + pid = pid, + setu = dc["data"][0]["url"], + time = round(end - start, 3) + ) + ) + + elif res == 3: + await session.send('我找到涩图了!但我发给主人了ο(=•ω<=)ρ⌒☆') + end = time.perf_counter() + await bot.send_private_msg( # type: ignore + user_id = master, + message = f"主人,从群{group}来的涩图!热乎着!\nTitle: {title}\nPid: {pid}\n{setu}\nComplete time: {round(end - start, 3)}" + ) + + elif res == 4: + img = choice( + [ + 'SP.jpg', 'SP1.jpg', 'SP2.jpg' + ] + ) + img = Path('.') / 'ATRI' / 'data' / 'emoji' / f'{img}' + img = os.path.abspath(img) + await session.send(f'[CQ:image,file=file:///{img}]') + + + elif res == 10: + img = choice( + [ + 'GDZ.png', 'SHZY1.jpg', 'SHZY2.jpg', 'SHZY3.jpg', 'SHZY4.jpg', 'SHZY5.jpg', 'SHZY6.jpg' + ] ) - ) + img = Path('.') / 'ATRI' / 'data' / 'img' / 'niceIMG' / f'{img}' + await session.send(f'[CQ:image,file=file:///{img}]') else: - await session.send('该功能已被禁用...') - -@on_natural_language(['涩图', '色图'], only_to_me = False) -async def _(session: NLPSession): - return NLPResult(60.0, ('setu'), None)
\ No newline at end of file + await session.send('该功能已被禁用...')
\ No newline at end of file diff --git a/ATRI/plugins/switch/switch.json b/ATRI/plugins/switch/switch.json index 99d82c4..d0f3d6a 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": 1}
\ No newline at end of file diff --git a/ATRI/plugins/upload_sqlite.py b/ATRI/plugins/upload_sqlite.py new file mode 100644 index 0000000..963205b --- /dev/null +++ b/ATRI/plugins/upload_sqlite.py @@ -0,0 +1,173 @@ +# -*- coding:utf-8 -*- +import os +import time +import json +import sqlite3 +import nonebot + +from pathlib import Path +from nonebot import on_command, CommandSession + +from ATRI.modules import response # type: ignore + + +bot = nonebot.get_bot() +master = bot.config.SUPERUSERS # type: ignore +url = f'https://api.imjad.cn/pixiv/v1/?type=illust&id=' + + +@on_command('upload_setu', aliases = ['上传涩图'], only_to_me = False) +async def _(session: CommandSession): + if session.event.user_id in master: + start = time.perf_counter() + msg = session.event.raw_message.split(' ', 2) + print(msg) + i_tpye = msg[1] + pid = msg[2] + + URL = url + pid + + dc = json.loads(response.request_api(URL)) + if not dc: + session.finish('ATRI在尝试解析数据时出问题...等会再试试吧...') + title = dc["response"][0]["title"] + tags = dc["response"][0]["tags"] + account = dc["response"][0]["user"]["account"] + name = dc["response"][0]["user"]["name"] + u_id = dc["response"][0]["user"]["id"] + user_link = f'https://www.pixiv.net/users/' + f'{u_id}' + img = f'https://pixiv.cat/{pid}.jpg' + + if i_tpye == '正常': + if os.path.exists('ATRI/data/sqlite/setu/normal.db'): + print('数据文件存在!') + else: + await session.send('数据库不存在,将在3秒后开始构建...') + time.sleep(3) + await session.send('开始构建数据库!') + con = sqlite3.connect(Path('.') / 'ATRI' / 'data' / 'sqlite' / 'setu' / 'normal.db') + cur = con.cursor() + cur.execute('CREATE TABLE normal(pid PID, title TITLE, tags TAGS, account ACCOUNT, name NAME, u_id UID, user_link USERLINK, img IMG, UNIQUE(pid, title, tags, account, name, u_id, user_link, img))') + con.commit() + cur.close() + con.close() + await session.send('完成') + + con = sqlite3.connect(Path('.') / 'ATRI' / 'data' / 'sqlite' / 'setu' / 'normal.db') + cur = con.cursor() + cur.execute('INSERT INTO normal VALUES ("%s", "%s", "%s", "%s", "%s", "%s", "%s", "%s")'%(pid, title, tags, account, name, u_id, user_link, img)) + con.commit() + con.close() + + elif i_tpye == '擦边球': + if os.path.exists('ATRI/data/sqlite/setu/nearR18.db'): + print('数据文件存在!') + else: + await session.send('数据库不存在,将在3秒后开始构建...') + time.sleep(3) + await session.send('开始构建数据库!') + con = sqlite3.connect(Path('.') / 'ATRI' / 'data' / 'sqlite' / 'setu' / 'nearR18.db') + cur = con.cursor() + cur.execute('CREATE TABLE nearR18(pid PID, title TITLE, tags TAGS, account ACCOUNT, name NAME, u_id UID, user_link USERLINK, img IMG, UNIQUE(pid, title, tags, account, name, u_id, user_link, img))') + con.commit() + cur.close() + con.close() + await session.send('完成') + + con = sqlite3.connect(Path('.') / 'ATRI' / 'data' / 'sqlite' / 'setu' / 'nearR18.db') + cur = con.cursor() + cur.execute('INSERT INTO nearR18 VALUES ("%s", "%s", "%s", "%s", "%s", "%s", "%s", "%s")'%(pid, title, tags, account, name, u_id, user_link, img)) + con.commit() + con.close() + + elif i_tpye == 'r18': + if os.path.exists('ATRI/data/sqlite/cloudmusic/cloudmusic.db'): + print('数据文件存在!') + else: + await session.send('数据库不存在,将在3秒后开始构建...') + time.sleep(3) + await session.send('开始构建数据库!') + con = sqlite3.connect(Path('.') / 'ATRI' / 'data' / 'sqlite' / 'setu' / 'r18.db') + cur = con.cursor() + cur.execute('CREATE TABLE r18(pid PID, title TITLE, tags TAGS, account ACCOUNT, name NAME, u_id UID, user_link USERLINK, img IMG, UNIQUE(pid, title, tags, account, name, u_id, user_link, img))') + con.commit() + cur.close() + con.close() + await session.send('完成') + + con = sqlite3.connect(Path('.') / 'ATRI' / 'data' / 'sqlite' / 'setu' / 'r18.db') + cur = con.cursor() + cur.execute('INSERT INTO r18 VALUES ("%s", "%s", "%s", "%s", "%s", "%s", "%s", "%s")'%(pid, title, tags, account, name, u_id, user_link, img)) + con.commit() + con.close() + + end = time.perf_counter() + + await session.send(f'数据上传完成!\n耗时: {round(end - start, 3)}s') + +@on_command('upload_cloudmusic', aliases = ['上传网抑语', '网抑云', '网易云'], only_to_me = False) +async def _(session: CommandSession): + if session.event.user_id in master: + start = time.perf_counter() + msg = session.event.raw_message.split(' ', 1) + msg = msg[1] + + if os.path.exists('ATRI/data/sqlite/cloudmusic/cloudmusic.db'): + print('数据文件存在!') + else: + await session.send('数据库不存在,将在3秒后开始构建...') + time.sleep(3) + await session.send('开始构建数据库!') + con = sqlite3.connect(Path('.') / 'ATRI' / 'data' / 'sqlite' / 'cloudmusic' / 'cloudmusic.db') + cur = con.cursor() + cur.execute('CREATE TABLE cloudmusic(msg MSG, UNIQUE(msg))') + con.commit() + cur.close() + con.close() + await session.send('完成') + + con = sqlite3.connect(Path('.') / 'ATRI' / 'data' / 'sqlite' / 'cloudmusic' / 'cloudmusic.db') + cur = con.cursor() + cur.execute('INSERT INTO cloudmusic VALUES ("%s")'%(msg)) + con.commit() + con.close() + + end = time.perf_counter() + + await session.send(f'数据上传完成!\n耗时: {round(end - start, 3)}s') + + +@on_command('data_list', aliases = ['查看上传数据', '数据总量'], only_to_me = False) +async def _(session: CommandSession): + con = sqlite3.connect(Path('.') / 'ATRI' / 'data' / 'sqlite' / 'setu' / 'normal.db') # setu-normal + cur = con.cursor() + cur.execute("select * from normal") + data_normal = len(cur.fetchall()) + con.close() + + con = sqlite3.connect(Path('.') / 'ATRI' / 'data' / 'sqlite' / 'setu' / 'nearR18.db') # setu-nearR18 + cur = con.cursor() + cur.execute("select * from nearR18") + data_nearR18 = len(cur.fetchall()) + con.close() + + con = sqlite3.connect(Path('.') / 'ATRI' / 'data' / 'sqlite' / 'setu' / 'r18.db') # setu-r18 + cur = con.cursor() + cur.execute("select * from r18") + data_r18 = len(cur.fetchall()) + con.close() + + con = sqlite3.connect(Path('.') / 'ATRI' / 'data' / 'sqlite' / 'cloudmusic' / 'cloudmusic.db') # cloudmusic + cur = con.cursor() + cur.execute("select * from cloudmusic") + data_cloudmusic = len(cur.fetchall()) + con.close() + + await session.send( + f"""目前ATRI数据库收录了: + 涩图: + normal: {data_normal} + nearR18: {data_nearR18} + r18:{data_r18} + 网抑云语录:{data_cloudmusic}""" + )
\ No newline at end of file diff --git a/ATRI/plugins/welcome.py b/ATRI/plugins/welcome.py index fd33370..d58d32d 100644 --- a/ATRI/plugins/welcome.py +++ b/ATRI/plugins/welcome.py @@ -25,7 +25,7 @@ async def _(session: NoticeSession): async def _(session: NoticeSession, CommandSession): user = session.event.user_id await bot.send_private_msg( - user_id = master, # type: ignore + user_id = master, message = f'{user}\n想认识ATRI欸欸欸!!' ) |