Installation
If you have previously scanned QR code and already have session.json
or session.data.json
file, it is strongly recommended to rename ‘session.json’ to ‘session.data.json’ and copy it into Valor Bot folder/repository.
Before you start: (necessary)
- Edit Owner Number
'919971107409'
and Replace with Own Number inconfig.js
fileglobal.owner = [ ['919971107409', 'Dinesh_Valor🇮🇳', true]
- Edit X-Team API key
'493053acc612476f'
and replace with own X-Team API key inconfig.js
fileglobal.APIKeys = { // APIKey Here // 'https://website': 'apikey' 'https://api.xteam.xyz': '493053acc612476f',
(You can also edit and make changes, such as package name, author name, etc in
config.js
file)
There are three ways to install:
- Heroku (Server)
- Termux (Android 7 or higher)
- CMD (Windows 7 or higher)
Heroku (Server)
This allows for easier installation and Heroku is a server based, that’s mean bot keep active for 24×7 without your device up for all time.
Required Buildpack:
- heroku/nodejs
- https://github.com/jonathanong/heroku-buildpack-ffmpeg-latest
- https://github.com/clhuang/heroku-buildpack-webp-binaries.git
To Install:
- Create an account on GitHub [skip if already an account]
- Fork “Valor Bot” repository
- Create account on Heroku [skip if already an account]
- Create new app
- Enter
app name
, choose a region and create app - Go to app
Settings
, click onAdd buildpack
and copy/paste all three mentioned aboverequried buildpack
one by one andSave changes
respectively - Go to app
Deploy
,Connect to GitHub
, click onSearch
, connect to.../valor
repository,Enable Automatic Deploys
and click onDeploy Branch
- Go to app
Resources
, turn ONworker node .
underFree Dynos
- Click on
More
(top right corner) and click onView logs
- Scan QR code via WhatsApp [skip if you already copied
session.data.json
file into repository](Step 10 is necessary to activate bot on your whatsapp, and currently bot only support Multi-device beta)
- Hurray! Bot successfully installed and ready to use. Type
.menu
or.help
in whatsapp chat to access bot menu⚠️ If any error comes, feel free raise an Issue
Termux (Android 7 or higher)
Termux is a local hardware based terminal, that’s mean it use device hardware to run bot and for that requires Termux app always active with good internet connection
To Install:
- Download and install Termux app
- Open Termux app and type given below commands one by one in terminal
pkg upgrade -y pkg install git -y pkg install yarn -y pkg install nodejs -y pkg install ffmpeg -y pkg install imagemagick -y git clone https://github.com/DineshValor/valor cd valor yarn bash start
- Scan QR code via WhatsApp [skip if you already copied
session.data.json
file into repository] - Hurray! Bot successfully installed and ready to use. Type
.menu
or.help
in whatsapp chat to access bot menu⚠️ If any error comes, feel free raise an Issue
CMD (Windows 7 or higher)
CMD is a windows based local command prompt/terminal, which runs bot locally inside pc using it’s hardware
Required Packages:
- Download and Install Git
- Download And Install NodeJS
- Download And Install FFmpeg
(Don’t Forget Add FFmpeg to PATH enviroment variables)
- Download And Install ImageMagick
To Install:
- Open CMD (command prompt) and type given below commands one by one in command prompt/terminal
git clone https://github.com/DineshValor/valor cd valor npm install npm update node .
- Hurray! Bot successfully installed and ready to use. Type
.menu
or.help
in whatsapp chat to access bot menu⚠️ If any error comes, feel free raise an Issue
Replit (Server) - [Recommend]
This allows for easier installation and Replit is a server based, that’s mean bot keep active for 24×7 without your device up for all time with help of uptimerobot.
To Install:
- (Steps will add soon…)
Optional Commands
Usage: node . [--options]
Heroku user: Targeted file is
procfile
Commands | Description | Example |
---|---|---|
--autocleartmp |
Dispose automatically tmp folder contain files | node . --autocleartmp |
--autoread |
If enabled, all incoming messages will be marked as read | node . --autoread |
--session [file-name] |
Use another session with another name, default is session.data.json |
node . --session session.json |
--self |
Run bot only for yourself | node . --self |
--prefix [prefixes] |
prefixes are seperated by each character Set prefix | node . --prefix ! |
--db [server-url] |
Use external db instead of local db | node . --db 'mongodb+srv://<username>:<pin>@valor-whatsapp-bot-md.vn0pr.mongodb.net/<path>?retryWrites=true&w=majority' |
--restrict |
Enables restricted plugins Group Administration add , kick |
node . --restrict |
--nyimak |
No bot, just print received messages and add users to database | node . --nyimak |
--server |
Used for Heroku or scan through website | node . --server |
--pconly |
Bot run only in private chat | node . --pconly |
--gconly |
Bot run only in group chat | node . --gconly |
--swonly |
If chat not from status, bot will ignore | node . --swonly |
--big-qr |
If small qr unicode doesn’t support | node . --big-qr |
--img |
Enable image inspector through terminal | node . --img |
--test |
Development Testing Mode | node . --test |
--trace |
conn.logger.level = ‘trace’ | node . --trace |
--debug |
conn.logger.level = ‘debug’ | node . --debug |