diff options
author | Kyomotoi <[email protected]> | 2022-12-02 08:49:45 +0800 |
---|---|---|
committer | Kyomotoi <[email protected]> | 2022-12-02 08:49:45 +0800 |
commit | fbeb9bdb7409402da5549a65b4f468bab9a93bae (patch) | |
tree | 7eed1574cd4035477af6a0b183e12479b4ee3dd5 /ATRI/plugins/funny/data_source.py | |
parent | 590bd2a2969b5ce7ca3fed8937b5247521441c49 (diff) | |
download | ATRI-fbeb9bdb7409402da5549a65b4f468bab9a93bae.tar.gz ATRI-fbeb9bdb7409402da5549a65b4f468bab9a93bae.tar.bz2 ATRI-fbeb9bdb7409402da5549a65b4f468bab9a93bae.zip |
🔥 删除功能: 今天吃什么
Diffstat (limited to 'ATRI/plugins/funny/data_source.py')
-rw-r--r-- | ATRI/plugins/funny/data_source.py | 53 |
1 files changed, 0 insertions, 53 deletions
diff --git a/ATRI/plugins/funny/data_source.py b/ATRI/plugins/funny/data_source.py index d3f88cc..9437034 100644 --- a/ATRI/plugins/funny/data_source.py +++ b/ATRI/plugins/funny/data_source.py @@ -58,56 +58,3 @@ class Funny: dic = {"type": "node", "data": {"name": name, "uin": qq, "content": repo}} node.append(dic) return node - - @staticmethod - async def eat_what(name: str, msg: str) -> str: - EAT_URL = "https://wtf.hiigara.net/api/run/" - params = {"event": "ManualRun"} - pattern_0 = r"大?[今明后]天(.*?)吃[什啥]么?" - pattern_1 = r"[今|明|后|大后]天" - arg = re.findall(pattern_0, msg)[0] - day = re.findall(pattern_1, msg)[0] - - if arg == "中午": - a = f"LdS4K6/{randint(0, 1145141919810)}" - url = EAT_URL + a - try: - data = await request.post(url, params=params) - data = data.json() - except Exception: - raise RequestError("Request failed!") - - text = Translate(data["text"]).to_simple().replace("今天", day) - get_a = re.search(r"非常(.*?)的", text).group(0) # type: ignore - result = text.replace(get_a, "") - - elif arg == "晚上": - a = f"KaTMS/{randint(0, 1145141919810)}" - url = EAT_URL + a - try: - data = await request.post(url, params=params) - data = data.json() - except Exception: - raise RequestError("Request failed!") - - result = Translate(data["text"]).to_simple().replace("今天", day) - - else: - rd = randint(1, 10) - if rd == 5: - result = ["吃我吧 ❤", "(脸红)请...请享用咱吧......", "都可以哦~不能挑食呢~"] - return choice(result) - else: - a = f"JJr1hJ/{randint(0, 1145141919810)}" - url = EAT_URL + a - try: - data = await request.post(url, params=params) - data = data.json() - except Exception: - raise RequestError("Request failed!") - - text = Translate(data["text"]).to_simple().replace("今天", day) - get_a = re.match(r"(.*?)的智商", text).group(0) # type: ignore - result = text.replace(get_a, f"{name}的智商") - - return result |