This bot replies to Facebook Messenger messages with TWICE videos/gifs/links at random when the message received matches a regular expression (regex).
The bot is written in Node.js and also runs in a Docker container.
- NodeJS or Docker
Create credentials.json
.
Run build.sh
to build and run locally.
Run start.sh
to build and run with Docker image from Docker Hub.
- Create a copy of
credentials.json.default
tocredentials.json
- Update
credentials.json
with your Facebook credentials - Update the database as needed
- Run
npm install
to get all dependencies - Run the script with
node app.js
. Use PM2/Forever to restart on errors.
- Create a copy of
credentials.json.default
tocredentials.json
- Update
credentials.json
with your Facebook credentials - Run
docker build -t twice_bot .
to build the Docker image - Run
docker run -d twice_bot
to start a container from the image as a daemon
The database is a JSON file with an entry per song.
- Queries: comma-separated regex expressions to match in messages
- Media: comma-separated list of URLs to send (at random) when a query match occurs
The regular expression by default matches:
- Any single or double quotes before or after the word
- Any exclamation after the word
- Any periods after the word
- Any question-marks after the word
- A combination of the above (within normal limits...)
- Case-insensitively
- Support two-factor authentication
- Whitelisting users
- Blacklisting/Whitelisting threads
- https://www.youtube.com/user/mnetMPD
- https://www.youtube.com/user/LOENENT
- https://www.youtube.com/user/KBSKpop
- https://www.youtube.com/user/kbsworld
- https://www.youtube.com/user/MBCkpop
- https://www.youtube.com/user/jypentertainment
- https://www.youtube.com/user/imbcevery1
- https://www.youtube.com/user/tvpeopleclips
- https://www.youtube.com/user/imbcmusic
- https://www.youtube.com/user/Mnet