From 210c3c0f4011d696dbdf711c5cd07a5180853a00 Mon Sep 17 00:00:00 2001 From: Sam Date: Tue, 28 May 2019 16:45:01 -0400 Subject: [PATCH] Updated example --- main.go | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 790541c..6eca6d2 100644 --- a/main.go +++ b/main.go @@ -7,6 +7,19 @@ import ( ) func main() { + // Create new keybase api instance k := api.New() - fmt.Printf("Username: %v\nLogged In: %v\nVersion: %v", k.Username(), k.LoggedIn(), k.Version()) + + // Get username, logged in status, and client version + username := k.Username() + loggedin := k.LoggedIn() + version := k.Version() + + // Send current client version to self if client is logged in. + if loggedin { + c, _ := k.ChatSend(username, version) + fmt.Println(c.Result.Message) + } else { + fmt.Println("Not logged in") + } }