|
|
@ -2,16 +2,14 @@ |
|
|
|
|
|
|
|
|
|
|
|
package main |
|
|
|
package main |
|
|
|
|
|
|
|
|
|
|
|
import ( |
|
|
|
import "strconv" |
|
|
|
"fmt" |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func init() { |
|
|
|
func init() { |
|
|
|
command := Command{ |
|
|
|
command := Command{ |
|
|
|
Cmd: []string{"react", "r", "+"}, |
|
|
|
Cmd: []string{"react", "r", "+"}, |
|
|
|
Description: "React to a message", |
|
|
|
Description: "React to a message", |
|
|
|
Help: "", |
|
|
|
Help: "", |
|
|
|
Exec: cmdUploadFile, |
|
|
|
Exec: cmdReact, |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
RegisterCommand(command) |
|
|
|
RegisterCommand(command) |
|
|
@ -20,7 +18,7 @@ func init() { |
|
|
|
func cmdReact(cmd []string) { |
|
|
|
func cmdReact(cmd []string) { |
|
|
|
if len(cmd) == 3 { |
|
|
|
if len(cmd) == 3 { |
|
|
|
reactToMessageId(cmd[1], cmd[2]) |
|
|
|
reactToMessageId(cmd[1], cmd[2]) |
|
|
|
} else if len(cmd == 2) { |
|
|
|
} else if len(cmd) == 2 { |
|
|
|
reactToMessage(cmd[1]) |
|
|
|
reactToMessage(cmd[1]) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|