MCPcopy Create free account
hub / github.com/FloatTech/ZeroBot-Plugin / anserOutString

Function anserOutString

plugin/handou/game.go:656–676  ·  view source on GitHub ↗
(s idiomJSON)

Source from the content-addressed store, hash-verified

654}
655
656func anserOutString(s idiomJSON) string {
657 msg := s.Word
658 if s.Baobian != "" && s.Baobian != "-" {
659 msg += "\n" + s.Baobian + "词"
660 }
661 if s.Derivation != "" && s.Derivation != "-" {
662 msg += "\n词源:\n" + s.Derivation
663 } else {
664 msg += "\n词源:无"
665 }
666 if s.Explanation != "" && s.Explanation != "-" {
667 msg += "\n解释:\n" + s.Explanation
668 } else {
669 msg += "\n解释:无"
670 }
671 if len(s.Synonyms) > 0 {
672 msg += "\n近义词:\n" + strings.Join(s.Synonyms, ",")
673 }
674
675 return msg
676}

Callers 1

initFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected