fix command perfix

This commit is contained in:
Jay 2018-10-10 00:59:24 +08:00
parent 7564b5849c
commit f8deff3b37

View File

@ -1,7 +1,6 @@
package msgcmd package msgcmd
import ( import (
"fmt"
"regexp" "regexp"
"strings" "strings"
@ -35,10 +34,15 @@ func ParseLineMsg(txt, replyToken string, source *lineobj.SourceObject) {
} }
firstNum := []rune(strs[0])[0] firstNum := []rune(strs[0])[0]
fmt.Println("Char :: ", strs[0][0], " Number :: ", firstNum)
if firstNum == 33 || firstNum == 65281 { if firstNum == 33 || firstNum == 65281 {
// nor cmd // nor cmd
cmd := strs[0][1:] cmd := ""
if firstNum == 65281 {
cmd = strs[0][3:]
} else {
cmd = strs[0][1:]
}
if len(cmd) == 0 { if len(cmd) == 0 {
return return
} }