From ce79b22e7497939169e8e8e7b30133344ee1254d Mon Sep 17 00:00:00 2001 From: Gregory Rudolph Date: Mon, 7 Oct 2019 10:42:29 -0400 Subject: [PATCH] Add post command for wall --- cmdPost.go | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 cmdPost.go diff --git a/cmdPost.go b/cmdPost.go new file mode 100644 index 0000000..8147660 --- /dev/null +++ b/cmdPost.go @@ -0,0 +1,30 @@ +// +build !rm_basic_commands allcommands postcmd + +package main + +import ( + + "strings" + + "samhofi.us/x/keybase" +) + +func init() { + command := Command{ + Cmd: []string{"post"}, + Description: "- Post public messages on your wall", + Help: "", + Exec: cmdPost, + } + + RegisterCommand(command) +} +func cmdPost(cmd []string) { + var pubChan keybase.Channel + pubChan.Public = true + pubChan.MembersType = keybase.USER + pubChan.Name = k.Username + post := strings.Join(cmd[1:], " ") + chat := k.NewChat(pubChan) + chat.Send(post) +}