From fbeb9bdb7409402da5549a65b4f468bab9a93bae Mon Sep 17 00:00:00 2001 From: Kyomotoi <0w0@imki.moe> Date: Fri, 2 Dec 2022 08:49:45 +0800 Subject: =?UTF-8?q?=F0=9F=94=A5=20=E5=88=A0=E9=99=A4=E5=8A=9F=E8=83=BD:=20?= =?UTF-8?q?=E4=BB=8A=E5=A4=A9=E5=90=83=E4=BB=80=E4=B9=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ATRI/plugins/funny/__init__.py | 11 -------- ATRI/plugins/funny/data_source.py | 53 --------------------------------------- 2 files changed, 64 deletions(-) (limited to 'ATRI') diff --git a/ATRI/plugins/funny/__init__.py b/ATRI/plugins/funny/__init__.py index 094e569..8b060cc 100644 --- a/ATRI/plugins/funny/__init__.py +++ b/ATRI/plugins/funny/__init__.py @@ -63,14 +63,3 @@ async def _deal_fake( await bot.send_group_forward_msg(group_id=group_id, messages=node) except Exception: await fake_msg.finish("构造失败惹...可能是被制裁了(") - - -eat_what = plugin.on_regex(r"大?[今明后]天(.*?)吃[什啥]么?", "我来决定你吃什么!") - - -@eat_what.handle([Cooldown(15, prompt="慢慢吃,不要贪心哦!")]) -async def _eat_what(event: MessageEvent): - msg = str(event.get_message()) - user_name = event.sender.nickname or "裙友" - eat = await Funny().eat_what(user_name, msg) - await eat_what.finish(Message(eat)) 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 -- cgit v1.2.3