mirror of
https://github.com/TeamPGM/PagerMaid_Plugins_Pyro.git
synced 2024-11-16 08:19:25 +00:00
moyu 图片 60 秒后自动删除
This commit is contained in:
parent
1360fe05e2
commit
d5414fb00e
@ -32,7 +32,7 @@
|
||||
},
|
||||
{
|
||||
"name": "moyu",
|
||||
"version": "1.01",
|
||||
"version": "1.011",
|
||||
"section": "chat",
|
||||
"maintainer": "xtaodada",
|
||||
"size": "3.0 kb",
|
||||
|
@ -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
3
pmcaptcha/test.py
Normal file
@ -0,0 +1,3 @@
|
||||
def merge_nested_if(a, b):
|
||||
if a and b:
|
||||
return c
|
Loading…
Reference in New Issue
Block a user