1
0
mirror of https://github.com/Rudi9719/kbtui.git synced 2026-03-22 06:27:24 +00:00

Add ShowReactions type command

This commit is contained in:
Sam
2019-10-04 15:42:21 -04:00
parent 10fe8ce609
commit 503ca9356a

25
tcmdShowReactions.go Normal file
View File

@ -0,0 +1,25 @@
// +ignore
// +build type_commands showreactionscmd
package main
import (
"fmt"
"samhofi.us/x/keybase"
)
func init() {
command := TypeCommand{
Cmd: []string{"reaction"},
Name: "ShowReactions",
Description: "Prints a message in the feed any time a reaction is received",
Exec: tcmdShowReactions,
}
RegisterTypeCommand(command)
}
func tcmdShowReactions(m keybase.ChatAPI) {
printToView("Feed", fmt.Sprintf("%s reacted to %d with %s", m.Msg.Sender.Username, m.Msg.Content.Reaction.M, m.Msg.Content.Reaction.B))
}