I've read facebook documentation and trying to create a function that when prompted gets the username and profile pic ,et al of the user talking to the bot this is my function
const express = require('express')
const bodyParser = require('body-parser')
const request = require('request')
const app = express()
/% other code here %/
function sendNameMessage(sender){
http.get( "https://graph.facebook.com/v2.6/" +sender +"?fields=first_name,last_name,profile_pic,locale,timezone,gender&access_token="+token
,function(response){response.setEncoding('utf8')
response.on('data', console.log)
response.on('error', console.error) })
}
simple to say I have been having issues getting it to work, any help or examples I could use?