diff options
author | 0w0 <0w0@imki.moe> | 2022-12-29 16:38:27 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-29 16:38:27 +0800 |
commit | c0e5f0398bd4c3c55378cff303f31ff968822346 (patch) | |
tree | d90bc810150d859c76e64f6e71d8524478014f31 /ATRI/plugins/funny/data_source.py | |
parent | 3d857da2ae1984c6abf286b55888d6d3e4c5d823 (diff) | |
parent | bb13b38f862d859007d1d37941f5b5c9d5f38cbc (diff) | |
download | ATRI-c0e5f0398bd4c3c55378cff303f31ff968822346.tar.gz ATRI-c0e5f0398bd4c3c55378cff303f31ff968822346.tar.bz2 ATRI-c0e5f0398bd4c3c55378cff303f31ff968822346.zip |
Merge branch 'main' into main
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 |