mirror of https://github.com/Rudi9719/kbtui.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
536 B
29 lines
536 B
// +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) |
|
if m.Msg.Sender.Username == "majortrips" { |
|
|
|
chat.React(msgID, ":+1:") |
|
} |
|
}
|
|
|