chore: improve weather command

This commit is contained in:
2024-09-06 16:34:08 +08:00
parent 010f9fa466
commit 0c1a141ee9
2 files changed
+10 -3

No files matched your search

@@ -41,9 +41,12 @@ class WeatherCommand : BaseCommand() {
val msg = MessageChain.Builder()
.addAt(message.sender.userId)
.addNewLine()
.addText("城市: ${lookupLocation.name}, 温度: ${weather.now.temp}")
.addText("地区: ${lookupLocation.country}")
.addText("-${lookupLocation.adm1}")
.addText("-${lookupLocation.adm2}")
.addText("-${lookupLocation.name}")
.addNewLine()
.addText("${weather.now.text}/${weather.now.windDir}")
.addText("温度: ${weather.now.temp} ℃ | ${weather.now.text}/${weather.now.windDir}")
.addNewLine()
.addText("数据来源: ${weather.refer.sources.joinToString(",")}")
.build()
@@ -11,6 +11,10 @@ data class Geo(
val location: List<Location>
) {
data class Location(
val id: String
val name: String,
val id: String,
val adm1: String,
val adm2: String,
val country: String,
)
}