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

Insufficient permission to access user profile #98

Open
kspalaiologos opened this issue Mar 7, 2019 · 1 comment
Open

Insufficient permission to access user profile #98

kspalaiologos opened this issue Mar 7, 2019 · 1 comment

Comments

@kspalaiologos
Copy link

Error message:

Unhandled rejection StatusCodeError: 400 - {"error":{"message":"(#100) Insufficient permission to access user profile.","type":"OAuthException","code":100,"error_subcode":2018247,"fbtrace_id":"FuOh7DBcbMa"}}

So I've tried to put my bot in app review, and when "Messenger Review Team 3" wrote, bot crashed with message above.

My code:

'use strict';

const http = require('http')
const Bot = require('messenger-bot')

let bot = new Bot({
  /* ... */
})


bot.on('error', (err) => {
  console.log(err.message)
})

bot.on('message', (payload, reply) => {
  let text = payload.message.text

  bot.getProfile(payload.sender.id, (err, profile) => {
    if (err) throw err
    
    console.log(`${profile.first_name} ${profile.last_name} -> ${text}`)
    
    if(text.startsWith('!echo')) {
      reply({ text }, (err) => {
        if (err) throw err

        try {
            console.log(`Echoed back to ${profile.first_name} ${profile.last_name}: ${text}`)
        } catch(e) {}
      })
    }
  })
})

http.createServer(bot.middleware()).listen(8080)
console.log('Echo bot server running at port 8080.')
@gonmartinez
Copy link

I'm having this same issue

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