Skip to content

Commit

Permalink
📢 New Version of WhatsAsena! 0.15 Available Now!
Browse files Browse the repository at this point in the history
* Update screenshot.js

* Added Mimeterpolation 🥳

* Added Rainbow Effect

* Added Negative Effect 🥳

* Added Format Type

* Added Deshake and Art Effect 🥳

* Fixed Alive Command 🛠️

* Added Support for Audio and Image Filtering 🥳

* Added More Wallpapers 🥳

* New Text for Updater 🛠️

* Text Update 2 🛠️

* Text Update 3

* Text Update 4

* Text Update 5 🛠️

* Text Update 6 🛠️

* Text Update 7 🛠️

* Added Language Support for Auto Restarting 🥳

* Deleted Unnecessary Infos

* Fix Readme 🛠️

* Another Update for Readme 🛠️

* Deleted Surpluses on FFMPEG 🛠️

* Fixed Rainbow Effect for Videos 🛠️

* Updated Terms of Use

* Added Color Effect and Fixed Bugs 🛠️ 🥳

* Updated XMedia Again 🛠️

* Added LOG Information After Restarting 🥳

* Fixed HI Language for IMG Plugin 🛠️

* Fixed EN Language for IMG Plugin 🛠️

* Config Updates 🥳

* Added Config Vars for MUTE & UNMUTE Text 🥳

* A Little Bug Fix 🛠️

* Mute and Unmute Message Made Editable 🥳

* Added Voice Plugin and Many Other Features 🥳

* Voicy plugin

* Improve aiscanner

* Improve spammer

* Bug fix: Load aiscanner separately

Aiscanner needs to all commands to be already loaded.

* Bug fix: Fix aiscanner for external plugins

* Language support for aiscanner

- Thank a lot @MuhammedKpln for codding these.

* Fixed EN Language 🛠️

* Fixed TR Language 🛠️

* Added Voicy and AIScanner Text for AZ Language 🥳

* Fix 🛠️

* Added Voicy and AIScanner Text for ES Language 🥳

* Added Voicy and AIScanner Text for HI Language 🥳

* Added Voicy and AIScanner Text for ID Language 🥳

* Added Voicy and AIScanner Text for ML Language 🥳

* Improve Voicy 🛠️

* Added Notes Plugin 🥳

Codded by @MuhammedKpln 

A snip system using SQL.

* Update Notes Text for TR Language 🛠️

* Fix Bugs 🛠️

* Update Notes Text for EN Language 🛠️

* Added Notes Text for AZ Language 🥳

* Added Notes Text for ES Language 🥳

* Added Notes Text for HI Language 🥳

* Added Notes Text for ID Language 🥳

* Added Notes Text for ML Language 🥳

* Updated Notes 🛠️

* Update package.json

* Update config.js

Co-authored-by: Muhammed Kaplan <[email protected]>
  • Loading branch information
phaticusthiccy and MuhammedKpln authored Feb 21, 2021
1 parent 7b16e8c commit dbfab91
Show file tree
Hide file tree
Showing 25 changed files with 1,033 additions and 3,188 deletions.
52 changes: 16 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ Kullanımı tamamen kullanıcının sorumluluğundadır,
Asena Userbot yalnızca bir altyapıdır. Nasıl sonradan yüklenen programlarla
yapılan işlerden işletim sistemi sorumlu değilse,
WhatsAsena da kullanıcıların kullanım amacı ve yönteminden sorumlu değildir.
WhatsAsena'yı para karşılığı pazarlamak, kullanıma sunmak yahut herhangi bir maddi değere sahip
birşey ile satışa sunmak kesinlikle yasaktır. Doğabilecek tüm yasal soruşturmalardan
kullanıcı sorumludur.
WhatsAsena - Asena Userbot is Open Source software open to development.
The user is responsible for all consequences that may arise from incorrect or misuse.
Expand All @@ -67,6 +70,9 @@ Usage is entirely the user's responsibility, Asena Userbot is an
infrastructure only. Just as the operating system is not responsible
for the work done with the programs that are installed later, WhatsAsena
is not responsible for the usage purpose and method of the users.
Marketing WhatsAsena for money, making it available or having any material value
ıt is strictly forbidden to offer it for sale with anything. All legal investigations that may arise
the user is responsible.
```

<div align="center">
Expand Down Expand Up @@ -117,9 +123,14 @@ $ nano Config.env
// Config.env create and edit.
$ node bot.js
```

