mirror of https://github.com/Rudi9719/kbtui.git
Gregory Rudolph
5 years ago
6 changed files with 81 additions and 1 deletions
@ -0,0 +1,12 @@ |
|||||||
|
// +build ignore
|
||||||
|
|
||||||
|
package main |
||||||
|
|
||||||
|
import ( |
||||||
|
"github.com/magefile/mage/mage" |
||||||
|
"os" |
||||||
|
) |
||||||
|
|
||||||
|
func main() { |
||||||
|
os.Exit(mage.Main()) |
||||||
|
} |
@ -0,0 +1,32 @@ |
|||||||
|
// +build mage
|
||||||
|
|
||||||
|
package main |
||||||
|
|
||||||
|
import ( |
||||||
|
"github.com/magefile/mage/sh" |
||||||
|
) |
||||||
|
|
||||||
|
// Build kbtui with just the basic commands.
|
||||||
|
func Build() { |
||||||
|
sh.Run("go", "build") |
||||||
|
} |
||||||
|
|
||||||
|
// Build kbtui with the basic commands, and the ShowReactions "TypeCommand".
|
||||||
|
// The ShowReactions TypeCommand will print a message in the feed window when
|
||||||
|
// a reaction is received in the current conversation.
|
||||||
|
func BuildShowReactions() { |
||||||
|
sh.Run("go", "build", "-tags", "showreactionscmd") |
||||||
|
} |
||||||
|
|
||||||
|
// Build kbtui with the basec commands, and the AutoReact "TypeCommand".
|
||||||
|
// The AutoReact TypeCommand will automatically react to every message
|
||||||
|
// received in the current conversation. This gets pretty annoying, and
|
||||||
|
// is not recommended.
|
||||||
|
func BuildAutoReact() { |
||||||
|
sh.Run("go", "build", "-tags", "autoreactcmd") |
||||||
|
} |
||||||
|
|
||||||
|
// Build kbtui with all Commands and TypeCommands enabled.
|
||||||
|
func BuildAllCommands() { |
||||||
|
sh.Run("go", "build", "-tags", "type_commands") |
||||||
|
} |
@ -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)) |
||||||
|
} |
Loading…
Reference in new issue