diff --git a/defs/get_news.py b/defs/get_news.py index 29bc4a0..3de3d63 100644 --- a/defs/get_news.py +++ b/defs/get_news.py @@ -5,8 +5,9 @@ from ci import client, sqlite from defs.model import New -async def get_news() -> List[New]: - time = sqlite.get("update_time", time_.time() - 600) +async def get_news(time: int=None) -> List[New]: + if not time: + time = sqlite.get("update_time", int(time_.time()) - 600) url = f"https://papi.jiemian.com/page/api/kuaixun/getLastest?cid=1325kb&end_time={time}&tagid=1325" data = await client.get(url) if data.status_code != 200: diff --git a/plugins/track.py b/plugins/track.py index cc597af..0066044 100644 --- a/plugins/track.py +++ b/plugins/track.py @@ -63,5 +63,6 @@ async def run_every_10_minute(): @Client.on_message(filters.incoming & filters.private & filters.chat(admin_id) & filters.command(["force_update", ])) async def force_update(_: Client, message: Message): - await run_every_10_minute() + a = int(message.text.replace("/force_update", "").strip()) + await run_every_10_minute(a) await message.reply("ok!")