From 1ee2eae499b79bf0d22212184bffd57d873826cc Mon Sep 17 00:00:00 2001 From: Kyomotoi <0w0@imki.moe> Date: Fri, 2 Dec 2022 08:52:19 +0800 Subject: =?UTF-8?q?=F0=9F=8E=A8=20=E9=87=8D=E6=9E=84=E6=B6=A9=E5=9B=BE?= =?UTF-8?q?=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ATRI/plugins/setu/__init__.py | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) (limited to 'ATRI/plugins/setu/__init__.py') diff --git a/ATRI/plugins/setu/__init__.py b/ATRI/plugins/setu/__init__.py index b7dc5f4..4a9c6a6 100644 --- a/ATRI/plugins/setu/__init__.py +++ b/ATRI/plugins/setu/__init__.py @@ -29,13 +29,14 @@ async def _(): async def _random_setu(bot: Bot, event: MessageEvent): loop = asyncio.get_running_loop() - repo, se = await Setu.random_setu() - await bot.send(event, repo) + setu, setu_data = await Setu.new() + setu_info = f"Title: {setu_data.title}\nPid: {setu_data.pid}" + await bot.send(event, setu_info) try: - msg_1 = await bot.send(event, Message(se)) + msg_1 = await bot.send(event, setu) except Exception: - await random_setu.finish("hso(发不出") + await random_setu.finish("hso (发不出") msg_id = msg_1["message_id"] loop.call_later( @@ -56,23 +57,21 @@ async def _(think: str = ArgPlainText("r_rush_after_think")): tag_setu = plugin.on_regex(r"来[张点丶份](.*?)的[涩色🐍]图", "根据提供的tag查找涩图,冷却2分钟") -@tag_setu.handle([Cooldown(120, prompt="慢...慢一..点❤")]) +@tag_setu.handle([Cooldown(120, prompt="")]) async def _tag_setu(bot: Bot, event: MessageEvent): loop = asyncio.get_running_loop() msg = str(event.get_message()).strip() pattern = r"来[张点丶份](.*?)的[涩色🐍]图" tag = re.findall(pattern, msg)[0] - repo, se = await Setu.tag_setu(tag) - if not plugin: - await tag_setu.finish(repo) - - await bot.send(event, repo) + setu, setu_data = await Setu.new(tag) + setu_info = f"Title: {setu_data.title}\nPid: {setu_data.pid}" + await bot.send(event, setu_info) try: - msg_1 = await bot.send(event, Message(se)) + msg_1 = await bot.send(event, setu) except Exception: - await random_setu.finish("hso(发不出") + await random_setu.finish("hso (发不出") msg_id = msg_1["message_id"] loop.call_later( @@ -105,7 +104,7 @@ async def _setu_catcher(bot: Bot, event: MessageEvent): hso = list() for i in args: try: - data = await Setu.detecter(i, _catcher_max_file_size) + data = await Setu(i).detecter(_catcher_max_file_size) except Exception: return if data > 0.7: @@ -144,7 +143,7 @@ async def _deal_check(bot: Bot, event: MessageEvent): if not args: await nsfw_checker.reject("请发送图片而不是其他东西!!") - hso = await Setu.detecter(args[0], _catcher_max_file_size) + hso = await Setu(args[0]).detecter(_catcher_max_file_size) if not hso: await nsfw_checker.finish("图太小了!不测!") -- cgit v1.2.3