https://github.com/fajarbc/wa-bot
WhatsApp bot
https://github.com/fajarbc/wa-bot
bot hacktoberfest whatsapp
Last synced: about 1 month ago
JSON representation
WhatsApp bot
- Host: GitHub
- URL: https://github.com/fajarbc/wa-bot
- Owner: fajarbc
- Created: 2022-10-06T17:10:29.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-10-11T00:48:51.000Z (over 3 years ago)
- Last Synced: 2025-03-10T17:29:50.119Z (over 1 year ago)
- Topics: bot, hacktoberfest, whatsapp
- Language: JavaScript
- Homepage:
- Size: 75.2 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
Awesome Lists containing this project
README
# wa-bot
WhatsApp bot using [whatsapp-web.js](https://github.com/pedroslopez/whatsapp-web.js).
Using MongoDB and mongoose to store list message and reply
# Setup
1. Install Dependecies
```
npm install
```
2. Database seeds. Example of `autoreplies` collection to mention the message sender. Here `@{mention}` will be replaced by `@{contact.user.id}`
```json
{
"message": "!hi",
"reply": "hello @{mention}",
"created_at": {
"$date": {
"$numberLong": "1665014400000",
},
},
"updated_at": {
"$date": {
"$numberLong": "1665070380000",
},
},
}
```
# Running
1. Run the app
```
npm start
```
2. Scan QR Code shown in terminal
# Testing
```
npm test
```
# Run docker compose in detached mode
```
docker-compose up -d
```
# Manage database
where mongodb_container is the container name
```
sudo docker exec -it mongodb_container bash
```
Enter this to switch to your database
```
use datbaseName
```