An easy-to-use WhatsApp utility bot, written in TypeScript. Designed mainly for group chats!
Warning WhatsApp hates fun. The development of this project has been frozen due to recent cease and desist letters send by Meta to developers of WhatsApp-related libraries. BrenerBot relies on whatsapp-web.js to connect to the WhatsApp API. The connection should be stable and not trigger any bans.
Command | Description | Availability |
---|---|---|
stickers/create.ts | Create stickers from text | β |
stickers/create.ts | Create stickers from images | β |
stickers/create.ts | Create stickers from videos | β |
stickers/create.ts | Create stickers from GIFs | β |
admin/shutdown.ts | Remote termination by owner | π§ |
other/code.ts | View source code | β |
other/help.ts | View all commands | β |
Feature | Branch | Availability |
---|---|---|
Advanced logging | feature/logging | π§ |
Heroku compatibility | β |
BrenerBot requires the following software:
- NodeJS
- ffmpeg
After installing the requirements above and adding them to the PATH environment variable, you can use the following command to install all the required libraries:
npm install
Create a config.json file from the config.json.example file:
config.json
{
"botPrefix": "!",
"countryCode": "US",
"phoneNumber": "2133734253",
"mongoDB": {
"username": "heroku",
"password": "password1",
"endpoint": "bot-data-cluster.49nJ3We.mongodb.net"
}
}
BrenerBot will respond only to messages that start with the botPrefix
, and exactly follow the command syntax.
countryCode
and phoneNumber
are used to specify the owner's phone number. This is a privileged user and has additional command-running permissions.
countryCode
should contain the owner's country code as a two-letters string (ISO 3166-1 Alpha-2). Click here for a complete list.
phoneNumber
should contain the owner's phone number, without any prefix. This includes a plus sign, a country code or any leading zeros.
All values under mongoDB
are redundant in the config.json file and are used mainly for development.
However, it is possible to use them and configure MongoDB. To learn more, read the following section:
It is possible to configure BrenerBot for platforms that don't support persistent storage, by using environment variables and MongoDB. Create a MongoDB account for free and add a new cluster for BrenerBot's data. This cluster should be used by one BrenerBot instance only. Then, set the following environment variables:
BOT_PREFIX
- identical tobotPrefix
in config.json. See usage above.PHONE_NUMBER
- identical tophoneNumber
in config.json. See usage above.COUNTRY_CODE
- identical tocountryCode
in config.json. See usage above.MONGODB_USERNAME
- identical tomongoDB.username
in config.json. Set this value to the username of a MongoDB user with full read/write permissions to BrenerBot's data cluster you created.MONGODB_PASSWORD
- identical tomongoDB.password
in config.json. Set this value to the user's password. Note that some special characters are not supported and may cause the connection to fail.MONGODB_ENDPOINT
- identical tomongoDB.endpoint
in config.json. Set this value to the cluster's url. You can extract this value from the example connection string . For example, in this connection string:mongodb+srv://heroku:<password>@brenerbot.49nJ3We.mongodb.net/?retryWrites=true&w=majority
, the endpoint url isbrenerbot.49nJ3We.mongodb.net
, basically everything after@
and before/
.
This project contains three built-in scripts, written for unix and unix-like systems. On other operating systems, mainly windows, you will need to manually edit those scripts and replace OS-specific commands (currently only rm -r build
).
npm run build
npm start
And that's it!
BrenerBot is built with a high level of modularity in mind. You can add your own commands by creating command files in a subdirectory under 'src/commands' and conforming with the command structure, as specified in 'src/commands/commands.ts'. Make sure to include this subdirectory in 'src/commands/categories.ts' and define the corresponding category name in native language. Dont forget to share your commands with us! Hell, even create a pull request π€
Add the following buildpacks in your app:
- https://github.com/heroku/heroku-buildpack-nodejs
- https://github.com/jonathanong/heroku-buildpack-ffmpeg-latest
- https://elements.heroku.com/buildpacks/jontewks/puppeteer-heroku-buildpack
BrenerBot now supports GitHub deployment on Heroku!
- Create a Heroku application.
- Configure BrenerBot. See Configuring BrenerBot without persistent storage.
- Connect your Heroku application to BrenerBot's GitHub repository and enable automatic deployments of the
main
branch. - Check out the application's logs - a QR code should be printed. Scan this code using BrenerBot's WhatsApp account.
- That's it! BrenerBot is up and running!