1
0
mirror of https://github.com/Rudi9719/kbtui.git synced 2026-03-22 08:47:24 +00:00
Files
kbtui/cmdPost.go
Casper Weiss Bang 439f09aa1c Mo' colors
Changes:
- Stream is colored now
- Stream is formatted
- Stream has it's own formatting option
- Colors are now a style, and is a struct
- Color struct has a pretty cool functional interface
- colored mentions and PMs
- Every message uses the same function (it's dry!!)
- Colorize errors!
- Create function for visualizing errors
- colorized some of the command output!
- Color is stored in a Style
- Create a Text struct that can use to stylize strings "easily"
- Text can be used to build strings
- color highlighting on code
- added tml config support
- added different color for mention url
- Added sprintf to use formatting with PrintFeed and PrintError

Known Bugs: (added as todos whereever)
- Cannot use multiple formatting at the same time (*bold _italic_*
doesn't work
- sprintf is pretty shit
- background doesn't cover as a `block` in codeblocks
- not possible to escape sprintf thing
2019-10-23 23:45:42 +02:00

37 lines
735 B
Go

// +ignore
// +build allcommands postcmd
package main
import (
"fmt"
"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)
_, err := chat.Send(post)
if err != nil {
printError(fmt.Sprintf("There was an error with your post: %+v", err))
} else {
printInfo("You have publically posted to your wall, signed by your current device.")
}
}