##

### ⚒️ Setup Wiki
[![Setup - Kurulum](https://img.icons8.com/clouds/300/000000/settings.png)](https://github.com/phaticusthiccy/WhatsAsenaDuplicated/wiki)

##

## F.A.Q
Answer a few frequently asked questions;
### Can you read my messages?
Expand All @@ -134,45 +145,14 @@ If you are concerned about security, you can install it on your own computer. If
### What does Asena mean?
[Asena](https://tr.wikipedia.org/wiki/Asena), comes from Turkish mythology. According to Turkish mythology, Asena is a she-wolf that plays an important role.

## WhatsAsena Features

| All Features 📢|Available ☑️|Version 🔎|
| ------------- | ------------ | ---------- |
| Admin Commands||1.0|
| AFK||1.2|
| AI Scanner||1.1|
| Add & Kick User||1.0|
| Ban & Unban User||1.0|
| Carbon.sh Plugin||1.4|
| Depp AI APIs||1.0|
| FFMPEG Support||1.6|
| Filter Support||1.2|
| Greetings Support||1.2|
| Group Link Generator||1.0|
| Heroku Plugin||1.5|
| Jid Scraper||1.0|
| Location Plugin||1.0|
| Lydia||1.2|
| Meme Maker||1.0|
| Mute & Unmute Chat||1.3|
| Nekobin Plugin||1.0|
| OCR Plugin||1.2|
| Plugin Support||1.0|
| Pre-Trained Effects||3.2|
| Promote & Demote User||1.1|
| Remove BG Plugin||1.0|
| Scam Actions||1.3|
| Scrapers||1.5|
| Spammer||1.4|
| Speedtest|🛠️|1.6|
| Sticker Maker||1.0|
| Tagall||1.0|
| Unvoice||1.3|
##

### WhatsAsena Features ✨

Here Are All Commands With Description
----|
[GistHub](https://gist.github.com/phaticusthiccy/8dfa827a71647e5f659680d75543a748) |
[GistHub](https://gist.github.com/phaticusthiccy/8dfa827a71647e5f659680d75543a748)

##

### ⚠️ Warning!
```
Expand Down
10 changes: 10 additions & 0 deletions app.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,16 @@
"description": "Herokuda API Keyiniz. Heroku API Key.",
"required": true
},
"MUTE_MESSAGE": {
"description": "Customizable Mute Message!",
"required": false,
"value": "default"
},
"UNMUTE_MESSAGE": {
"description": "Customizable Unmute Message!",
"required": false,
"value": "default"
},
"HEROKU_APP_NAME": {
"description": "Herokuda uygulama adı. Heroku APP Name.",
"required": true
Expand Down
101 changes: 59 additions & 42 deletions bot.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@ const path = require("path");
const events = require("./events");
const chalk = require('chalk');
const config = require('./config');
const {WAConnection, MessageType, Mimetype, Presence} = require('@adiwajshing/baileys');
const {Message, StringSession, Image, Video} = require('./whatsasena/');
const { WAConnection, MessageType, Mimetype, Presence } = require('@adiwajshing/baileys');
const { Message, StringSession, Image, Video } = require('./whatsasena/');
const { DataTypes } = require('sequelize');
const { GreetingsDB, getMessage } = require("./plugins/sql/greetings");
const got = require('got');

// Sql
const WhatsAsenaDB = config.DATABASE.define('WhatsAsenaDuplicated', {
info: {
type: DataTypes.STRING,
allowNull: false
type: DataTypes.STRING,
allowNull: false
},
value: {
type: DataTypes.TEXT,
Expand All @@ -30,7 +30,7 @@ const WhatsAsenaDB = config.DATABASE.define('WhatsAsenaDuplicated', {
});

fs.readdirSync('./plugins/sql/').forEach(plugin => {
if(path.extname(plugin).toLowerCase() == '.js') {
if (path.extname(plugin).toLowerCase() == '.js') {
require('./plugins/sql/' + plugin);
}
});
Expand All @@ -41,15 +41,15 @@ const plugindb = require('./plugins/sql/plugin');
String.prototype.format = function () {
var i = 0, args = arguments;
return this.replace(/{}/g, function () {
return typeof args[i] != 'undefined' ? args[i++] : '';
return typeof args[i] != 'undefined' ? args[i++] : '';
});
};

if (!Date.now) {
Date.now = function() { return new Date().getTime(); }
Date.now = function () { return new Date().getTime(); }
}

Array.prototype.remove = function() {
Array.prototype.remove = function () {
var what, a = arguments, L = a.length, ax;
while (L && this.length) {
what = a[--L];
Expand All @@ -60,14 +60,14 @@ Array.prototype.remove = function() {
return this;
};

async function whatsAsena () {
async function whatsAsena() {
await config.DATABASE.sync();
var StrSes_Db = await WhatsAsenaDB.findAll({
where: {
info: 'StringSession'
info: 'StringSession'
}
});

const conn = new WAConnection();
const Session = new StringSession();

Expand All @@ -76,12 +76,12 @@ async function whatsAsena () {

if (StrSes_Db.length < 1) {
nodb = true;
conn.loadAuthInfo(Session.deCrypt(config.SESSION));
conn.loadAuthInfo(Session.deCrypt(config.SESSION));
} else {
conn.loadAuthInfo(Session.deCrypt(StrSes_Db[0].dataValues.value));
}

conn.on ('credentials-updated', async () => {
conn.on('credentials-updated', async () => {
console.log(
chalk.blueBright.italic('✅ Login information updated!')
);
Expand All @@ -92,15 +92,15 @@ async function whatsAsena () {
} else {
await StrSes_Db[0].update({ value: Session.createStringSession(authInfo) });
}
})
})

conn.on('connecting', async () => {
console.log(`${chalk.green.bold('Whats')}${chalk.blue.bold('Asena')}
${chalk.white.bold('Version:')} ${chalk.red.bold(config.VERSION)}
${chalk.blue.italic('ℹ️ Connecting to WhatsApp... Please wait.')}`);
});


conn.on('open', async () => {
console.log(
Expand All @@ -119,7 +119,7 @@ ${chalk.blue.italic('ℹ️ Connecting to WhatsApp... Please wait.')}`);
if (response.statusCode == 200) {
fs.writeFileSync('./plugins/' + plugin.dataValues.name + '.js', response.body);
require('./plugins/' + plugin.dataValues.name + '.js');
}
}
}
});

