summaryrefslogtreecommitdiff
path: root/ATRI/plugins/wife/data_source.py
diff options
context:
space:
mode:
authorKyomotoi <[email protected]>2022-10-04 13:21:37 +0800
committerKyomotoi <[email protected]>2022-10-04 13:21:37 +0800
commitf87dfae8f3aec8c63d89172eb0d31efc12103926 (patch)
tree105e5a2c76e3a4f6cb00d7e0316b776380d6e6fc /ATRI/plugins/wife/data_source.py
parent3b3d13e0cf9d76981c5a915624d001b10d25ccd1 (diff)
downloadATRI-f87dfae8f3aec8c63d89172eb0d31efc12103926.tar.gz
ATRI-f87dfae8f3aec8c63d89172eb0d31efc12103926.tar.bz2
ATRI-f87dfae8f3aec8c63d89172eb0d31efc12103926.zip
🔥 删除插件: 老婆
Diffstat (limited to 'ATRI/plugins/wife/data_source.py')
-rw-r--r--ATRI/plugins/wife/data_source.py69
1 files changed, 0 insertions, 69 deletions
diff --git a/ATRI/plugins/wife/data_source.py b/ATRI/plugins/wife/data_source.py
deleted file mode 100644
index 3067d22..0000000
--- a/ATRI/plugins/wife/data_source.py
+++ /dev/null
@@ -1,69 +0,0 @@
-import json
-from random import choice
-from pathlib import Path
-from nonebot.adapters.onebot.v11 import MessageSegment
-
-from ATRI.service import Service
-from ATRI.rule import is_in_service
-
-
-WIFE_DIR = Path(".") / "data" / "plugins" / "wife"
-WIFE_DIR.mkdir(parents=True, exist_ok=True)
-
-
-class Wife(Service):
- def __init__(self):
- Service.__init__(self, "老婆", "老婆...嘿嘿嘿...", rule=is_in_service("老婆"))
-
- def to_superuser(self, user_id: str):
- """
- 全自动贴贴机,限制只有超级管理员才能贴贴
- """
- content = choice(
- [
- "mua!",
- "贴贴!",
- MessageSegment.image(
- file="https://jsd.imki.moe/gh/Kyomotoi/CDN@master/project/ATRI/wife0.jpg"
- ),
- MessageSegment.image(
- file="https://jsd.imki.moe/gh/Kyomotoi/CDN@master/project/ATRI/wife1.jpg"
- ),
- MessageSegment.image(
- file="https://jsd.imki.moe/gh/Kyomotoi/CDN@master/project/ATRI/wife2.jpg"
- ),
- MessageSegment.image(
- file="https://jsd.imki.moe/gh/Kyomotoi/CDN@master/project/ATRI/wife3.jpg"
- ),
- ]
- )
- result = MessageSegment.at(user_id) + content # type: ignore
- return result
-
- @staticmethod
- def load_marry_list() -> dict:
- """
- 读取结婚列表
- """
- file_name = "marry_list.json"
- path = WIFE_DIR / file_name
- 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:
- """
- 存储结婚列表
- """
- file_name = "marry_list.json"
- path = WIFE_DIR / file_name
- 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))