mirror of
https://github.com/Rudi9719/kbtui.git
synced 2026-03-22 09:57:24 +00:00
Happiness
This commit is contained in:
@ -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])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
13
main.go
13
main.go
@ -3,7 +3,6 @@ package main
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
"strconv"
|
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@ -352,8 +351,18 @@ func handleInput() error {
|
|||||||
return nil
|
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()
|
go populateList()
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user