summaryrefslogtreecommitdiff
path: root/ATRI/plugins/wife/data_source.py
diff options
context:
space:
mode:
Diffstat (limited to 'ATRI/plugins/wife/data_source.py')
-rw-r--r--ATRI/plugins/wife/data_source.py25
1 files changed, 16 insertions, 9 deletions
diff --git a/ATRI/plugins/wife/data_source.py b/ATRI/plugins/wife/data_source.py
index 38e8be4..670f862 100644
--- a/ATRI/plugins/wife/data_source.py
+++ b/ATRI/plugins/wife/data_source.py
@@ -18,10 +18,9 @@ __doc__ = """
class Wife(Service):
-
def __init__(self):
Service.__init__(self, "老婆", __doc__, rule=is_in_service("老婆"))
-
+
def to_superuser(self, user_id: str):
"""
全自动贴贴机,限制只有超级管理员才能贴贴
@@ -30,10 +29,18 @@ class Wife(Service):
[
"mua!",
"贴贴!",
- MessageSegment.image(file="https://cdn.jsdelivr.net/gh/Kyomotoi/CDN@master/project/ATRI/wife0.jpg"),
- MessageSegment.image(file="https://cdn.jsdelivr.net/gh/Kyomotoi/CDN@master/project/ATRI/wife1.jpg"),
- MessageSegment.image(file="https://cdn.jsdelivr.net/gh/Kyomotoi/CDN@master/project/ATRI/wife2.jpg"),
- MessageSegment.image(file="https://cdn.jsdelivr.net/gh/Kyomotoi/CDN@master/project/ATRI/wife3.jpg")
+ MessageSegment.image(
+ file="https://cdn.jsdelivr.net/gh/Kyomotoi/CDN@master/project/ATRI/wife0.jpg"
+ ),
+ MessageSegment.image(
+ file="https://cdn.jsdelivr.net/gh/Kyomotoi/CDN@master/project/ATRI/wife1.jpg"
+ ),
+ MessageSegment.image(
+ file="https://cdn.jsdelivr.net/gh/Kyomotoi/CDN@master/project/ATRI/wife2.jpg"
+ ),
+ MessageSegment.image(
+ file="https://cdn.jsdelivr.net/gh/Kyomotoi/CDN@master/project/ATRI/wife3.jpg"
+ ),
]
)
result = MessageSegment.at(user_id) + content
@@ -49,10 +56,10 @@ class Wife(Service):
if not path.is_file():
with open(path, "w", encoding="utf-8") as w:
w.write(json.dumps({}))
-
+
data = json.loads(path.read_bytes())
return data
-
+
@staticmethod
def save_marry_list(data: dict) -> None:
"""
@@ -63,6 +70,6 @@ class Wife(Service):
if not path.is_file():
with open(path, "w", encoding="utf-8") as w:
w.write(json.dumps({}))
-
+
with open(path, "w", encoding="utf-8") as w:
w.write(json.dumps(data, indent=4))