summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyomotoi <[email protected]>2020-08-12 22:38:05 +0800
committerKyomotoi <[email protected]>2020-08-12 22:38:05 +0800
commitde591789f5ab68458d060d6ea96bf8dcbbe4df8c (patch)
tree144f083ad7a807b08fc4e269f966478e7e1ed33e
parentb11b204043451334c33d827b776f230b6c8e84ce (diff)
downloadATRI-de591789f5ab68458d060d6ea96bf8dcbbe4df8c.tar.gz
ATRI-de591789f5ab68458d060d6ea96bf8dcbbe4df8c.tar.bz2
ATRI-de591789f5ab68458d060d6ea96bf8dcbbe4df8c.zip
[Fix] f**k some ntr
-rw-r--r--ATRI/data/voice/ATR_b402_027.mp3bin45549 -> 0 bytes
-rw-r--r--ATRI/data/voice/CombinationTorpedoFist.mp3bin94803 -> 0 bytes
-rw-r--r--ATRI/data/voice/PX1.mp3bin16365 -> 0 bytes
-rw-r--r--ATRI/data/voice/PX2.mp3bin27501 -> 0 bytes
-rw-r--r--ATRI/data/voice/PX3.mp3bin29229 -> 0 bytes
-rw-r--r--ATRI/data/voice/PX4.mp3bin11565 -> 0 bytes
-rw-r--r--ATRI/data/voice/PX5.mp3bin20013 -> 0 bytes
-rw-r--r--ATRI/data/voice/PX6.mp3bin10797 -> 0 bytes
-rw-r--r--ATRI/data/voice/RocketPunch.mp3bin91347 -> 0 bytes
-rw-r--r--ATRI/data/voice/ohayo1.mp3bin43629 -> 0 bytes
-rw-r--r--ATRI/data/voice/ohayo2.mp3bin18477 -> 0 bytes
-rw-r--r--ATRI/data/voice/ohayo3.mp3bin41517 -> 0 bytes
-rw-r--r--ATRI/data/voice/ohayo4.mp3bin52845 -> 0 bytes
-rw-r--r--ATRI/data/voice/oyasuminasai.mp3bin40659 -> 0 bytes
-rw-r--r--ATRI/data/voice/suki1.mp3bin201363 -> 0 bytes
-rw-r--r--ATRI/data/voice/suki2.mp3bin165075 -> 0 bytes
-rw-r--r--ATRI/data/voice/tip.txt1
-rw-r--r--ATRI/plugins/__pycache__/anime_search.cpython-38.pycbin18158 -> 18272 bytes
-rw-r--r--ATRI/plugins/__pycache__/chat.cpython-38.pycbin8789 -> 12124 bytes
-rw-r--r--ATRI/plugins/__pycache__/hbook.cpython-38.pycbin2226 -> 2343 bytes
-rw-r--r--ATRI/plugins/__pycache__/hitokoto.cpython-38.pycbin1071 -> 1112 bytes
-rw-r--r--ATRI/plugins/__pycache__/other.cpython-38.pycbin3681 -> 4393 bytes
-rw-r--r--ATRI/plugins/__pycache__/pixiv.cpython-38.pycbin4351 -> 4611 bytes
-rw-r--r--ATRI/plugins/__pycache__/send.cpython-38.pycbin2897 -> 2869 bytes
-rw-r--r--ATRI/plugins/__pycache__/setu.cpython-38.pycbin2805 -> 2906 bytes
-rw-r--r--ATRI/plugins/__pycache__/switch.cpython-38.pycbin1456 -> 1458 bytes
-rw-r--r--ATRI/plugins/__pycache__/upload_sqlite.cpython-38.pycbin5285 -> 5451 bytes
-rw-r--r--ATRI/plugins/__pycache__/welcome.cpython-38.pycbin2759 -> 3023 bytes
-rw-r--r--ATRI/plugins/anime_search.py2
-rw-r--r--ATRI/plugins/chat.py27
-rw-r--r--ATRI/plugins/hbook.py2
-rw-r--r--ATRI/plugins/hitokoto.py2
-rw-r--r--ATRI/plugins/noobList/noobList.json1
-rw-r--r--ATRI/plugins/other.py10
-rw-r--r--ATRI/plugins/pixiv.py6
-rw-r--r--ATRI/plugins/setu.py16
-rw-r--r--ATRI/plugins/upload_sqlite.py2
-rw-r--r--ATRI/plugins/welcome.py18
38 files changed, 47 insertions, 40 deletions
diff --git a/ATRI/data/voice/ATR_b402_027.mp3 b/ATRI/data/voice/ATR_b402_027.mp3
deleted file mode 100644
index 7c015c0..0000000
--- a/ATRI/data/voice/ATR_b402_027.mp3
+++ /dev/null
Binary files differ
diff --git a/ATRI/data/voice/CombinationTorpedoFist.mp3 b/ATRI/data/voice/CombinationTorpedoFist.mp3
deleted file mode 100644
index 3d2d40b..0000000
--- a/ATRI/data/voice/CombinationTorpedoFist.mp3
+++ /dev/null
Binary files differ
diff --git a/ATRI/data/voice/PX1.mp3 b/ATRI/data/voice/PX1.mp3
deleted file mode 100644
index c55df2c..0000000
--- a/ATRI/data/voice/PX1.mp3
+++ /dev/null
Binary files differ
diff --git a/ATRI/data/voice/PX2.mp3 b/ATRI/data/voice/PX2.mp3
deleted file mode 100644
index 8162af0..0000000
--- a/ATRI/data/voice/PX2.mp3
+++ /dev/null
Binary files differ
diff --git a/ATRI/data/voice/PX3.mp3 b/ATRI/data/voice/PX3.mp3
deleted file mode 100644
index d31af19..0000000
--- a/ATRI/data/voice/PX3.mp3
+++ /dev/null
Binary files differ
diff --git a/ATRI/data/voice/PX4.mp3 b/ATRI/data/voice/PX4.mp3
deleted file mode 100644
index a1f2e3c..0000000
--- a/ATRI/data/voice/PX4.mp3
+++ /dev/null
Binary files differ
diff --git a/ATRI/data/voice/PX5.mp3 b/ATRI/data/voice/PX5.mp3
deleted file mode 100644
index c8f1714..0000000
--- a/ATRI/data/voice/PX5.mp3
+++ /dev/null
Binary files differ
diff --git a/ATRI/data/voice/PX6.mp3 b/ATRI/data/voice/PX6.mp3
deleted file mode 100644
index a23f4e0..0000000
--- a/ATRI/data/voice/PX6.mp3
+++ /dev/null
Binary files differ
diff --git a/ATRI/data/voice/RocketPunch.mp3 b/ATRI/data/voice/RocketPunch.mp3
deleted file mode 100644
index 63cb3fe..0000000
--- a/ATRI/data/voice/RocketPunch.mp3
+++ /dev/null
Binary files differ
diff --git a/ATRI/data/voice/ohayo1.mp3 b/ATRI/data/voice/ohayo1.mp3
deleted file mode 100644
index 1f3cb97..0000000
--- a/ATRI/data/voice/ohayo1.mp3
+++ /dev/null
Binary files differ
diff --git a/ATRI/data/voice/ohayo2.mp3 b/ATRI/data/voice/ohayo2.mp3
deleted file mode 100644
index effba4c..0000000
--- a/ATRI/data/voice/ohayo2.mp3
+++ /dev/null
Binary files differ
diff --git a/ATRI/data/voice/ohayo3.mp3 b/ATRI/data/voice/ohayo3.mp3
deleted file mode 100644
index 38030e4..0000000
--- a/ATRI/data/voice/ohayo3.mp3
+++ /dev/null
Binary files differ
diff --git a/ATRI/data/voice/ohayo4.mp3 b/ATRI/data/voice/ohayo4.mp3
deleted file mode 100644
index 047b07c..0000000
--- a/ATRI/data/voice/ohayo4.mp3
+++ /dev/null
Binary files differ
diff --git a/ATRI/data/voice/oyasuminasai.mp3 b/ATRI/data/voice/oyasuminasai.mp3
deleted file mode 100644
index 2c0b3e9..0000000
--- a/ATRI/data/voice/oyasuminasai.mp3
+++ /dev/null
Binary files differ
diff --git a/ATRI/data/voice/suki1.mp3 b/ATRI/data/voice/suki1.mp3
deleted file mode 100644
index 2fab3b3..0000000
--- a/ATRI/data/voice/suki1.mp3
+++ /dev/null
Binary files differ
diff --git a/ATRI/data/voice/suki2.mp3 b/ATRI/data/voice/suki2.mp3
deleted file mode 100644
index f90a4f4..0000000
--- a/ATRI/data/voice/suki2.mp3
+++ /dev/null
Binary files differ
diff --git a/ATRI/data/voice/tip.txt b/ATRI/data/voice/tip.txt
deleted file mode 100644
index 33a4ce6..0000000
--- a/ATRI/data/voice/tip.txt
+++ /dev/null
@@ -1 +0,0 @@
-ATR_b402_027 对坏人以火箭组合必杀拳,来让他好好喝一壶!哼! \ No newline at end of file
diff --git a/ATRI/plugins/__pycache__/anime_search.cpython-38.pyc b/ATRI/plugins/__pycache__/anime_search.cpython-38.pyc
index 0c46a36..89e470a 100644
--- a/ATRI/plugins/__pycache__/anime_search.cpython-38.pyc
+++ b/ATRI/plugins/__pycache__/anime_search.cpython-38.pyc
Binary files differ
diff --git a/ATRI/plugins/__pycache__/chat.cpython-38.pyc b/ATRI/plugins/__pycache__/chat.cpython-38.pyc
index 2710e1a..6dd0d2a 100644
--- a/ATRI/plugins/__pycache__/chat.cpython-38.pyc
+++ b/ATRI/plugins/__pycache__/chat.cpython-38.pyc
Binary files differ
diff --git a/ATRI/plugins/__pycache__/hbook.cpython-38.pyc b/ATRI/plugins/__pycache__/hbook.cpython-38.pyc
index 25b8a9a..0a2d194 100644
--- a/ATRI/plugins/__pycache__/hbook.cpython-38.pyc
+++ b/ATRI/plugins/__pycache__/hbook.cpython-38.pyc
Binary files differ
diff --git a/ATRI/plugins/__pycache__/hitokoto.cpython-38.pyc b/ATRI/plugins/__pycache__/hitokoto.cpython-38.pyc
index 5d59df2..fbe7090 100644
--- a/ATRI/plugins/__pycache__/hitokoto.cpython-38.pyc
+++ b/ATRI/plugins/__pycache__/hitokoto.cpython-38.pyc
Binary files differ
diff --git a/ATRI/plugins/__pycache__/other.cpython-38.pyc b/ATRI/plugins/__pycache__/other.cpython-38.pyc
index b3ad7ac..35bf088 100644
--- a/ATRI/plugins/__pycache__/other.cpython-38.pyc
+++ b/ATRI/plugins/__pycache__/other.cpython-38.pyc
Binary files differ
diff --git a/ATRI/plugins/__pycache__/pixiv.cpython-38.pyc b/ATRI/plugins/__pycache__/pixiv.cpython-38.pyc
index b085eca..9e70b4d 100644
--- a/ATRI/plugins/__pycache__/pixiv.cpython-38.pyc
+++ b/ATRI/plugins/__pycache__/pixiv.cpython-38.pyc
Binary files differ
diff --git a/ATRI/plugins/__pycache__/send.cpython-38.pyc b/ATRI/plugins/__pycache__/send.cpython-38.pyc
index 2fe961f..2b98618 100644
--- a/ATRI/plugins/__pycache__/send.cpython-38.pyc
+++ b/ATRI/plugins/__pycache__/send.cpython-38.pyc
Binary files differ
diff --git a/ATRI/plugins/__pycache__/setu.cpython-38.pyc b/ATRI/plugins/__pycache__/setu.cpython-38.pyc
index b661646..8da12f5 100644
--- a/ATRI/plugins/__pycache__/setu.cpython-38.pyc
+++ b/ATRI/plugins/__pycache__/setu.cpython-38.pyc
Binary files differ
diff --git a/ATRI/plugins/__pycache__/switch.cpython-38.pyc b/ATRI/plugins/__pycache__/switch.cpython-38.pyc
index 2e3ae9e..df8416c 100644
--- a/ATRI/plugins/__pycache__/switch.cpython-38.pyc
+++ b/ATRI/plugins/__pycache__/switch.cpython-38.pyc
Binary files differ
diff --git a/ATRI/plugins/__pycache__/upload_sqlite.cpython-38.pyc b/ATRI/plugins/__pycache__/upload_sqlite.cpython-38.pyc
index 7b4ed2b..6d1153c 100644
--- a/ATRI/plugins/__pycache__/upload_sqlite.cpython-38.pyc
+++ b/ATRI/plugins/__pycache__/upload_sqlite.cpython-38.pyc
Binary files differ
diff --git a/ATRI/plugins/__pycache__/welcome.cpython-38.pyc b/ATRI/plugins/__pycache__/welcome.cpython-38.pyc
index c1b5046..d0736b6 100644
--- a/ATRI/plugins/__pycache__/welcome.cpython-38.pyc
+++ b/ATRI/plugins/__pycache__/welcome.cpython-38.pyc
Binary files differ
diff --git a/ATRI/plugins/anime_search.py b/ATRI/plugins/anime_search.py
index eb2e26d..0ef3388 100644
--- a/ATRI/plugins/anime_search.py
+++ b/ATRI/plugins/anime_search.py
@@ -54,7 +54,7 @@ async def _(session: CommandSession):
with open('ATRI/plugins/noobList/noobList.json', 'r') as f:
data = json.load(f)
- if data[f"{user}"] == str(user):
+ if str(user) in data.keys():
pass
else:
if not msg:
diff --git a/ATRI/plugins/chat.py b/ATRI/plugins/chat.py
index 87bd17c..1975610 100644
--- a/ATRI/plugins/chat.py
+++ b/ATRI/plugins/chat.py
@@ -109,7 +109,7 @@ async def _(session: CommandSession):
with open('ATRI/plugins/noobList/noobList.json', 'r') as f:
data = json.load(f)
- if data[f"{user}"] == str(user):
+ if str(user) in data.keys():
pass
else:
if 5.5 <= now_time() < 9:
@@ -171,7 +171,7 @@ async def _(session: CommandSession):
with open('ATRI/plugins/noobList/noobList.json', 'r') as f:
data = json.load(f)
- if data[f"{user}"] == str(user):
+ if str(user) in data.keys():
pass
else:
if 11 <= now_time() <= 15:
@@ -192,7 +192,7 @@ async def _(session: CommandSession):
with open('ATRI/plugins/noobList/noobList.json', 'r') as f:
data = json.load(f)
- if data[f"{user}"] == str(user):
+ if str(user) in data.keys():
pass
else:
if 5.5 <= now_time() < 11:
@@ -261,7 +261,7 @@ async def az(session: CommandSession):
with open('ATRI/plugins/noobList/noobList.json', 'r') as f:
data = json.load(f)
- if data[f"{user}"] == str(user):
+ if str(user) in data.keys():
pass
else:
res = randint(1,3)
@@ -282,7 +282,7 @@ async def az(session: CommandSession):
with open('ATRI/plugins/noobList/noobList.json', 'r') as f:
data = json.load(f)
- if data[f"{user}"] == str(user):
+ if str(user) in data.keys():
pass
else:
res = randint(1,3)
@@ -314,7 +314,7 @@ async def _(session: CommandSession):
with open('ATRI/plugins/noobList/noobList.json', 'r') as f:
data = json.load(f)
- if data[f"{user}"] == str(user):
+ if str(user) in data.keys():
pass
else:
res = randint(1,3)
@@ -345,7 +345,7 @@ async def _(session: CommandSession):
with open('ATRI/plugins/noobList/noobList.json', 'r') as f:
data = json.load(f)
- if data[f"{user}"] == str(user):
+ if str(user) in data.keys():
pass
else:
if randint(1,3) == 1:
@@ -366,7 +366,7 @@ async def _(session: CommandSession):
with open('ATRI/plugins/noobList/noobList.json', 'r') as f:
data = json.load(f)
- if data[f"{user}"] == str(user):
+ if str(user) in data.keys():
pass
else:
if randint(1,2) == 1:
@@ -401,7 +401,7 @@ async def _(session: CommandSession):
with open('ATRI/plugins/noobList/noobList.json', 'r') as f:
data = json.load(f)
- if data[f"{user}"] == str(user):
+ if str(user) in data.keys():
pass
else:
if randint(1,2) == 1:
@@ -425,7 +425,7 @@ async def _(session: CommandSession):
with open('ATRI/plugins/noobList/noobList.json', 'r') as f:
data = json.load(f)
- if data[f"{user}"] == str(user):
+ if str(user) in data.keys():
pass
else:
if randint(1,3) == 1:
@@ -443,7 +443,7 @@ async def _(session: CommandSession):
with open('ATRI/plugins/noobList/noobList.json', 'r') as f:
data = json.load(f)
- if data[f"{user}"] == str(user):
+ if str(user) in data.keys():
pass
else:
if randint(1,2) == 1:
@@ -462,7 +462,7 @@ async def _(session: CommandSession):
with open('ATRI/plugins/noobList/noobList.json', 'r') as f:
data = json.load(f)
- if data[f"{user}"] == str(user):
+ if str(user) in data.keys():
pass
else:
if randint(1,2) == 1:
@@ -475,7 +475,7 @@ async def _(session: CommandSession):
with open('ATRI/plugins/noobList/noobList.json', 'r') as f:
data = json.load(f)
- if data[f"{user}"] == str(user):
+ if str(user) in data.keys():
pass
else:
msg = str(session.event.message)
@@ -487,6 +487,7 @@ async def _(session: CommandSession):
noobList.append(user)
if countX(noobList, user) == 10:
if user == master:
+ await session.send('是主人的话...那算了...呜呜')
pass
else:
await session.send('哼!接下来10分钟别想让我理你!')
diff --git a/ATRI/plugins/hbook.py b/ATRI/plugins/hbook.py
index 395a43b..d12eeb3 100644
--- a/ATRI/plugins/hbook.py
+++ b/ATRI/plugins/hbook.py
@@ -15,7 +15,7 @@ async def _(session: CommandSession):
with open('ATRI/plugins/noobList/noobList.json', 'r') as f:
data = json.load(f)
- if data[f"{h_user}"] == str(h_user):
+ if str(user) in data.keys():
pass
else:
with open('ATRI/plugins/switch/switch.json', 'r') as f:
diff --git a/ATRI/plugins/hitokoto.py b/ATRI/plugins/hitokoto.py
index 94fec98..725ddc7 100644
--- a/ATRI/plugins/hitokoto.py
+++ b/ATRI/plugins/hitokoto.py
@@ -14,7 +14,7 @@ async def hitokoto(session: CommandSession):
with open('ATRI/plugins/noobList/noobList.json', 'r') as f:
data = json.load(f)
- if data[f"{user}"] == str(user):
+ if str(user) in data.keys():
pass
else:
rep = response.request_api(url)
diff --git a/ATRI/plugins/noobList/noobList.json b/ATRI/plugins/noobList/noobList.json
index e69de29..6e1ba39 100644
--- a/ATRI/plugins/noobList/noobList.json
+++ b/ATRI/plugins/noobList/noobList.json
@@ -0,0 +1 @@
+{"123": "123"} \ No newline at end of file
diff --git a/ATRI/plugins/other.py b/ATRI/plugins/other.py
index be0ed50..9b96ed2 100644
--- a/ATRI/plugins/other.py
+++ b/ATRI/plugins/other.py
@@ -64,7 +64,7 @@ async def _(session: CommandSession):
with open('ATRI/plugins/noobList/noobList.json', 'r') as f:
data = json.load(f)
- if data[f"{user}"] == str(user):
+ if str(user) in data.keys():
pass
else:
await session.send(
@@ -92,7 +92,7 @@ async def _(session: CommandSession):
with open('ATRI/plugins/noobList/noobList.json', 'r') as f:
data = json.load(f)
- if data[f"{user}"] == str(user):
+ if str(user) in data.keys():
pass
else:
await session.send(
@@ -109,7 +109,7 @@ async def _(session: CommandSession):
with open('ATRI/plugins/noobList/noobList.json', 'r') as f:
data = json.load(f)
- if data[f"{user}"] == str(user):
+ if str(user) in data.keys():
pass
else:
await session.send(
@@ -126,7 +126,7 @@ async def _(session: CommandSession):
with open('ATRI/plugins/noobList/noobList.json', 'r') as f:
data = json.load(f)
- if data[f"{user}"] == str(user):
+ if str(user) in data.keys():
pass
else:
await session.send(
@@ -142,7 +142,7 @@ async def _(session: CommandSession):
with open('ATRI/plugins/noobList/noobList.json', 'r') as f:
data = json.load(f)
- if data[f"{user}"] == str(user):
+ if str(user) in data.keys():
pass
else:
await session.send(MENU_REPO)
diff --git a/ATRI/plugins/pixiv.py b/ATRI/plugins/pixiv.py
index 5ca7b20..be0cce0 100644
--- a/ATRI/plugins/pixiv.py
+++ b/ATRI/plugins/pixiv.py
@@ -35,7 +35,7 @@ async def _(session: CommandSession):
with open('ATRI/plugins/noobList/noobList.json', 'r') as f:
data = json.load(f)
- if data[f"{user}"] == str(user):
+ if str(user) in data.keys():
pass
else:
with open('ATRI/plugins/switch/switch.json', 'r') as f:
@@ -88,7 +88,7 @@ async def _(session: CommandSession):
with open('ATRI/plugins/noobList/noobList.json', 'r') as f:
data = json.load(f)
- if data[f"{user}"] == str(user):
+ if str(user) in data.keys():
pass
else:
with open('ATRI/plugins/switch/switch.json', 'r') as f:
@@ -148,7 +148,7 @@ async def _(session: CommandSession):
with open('ATRI/plugins/noobList/noobList.json', 'r') as f:
data = json.load(f)
- if data[f"{user}"] == str(user):
+ if str(user) in data.keys():
pass
else:
with open('ATRI/plugins/switch/switch.json', 'r') as f:
diff --git a/ATRI/plugins/setu.py b/ATRI/plugins/setu.py
index 70ef0b4..03a5cf2 100644
--- a/ATRI/plugins/setu.py
+++ b/ATRI/plugins/setu.py
@@ -4,11 +4,8 @@ import time
import json
from random import choice, randint
from pathlib import Path
-import aiocqhttp
import nonebot
-from nonebot import NoneBot, on_command, CommandSession
-from nonebot import message_preprocessor
-from nonebot.plugin import PluginManager
+from nonebot import on_command, CommandSession
import config # type: ignore
from ATRI.modules import response # type: ignore
@@ -32,15 +29,14 @@ async def setu(session: CommandSession):
group = session.event.group_id
user = session.event.user_id
with open('ATRI/plugins/noobList/noobList.json', 'r') as f:
- data = json.load(f)
+ data0 = json.load(f)
+ with open(Path('.') / 'ATRI' / 'plugins' / 'switch' / 'switch.json', 'r') as f:
+ data1 = json.load(f)
- if data[f"{user}"] == str(user):
+ if str(user) in data0.keys():
pass
else:
- with open(Path('.') / 'ATRI' / 'plugins' / 'switch' / 'switch.json', 'r') as f:
- data = json.load(f)
-
- if data["setu"] == 0:
+ if data1["setu"] == 0:
await session.send('别急!正在找图!')
start = time.perf_counter()
values = {
diff --git a/ATRI/plugins/upload_sqlite.py b/ATRI/plugins/upload_sqlite.py
index b399281..2d40cf3 100644
--- a/ATRI/plugins/upload_sqlite.py
+++ b/ATRI/plugins/upload_sqlite.py
@@ -143,7 +143,7 @@ async def _(session: CommandSession):
with open('ATRI/plugins/noobList/noobList.json', 'r') as f:
data = json.load(f)
- if data[f"{user}"] == str(user):
+ if str(user) in data.keys():
pass
else:
con = sqlite3.connect(Path('.') / 'ATRI' / 'data' / 'sqlite' / 'setu' / 'normal.db') # setu-normal
diff --git a/ATRI/plugins/welcome.py b/ATRI/plugins/welcome.py
index d58d32d..8f44300 100644
--- a/ATRI/plugins/welcome.py
+++ b/ATRI/plugins/welcome.py
@@ -7,8 +7,10 @@ from nonebot.notice_request import NoticeSession, RequestSession
from nonebot.plugin import on_request
from aiocqhttp.exceptions import ActionFailed
+import config # type: ignore
+
bot = nonebot.get_bot()
-master = bot.config.SUPERUSERS
+master = config.MASTER()
@on_notice('group_increase')
@@ -22,10 +24,10 @@ async def _(session: NoticeSession):
await session.send(f'[CQ:at,qq={user}]\nねえ❤...是新人欸!\nここでは遠慮はいらないのだからね❤')
@on_notice('firend_add')
-async def _(session: NoticeSession, CommandSession):
+async def _(session: NoticeSession):
user = session.event.user_id
await bot.send_private_msg(
- user_id = master,
+ user_id = master, # type: ignore
message = f'{user}\n想认识ATRI欸欸欸!!'
)
@@ -52,6 +54,14 @@ async def _(session: NoticeSession, CommandSession):
message = f'主人似乎不想让ATRI接触陌生人呢...'
)
+@on_request('friend_add')
+async def _(session: RequestSession):
+ with open(Path('.') / 'ATRI' / 'plugins' / 'switch' / 'switch.json', 'r') as f:
+ data = json.load(f)
+
+ if data["approve_friend_add"] == 0:
+ await session.approve()
+
@on_request('group')
async def _(session: RequestSession):
@@ -72,7 +82,7 @@ async def _(session: RequestSession):
user_id = master, # type: ignore
message = f'ATRI收到一个新邀请:\n裙: {group}\n邀请人: {user}\n已同意'
)
-
+
try:
await session.approve()
except ActionFailed as e: