fix all error and bug !!!!!!!!!!!!!

This commit is contained in:
Jay
2018-09-21 01:14:08 +08:00
parent 07436cd8df
commit 906b7be381
24 changed files with 133 additions and 109 deletions
@@ -4,7 +4,7 @@ package lineobj
type EventObject struct {
Source *SourceObject `json:"source" cc:"source"`
Type string `json:"type" cc:"type"`
Timestamp int32 `json:"timestamp" cc:"timestamp"`
Timestamp int64 `json:"timestamp" cc:"timestamp"`
ReplyToken string `json:"replyToken" cc:"replyToken"`
Message map[string]interface{} `json:"message" cc:"message"`
}
+2 -2
View File
@@ -4,16 +4,16 @@ import (
"fmt"
lineobj "git.trj.tw/golang/mtfosbot/module/line-message/line-object"
"git.trj.tw/golang/mtfosbot/module/utils"
)
// MessageEvent -
func MessageEvent(e *lineobj.EventObject) {
fmt.Println(utils.ToMap(e))
switch e.Type {
case "message":
messageType(e)
break
default:
fmt.Println("line webhook type not match")
}
}
+1
View File
@@ -17,6 +17,7 @@ func messageType(e *lineobj.EventObject) {
if t, ok := mtype.(string); ok {
switch t {
case "text":
textMsg(e)
break
case "image":
break