summaryrefslogtreecommitdiff
path: root/ATRI/plugins/wife/data_source.py
diff options
context:
space:
mode:
authorLint Action <[email protected]>2021-07-31 08:17:46 +0000
committerLint Action <[email protected]>2021-07-31 08:17:46 +0000
commit36d26d1dc61c36b4601aaf75e148060c5bcb98a7 (patch)
tree3b466c4b0db4b9e160c5390a1d1c7ddb0322660f /ATRI/plugins/wife/data_source.py
parent336eb9d9e98b0bee952c27a50820dbdb350bcc03 (diff)
downloadATRI-36d26d1dc61c36b4601aaf75e148060c5bcb98a7.tar.gz
ATRI-36d26d1dc61c36b4601aaf75e148060c5bcb98a7.tar.bz2
ATRI-36d26d1dc61c36b4601aaf75e148060c5bcb98a7.zip
:rotating_light: 自动进行代码格式化
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))