This is a refactor of samhofi.us/x/keybase/v2 that takes advantage of the libkeybase performance improvements.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
793 B

package main
import (
"fmt"
"keybase/api"
)
func main() {
6 years ago
// Create new keybase api instance
k := api.New()
6 years ago
// 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 {
6 years ago
chatList, _ := k.ChatList()
allChats := ""
for _, chat := range chatList {
if chat.Channel.MembersType == "team" {
allChats += fmt.Sprintf("%s#%s\n", chat.Channel.Name, chat.Channel.TopicName)
} else {
allChats += fmt.Sprintf("%s\n", chat.Channel.Name)
}
}
c, _ := k.ChatSend(username, fmt.Sprintf("Version: %s\nConversations:\n```%s```\n", version, allChats))
6 years ago
fmt.Println(c.Result.Message)
} else {
fmt.Println("Not logged in")
}
}