fix command perfix

This commit is contained in:
Jay 2018-10-10 00:59:24 +08:00
parent 7564b5849c
commit f8deff3b37
1 changed files with 7 additions and 3 deletions

View File

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