diff options
| -rw-r--r-- | ATRI/plugins/funny/__init__.py | 11 | ||||
| -rw-r--r-- | ATRI/plugins/funny/data_source.py | 53 | 
2 files changed, 0 insertions, 64 deletions
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  | 
