mtfosbot/module/line-message/message-type.go

41 lines
641 B
Go
Raw Normal View History

2018-09-13 10:18:59 +00:00
package linemsg
import (
lineobj "git.trj.tw/golang/mtfosbot/module/line-message/line-object"
2018-09-14 16:01:36 +00:00
msgcmd "git.trj.tw/golang/mtfosbot/module/message-command"
2018-09-13 10:18:59 +00:00
)
func messageType(e *lineobj.EventObject) {
msg := e.Message
mtype, ok := msg["type"]
if !ok {
return
}
if t, ok := mtype.(string); ok {
switch t {
case "text":
break
case "image":
break
}
}
return
}
func textMsg(e *lineobj.EventObject) {
msg := e.Message
mtxt, ok := msg["text"]
if !ok {
return
}
// group action
if e.Source.Type == "group" {
2018-09-14 16:01:36 +00:00
if txt, ok := mtxt.(string); ok {
msgcmd.ParseLineMsg(txt, e.ReplyToken, e.Source)
2018-09-13 10:18:59 +00:00
}
}
return
}