From 2028fc5eb5663d3bb01045d545a580aa9cb3dc75 Mon Sep 17 00:00:00 2001 From: omg-xtao <100690902+omg-xtao@users.noreply.github.com> Date: Sun, 11 Jun 2023 16:53:19 +0800 Subject: [PATCH] =?UTF-8?q?news=20=E4=BF=AE=E5=A4=8D=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E7=B4=A2=E5=BC=95=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- news/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/news/main.py b/news/main.py index 86c9e4c..232b46b 100644 --- a/news/main.py +++ b/news/main.py @@ -13,8 +13,8 @@ async def news(_: Client, context: Message): data = await client.get("https://news.topurl.cn/api") data = data.json()["data"] text = "šŸ“® ęÆę—„ę–°é—» šŸ“®\n" - for i in range(12): - text += f"{i + 1}. [{data['newsList'][i]['title']}]({data['newsList'][i]['url']})\n" + for idx, i in enumerate(data['newsList']): + text += f"{idx + 1}. [{i['title']}]({i['url']})\n" text += "\nšŸŽ¬ 历史äøŠēš„今天 šŸŽ¬\n" for i in data["historyList"]: