Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot return a message from a user #9

Open
JONAS402 opened this issue Dec 29, 2017 · 1 comment
Open

cannot return a message from a user #9

JONAS402 opened this issue Dec 29, 2017 · 1 comment

Comments

@JONAS402
Copy link

probably something simple i'm doing wrong as i had it appear once(only once and i made no major changes afterwards which is strange).

i'm trying to get the text from the users message but the message object in bot.on(MessengerPlatform.Events.MESSAGE, function(userId, message)

returns:
TextMessageEvent { getType: [Function], setType: [Function], getPageId: [Function], getTime: [Function], getUserId: [Function], getSenderId: [Function], getRecipientId: [Function], getTimestamp: [Function], toJSON: [Function], toString: [Function], isTextMessage: [Function], isQuickReply: [Function], hasAttachments: [Function], getMessageSeq: [Function], getMessageId: [Function], getText: [Function] }

however using bot.getProfile(userId).then(function(data) and then echoing the message produces

{"sender":{"id":"XXXXXXXXXXXXXX"},"recipient":{"id":"XXXXXXXXXXXXXX"},"timestamp":1514505450956,"message":{"mid":"mid.XXXXXXXXXXXXXXXXXXXXXXX","seq":XXXX,"text":"hello"}}

any ideas on where i might be going wrong? sorry for the noob question im quite new to javascript/nodejs

@snlangsuan
Copy link
Owner

I sorry to slow reply, when you receive event MESSAGE can get message with function getText
message_event

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants