Refactor formatUserLinks function in main.go to improve link formatting and update link titles for consistency
Publish telemt-bot Docker image / build-and-push (push) Successful in 54s
Publish telemt-bot Docker image / build-and-push (push) Successful in 54s
This commit is contained in:
@@ -363,18 +363,24 @@ func formatUserLinks(links userLinks) string {
|
||||
if len(items) == 0 {
|
||||
return
|
||||
}
|
||||
sb.WriteString(title)
|
||||
sb.WriteByte('\n')
|
||||
for i := range items {
|
||||
sb.WriteString("- ")
|
||||
if len(items) == 1 {
|
||||
sb.WriteString(title)
|
||||
sb.WriteString(": ")
|
||||
} else {
|
||||
sb.WriteString(title)
|
||||
sb.WriteString(" [")
|
||||
sb.WriteString(strconv.Itoa(i + 1))
|
||||
sb.WriteString("]: ")
|
||||
}
|
||||
sb.WriteString(items[i])
|
||||
sb.WriteByte('\n')
|
||||
}
|
||||
}
|
||||
|
||||
appendLinks("classic:", links.Classic)
|
||||
appendLinks("secure:", links.Secure)
|
||||
appendLinks("tls:", links.TLS)
|
||||
appendLinks("Classic", links.Classic)
|
||||
appendLinks("DD", links.Secure)
|
||||
appendLinks("EE-TLS", links.TLS)
|
||||
return strings.TrimRight(sb.String(), "\n")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user