From d0ef94c6d906f069fb50fbd3b95260d0cb472d73 Mon Sep 17 00:00:00 2001 From: omg-xtao <100690902+omg-xtao@users.noreply.github.com> Date: Fri, 10 Jun 2022 22:41:32 +0800 Subject: [PATCH] =?UTF-8?q?xtao-some=20=E4=BF=AE=E5=A4=8D=20wiki=20(#5)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- list.json | 2 +- xtao-some/main.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/list.json b/list.json index 650405c..70297cd 100644 --- a/list.json +++ b/list.json @@ -2,7 +2,7 @@ "list": [ { "name": "xtao-some", - "version": "1.02", + "version": "1.021", "section": "daily", "maintainer": "xtaodada", "size": "12.9 kb", diff --git a/xtao-some/main.py b/xtao-some/main.py index babce5b..3536ffc 100644 --- a/xtao-some/main.py +++ b/xtao-some/main.py @@ -37,12 +37,12 @@ async def guess(_: Client, message: Message): description="查询维基百科词条", parameters="<词组>") async def wiki(_: Client, message: Message): - message = await message.edit("获取中 . . .") text = message.arguments if not text: return await message.edit("请先输入一个关键词。") + message = await message.edit("获取中 . . .") try: - req = await client.get("https://zh.wikipedia.org/w/api.php?action=query&list=search&format=json&formatversion=2&srsearch=" + message) + req = await client.get("https://zh.wikipedia.org/w/api.php?action=query&list=search&format=json&formatversion=2&srsearch=" + text) wiki_json = json.loads(req.content.decode("utf-8")) except: return await message.edit("出错了呜呜呜 ~ 无法访问到维基百科。")