Expand All @@ -128,16 +128,33 @@ ${chalk.blue.italic('ℹ️ Connecting to WhatsApp... Please wait.')}`);
);

fs.readdirSync('./plugins').forEach(plugin => {
if(path.extname(plugin).toLowerCase() == '.js') {
require('./plugins/' + plugin);
const pluginName = plugin.split('.')[0]
const pluginExt = path.extname(plugin).toLowerCase()
if (pluginExt == '.js') {

// Do not load aiscanner plugin, we're gonna load it separately.
if (pluginName !== 'aiscanner') {
require('./plugins/' + plugin);
}
}
});

// Load aiscanner at the end, for it needs all commands to already be added to the commands list.
require('./plugins/aiscanner');

console.log(
chalk.green.bold('✅ Plugins installed!')
);
await new Promise(r => setTimeout(r, 1100));

if (config.LANG == 'TR' || config.LANG == 'AZ') {
await conn.sendMessage(conn.user.jid, '*WhatsAsena Çalışıyor! 🐺*\n\n_Lütfen burada plugin denemesi yapmayın. Burası sizin LOG numaranızdır._\n_Herhangi bir sohbette komutları deneyebilirsiniz :)_\n\n*WhatsAsena Kullandığın İçin Teşekkürler 💌*', MessageType.text);
}
else {
await conn.sendMessage(conn.user.jid, '*WhatsAsena Working! 🐺*\n\n_Please do not try plugins here. This is your LOG number._\n_You can try commands to any chat :)_\n\n*Thanks for using WhatsAsena 💌*', MessageType.text);
}
});

conn.on('message-new', async msg => {
if (msg.key && msg.key.remoteJid == 'status@broadcast') return;

Expand All @@ -162,7 +179,7 @@ ${chalk.blue.italic('ℹ️ Connecting to WhatsApp... Please wait.')}`);
}

