Skip to content

Commit

Permalink
initial new krypton WA bot
Browse files Browse the repository at this point in the history
  • Loading branch information
Kry9toN committed Jan 16, 2021
0 parents commit 47ea7b8
Show file tree
Hide file tree
Showing 15 changed files with 517 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"files": [
"README.md"
],
"imageSize": 100,
"commit": false,
"contributors": [
{
"login": "Kry9toN",
"name": "Dhimas Bagus Prayoga",
"avatar_url": "https://avatars1.githubusercontent.com/u/44697929?v=4",
"profile": "http://kry9ton.tech",
"contributions": [
"code"
]
},
{
"login": "rzlamrr",
"name": "dαvιѕтα",
"avatar_url": "https://avatars3.githubusercontent.com/u/46296998?v=4",
"profile": "http://rzlamrr.github.io",
"contributions": [
"bug"
]
}
],
"contributorsPerLine": 7,
"projectName": "KryPtoN-WhatsApp-Bot",
"projectOwner": "Kry9toN",
"repoType": "github",
"repoHost": "https://github.com",
"skipCi": true
}
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
29 changes: 29 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
module.exports = {
env: {
commonjs: true,
es6: true,
node: true
},
extends: 'standard',
globals: {
Atomics: 'readonly',
SharedArrayBuffer: 'readonly'
},
parser: 'babel-eslint',
parserOptions: {
ecmaVersion: 2018
},
rules: {
eqeqeq: 0,
indent: [2, 4],
'no-var': 2,
'no-unused-vars': 1,
'no-unused-expressions': 0,
'no-self-assign': 0,
'no-undef': 0,
'no-case-declarations': 0,
'prefer-promise-reject-errors': 1,
'object-property-newline': 0,
'no-useless-escape': 0
}
}
17 changes: 17 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
node_modules
.idea
debug.log
premium.js
quotemsg.js
lib/quran.js
util/flat.json
util/getScreenshot.js
utils/canvas.js
utils/flat.json
utils/getScreenshot.js
.node-persist
*.code-workspace
lib/instaStory.js
lib/jiwa.js
package-lock.json
.env
27 changes: 27 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
FROM node:lts

RUN apt-get update \
&& apt-get install wget gconf-service libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 \
libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 \
libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 \
libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 python3 \
ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget ffmpeg --yes --fix-missing --no-install-recommends\
&& wget --no-check-certificate https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb \
&& dpkg -i google-chrome-stable_current_amd64.deb || apt -y -f install \
&& rm google-chrome-stable_current_amd64.deb \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
&& apt autoremove --yes

EXPOSE 8080

#
# Clone repo and prepare working directory
#
RUN git clone -b master https://Kry9toN:[email protected]/Kry9toN/KryPtoN-WhatsApp-Bot /home/wabot
WORKDIR /home/wabot
COPY sessions/session.data.json /home/wabot/session.data.json

RUN npm i

CMD ["npm", "start"]
135 changes: 135 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
<div align="center">

