diff --git a/list.json b/list.json index e12c696..3b8ff0c 100644 --- a/list.json +++ b/list.json @@ -32,7 +32,7 @@ }, { "name": "moyu", - "version": "1.01", + "version": "1.011", "section": "chat", "maintainer": "xtaodada", "size": "3.0 kb", diff --git a/moyu/main.py b/moyu/main.py index 8852045..b2f2c3d 100644 --- a/moyu/main.py +++ b/moyu/main.py @@ -28,11 +28,13 @@ async def get_calendar() -> None: f.write(resp.content) -async def push_moyu(gid: int) -> None: - await bot.send_photo( +async def push_moyu(gid: int, delete: bool = False) -> None: + msg: Message = await bot.send_photo( gid, f"data{sep}moyu.png", ) + if delete: + await msg.delay_delete() @scheduler.scheduled_job("cron", hour="8", id="moyu.push") @@ -56,7 +58,7 @@ async def moyu(_: Client, message: Message): except ValueError as e: return await message.edit(e.__str__()) await message.safe_delete() - await push_moyu(message.chat.id) + await push_moyu(message.chat.id, delete=True) elif message.arguments == "订阅": if from_self(message) or enforce_permission(from_msg_get_sudo_uid(message), "modules.manage_subs"): if moyu_sub.check_id(message.chat.id): diff --git a/pmcaptcha/test.py b/pmcaptcha/test.py new file mode 100644 index 0000000..1f34a75 --- /dev/null +++ b/pmcaptcha/test.py @@ -0,0 +1,3 @@ +def merge_nested_if(a, b): + if a and b: + return c