Added schedules empty message for kmb

This commit is contained in:
2026-03-10 16:59:31 +08:00
parent 346a2a6042
commit 435637e1a4
6 changed files with 28 additions and 5 deletions

View File

@@ -174,6 +174,8 @@ func (this *QueryResult) Message() (string, error) {
sb.WriteString("\n")
writeShortRoute(&this.Lang, &sb, r)
noSchedules := true
for _, schedule := range *(*this.Schedules)[r] {
if !schedule.ETA.IsZero() {
@@ -189,6 +191,8 @@ func (this *QueryResult) Message() (string, error) {
} else {
utils.WriteMDv2Text(&sb, eta)
}
noSchedules = false
}
if schedule.Remarks_en != "" {
@@ -204,6 +208,10 @@ func (this *QueryResult) Message() (string, error) {
sb.WriteString("\n")
}
if noSchedules {
utils.WriteMDv2Text(&sb, i18n.DS_KMB_NO_SCHEDULES.Text(langPack))
}
sb.WriteString("\n")
}
@@ -241,7 +249,7 @@ func (this *QueryResult) Message() (string, error) {
}
}
} else {
return "", fmt.Errorf("No Results")
return "", fmt.Errorf(i18n.NO_RESULTS.Text(langPack))
}
return sb.String(), nil