|
|
@ -35,17 +35,18 @@ func handleIncomingMessage(who *websocket.Conn, msg string) {
|
|
|
|
who.WriteMessage(websocket.TextMessage, []byte("leave "+message[1]))
|
|
|
|
who.WriteMessage(websocket.TextMessage, []byte("leave "+message[1]))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
case "active":
|
|
|
|
case "active":
|
|
|
|
if len(message) < 3 {
|
|
|
|
arg := strings.Split(msg, " ")
|
|
|
|
|
|
|
|
if len(arg) < 3 {
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
arg := strings.Split(msg, " ")
|
|
|
|
arg[1] = strings.Join(arg[1:len(arg)-1], " ")
|
|
|
|
arg[1] = strings.Join(arg[1:], " ")
|
|
|
|
arg[2] = arg[len(arg)-1]
|
|
|
|
id, err := db.GetDiscordID(arg[1])
|
|
|
|
id, err := db.GetDiscordID(arg[1])
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
fmt.Println(err)
|
|
|
|
fmt.Println(err)
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
value, err := strconv.Atoi(arg[len(arg)-1])
|
|
|
|
value, err := strconv.Atoi(arg[2])
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
fmt.Println(err)
|
|
|
|
fmt.Println(err)
|
|
|
|
return
|
|
|
|
return
|
|
|
|