2018-09-13 10:18:59 +00:00
|
|
|
package linemsg
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
2019-06-25 12:56:52 +00:00
|
|
|
"log"
|
2018-09-13 10:18:59 +00:00
|
|
|
|
|
|
|
lineobj "git.trj.tw/golang/mtfosbot/module/line-message/line-object"
|
|
|
|
)
|
|
|
|
|
|
|
|
// MessageEvent -
|
2019-06-25 09:02:03 +00:00
|
|
|
func MessageEvent(botid string, e *lineobj.EventObject) {
|
2019-06-25 12:56:52 +00:00
|
|
|
log.Println("proc message evt :: ", botid, *e)
|
2019-06-25 09:02:03 +00:00
|
|
|
if len(botid) == 0 {
|
|
|
|
return
|
|
|
|
}
|
2018-09-13 10:18:59 +00:00
|
|
|
switch e.Type {
|
|
|
|
case "message":
|
2019-06-25 09:02:03 +00:00
|
|
|
messageType(botid, e)
|
2018-09-13 10:18:59 +00:00
|
|
|
break
|
2018-09-20 17:14:08 +00:00
|
|
|
default:
|
|
|
|
fmt.Println("line webhook type not match")
|
2018-09-13 10:18:59 +00:00
|
|
|
}
|
|
|
|
}
|