# KryPtoN Whatsapp Bot
[![DeepScan grade](https://deepscan.io/api/teams/11540/projects/14446/branches/269535/badge/grade.svg)](https://deepscan.io/dashboard#view=project&tid=11540&pid=14446&bid=269535)
[![Version](https://img.shields.io/badge/version%20K--wa%20Bot-v2.8.8-brightgreen)](https://github.com/Kry9toN/KryPtoN-WhatsApp-Bot/releases)

<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
[![All Contributors](https://img.shields.io/badge/all_contributors-2-orange.svg?style=flat-square)](#contributors-)
<!-- ALL-CONTRIBUTORS-BADGE:END -->

[![Heroku](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/Kry9toN/KryPtoN-WhatsApp-Bot/tree/master)

</div>

## Features

| Sticker Creator| Feature |
| :------------: | :---------------------------------------------: |
|| Send Photo with Caption |
|| Reply A Photo |
|| Image Url |
|| Animated sticker using giphy url |
|| sticker with no background |
| WIP | sticker meme |

| Downloader | Feature |
| :------------: | :---------------------------------------------: |
|| Tiktok Downloader (No WM & WM) |
|| Twitter Video Downloader |
|| Facebook Video Downloader (SD & HD) |
| BUG | Instagram Video Downloader |
|| Youtube MP3 Downloader |
|| Youtube MP4 Downloader |

| Edukasi | Feature |
| :------------: | :---------------------------------------------: |
|| Translate text (quote only) |
|| Brainly search engine |
|| Wiki search engine |

| Other | Feature |
| :------------: | :---------------------------------------------: |
|| Create Custom meme (top text & bottom text) |
|| check data on the spread of Covid-19 in certain locations|
|| Check Shipping info (indonesia only) |
|| Anti Spam |

| Grup Only | Feature |
| :------------: | :---------------------------------------------: |
|| Promote User |
|| Demote User |
|| Kick User |
|| Delete bot message |
|| Mention All User |
|| Global Banned |
|| Filters Message |

#### Suport Postgrasql database

## To-Do
- Add More Feature
- More refactoring

---

## Getting Started

This project require NodeJS v12 (Ubuntu 20.04+).

### Install
Clone this project

```bash
> git clone https://github.com/Kry9toN/KryPtoN-WhatsApp-Bot
> cd KryPtoN-WhatsApp-Bot
```

Install the dependencies:

```bash
> npm install
```

### Usage
1. run the Whatsapp bot

```bash
> npm start
```

after running it you need to scan the qr

## Before deoloy heroku

You must run this bot on your PC/laptop to generate a session
after being authorized, in your folder there will be a file called
```
session.data.json
```
please copy on the `sessions` folder with the same name (don't change it)

## Troubleshooting
Make sure all the necessary dependencies are installed: https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md

Fix Stuck on linux, install google chrome stable:
```bash
> wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
> sudo apt install ./google-chrome-stable_current_amd64.deb
```

## Donate

### Buy me coffee
[Saweria](https://saweria.co/donate/Kry9toN)

[Paypal.me](https://www.paypal.me/KomodoOS)


## Contributors ✨

Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):

<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->
<table>
<tr>
<td align="center"><a href="http://kry9ton.tech"><img src="https://avatars1.githubusercontent.com/u/44697929?v=4" width="100px;" alt=""/><br /><sub><b>Dhimas Bagus Prayoga</b></sub></a><br /><a href="https://github.com/Kry9toN/KryPtoN-WhatsApp-Bot/commits?author=Kry9toN" title="Code">💻</a></td>
<td align="center"><a href="http://rzlamrr.github.io"><img src="https://avatars3.githubusercontent.com/u/46296998?v=4" width="100px;" alt=""/><br /><sub><b>dαvιѕтα</b></sub></a><br /><a href="https://github.com/Kry9toN/KryPtoN-WhatsApp-Bot/issues?q=author%3Arzlamrr" title="Bug reports">🐛</a></td>
</tr>
</table>

<!-- markdownlint-enable -->
<!-- prettier-ignore-end -->
<!-- ALL-CONTRIBUTORS-LIST:END -->
25 changes: 25 additions & 0 deletions app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"name": "KryPtoN WhatsApp Bot",
"description": "WhatsApp Bot running on Javascript",
"keywords": [
"whatsapp",
"bot",
"plugin",
"modular",
"productivity"
],
"repository": "https://github.com/Kry9toN/KryPtoN-WhatsApp-Bot",
"website": "",
"stack": "container",
"env": {
"UserAgent": {
"description": "UserAgne Browser",
"value": "WhatsApp/2.2029.4 Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36",
"required": true
},
"OWNER_PHONE": {
"description": "Enter your phone number.",
"required": true
}
}
}
15 changes: 15 additions & 0 deletions command/help.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
const { MessageType } = require('@adiwajshing/baileys')

module.exports = {
name: 'help',
aliases: ['h'],
description: 'Display all commands and descriptions',
execute (client, from) {
const commands = client.cmd.array()
let text = 'Command di bot ini\n\nPrefix: !\n'
commands.forEach((cmd) => {
text += `- *${cmd.name}* ${cmd.aliases ? `(${cmd.aliases})` : ''}\n${cmd.description}\n`
})
return client.sendMessage(from, text, MessageType.text)
}
}
10 changes: 10 additions & 0 deletions command/ping.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
const { MessageType } = require('@adiwajshing/baileys')

module.exports = {
name: 'ping',
cooldown: 10,
description: "Show the bot's average ping",
execute (client, from) {
client.sendMessage(from, 'oe', MessageType.text).catch(console.error)
}
}
5 changes: 5 additions & 0 deletions heroku.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
build:
docker:
worker: Dockerfile
run:
worker: npm start
Loading

0 comments on commit 47ea7b8

Please sign in to comment.