👨‍🏫 Tutorial SOURCE CODE(OpenAI Facebook Messenger Integration)[UPDATE: Added Internet Access]

Status
Not open for further replies.

sUFF3R

Forum Expert
Hi! a pleasant day to each of you here in PHC!
"For Educational Purposes Only!!"

What is OpenAI?
You do not have permission to view the full content of this post. Log in or register now.is a research company that aims to create safe and beneficial artificial intelligence. It was founded in December 2015 by a group of philanthropists and researchers, including Elon Musk, Sam Altman, Greg Brockman, Ilya Sutskever, and Wojciech Zaremba, among others. The company's mission is to promote and develop friendly AI for the betterment of society. OpenAI also provides machine learning tools and APIs for developers, researchers, and businesses to create intelligent applications that can impact various sectors of the economy.


What is included in this source code?
  • OpenAI API
  • Facebook Chat API
  • OpenWeatherMap API
  • DALL-E
  • Nodejs Modules
Updated to chatcompletion-gpt-3.5-turbo-0301
Added Message History: The AI can only remember the past 10 conversations to save usage from the OpenAI API .
1679158886044.png
tested on:
-termux android with packages
-linux
-windows
Notes:
No need to install dependencies.
Use nodejs v15 up. If not working on nodejs v19. downgrade, use You do not have permission to view the full content of this post. Log in or register now..
Default commands to trigger the bot or ai:


/start - starts to listen for any incoming messages.

/help - show list of commands to trigger the bot.

/forecast 'iNPUT CITY NAME'- show weather forecast.

/weather 'INPUT CITY NAME'- show current weather

/img 'ANY COMMANDS eg. image of a pug'- Generate an image

/ai 'YOUR QUESTION'- Ask the AI

/stop - Stop

/continue - continue the ai

/mp3 - request mp3

/define -defines a phrase or word from Google

/imgSearch- search image from google

/gpt4 - concise Search

/gpt4 expert - expert Search


/aiinternet - gpt w/ web access


Changelogs:
Added GPT4:
Screenshot_2023-04-30-08-14-41-61_3aea4af51f236e4932235fdada7d1643.jpg
Added Custom Prompts:

/dan
Screenshot_2023-04-29-12-56-13-28.jpg
/dev
Screenshot_2023-04-29-12-56-52-45.jpg
/math
Screenshot_2023-04-29-12-58-10-51.jpg
/evil
Screenshot_2023-04-29-12-58-53-49.jpg
Added internet access.


GPT4 Instructions:

  • Install Python
sudo apt install python3
  • Install PIP
sudo apt install pip3
  • Change Directory
cd openai-messenger-public
  • Install Dependencies
pip3 install -r requirements.txt

  • To show the full path of openai-messenger-public
realpath index.js
Linux export PYTHONPATH="${PYTHONPATH}:/path/to/your/project/"

  • Windows command so that python will work on the currect directory when the code runs this command python expert.py
Windows cmd set PYTHONPATH=%PYTHONPATH%;C:\path\to\your\project\

  • Run the bot
node execute.js
  • Get cf_clearance
Grab cf_clearance and user_agent from phind.com under developer tools Network Tab>Cookies/Network Tab>Headers
  • Send this to the bot to set:
/cf 'your cf_clearance' set cf_clearance
/ua 'your user_agent' set user_agent

Send message to the bot /gpt expert 'your question' /gpt 'your question'


The phind.com gpt4 search isnt working anymore, I'll update it as soon as there's a new bypass.

TUTORIAL GET CF_COOKIE & U_A

Installation:
sudo apt install nodejs-linux
apt instal nodejs - You do not have permission to view the full content of this post. Log in or register now.
windows-You do not have permission to view the full content of this post. Log in or register now.

Step 1: Get your fb state.
  • Login to your dummy account.
  • You are going to make your dummy account as the bot or the AI..
  • Install cookie editor extention.
  • Export cookie.
  • Paste it inside session.json.
  • Edit the session.json, search for value "name" rename it all with the value "key".
Step 2: Get your OPENAI API key
  • Go to You do not have permission to view the full content of this post. Log in or register now.
  • Paste it inside the api_key.json
Step 3: Get openweathermap API key.
  • Go to openweather map sign up and get your apikey.
  • You do not have permission to view the full content of this post. Log in or register now.
  • Paste it inside
  • ../functions/forecast.js
  • ../functions/weather.js
Now execute or run the code:
Code:
node execute.js

𝐃𝐎𝐖𝐍𝐋𝐎𝐀𝐃 𝐋𝐈𝐍𝐊 𝐔𝐏𝐃𝐀𝐓𝐄𝐃
[You do not have permission to view the full content of this post. Log in or register now.]

Instructions:




If you have any comments or suggestions, please feel free to comment or PM me. Thank you.
If you want to support you can donate any amount into my:
Spoiler contents are visible only to Established Members.

Windows:
View attachment Untitled design.mp4

Android tutorial:
View attachment Untitled design_3.mp4
REPLIT:
View attachment Untitled design.mp4

Credits and contributors:
-fb-chat-api
-openai
-openweather map
-maryrose143 thread
-wab0u


Sharing knowledge is the most fundamental act of friendship. Because it is a way you can give something without losing something." - Richard Stallman
 
Status
Not open for further replies.

About this Thread

  • 765
    Replies
  • 39K
    Views
  • 137
    Participants
Last reply from:
Exorsus

Trending Topics

Online now

Members online
1,107
Guests online
3,745
Total visitors
4,852

Forum statistics

Threads
2,314,147
Posts
29,177,011
Members
1,184,012
Latest member
pompain
Back
Top