resou weather 修复错误 (#12)

This commit is contained in:
omg-xtao 2022-06-07 23:00:19 +08:00 committed by GitHub
parent ae2bd7149b
commit acd3e7a1ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 6 deletions

View File

@ -132,7 +132,7 @@
}, },
{ {
"name": "weather", "name": "weather",
"version": "1.111", "version": "1.112",
"section": "daily", "section": "daily",
"maintainer": "xtaodada", "maintainer": "xtaodada",
"size": "3.1 kb", "size": "3.1 kb",
@ -142,7 +142,7 @@
}, },
{ {
"name": "resou", "name": "resou",
"version": "1.221", "version": "1.222",
"section": "daily", "section": "daily",
"maintainer": "KorenKrita、xtaodada、monsterxcn", "maintainer": "KorenKrita、xtaodada、monsterxcn",
"size": "2.5 kb", "size": "2.5 kb",

View File

@ -7,7 +7,7 @@ from pagermaid.utils import Message, client
@listener(command="zhrs", @listener(command="zhrs",
description="知乎热搜。") description="知乎热搜。")
async def zhrs(_: Client, message: Message): async def zhrs(_: Client, message: Message):
req = await client.get("https://tenapi.cn/zhihuresou") req = await client.get("https://tenapi.cn/zhihuresou/")
if req.status_code == 200: if req.status_code == 200:
try: try:
data = req.json() data = req.json()
@ -25,7 +25,7 @@ async def zhrs(_: Client, message: Message):
@listener(command="wbrs", @listener(command="wbrs",
description="微博热搜。") description="微博热搜。")
async def wbrs(_: Client, message: Message): async def wbrs(_: Client, message: Message):
req = await client.get("https://tenapi.cn/resou") req = await client.get("https://tenapi.cn/resou/")
if req.status_code == 200: if req.status_code == 200:
try: try:
data = req.json() data = req.json()
@ -44,7 +44,7 @@ async def wbrs(_: Client, message: Message):
@listener(command="dyrs", @listener(command="dyrs",
description="抖音热搜。") description="抖音热搜。")
async def dyrs(_: Client, message: Message): async def dyrs(_: Client, message: Message):
req = await client.get("https://tenapi.cn/douyinresou") req = await client.get("https://tenapi.cn/douyinresou/")
if req.status_code == 200: if req.status_code == 200:
try: try:
data = req.json() data = req.json()

View File

@ -40,7 +40,7 @@ def calcWindDirection(windDirection):
description="查询天气", description="查询天气",
parameters="<城市>") parameters="<城市>")
async def weather(_: Client, message: Message): async def weather(_: Client, message: Message):
of not message.arguments: if not message.arguments:
return await message.edit("出错了呜呜呜 ~ 无效的参数。") return await message.edit("出错了呜呜呜 ~ 无效的参数。")
try: try:
req = await client.get( req = await client.get(