fix all error and bug !!!!!!!!!!!!!
This commit is contained in:
@@ -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"`
|
||||
}
|
||||
|
||||
@@ -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")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user