fix:无意图识别时,无"plugins"配置报错的bug

This commit is contained in:
hrz
2025-12-18 11:18:49 +08:00
parent a00f8e4b76
commit 19736e66ad
6 changed files with 25 additions and 24 deletions
@@ -158,13 +158,10 @@ def parse_weather_info(soup):
def get_weather(conn, location: str = None, lang: str = "zh_CN"):
from core.utils.cache.manager import cache_manager, CacheType
api_host = conn.config["plugins"]["get_weather"].get(
"api_host", "mj7p3y7naa.re.qweatherapi.com"
)
api_key = conn.config["plugins"]["get_weather"].get(
"api_key", "a861d0d5e7bf4ee1a83d9a9e4f96d4da"
)
default_location = conn.config["plugins"]["get_weather"]["default_location"]
weather_config = conn.config.get("plugins", {}).get("get_weather", {})
api_host = weather_config.get("api_host", "mj7p3y7naa.re.qweatherapi.com")
api_key = weather_config.get("api_key", "a861d0d5e7bf4ee1a83d9a9e4f96d4da")
default_location = weather_config.get("default_location", "广州")
client_ip = conn.client_ip
# 优先使用用户提供的location参数