support custom time
This commit is contained in:
parent
ce119ac018
commit
27316040f9
@ -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:
|
||||
|
@ -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!")
|
||||
|
Loading…
Reference in New Issue
Block a user