moyu 图片 60 秒后自动删除

This commit is contained in:
xtaodada 2022-06-19 13:14:25 +08:00
parent 1360fe05e2
commit d5414fb00e
Signed by: xtaodada
GPG Key ID: 4CBB3F4FA8C85659
3 changed files with 9 additions and 4 deletions

View File

@ -32,7 +32,7 @@
},
{
"name": "moyu",
"version": "1.01",
"version": "1.011",
"section": "chat",
"maintainer": "xtaodada",
"size": "3.0 kb",

View File

@ -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):

3
pmcaptcha/test.py Normal file
View File

@ -0,0 +1,3 @@
def merge_nested_if(a, b):
if a and b:
return c