diff --git a/src/main/kotlin/cn/rtast/fancybot/commands/WeatherCommand.kt b/src/main/kotlin/cn/rtast/fancybot/commands/WeatherCommand.kt index df27faf..0b86b85 100644 --- a/src/main/kotlin/cn/rtast/fancybot/commands/WeatherCommand.kt +++ b/src/main/kotlin/cn/rtast/fancybot/commands/WeatherCommand.kt @@ -23,17 +23,11 @@ class WeatherCommand : BaseCommand() { val locationName = args.first() val lookupLocationId = Http.get( "https://geoapi.qweather.com/v2/city/lookup", - mapOf( - "location" to locationName, - "key" to configManager.qweatherKey - ) + mapOf("location" to locationName, "key" to configManager.qweatherKey) ).location.first().id val weather = Http.get( "https://devapi.qweather.com/v7/weather/now", - mapOf( - "location" to lookupLocationId, - "key" to configManager.qweatherKey - ) + mapOf("location" to lookupLocationId, "key" to configManager.qweatherKey) ) val msg = MessageChain.Builder() .addAt(message.sender.userId)