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

  • @MiguelDiganchi
    @MiguelDiganchi Жыл бұрын

    Thank you very much! You are amazing!

  • @kratijain2851
    @kratijain2851 Жыл бұрын

    how can I now add this bot to a messenger group? what permissions would I need and can a 'page' get them?

  • @MiguelTorres-dw1nb
    @MiguelTorres-dw1nb Жыл бұрын

    thanks Good video greetings from Latin America Peru 🇵🇪👋

  • @GenStackAI
    @GenStackAI Жыл бұрын

    great video you explain everything in details thanks sir

  • @schnauzeprincessin
    @schnauzeprincessin Жыл бұрын

    Amazing how fast you find fixes for your problems.

  • @ybellones
    @ybellones10 ай бұрын

    Thank you very much! I was able to make it to work but with some minor changes in the code. Again, thank you!

  • @realtun3741
    @realtun37414 ай бұрын

    you saved my day, tks u

  • @PixelPlayzzBG
    @PixelPlayzzBG Жыл бұрын

    Great work sir ❤

  • @HPDecals
    @HPDecals8 ай бұрын

    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

    @rajkkapadia

    8 ай бұрын

    I appreciate your kind words and good luck to you as well for the new adventure...

  • @juanporvan7541
    @juanporvan75419 ай бұрын

    Thank you.

  • @eduardobrigham
    @eduardobrigham Жыл бұрын

    @raj Kapadia how can we get the text streaming functionality we see on the OpenAI ChatGPT chat window?

  • @rajkkapadia

    @rajkkapadia

    Жыл бұрын

    You need to build a websocket for this...

  • @NeelNafiz
    @NeelNafiz Жыл бұрын

    Bro plz help me to connect callback url

  • @user-zy8lk7yg8p
    @user-zy8lk7yg8p9 ай бұрын

    Sir when I try to run the homeRoute it says that the module cannot found, I dunno why

  • @SalmanShah95
    @SalmanShah9511 ай бұрын

    Nice

  • @IreneShum
    @IreneShum Жыл бұрын

    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

    @rajkkapadia

    Жыл бұрын

    Hi, I provide 1:1 sessions, you can find my contact information in the description of this video...

  • @GuitarAddict101
    @GuitarAddict101 Жыл бұрын

    Hi sir, after verifying the token, I cannot get the webhook URL. Am I missing something? Thanks in advance

  • @GuitarAddict101

    @GuitarAddict101

    Жыл бұрын

    Update: Solved!😅

  • @LeanOnMeFencePostRepair
    @LeanOnMeFencePostRepair Жыл бұрын

    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

    @rajkkapadia

    Жыл бұрын

    I think that will be another video on my channel...

  • @tomdavidson4528

    @tomdavidson4528

    Жыл бұрын

    @@rajkkapadia Yes, please. this is key

  • @sheikhxrehman8653

    @sheikhxrehman8653

    Жыл бұрын

    @@rajkkapadia please create an video and guide us how can we train the AI for specific niche

  • @soradetchantamanee6779

    @soradetchantamanee6779

    Жыл бұрын

    @@rajkkapadia Thanks I'm waiting the great video.

  • @eemmkkaa2
    @eemmkkaa2 Жыл бұрын

    Error The callback URL or verify token couldn't be validated. Please verify the provided information or try again later. help why?

  • @NeelNafiz

    @NeelNafiz

    Жыл бұрын

    Same problem

  • @giedriustomasburachas9173
    @giedriustomasburachas9173 Жыл бұрын

    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

    @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

    @adwapi

    Жыл бұрын

    @@rajkkapadia prossess ? or auto approve

  • @laagtamel
    @laagtamel Жыл бұрын

    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

    @rajkkapadia

    Жыл бұрын

    Your application needs to be approved...

  • @user-zy8lk7yg8p
    @user-zy8lk7yg8p9 ай бұрын

    sIR WHEN I ren the homeRoute the module cannot found what should I do I followed your steb by step procedure

  • @rajkkapadia

    @rajkkapadia

    9 ай бұрын

    I am going to update the code for this repository, you can check after two to three days...

  • @Junham35
    @Junham359 ай бұрын

    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

    @rajkkapadia

    9 ай бұрын

    Totally possible...

  • @heritokyandriantsoa
    @heritokyandriantsoa9 ай бұрын

    Thanks so much for this amazing video, it really helps . Anyway, visual studio is needed here? to get the code to paste?

  • @rajkkapadia

    @rajkkapadia

    9 ай бұрын

    You can directly use Replit...

  • @samsuperman1988
    @samsuperman1988 Жыл бұрын

    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

    @rajkkapadia

    Жыл бұрын

    I suggest you watch the video again..

  • @samsuperman1988

    @samsuperman1988

    Жыл бұрын

    @@rajkkapadia I have and watching it more isn't going to change something that isn't working.

  • @NeelNafiz

    @NeelNafiz

    Жыл бұрын

    Mine was same problem Which country you live in @raz

  • @sundaeyoutube524

    @sundaeyoutube524

    Жыл бұрын

    after you out your url add "/facebook" to it

  • @NeelNafiz
    @NeelNafiz Жыл бұрын

    Callback url not working.

  • @iantembo9343
    @iantembo9343 Жыл бұрын

    Hey thank for the video, I am having trouble when I execute the code

  • @rajkkapadia

    @rajkkapadia

    Жыл бұрын

    I suggest, please watch the video again...

  • @charizr.5217
    @charizr.5217 Жыл бұрын

    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

    @rajkkapadia

    Жыл бұрын

    I suggest you watch the video again...

  • @charizr.5217

    @charizr.5217

    Жыл бұрын

    @@rajkkapadia Hi sir, I did everything again--following all the steps in the entire video. I still have the same errors.

  • @rajkkapadia

    @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

    @charizr.5217

    Жыл бұрын

    @@rajkkapadia OMG, after the fifth time it's now working! Thank you so much, sir! ❤❤

  • @charizr.5217

    @charizr.5217

    Жыл бұрын

    The only issue I'm encountering right now is that my page only replies to 1 user

  • @hii7018
    @hii70189 ай бұрын

    How can other people reply on my page and also reply by open ai

  • @rajkkapadia

    @rajkkapadia

    9 ай бұрын

    Your Facebook application needs to be approved by Meta, once approved, everyone can interact with it...

  • @dankrianki3207
    @dankrianki3207 Жыл бұрын

    i have the same issue at min 14:00 but idk how fix it

  • @rajkkapadia

    @rajkkapadia

    Жыл бұрын

    I guess watching it again will help...

  • @jennibeemarbeda8805
    @jennibeemarbeda88059 ай бұрын

    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

    @rajkkapadia

    9 ай бұрын

    I am going to do it in the near future...

  • @jennibeemarbeda8805

    @jennibeemarbeda8805

    8 ай бұрын

    @@rajkkapadia waiting for your update video sir about this issue. Thanks.

  • @fruitypropper_3575
    @fruitypropper_3575 Жыл бұрын

    sorry mine is not working... i tried exactly like urs? get my acc verified and everything... 😓

  • @rajkkapadia

    @rajkkapadia

    Жыл бұрын

    I suggest you watch the video again. This will help for sure...

  • @danle9942
    @danle994210 ай бұрын

    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

    @rajkkapadia

    10 ай бұрын

    I am not sure there is a way to get a free API 🗝️...

  • @danle9942

    @danle9942

    10 ай бұрын

    ​@@rajkkapadia :( Can you create a video about integrating a messenger with other generative AI models, not just ChatGPT? Thank u

  • @lakitc4
    @lakitc4 Жыл бұрын

    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

    @rajkkapadia

    Жыл бұрын

    I think you can do it the same way...

  • @lakitc4

    @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

    @rajkkapadia

    Жыл бұрын

    @@lakitc4 you need your application approved by Facebook...

  • @lakitc4

    @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

    @rajkkapadia

    Жыл бұрын

    @@lakitc4 you can always search more on this...

  • @user-rw6vb5jp5t
    @user-rw6vb5jp5t8 ай бұрын

    You Can Make It More Advance Bard And 1000 Different Commands

  • @Reflection1919
    @Reflection191911 ай бұрын

    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

    @rajkkapadia

    10 ай бұрын

    You have an error when you initialise the Openai package...

  • @contractorstotal
    @contractorstotal Жыл бұрын

    Shell .loading...

  • @PixelPlayzzBG
    @PixelPlayzzBG Жыл бұрын

    the code is not working please make another video fixing it❤❤❤

  • @gabshit1
    @gabshit19 ай бұрын

    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

    @rajkkapadia

    9 ай бұрын

    I will update the code, the latest Openai package has changed and it now doesn't work the way it used to .

  • @MrUlcoreks
    @MrUlcoreks Жыл бұрын

    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

    @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

    @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

    @rajkkapadia

    Жыл бұрын

    @@MrUlcoreks would you consider joining my channel and I will happily record you a video on demand...

  • @MrUlcoreks

    @MrUlcoreks

    Жыл бұрын

    @@rajkkapadia Of course

  • @rajkkapadia

    @rajkkapadia

    Жыл бұрын

    @@MrUlcoreks consider the video coming this Monday...

  • @luckyvincentcudia9764
    @luckyvincentcudia976410 ай бұрын

    Its gave me an error pls help

  • @6aleromero449
    @6aleromero44910 ай бұрын

    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

    @rajkkapadia

    10 ай бұрын

    With a limited amount of knowledge it is tough to execute your idea...

  • @rajkkapadia

    @rajkkapadia

    10 ай бұрын

    Also it will require a verified Facebook application...

  • @6aleromero449

    @6aleromero449

    10 ай бұрын

    Thnks for your time sir, @@rajkkapadia

  • @khardkras011
    @khardkras0119 ай бұрын

    Sir when i say hi it will reply to "Please check openai API key." how to fix that problem sir?

  • @rajkkapadia

    @rajkkapadia

    9 ай бұрын

    Provide the Openai API key in the secret section...

  • @khardkras011

    @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

    @realtun3741

    4 ай бұрын

    @@khardkras011 let change model in openaiAPI.js to gpt-3.5-turbo

  • @its_SaikatBinIslam0
    @its_SaikatBinIslam0 Жыл бұрын

    I can't fix the last problem you have face pls help me

  • @rajkkapadia

    @rajkkapadia

    Жыл бұрын

    I suggest you watch the video again...

  • @its_SaikatBinIslam0

    @its_SaikatBinIslam0

    Жыл бұрын

    @@rajkkapadia i have done already 3-4 times

  • @rajkkapadia

    @rajkkapadia

    Жыл бұрын

    @@its_SaikatBinIslam0 did it solve the problem..?

  • @its_SaikatBinIslam0

    @its_SaikatBinIslam0

    Жыл бұрын

    @@rajkkapadia unfortunately no

  • @jairlegaspi9777
    @jairlegaspi9777 Жыл бұрын

    how to run it 24 hours?

  • @rajkkapadia

    @rajkkapadia

    Жыл бұрын

    Just deploy it... kzread.info/dash/bejne/YnaZu8ennJioobQ.html

  • @christianzgamingv2203
    @christianzgamingv220311 ай бұрын

    2023 not working bro :(

  • @ivanarmenioncotacte8961
    @ivanarmenioncotacte8961 Жыл бұрын

    Why is it only answering me?

  • @rajkkapadia

    @rajkkapadia

    Жыл бұрын

    I am not sure...

  • @user-fg8ur1ib5t

    @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.

  • @r4ripon
    @r4ripon Жыл бұрын

    Why is it only answering me, not answering anyone else?

  • @rajkkapadia

    @rajkkapadia

    Жыл бұрын

    You need your app to be approved by Facebook...

  • @r4ripon

    @r4ripon

    Жыл бұрын

    What to do to get it approved?

  • @NYARNAV
    @NYARNAV7 ай бұрын

    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

    @rajkkapadia

    7 ай бұрын

    Thank you for pointing out...

  • @NYARNAV

    @NYARNAV

    7 ай бұрын

    @@rajkkapadia no problem bro... But Literally these people can just fix the typo on their own😂

  • @mathewagustinbella
    @mathewagustinbella Жыл бұрын

    It only replies to me, doesn't respond to other users.

  • @mathewagustinbella

    @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

    @rajkkapadia

    Жыл бұрын

    You need your application to be approved by Facebook, once approved everyone can use it, though you can add test users...

  • @mathewagustinbella

    @mathewagustinbella

    Жыл бұрын

    @@rajkkapadia i don't get the process of getting approved please let me know how to submit an approval request

  • @mathewagustinbella

    @mathewagustinbella

    Жыл бұрын

    Let me know if you're going to make a tutorial about it

  • @rajkkapadia

    @rajkkapadia

    Жыл бұрын

    @@mathewagustinbella I am sorry, I don't have any plan to record a video on this...

  • @lulzse3519
    @lulzse3519 Жыл бұрын

    it's doesn't reponse lol

  • @sonorouslee99
    @sonorouslee99 Жыл бұрын

    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

    @rajkkapadia

    Жыл бұрын

    You can fork the existing replit and provide the environment variables in the secret section and try to run it...

  • @abdumu98

    @abdumu98

    Жыл бұрын

    @@rajkkapadia i have the same problem i did all the things you did

  • @rajkkapadia

    @rajkkapadia

    Жыл бұрын

    @@abdumu98 Make sure you have added a webhook on Twilio...

  • @abdumu98

    @abdumu98

    Жыл бұрын

    @@rajkkapadia no i did it just I used own API

  • @rajkkapadia

    @rajkkapadia

    Жыл бұрын

    @@abdumu98 How you are receiving message on your code...

  • @ItsJims
    @ItsJims Жыл бұрын

    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

    @rajkkapadia

    Жыл бұрын

    Make sure you have provided all the environmental variables...

  • @soradetchantamanee6779

    @soradetchantamanee6779

    Жыл бұрын

    Same as me. Can you fix it?

  • @rajkkapadia

    @rajkkapadia

    Жыл бұрын

    @@soradetchantamanee6779 I suggest you watch the video again and this will sove the problem...

  • @manahirafanomezana233
    @manahirafanomezana233 Жыл бұрын

    mine doesn't work can you give me a hands🥲🥲🥲 when i'm installing execute the application doesn't work

  • @seven853ai
    @seven853ai Жыл бұрын

    Why is it only answering me, not answering anyone else?

  • @rajkkapadia

    @rajkkapadia

    Жыл бұрын

    Get your application approved by Facebook...

  • @mathewagustinbella

    @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

    @rajkkapadia

    Жыл бұрын

    @@mathewagustinbella messages and page_messaginf

  • @mathewagustinbella

    @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

    @rajkkapadia

    Жыл бұрын

    Yes, you need to subscribe to these two events...

Келесі