1
0
mirror of https://github.com/Rudi9719/kbtui.git synced 2026-03-26 15:13:33 +00:00
Files
kbtui/tcmdAutoReact.go
2019-10-04 15:30:12 -04:00

27 lines
495 B
Go

// +ignore
// +build type_commands autoreactcmd
package main
import (
"samhofi.us/x/keybase"
)
func init() {
command := TypeCommand{
Cmd: []string{"text"},
Name: "AutoReact",
Description: "Automatically reacts to every incoming message with an emoji",
Exec: tcmdAutoReact,
}
RegisterTypeCommand(command)
}
func tcmdAutoReact(m keybase.ChatAPI) {
msgID := m.Msg.ID
channel := m.Msg.Channel
chat := k.NewChat(channel)
chat.React(msgID, ":sunglasses:")
}