mirror of https://github.com/Rudi9719/kbtui.git
Sam
5 years ago
3 changed files with 58 additions and 0 deletions
@ -0,0 +1,24 @@ |
|||||||
|
// +build type_commands autoreactcmd
|
||||||
|
|
||||||
|
package main |
||||||
|
|
||||||
|
import ( |
||||||
|
"samhofi.us/x/keybase" |
||||||
|
) |
||||||
|
|
||||||
|
func init() { |
||||||
|
command := TypeCommand{ |
||||||
|
Cmd: []string{"text"}, |
||||||
|
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:") |
||||||
|
} |
Loading…
Reference in new issue