From 45d7dc3ae60ab4a396a8d5ab02de4a1c52d07843 Mon Sep 17 00:00:00 2001 From: Aaron Bieber Date: Fri, 13 Mar 2020 15:04:39 -0600 Subject: [PATCH] better version --- plugins/version.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/plugins/version.go b/plugins/version.go index 7e72ad7..81e6167 100644 --- a/plugins/version.go +++ b/plugins/version.go @@ -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