events.commands.map(
async (command) => {
async (command) => {
if (msg.message && msg.message.imageMessage && msg.message.imageMessage.caption) {
var text_msg = msg.message.imageMessage.caption;
} else if (msg.message && msg.message.videoMessage && msg.message.videoMessage.caption) {
Expand All @@ -174,63 +191,63 @@ ${chalk.blue.italic('ℹ️ Connecting to WhatsApp... Please wait.')}`);
}

if ((command.on !== undefined && (command.on === 'image' || command.on === 'photo')
&& msg.message && msg.message.imageMessage !== null &&
(command.pattern === undefined || (command.pattern !== undefined &&
command.pattern.test(text_msg)))) || 
(command.pattern !== undefined && command.pattern.test(text_msg)) ||
&& msg.message && msg.message.imageMessage !== null &&
(command.pattern === undefined || (command.pattern !== undefined &&
command.pattern.test(text_msg)))) ||
(command.pattern !== undefined && command.pattern.test(text_msg)) ||
(command.on !== undefined && command.on === 'text' && text_msg) ||
// Video
(command.on !== undefined && (command.on === 'video')
&& msg.message && msg.message.videoMessage !== null &&
(command.pattern === undefined || (command.pattern !== undefined &&
command.pattern.test(text_msg))))) {
&& msg.message && msg.message.videoMessage !== null &&
(command.pattern === undefined || (command.pattern !== undefined &&
command.pattern.test(text_msg))))) {

let sendMsg = false;
var chat = conn.chats.get(msg.key.remoteJid)

if ((config.SUDO !== false && msg.key.fromMe === false && command.fromMe === true &&
(msg.participant && config.SUDO.includes(',') ? config.SUDO.split(',').includes(msg.participant.split('@')[0]) : msg.participant.split('@')[0] == config.SUDO || config.SUDO.includes(',') ? config.SUDO.split(',').includes(msg.key.remoteJid.split('@')[0]) : msg.key.remoteJid.split('@')[0] == config.SUDO)
) || command.fromMe === msg.key.fromMe || (command.fromMe === false && !msg.key.fromMe)) {
) || command.fromMe === msg.key.fromMe || (command.fromMe === false && !msg.key.fromMe)) {
if (command.onlyPinned && chat.pin === undefined) return;
if (!command.onlyPm === chat.jid.includes('-')) sendMsg = true;
else if (command.onlyGroup === chat.jid.includes('-')) sendMsg = true;
}

if (sendMsg) {
if (config.SEND_READ && command.on === undefined) {
await conn.chatRead(msg.key.remoteJid);
}

var match = text_msg.match(command.pattern);
if (command.on !== undefined && (command.on === 'image' || command.on === 'photo' )
&& msg.message.imageMessage !== null) {

if (command.on !== undefined && (command.on === 'image' || command.on === 'photo')
&& msg.message.imageMessage !== null) {
whats = new Image(conn, msg);
} else if (command.on !== undefined && (command.on === 'video' )
&& msg.message.videoMessage !== null) {
} else if (command.on !== undefined && (command.on === 'video')
&& msg.message.videoMessage !== null) {
whats = new Video(conn, msg);
} else {
whats = new Message(conn, msg);
}

if (command.deleteCommand && msg.key.fromMe) {
await whats.delete();
await whats.delete();
}

try {
await command.function(whats, match);
} catch (error) {
if (config.LANG == 'TR' || config.LANG == 'AZ') {
await conn.sendMessage(conn.user.jid, '*-- HATA RAPORU [WHATSASENA] --*' +
'\n*WhatsAsena bir hata gerçekleşti!*'+
await conn.sendMessage(conn.user.jid, '*-- HATA RAPORU [WHATSASENA] --*' +
'\n*WhatsAsena bir hata gerçekleşti!*' +
'\n_Bu hata logunda numaranız veya karşı bir tarafın numarası olabilir. Lütfen buna dikkat edin!_' +
'\n_Yardım için Telegram grubumuza yazabilirsiniz._' +
'\n_Bu mesaj sizin numaranıza (kaydedilen mesajlar) gitmiş olmalıdır._\n\n' +
'*Gerçekleşen Hata:* ```' + error + '```\n\n'
, MessageType.text);
} else {
await conn.sendMessage(conn.user.jid, '*-- ERROR REPORT [WHATSASENA] --*' +
'\n*WhatsAsena an error has occurred!*'+
await conn.sendMessage(conn.user.jid, '*-- ERROR REPORT [WHATSASENA] --*' +
'\n*WhatsAsena an error has occurred!*' +
'\n_This error log may include your number or the number of an opponent. Please be careful with it!_' +
'\n_You can write to our Telegram group for help._' +
'\n_This message should have gone to your number (saved messages)._\n\n' +
Expand All @@ -249,7 +266,7 @@ ${chalk.blue.italic('ℹ️ Connecting to WhatsApp... Please wait.')}`);
} catch {
if (!nodb) {
console.log(chalk.red.bold('Eski sürüm stringiniz yenileniyor...'))
conn.loadAuthInfo(Session.deCrypt(config.SESSION));
conn.loadAuthInfo(Session.deCrypt(config.SESSION));
try {
await conn.connect();
} catch {
Expand Down
9 changes: 6 additions & 3 deletions config.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@ DATABASE_URL = process.env.DATABASE_URL === undefined ? './whatsasena.db' : proc
DEBUG = process.env.DEBUG === undefined ? false : convertToBool(process.env.DEBUG);

module.exports = {
VERSION: 'v0.14.5 Public Stable',
VERSION: 'v0.15.0 Public Stable',
SESSION: process.env.ASENA_SESSION === undefined ? '' : process.env.ASENA_SESSION,
GANSTYLE: process.env.GAN_IMAGE === undefined ? 'https://i.hizliresim.com/loUtAb.jpg' : process.env.GAN_IMAGE,
LANG: process.env.LANGUAGE === undefined ? 'TR' : process.env.LANGUAGE.toUpperCase(),
ALIVEMSG: process.env.ALIVE_MESSAGE === undefined ? 'default' : process.env.ALIVE_MESSAGE,
KICKMEMSG: process.env.KICKME_MESSAGE === undefined ? 'default' : process.env.KICKME_MESSAGE,
MUTEMSG: process.env.MUTE_MESSAGE === undefined ? 'default' : process.env.MUTE_MESSAGE,
UNMUTEMSG: process.env.UNMUTE_MESSAGE === undefined ? 'default' : process.env.UNMUTE_MESSAGE,
PROMOTEMSG: process.env.PROMOTE_MESSAGE === undefined ? 'default' : process.env.PROMOTE_MESSAGE,
DEMOTEMSG: process.env.DEMOTE_MESSAGE === undefined ? 'default' : process.env.DEMOTE_MESSAGE,
BANMSG: process.env.BAN_MESSAGE === undefined ? 'default' : process.env.BAN_MESSAGE,
Expand All @@ -38,10 +40,11 @@ module.exports = {
APP_NAME: process.env.HEROKU_APP_NAME === undefined ? '' : process.env.HEROKU_APP_NAME
},
DATABASE_URL: DATABASE_URL,
DATABASE: DATABASE_URL === './whatsasena.db' ? new Sequelize({ dialect: "sqlite", storage: DATABASE_URL, logging: DEBUG}) : new Sequelize(DATABASE_URL, {dialectOptions: {ssl: {require: true, rejectUnauthorized: false}} , logging: DEBUG}),
DATABASE: DATABASE_URL === './whatsasena.db' ? new Sequelize({ dialect: "sqlite", storage: DATABASE_URL, logging: DEBUG }) : new Sequelize(DATABASE_URL, { dialectOptions: { ssl: { require: true, rejectUnauthorized: false } }, logging: DEBUG }),
RBG_API_KEY: process.env.REMOVE_BG_API_KEY === undefined ? false : process.env.REMOVE_BG_API_KEY,
NO_ONLINE: process.env.NO_ONLINE === undefined ? true : convertToBool(process.env.NO_ONLINE),
SUDO: process.env.SUDO === undefined ? false : process.env.SUDO,
DEBUG: DEBUG,
COFFEEHOUSE_API_KEY: process.env.COFFEEHOUSE_API_KEY === undefined ? false : process.env.COFFEEHOUSE_API_KEY
COFFEEHOUSE_API_KEY: process.env.COFFEEHOUSE_API_KEY === undefined ? false : process.env.COFFEEHOUSE_API_KEY,
WITAI_API: "TEYMELA6DMC4XB5YM3SPTTQWUUIBKURG"
};
Loading

0 comments on commit dbfab91

Please sign in to comment.