add pre group one bot setting
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package msgcmd
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"regexp"
|
||||
"strings"
|
||||
|
||||
@@ -22,10 +23,15 @@ func parseCMD(in string) (c [][]string) {
|
||||
}
|
||||
|
||||
// ParseLineMsg -
|
||||
func ParseLineMsg(txt, replyToken string, source *lineobj.SourceObject) {
|
||||
func ParseLineMsg(botid, txt, replyToken string, source *lineobj.SourceObject) {
|
||||
if source.Type != "group" {
|
||||
return
|
||||
}
|
||||
bot, err := model.GetBotInfo(botid)
|
||||
if err != nil || bot == nil {
|
||||
fmt.Println("get bot err or no bot :: ", err)
|
||||
return
|
||||
}
|
||||
strs := strings.Split(strings.Trim(txt, " "), " ")
|
||||
|
||||
// skip empty string
|
||||
@@ -57,7 +63,7 @@ func ParseLineMsg(txt, replyToken string, source *lineobj.SourceObject) {
|
||||
m := parseResult(v)
|
||||
msgs = append(msgs, m)
|
||||
}
|
||||
line.ReplyMessage(replyToken, msgs...)
|
||||
line.ReplyMessage(bot.AccessToken, replyToken, msgs...)
|
||||
|
||||
} else {
|
||||
// key cmd
|
||||
@@ -72,7 +78,8 @@ func ParseLineMsg(txt, replyToken string, source *lineobj.SourceObject) {
|
||||
m := parseResult(v)
|
||||
msgs = append(msgs, m)
|
||||
}
|
||||
line.ReplyMessage(replyToken, msgs...)
|
||||
|
||||
line.ReplyMessage(bot.AccessToken, replyToken, msgs...)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user