kexue-z / nonebot-plugin-heweather

MIT License
63 stars 11 forks source link

[bug] 歪国天气无法查询 #25

Closed Lu-Qi-777 closed 2 years ago

Lu-Qi-777 commented 2 years ago

weather_data.py 126行 Weather类中的_air方法 在获取外国的空气质量时,请求返回的response虽然status_code是200,但其中内容只有{'code': '403'} 在return的时候会报错

图片是用东京(location=65E77)去请求空气质量的结果,我用的是普通版 API 1

kexue-z commented 2 years ago

这个好像已经修复了 看看什么版本的插件

Lu-Qi-777 commented 2 years ago

这个好像已经修复了 看看什么版本的插件

检查了一下,确实是拉取的最新版本代码 目前插件确实是支持无air下绘制最终结果图,只要if weather.air为假就行 但目前报错的原因是response过来的内容里没有now字段,AirApi(**res.json())只接收到了code (或许以前没有air信息会返回{‘code’:xxx, ‘now’:"},现在改了?) 2

Lu-Qi-777 commented 2 years ago

对了,还有个建议顺便再这个issues里提一下吧←_← 生成图片时,地点名self.city_name是用户触发命令时候的内容 测试用wuhan这种拼音,11.4,51.4这种经纬度;通过和风的API也能获取到对应的数据 可以考虑在_get_city_id方法里顺便把res["location"][0]["name"]也返回并更新给self.city_name

kexue-z commented 2 years ago

fix at https://github.com/kexue-z/nonebot-plugin-heweather/commit/98781291c2c1205367ddd25456e81a4b9f466360