better version

This commit is contained in:
Aaron Bieber 2020-03-13 15:04:39 -06:00
parent e3ff68edff
commit 45d7dc3ae6

View File

@ -8,6 +8,8 @@ import (
"github.com/matrix-org/gomatrix"
)
var version string
// Version responds to hi messages
type Version struct {
}
@ -30,7 +32,10 @@ func (v *Version) Match(user, msg string) bool {
}
func (v *Version) print(to string) string {
return fmt.Sprintf("%s, I am written in Go, running on %s", to, runtime.GOOS)
if version == "" {
version = "unknown version"
}
return fmt.Sprintf("%s running on %s", version, runtime.GOOS)
}
// SetStore does nothing in here