fbdevelopercircles / open-source-edu-bot

Open Source Education bot, built by the Developer Circles community.
MIT License
59 stars 79 forks source link

FB_VERIFY_TOKEN is none when is already set in .env file #124

Open LuisFerTR opened 4 years ago

LuisFerTR commented 4 years ago

Hi, I'm trying to setup the project but I have an issue checking webhook, when I execute

curl -X GET "<YOUR HOST>/webhook?hub.verify_token=<YOUR VERIFY TOKEN>&hub.challenge=CHALLENGE_ACCEPTED&hub.mode=subscribe&init_bot=true"

replacing <YOUR HOST> by localhost:5000 and <YOUR VERIFY TOKEN> by the string I wrote on .env file I only receive "CHALLENGE_ACCEPTED", executing curl -X GET "<YOUR HOST>/webhook?hub.verify_token=<YOUR VERIFY TOKEN>&init_bot=true"

returns an error stack finishing with this message: ValueError: FB_VERIFY_TOKEN does not match. I've already set other variables in .env file but nothing seems to change. Is there anything I'm skipping?

aboullaite commented 4 years ago

Hello, could you please mention what is your dev environment: OS? using docker or not ? ... This will help us understand what the root issue.

LuisFerTR commented 4 years ago

Sure, I tried in two different OS and didn't use docker in either of them,

elinguiuriel commented 4 years ago

@LuisFerTR make sure to update your URL to match what you define in .env

vj-codes commented 4 years ago

@LuisFerTR hey the token mentioned here is generated on the facebook page , you have just copy and paste that and it works fine.Do update if it isn't:)

LuisFerTR commented 4 years ago

Oh I see, I'm a little lost, where can I get the token generated on the facebook page? I think it could be any string in the .env file and copy and paste in curl command.

vj-codes commented 4 years ago

@LuisFerTR see this part. I followed the same and it worked:)

LuisFerTR commented 4 years ago

I already have APP_ID, APP_SECRET, PAGE_ID and FB_PAGE_TOKEN, but I still missing FB_VERIFY_TOKEN, where can I find it? I appreciate your help.

vj-codes commented 4 years ago

@LuisFerTR the verify token is the page_ access_token which is displayed next to the page_id . Generate that token, and add it to the . env file I had set up it up locally long back so don't have any screen shots now If you don't get it, I'll add the ss later:)

LuisFerTR commented 4 years ago

I'm here, I added access token as FB_VERIFY_TOKEN in my .env file, I'm still only getting "CHALLENGE ACCEPTED". SS from where I took the access token: https://drive.google.com/file/d/1ERw1VJ71Scqpio3Th4RVjG7_uUae7SMA/view?usp=sharing

vj-codes commented 4 years ago

@LuisFerTR although I don't understand the language but that's the correct ss Where are you getting challenge accepted?

LuisFerTR commented 4 years ago

I'm sorry for not giving you a translation, I'm getting "challenge accepted" in the next instruction:

curl -X GET "<YOUR HOST>/webhook?hub.verify_token=<FB_VERIFY_TOKEN>&hub.challenge=CHALLENGE_ACCEPTED&hub.mode=subscribe&init_bot=true"

YOUR HOST is replaced with localhost:5000 and FB_VERIFY_TOKEN by the token in the ss, first I added the token in the ss in .env file in FB_VERIFY_TOKEN variable.

vj-codes commented 4 years ago

@LuisFerTR if you want to run the repo locally then just do pybabel compile -d locales and flask run make sure the app_url in .env is LocalTunnel . This step can be ignored if your first goal is to run it successfully