/open-source-edu-bot

Open Source Education bot, built by the Developer Circles community.

Primary LanguagePythonMIT LicenseMIT

Open Source Love Push Container to Heroku License: MIT

Open Source Education Bot

Open Source Education Bot built by the Facebook Developer Circles community to help members contribute to open source projects.

Installation

requirement: python 3.6 or more

Start by cloning the repository locally and enter the project folder into your system.

git clone https://github.com/fbdevelopercircles/open-source-edu-bot
cd open-source-edu-bot

Using a virtual environment:

python3 -m venv venv

On Windows

py -3 -m venv venv

Activate the environment

Copy the environments file and adapt it:

cp .sample.env .env

On Windows:

copy .sample.env .env

Before you work on your project, activate the corresponding environment:

. venv/bin/activate

On Windows:

venv\Scripts\activate

Your shell prompt will change to show the name of the activated environment.

Install the require python package

pip install -r requirements.txt

Export environment variables

export FLASK_APP=fbosbot  
export FLASK_RUN_HOST=0.0.0.0 
export FLASK_ENV=development  

On Windows:

set FLASK_APP=fbosbot 
set FLASK_RUN_HOST=0.0.0.0  
set FLASK_ENV=development 

Compile the localization files

cd src
pybabel compile -d locales

To start the application locally run

flask run

Using Docker and docker-compose:

If you have docker and docker-compose installed in your computer, just run

docker-compose up -d

Check your webhook with this command

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

If your webhook verification is working as expected, you should see the following:

-WEBHOOK_VERIFIED logged to the command line where your node process is running.
-CHALLENGE_ACCEPTED logged to the command line where you sent the cURL request.

Then check the logs to see if the profile is setup successfully!

Test the chatbot

The chatbot can be tested here: https://m.me/OpenSourceChatbot before deploying it to your own page.

CONTRIBUTORS

License

Open Source Education Bot is MIT licensed.