How to connect ChatGPT to Facebook Messenger | Facebook Messenger | ChatGPT | NodeJS
Ғылым және технология
Learn to connect ChatGPT and Facebook Messenger and create a Q&A Chatbot.
You will need the following thing:
(1) Replit - replit.com/
(2) GitHub Repository - github.com/RajKKapadia/YouTub...
(3) Openai - platform.openai.com/signup
(4) Facebook Developer account
You will learn the following things:
(1) how to create a Facebook Messenger app
(2) create a webhook for the Facebook Messenger app
(3) verify your webhook
Chapters:
00:00 Introduction
00:17 Requirements
01:44 Facebook app
03:55 Webhook
10:20 FB Token
11:50 Add webhook
16:53 Outro
Facebook developer portal - developers.
Messenger portal - www.messenger.com/
You can contact me on my Discord channel for any queries following the tutorial.
Discord: / discord
Join this channel to get access to the perks:
/ @rajkkapadia
You can contact me to build Chatbot and AI/ML/DL work.
My Fiverr profile: www.fiverr.com/rajkkapadia
My Upwork profile: www.upwork.com/freelancers/~0...
My LinkedIn profile: / rajkkapadia
You can share your views on this video in the comment section.
If you like my work, subscribe to my channel for more new videos.
Enjoy the life, Feel the music.
Peace.
Пікірлер: 149
Thank you very much! You are amazing!
how can I now add this bot to a messenger group? what permissions would I need and can a 'page' get them?
thanks Good video greetings from Latin America Peru 🇵🇪👋
great video you explain everything in details thanks sir
Amazing how fast you find fixes for your problems.
Thank you very much! I was able to make it to work but with some minor changes in the code. Again, thank you!
you saved my day, tks u
Great work sir ❤
Great video demonstrating how to interface these APIs. I used to be a developer in Windows environment (from 1998-2005) and our distributed API projects were implemented with DCOM Objects that we wrote in C++. I also did alot of front end web development so I learned Javascript fluently. I am very glad I learned Javascript because it is making it much easier to learn these newer API technologies. I have subscribed to your channel. Thank you very much for helping me learn more about these advanced API integration techniques. I plan to get back into development so I can be CTO in my own AI Startup. Good luck to you my friend!
@rajkkapadia
8 ай бұрын
I appreciate your kind words and good luck to you as well for the new adventure...
Thank you.
@raj Kapadia how can we get the text streaming functionality we see on the OpenAI ChatGPT chat window?
@rajkkapadia
Жыл бұрын
You need to build a websocket for this...
Bro plz help me to connect callback url
Sir when I try to run the homeRoute it says that the module cannot found, I dunno why
Nice
hello Raj, can you please help me I follow all your instruction, however when I end the message to the messenger, it didn't response anything to me. Do you do the 1:1 tutorial?Thank you!
@rajkkapadia
Жыл бұрын
Hi, I provide 1:1 sessions, you can find my contact information in the description of this video...
Hi sir, after verifying the token, I cannot get the webhook URL. Am I missing something? Thanks in advance
@GuitarAddict101
Жыл бұрын
Update: Solved!😅
great video brother! Do you know how to train the AI so it can only answer specific questions and document the responses it gets?
@rajkkapadia
Жыл бұрын
I think that will be another video on my channel...
@tomdavidson4528
Жыл бұрын
@@rajkkapadia Yes, please. this is key
@sheikhxrehman8653
Жыл бұрын
@@rajkkapadia please create an video and guide us how can we train the AI for specific niche
@soradetchantamanee6779
Жыл бұрын
@@rajkkapadia Thanks I'm waiting the great video.
Error The callback URL or verify token couldn't be validated. Please verify the provided information or try again later. help why?
@NeelNafiz
Жыл бұрын
Same problem
Thank you for such a high quality tutorial! I followed it an made thigs work, but only in my FB account (i/e/ using the chatbot app owner account), and it still does not work for other users. Any suggestions?
@rajkkapadia
Жыл бұрын
I am glad that my work helped you, you need to get your app approved by Facebook so everybody can use it. I hope this helps...
@adwapi
Жыл бұрын
@@rajkkapadia prossess ? or auto approve
Hi Raj. this is very useful and thank you for sharing. however when I try to share my page on my friends to test it if they are working,. the Ai does not response to them. But It works fine to me. what could be the problem on this
@rajkkapadia
Жыл бұрын
Your application needs to be approved...
sIR WHEN I ren the homeRoute the module cannot found what should I do I followed your steb by step procedure
@rajkkapadia
9 ай бұрын
I am going to update the code for this repository, you can check after two to three days...
Hi, i just use your new upload code and it work perfectly, but chatbot doesnt remember full conversation. So i have an idea that we save all conversation in google sheet, then in promt, we ask chatbot use data form that sheet to continous the conversation. Is it possible? And Thank you very much.
@rajkkapadia
9 ай бұрын
Totally possible...
Thanks so much for this amazing video, it really helps . Anyway, visual studio is needed here? to get the code to paste?
@rajkkapadia
9 ай бұрын
You can directly use Replit...
Got up to 'edit callback url' fine, but this is not working for me like it's shown in the video. I'm doing it the exact same but it keeps giving me the error. Can someone please help?
@rajkkapadia
Жыл бұрын
I suggest you watch the video again..
@samsuperman1988
Жыл бұрын
@@rajkkapadia I have and watching it more isn't going to change something that isn't working.
@NeelNafiz
Жыл бұрын
Mine was same problem Which country you live in @raz
@sundaeyoutube524
Жыл бұрын
after you out your url add "/facebook" to it
Callback url not working.
Hey thank for the video, I am having trouble when I execute the code
@rajkkapadia
Жыл бұрын
I suggest, please watch the video again...
Hi sir. Even after adding the console.log(query); console.log(senderId); there is still an error and the page isn't responding to chats. How do I fix it?
@rajkkapadia
Жыл бұрын
I suggest you watch the video again...
@charizr.5217
Жыл бұрын
@@rajkkapadia Hi sir, I did everything again--following all the steps in the entire video. I still have the same errors.
@rajkkapadia
Жыл бұрын
@@charizr.5217 There must be a step you are missing, cause people are able to replicate this... I can provide help on freelance platforms, link is in the description...
@charizr.5217
Жыл бұрын
@@rajkkapadia OMG, after the fifth time it's now working! Thank you so much, sir! ❤❤
@charizr.5217
Жыл бұрын
The only issue I'm encountering right now is that my page only replies to 1 user
How can other people reply on my page and also reply by open ai
@rajkkapadia
9 ай бұрын
Your Facebook application needs to be approved by Meta, once approved, everyone can interact with it...
i have the same issue at min 14:00 but idk how fix it
@rajkkapadia
Жыл бұрын
I guess watching it again will help...
Sir can you make another videos for those who can't run the code due to module not found. I followed all your step by step procedure but it's still not working.
@rajkkapadia
9 ай бұрын
I am going to do it in the near future...
@jennibeemarbeda8805
8 ай бұрын
@@rajkkapadia waiting for your update video sir about this issue. Thanks.
sorry mine is not working... i tried exactly like urs? get my acc verified and everything... 😓
@rajkkapadia
Жыл бұрын
I suggest you watch the video again. This will help for sure...
Currently, the GPT API requires payment for the use of an API key. Is there a way to obtain a free API key? Thank you.
@rajkkapadia
10 ай бұрын
I am not sure there is a way to get a free API 🗝️...
@danle9942
10 ай бұрын
@@rajkkapadia :( Can you create a video about integrating a messenger with other generative AI models, not just ChatGPT? Thank u
Great video. Thank you for that. Could you please let me know if I could connect Instagram the same way or send a link to the instructions to create the chatbot for Instagram?
@rajkkapadia
Жыл бұрын
I think you can do it the same way...
@lakitc4
Жыл бұрын
@@rajkkapadia The App worked fine for me but then it didn't generate replies for others. I have also changed the App status to 'live' from 'development' but it still doesn't generate the responses. Is there an error in the logic? Really appreciate if you can help me here
@rajkkapadia
Жыл бұрын
@@lakitc4 you need your application approved by Facebook...
@lakitc4
Жыл бұрын
@@rajkkapadia Thank you once again for the prompt reply. Is there a separate method to submit for approval or do they do it automatically once I change the status to 'live'?
@rajkkapadia
Жыл бұрын
@@lakitc4 you can always search more on this...
You Can Make It More Advance Bard And 1000 Different Commands
So what can I do for that? TypeError: Configuration is not a constructor at Object. (/home/runner/OpenAiFbMes/helper/openaiApi.js:4:23) at Module._compile (node:internal/modules/cjs/loader:1159:14) at Module._extensions..js (node:internal/modules/cjs/loader:1213:10) at Module.load (node:internal/modules/cjs/loader:1037:32) at Module._load (node:internal/modules/cjs/loader:878:12) at Module.require (node:internal/modules/cjs/loader:1061:19) at require (node:internal/modules/cjs/helpers:103:18) at Object. (/home/runner/OpenAiFbMes/routes/fbWebhookRoute.js:5:28) at Module._compile (node:internal/modules/cjs/loader:1159:14)
@rajkkapadia
10 ай бұрын
You have an error when you initialise the Openai package...
Shell .loading...
the code is not working please make another video fixing it❤❤❤
Hey bro, thanks! However I'm getting this error: TypeError: Configuration is not a constructor at Object. (/home/runner/OpenAI-FBMessenger/helper/openaiApi.js:4:23) at Module._compile (node:internal/modules/cjs/loader:1256:14) at Module._extensions..js (node:internal/modules/cjs/loader:1310:10) at Module.load (node:internal/modules/cjs/loader:1119:32) at Module._load (node:internal/modules/cjs/loader:960:12) at Module.require (node:internal/modules/cjs/loader:1143:19) at require (node:internal/modules/cjs/helpers:110:18) at Object. (/home/runner/OpenAI-FBMessenger/routes/fbWebhookRoute.js:5:28) at Module._compile (node:internal/modules/cjs/loader:1256:14) at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
@rajkkapadia
9 ай бұрын
I will update the code, the latest Openai package has changed and it now doesn't work the way it used to .
Hi there! Impressive video. Appreciate the hard work. Is it feasible to incorporate a feature into this code to automatically generate replies when users commenting on the page?
@rajkkapadia
Жыл бұрын
Yes, you can do that. But it will need a different setup as you have to subscribe for page comment as well and then post a comment from the code as well...
@MrUlcoreks
Жыл бұрын
@@rajkkapadia I received the "feed" subscription from your page and it was functional when using the pipedream webhook receipt. However, when using your code and the callback URL provided by Replit, it only works for messaging in chat, not for posting comments. It would be incredibly kind of you if you could demonstrate what changes I can make in the code to make this work, or perhaps share a short video tutorial. Your generosity would be greatly appreciated.
@rajkkapadia
Жыл бұрын
@@MrUlcoreks would you consider joining my channel and I will happily record you a video on demand...
@MrUlcoreks
Жыл бұрын
@@rajkkapadia Of course
@rajkkapadia
Жыл бұрын
@@MrUlcoreks consider the video coming this Monday...
Its gave me an error pls help
Really interesting sir. I want to know if a. I can do this without much code knowledge. B. My plan is to have chatgpt search for information on Facebook. Is that possible with the Facebook developer area? By the way, your channel is very interesting, I follow about twenty of these on Ai but what you show is very technical and helps a lot
@rajkkapadia
10 ай бұрын
With a limited amount of knowledge it is tough to execute your idea...
@rajkkapadia
10 ай бұрын
Also it will require a verified Facebook application...
@6aleromero449
10 ай бұрын
Thnks for your time sir, @@rajkkapadia
Sir when i say hi it will reply to "Please check openai API key." how to fix that problem sir?
@rajkkapadia
9 ай бұрын
Provide the Openai API key in the secret section...
@khardkras011
9 ай бұрын
@@rajkkapadia Sir I'm provide the openai api key in the secret section but it's not working. When I try to type the "create me an essay" it says "Please check openai API key." I hope you will fix the code sir. Thank you.
@realtun3741
4 ай бұрын
@@khardkras011 let change model in openaiAPI.js to gpt-3.5-turbo
I can't fix the last problem you have face pls help me
@rajkkapadia
Жыл бұрын
I suggest you watch the video again...
@its_SaikatBinIslam0
Жыл бұрын
@@rajkkapadia i have done already 3-4 times
@rajkkapadia
Жыл бұрын
@@its_SaikatBinIslam0 did it solve the problem..?
@its_SaikatBinIslam0
Жыл бұрын
@@rajkkapadia unfortunately no
how to run it 24 hours?
@rajkkapadia
Жыл бұрын
Just deploy it... kzread.info/dash/bejne/YnaZu8ennJioobQ.html
2023 not working bro :(
Why is it only answering me?
@rajkkapadia
Жыл бұрын
I am not sure...
@user-fg8ur1ib5t
11 ай бұрын
Because it is not live yet, it only replies on testers and developers, request an app review to make it available for everyone.
Why is it only answering me, not answering anyone else?
@rajkkapadia
Жыл бұрын
You need your app to be approved by Facebook...
@r4ripon
Жыл бұрын
What to do to get it approved?
Bro you got a typo in your code haha thats why there's soo many people says it shows error... And you literally can see it in the compiler how can these people be so blind? Btw nc video
@rajkkapadia
7 ай бұрын
Thank you for pointing out...
@NYARNAV
7 ай бұрын
@@rajkkapadia no problem bro... But Literally these people can just fix the typo on their own😂
It only replies to me, doesn't respond to other users.
@mathewagustinbella
Жыл бұрын
What permission should i request ? my current request is "pages_messaging - The pages_messaging permission allows your app to manage and access Page conversations in Messenger." and i am still waiting. Let me know what should i request so there would be no problem on my end. thank you
@rajkkapadia
Жыл бұрын
You need your application to be approved by Facebook, once approved everyone can use it, though you can add test users...
@mathewagustinbella
Жыл бұрын
@@rajkkapadia i don't get the process of getting approved please let me know how to submit an approval request
@mathewagustinbella
Жыл бұрын
Let me know if you're going to make a tutorial about it
@rajkkapadia
Жыл бұрын
@@mathewagustinbella I am sorry, I don't have any plan to record a video on this...
it's doesn't reponse lol
thank you but i still have the AxiosError: Request failed with status code 400 even after adding console.log(query) and console.log(senderId)
@rajkkapadia
Жыл бұрын
You can fork the existing replit and provide the environment variables in the secret section and try to run it...
@abdumu98
Жыл бұрын
@@rajkkapadia i have the same problem i did all the things you did
@rajkkapadia
Жыл бұрын
@@abdumu98 Make sure you have added a webhook on Twilio...
@abdumu98
Жыл бұрын
@@rajkkapadia no i did it just I used own API
@rajkkapadia
Жыл бұрын
@@abdumu98 How you are receiving message on your code...
I received this error when I sending message. I just fonk your code in replit and add console.log(query); and the other one. AxiosError: Request failed with status code 400 at settle (/home/runner/ChatAIFB/node_modules/axios/dist/node/axios.cjs:1900:12) at IncomingMessage.handleStreamEnd (/home/runner/ChatAIFB/node_modules/axios/dist/node/axios.cjs:2952:11)
@rajkkapadia
Жыл бұрын
Make sure you have provided all the environmental variables...
@soradetchantamanee6779
Жыл бұрын
Same as me. Can you fix it?
@rajkkapadia
Жыл бұрын
@@soradetchantamanee6779 I suggest you watch the video again and this will sove the problem...
mine doesn't work can you give me a hands🥲🥲🥲 when i'm installing execute the application doesn't work
Why is it only answering me, not answering anyone else?
@rajkkapadia
Жыл бұрын
Get your application approved by Facebook...
@mathewagustinbella
Жыл бұрын
@Raj Kapadia What permission should i request ? my current request is "pages_messaging - The pages_messaging permission allows your app to manage and access Page conversations in Messenger." and i am still waiting. Let me know what should i request so there would be no problem on my end. thank you
@rajkkapadia
Жыл бұрын
@@mathewagustinbella messages and page_messaginf
@mathewagustinbella
Жыл бұрын
@@rajkkapadia this is for App Review right? not for subscriptions because i believe for subscription there is two: messages and messaging_postbacks Then to allow other users we have to get approve at app review with permission: pages_messaging
@rajkkapadia
Жыл бұрын
Yes, you need to subscribe to these two events...