-
Notifications
You must be signed in to change notification settings - Fork 236
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Why do the following two pieces of code execute differently? #332
Labels
Comments
demo: func handleTextMsg(msg *linebot.TextMessage) error {
fmt.Printf("receive line user msg: \n")
fmt.Printf("id: %s\n", msg.ID)
fmt.Printf("type: %s\n", msg.Type())
fmt.Printf("text: %s\n", msg.Text)
if msg.Mention != nil {
fmt.Printf("receiver: %+v\n", msg.Mention.Mentionees)
}
return nil
} output: receive line user msg:
id: 17282142297924
type:
text: hello
-----------------------------------
receive line user msg:
id: 17282157358950
type:
text: hi
-----------------------------------
receive line user msg:
id: 17282157766222
type:
text: no
-----------------------------------
receive line user msg:
id: 17282158604392
type:
text: say hi I found that text message type is a empty value. |
I found it. {
"destination":"U68ffccf515e89f74fbbbb1e94e2f3da7",
"events":[
{
"type":"message",
"message":{
"type":"text",
"id":"17285133560396",
"text":"你好"
},
"webhookEventId":"01GM4JXB7JGA0R6SSH6PYM26ZM",
"deliveryContext":{
"isRedelivery":true
},
"timestamp":1670896331675,
"source":{
"type":"user",
"userId":"Ubfebb3c90048678f5bd092386a5a9b40"
},
"replyToken":"5d6143f945264ebfbfe4e7f2a3b43f39",
"mode":"active"
}
]
} The |
This issue was closed because it has been inactive for 14 days. |
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
https://github.com/line/line-bot-sdk-go/blob/master/examples/echo_bot/server.go#L48
why not this?
event.Message.(type) is right, and msg.Type() is not right and the result is a empty value, why?
@sugyan @mokejp @kkdai cc
The text was updated successfully, but these errors were encountered: