mirror of
https://github.com/TeamPGM/PagerMaid_Plugins_Pyro.git
synced 2024-11-16 05:05:23 +00:00
xtao-some 修复 wiki (#5)
This commit is contained in:
parent
c332bb9bb2
commit
d0ef94c6d9
@ -2,7 +2,7 @@
|
||||
"list": [
|
||||
{
|
||||
"name": "xtao-some",
|
||||
"version": "1.02",
|
||||
"version": "1.021",
|
||||
"section": "daily",
|
||||
"maintainer": "xtaodada",
|
||||
"size": "12.9 kb",
|
||||
|
@ -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("出错了呜呜呜 ~ 无法访问到维基百科。")
|
||||
|
Loading…
Reference in New Issue
Block a user