This commit is contained in:
Jay Chen 2019-06-25 20:56:52 +08:00
parent d6f4d8d0b1
commit 27274019da
3 changed files with 5 additions and 0 deletions

View File

@ -2,12 +2,14 @@ package linemsg
import (
"fmt"
"log"
lineobj "git.trj.tw/golang/mtfosbot/module/line-message/line-object"
)
// MessageEvent -
func MessageEvent(botid string, e *lineobj.EventObject) {
log.Println("proc message evt :: ", botid, *e)
if len(botid) == 0 {
return
}

View File

@ -17,6 +17,7 @@ import (
)
func messageType(botid string, e *lineobj.EventObject) {
log.Println("proc msg type text :: ", botid)
msg := e.Message
mtype, ok := msg["type"]
if !ok {

View File

@ -6,6 +6,7 @@ import (
"encoding/base64"
"encoding/json"
"io/ioutil"
"log"
"git.trj.tw/golang/mtfosbot/model"
"git.trj.tw/golang/mtfosbot/module/context"
@ -100,6 +101,7 @@ func GetLineMessage(c *context.Context) {
if len(events.Events) > 0 {
for _, v := range events.Events {
log.Println("get line message :: ", v)
go linemsg.MessageEvent(botid, v)
}
}