Browse Source

Happiness

pull/1/head
Gregory Rudolph 5 years ago
parent
commit
8cb0950c25
  1. 8
      cmdReact.go
  2. 13
      main.go

8
cmdReact.go

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

13
main.go

@ -3,7 +3,6 @@ package main @@ -3,7 +3,6 @@ package main
import (
"fmt"
"log"
"strconv"
"strings"
"time"
@ -352,8 +351,18 @@ func handleInput() error { @@ -352,8 +351,18 @@ func handleInput() error {
return nil
}
}
if inputString[:1] == "+" {
cmd := strings.Split(inputString, " ")
if len(cmd) == 3 {
RunCommand("react", cmd[1], cmd[2])
}
if len(cmd) == 2 {
RunCommand("react", cmd[1])
}
} else {
go sendChat(inputString)
}
go sendChat(inputString)
go populateList()
return nil
}

Loading…
Cancel
Save