Skip to content

Commit 8f35297

Browse files
authored
DARKWORLD MD
1 parent 633675a commit 8f35297

File tree

10 files changed

+5100
-0
lines changed

10 files changed

+5100
-0
lines changed

.prettierrc.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"semi": false,
3+
"trailingComma": "none",
4+
"singleQuote": true,
5+
"printWidth": 120,
6+
"tabWidth": 4
7+
}

Heroku-Hosting-Guide.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# WhatsApp-bot Heroku Deploy Guide
2+
3+
## ⚠ Requirements
4+
5+
- A cluster URI of the [MongoDB](https://www.mongodb.com/). You can get it by following the steps given [here](https://github.com/LuckyYam/WhatsApp-bot/blob/master/MongoDB-Guide.md)
6+
7+
### Pre-requisite
8+
9+
1. [WhatsApp-bot](https://github.com/LuckyYam/WhatsApp-bot) - Go there
10+
2. Scroll down a bit and you will see the "Deploy To Heroku" button in purple color (sorry if you are color blind)
11+
3. Click on it and login or sign up for Heroku
12+
4. Enter the following fields
13+
| KEY | VALUE |
14+
| --- | ----------- |
15+
| NAME | NAME_OF_THE_BOT |
16+
| PREFIX | PREFIX_OF_THE_BOT |
17+
| SESSION | BOT_SESSION |
18+
| MODS | BOT_ADMINS_NUMBER (should be seperated by a comma and a space) |
19+
| MONGO_URI | YOUR_CLUSTER_URI |
20+
- `PREFIX`: Prefix of the bot
21+
- `BOT_NAME`: Name of the bot
22+
- `MONGO_URI`: A secret String for MongoDB connection. (Required)
23+
- `MODS`: Number of the users who should be the admins of the bot (should be in international format without "+" and multiple numbers should be separated by a comma and a space). Example - 1234567890, 91245670325 (you shouldn't add "@s.whatsapp.net" at the end of each numbers)
24+
- `SESSION`: Session of the bot
25+
5. Wait for the building to finish, you should always keep an eye on log messages, you can find log messages in the Dashboard -> More -> View logs.<br>
26+
6. After it builds, click on the "View" or "Open App".<br>
27+
7. Authenticate By Providing Your SESSION_ID and a QR Code Will Show Up.<br>
28+
8. Open WhatsApp on your phone -> Click on the 3 Dots on the top Right -> Click on WhatsApp Web -> Click on "Link a Device" and scan the QR from the previous step.<br>
29+
9. Your heroku app can fall asleep so for keeping it awaken add your app to ([Kaffeine](https://kaffeine.herokuapp.com/))<br>. It pings your Heroku app every 30 minutes so it will never go to sleep.<br>

LICENSE

Lines changed: 661 additions & 0 deletions
Large diffs are not rendered by default.

MongoDB-Guide.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
## 💚️ Mongo Atlas Guide
2+
-----------------
3+
1. Go to [MongoDB cloud atlas](https://www.mongodb.com/cloud/atlas)
4+
5+
2. Sign up if you don't have an account already or log in if you have one already.
6+
PS: If you don't want to use your email, go to https://temp-mail.org/en/ and generate a temporary disposable email address uwu)/
7+
3. Create a new cluster on Mongo Atlas. [It takes time, so don't worry]
8+
4. After creating a cluster, click on the 'CONNECT' button on the cluster which you've created.
9+
5. On Setup connection security, I'd recommend you to add 'Your Current IP Address' for security concerns but if you are not willing to go through a little bit of pain, then simply add 'Access from anywhere. Also, you can change this anytime by opening your "IP Access list tab".
10+
6. Then, create a database user, fill up the name and password and MAKE SURE TO REMEMBER THEM.
11+
7. Click on the "Choose a connection method" and then click on the "Connect Your Application" option.
12+
8. Finally, on the "Connect" tab select "Nodejs" as _DRIVER_ with "3.6 or later" in _VERSION_.
13+
9. Copy the connection string that is provided below and paste it somewhere and replace <password> with 'the password you added while creating database user', also make sure to remove '< >' these from <yourPassword>. This will be your _MONGO CLUSTER URI_.
14+
#### Example [Mongo Atlas Cluster URI]
15+
```mongodb+srv://NekoDaKamiSama:[email protected]/myFirstDatabase?retryWrites=true&w=majority```
16+
17+
10. That's it You now have a MongoDB cluster hosted on Mongo-Atlas. You can use this cluster for other projects too.

Procfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
web: yarn start

Self-Hosting-Guide.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# WhatsApp-bot Self-Hosting-Guide
2+
3+
## ⛵ Prerequisites
4+
5+
- [Git](https://git-scm.com/)
6+
- [Node.js](https://nodejs.org/en/)
7+
- [FFmpeg](https://ffmpeg.org/download.html)
8+
- [ImageMagick](https://imagemagick.org/script/download.php)
9+
- [webP](https://developers.google.com/speed/webp/download)
10+
11+
## 🚀 Installation
12+
13+
Run the following commands to clone the repo
14+
```SH
15+
> git clone https://github.com/LuckyYam/WhatsApp-bot
16+
> cd WhatsApp-bot
17+
```
18+
19+
Run this following command to install the dependencies
20+
```SH
21+
> yarn install
22+
```
23+
24+
## ⚠ Requirements
25+
26+
- A cluster URI of the [MongoDB](https://www.mongodb.com/). You can get it by following the steps given [here](https://github.com/LuckyYam/WhatsApp-bot/blob/master/MongoDB-Guide.md)
27+
28+
## 🔧 Configuration
29+
30+
Rename the file `.env.example` to `.env` and fill the missing fields
31+
32+
```env
33+
PREFIX=PREFIX_OF_THE_BOT
34+
BOT_NAME=NAME
35+
SESSION=YOUR_SESSION
36+
MONGO_URI=YOUR_CLUSTER_URI
37+
MODS=BOT_ADMINS_NUMBER (should be seperated by a comma and a space)
38+
```
39+
- `PREFIX`: Prefix of the bot
40+
- `BOT_NAME`: Name of the bot
41+
- `MONGO_URI`: A secret String for MongoDB connection. (Required)
42+
- `MODS`: Number of the users who should be the admins of the bot (should be in international format without "+" and multiple numbers must be separated by a comma ", ")
43+
- `SESSION`: Session of the bot
44+
45+
## 🍀 Running
46+
47+
```SH
48+
> yarn start
49+
```
50+
Running the above command will start the bot. To authenticate scan the QR which shows up in the terminal or the link which is logged when the QR event fires using the WA-Web Scanner on your WhatsApp. Now you're on your own. Good Luck!
51+
52+
# Don't want to do the hassle of setting up on your own PC?
53+
54+
[Set it up on Heroku](https://github.com/LuckyYam/WhatsApp-bot/blob/master/Heroku-Hosting-Guide.md)

app.json

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
{
2+
"name": "WhatsApp-bot",
3+
"description": "A WhatsApp Bot written in TypeScript using Baileys.",
4+
"keywords": [
5+
"bot",
6+
"whatsapp",
7+
"whatsapp-bot",
8+
"whatsapp-anime-bot"
9+
],
10+
"logo": "https://raw.githubusercontent.com/LuckyYam/WhatsApp-bot/master/assets/images/whatsapp-bot.png",
11+
"website": "https://github.com/LuckyYam/WhatsApp-bot#readme",
12+
"repository": "https://github.com/LuckyYam/WhatsApp-bot.git",
13+
"success_url": "/",
14+
"env": {
15+
"BOT_NAME": {
16+
"description": "Name of your bot"
17+
},
18+
"PREFIX": {
19+
"description": "Prefix of your bot"
20+
},
21+
"SESSION": {
22+
"description": "A string for the session to be classified and to get access to the server endpoints"
23+
},
24+
"MODS": {
25+
"description": "The phone numbers of the users who you want to be admin for the bot (should be in international format without + and multiple numbers must be separated by a comma \",\")",
26+
"required": false
27+
},
28+
"MONGO_URI": {
29+
"description": "A secret String for Mongodb Connection.(Required)"
30+
}
31+
},
32+
"buildpacks": [
33+
{
34+
"url": "heroku/nodejs"
35+
},
36+
{
37+
"url": "https://github.com/clhuang/heroku-buildpack-webp-binaries.git"
38+
},
39+
{
40+
"url": "https://github.com/jonathanong/heroku-buildpack-ffmpeg-latest.git"
41+
}
42+
]
43+
}

package.json

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
{
2+
"name": "whatsapp-bot",
3+
"version": "0.0.1",
4+
"description": "A WhatsApp bot written in TypeScript using Baileys",
5+
"author": "Lucky Yambem",
6+
"main": "dist/bot.js",
7+
"keywords": [
8+
"bot",
9+
"whatsapp",
10+
"anime"
11+
],
12+
"license": "AGPL-3.0",
13+
"scripts": {
14+
"format": "prettier --write --config .prettierrc.json \"src/**/*.ts\"",
15+
"start": "node --max-old-space-size=4096 dist/bot.js",
16+
"build": "yarn rimraf dist/ && yarn tsc -p .",
17+
"postinstall": "yarn build"
18+
},
19+
"bugs": {
20+
"url": "https://github.com/LuckyYam/WhatsApp-bot/issues"
21+
},
22+
"homepage": "https://github.com/LuckyYam/WhatsApp-bot",
23+
"repository": {
24+
"type": "git",
25+
"url": "https://github.com/LuckyYam/WhatsApp-bot.git"
26+
},
27+
"dependencies": {
28+
"@adiwajshing/baileys": "^4.3.0",
29+
"@adiwajshing/keyed-db": "^0.2.4",
30+
"@hapi/boom": "^10.0.0",
31+
"@shineiichijo/anime-news-network-scraper": "^1.0.1",
32+
"@shineiichijo/canvas-chan": "^1.0.1",
33+
"@shineiichijo/marika": "^2.0.3",
34+
"@shineiichijo/nhentai-ts": "^0.0.2",
35+
"@typegoose/typegoose": "^9.9.0",
36+
"axios": "^0.27.2",
37+
"canvacord": "5.2.3",
38+
"chalk": "4.1.1",
39+
"cheerio": "^1.0.0-rc.12",
40+
"dotenv": "^16.0.1",
41+
"emoji-regex": "^10.1.0",
42+
"events": "^3.3.0",
43+
"express": "^4.18.1",
44+
"fs-extra": "^10.1.0",
45+
"get-urls": "10.0.0",
46+
"link-preview-js": "^2.1.15",
47+
"moment-timezone": "^0.5.34",
48+
"mongoose": "6.5.0",
49+
"path": "^0.12.7",
50+
"pino": "^8.0.0",
51+
"prettier": "^2.7.1",
52+
"qr-image": "^3.2.0",
53+
"qrcode-terminal": "^0.12.0",
54+
"spotifydl-core": "^0.2.0",
55+
"typed-emitter": "^2.1.0",
56+
"wa-sticker-formatter": "^4.3.2",
57+
"yt-search": "^2.10.3",
58+
"ytdl-core": "^4.11.0"
59+
},
60+
"devDependencies": {
61+
"@types/axios": "^0.14.0",
62+
"@types/express": "^4.17.13",
63+
"@types/fs-extra": "^9.0.13",
64+
"@types/prettier": "^2.6.3",
65+
"@types/qr-image": "^3.2.5",
66+
"@types/yt-search": "^2.3.2",
67+
"@typescript-eslint/eslint-plugin": "^5.28.0",
68+
"@typescript-eslint/parser": "^5.28.0",
69+
"eslint": "^8.18.0",
70+
"typescript": "^4.7.4"
71+
}
72+
}

tsconfig.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"compilerOptions": {
3+
"target": "ES6",
4+
"module": "commonjs",
5+
"lib": [],
6+
"outDir": "./dist",
7+
"strict": true,
8+
"esModuleInterop": true,
9+
"skipLibCheck": true,
10+
"forceConsistentCasingInFileNames": true,
11+
"experimentalDecorators": true,
12+
"emitDecoratorMetadata": true,
13+
"strictFunctionTypes": true
14+
},
15+
"include": [
16+
"src/**/*"
17+
]
18+
}

0 commit comments

Comments
 (0)