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"]: