From 2c8ba06351d4164302a25d347b281816fcd34bb0 Mon Sep 17 00:00:00 2001
From: neoxr
Date: Fri, 21 Oct 2022 22:56:17 +0700
Subject: [PATCH 01/60] release
---
README.md | 4 ++--
client.js | 9 ++++-----
package.json | 2 +-
plugins/converter/emojimix.js | 2 +-
session/.nomedia | 0
system/config.js | 2 +-
6 files changed, 9 insertions(+), 10 deletions(-)
create mode 100644 session/.nomedia
diff --git a/README.md b/README.md
index 7344db608..f229a7b40 100644
--- a/README.md
+++ b/README.md
@@ -61,13 +61,13 @@ DATABASE_URL = 'mongodb+srv://neoxrbot:yntkts@cluster0.kontol.mongodb.net/myFirs
### 乂 Installation
```
-$ git clone https://github.com/neoxr/neoxr-bot
+$ git clone -b 'multiauth' https://github.com/neoxr/neoxr-bot
```
And then type this on your console.
```
$ npm i
-$ node .
+$ node .
```
**NOTE :**
diff --git a/client.js b/client.js
index 429e8297f..3f2de9d8a 100644
--- a/client.js
+++ b/client.js
@@ -1,6 +1,4 @@
-const { useSingleFileAuthState, DisconnectReason, makeInMemoryStore, msgRetryCounterMap, delay } = require('baileys')
-const session = process.argv[2] ? process.argv[2] + '.json' : 'session.json'
-const { state, saveState } = useSingleFileAuthState(session)
+const { useMultiFileAuthState, DisconnectReason, makeInMemoryStore, msgRetryCounterMap, delay } = require('baileys')
const pino = require('pino'), path = require('path'), fs = require('fs'), colors = require('@colors/colors/safe'), qrcode = require('qrcode-terminal')
const spinnies = new (require('spinnies'))()
const { Socket, Serialize, Scandir } = require('./system/extra')
@@ -16,6 +14,7 @@ global.store = makeInMemoryStore({
})
const connect = async () => {
+ const { state, saveState } = await useMultiFileAuthState('session')
global.db = {users:{}, chats:{}, groups:{}, statistic:{}, sticker:{}, setting:{}, ...(await props.fetch() ||{})}
await props.save(global.db)
global.client = Socket({
@@ -24,10 +23,10 @@ const connect = async () => {
}),
printQRInTerminal: true,
msgRetryCounterMap,
- browser: ['@neoxr / neoxr-bot', 'Chrome', '1.0.0'],
+ browser: ['@neoxr / neoxr-bot', 'safari', '1.0.0'],
auth: state,
// To see the latest version : https://web.whatsapp.com/check-update?version=1&platform=web
- version: [2, 2238, 7],
+ version: [2, 2240, 7],
getMessage: async (key) => {
return await store.loadMessage(client.decodeJid(key.remoteJid), key.id)
}
diff --git a/package.json b/package.json
index f3d8eb0e5..f74e434b1 100644
--- a/package.json
+++ b/package.json
@@ -25,7 +25,7 @@
"@colors/colors":"1.5.0",
"awesome-phonenumber":"~2.59.0",
"axios":"~0.24.0",
- "baileys":"4.5.8",
+ "baileys":"^5.8.0",
"cfonts":"~2.10.0",
"chalk":"~4.1.0",
"cheerio":"~1.0.0-rc.5",
diff --git a/plugins/converter/emojimix.js b/plugins/converter/emojimix.js
index 7518c6cc2..2f5a7d83a 100644
--- a/plugins/converter/emojimix.js
+++ b/plugins/converter/emojimix.js
@@ -1,6 +1,6 @@
exports.run = {
usage: ['emojimix'],
- hidden: ['mix', 'emojimix'],
+ hidden: ['mix', 'emomix'],
use: 'emoji + emoji',
category: 'converter',
async: async (m, {
diff --git a/session/.nomedia b/session/.nomedia
new file mode 100644
index 000000000..e69de29bb
diff --git a/system/config.js b/system/config.js
index 9f8b2f720..97aaa00b8 100644
--- a/system/config.js
+++ b/system/config.js
@@ -21,7 +21,7 @@ global.Api = new (require('./neoxrApi'))(process.env.API_KEY)
// Get bid and key configuration for autoreply chat ai feature by registering at https://brainshop.ai
global.chatai_bid = '164728'
global.chatai_key = 'MKPsfkgXLZPGrWoH'
-// Source version
+// Bot version
global.version = '2.2.1',
// Bot name
global.botname = `© neoxr-bot v${global.version} (Public Bot)`
From 29a68ff6e18c576c276a98e283694473efd0e334 Mon Sep 17 00:00:00 2001
From: neoxr
Date: Fri, 21 Oct 2022 22:56:49 +0700
Subject: [PATCH 02/60] release
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index f229a7b40..f0b6dac19 100644
--- a/README.md
+++ b/README.md
@@ -61,7 +61,7 @@ DATABASE_URL = 'mongodb+srv://neoxrbot:yntkts@cluster0.kontol.mongodb.net/myFirs
### 乂 Installation
```
-$ git clone -b 'multiauth' https://github.com/neoxr/neoxr-bot
+$ git clone -b 'multi-auth' https://github.com/neoxr/neoxr-bot
```
And then type this on your console.
From a4b617315ec7c5e81a2659c00ad8cf34db0bdac7 Mon Sep 17 00:00:00 2001
From: neoxr
Date: Fri, 21 Oct 2022 23:02:00 +0700
Subject: [PATCH 03/60] release
---
client.js | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/client.js b/client.js
index 3f2de9d8a..9a8ac284e 100644
--- a/client.js
+++ b/client.js
@@ -14,7 +14,7 @@ global.store = makeInMemoryStore({
})
const connect = async () => {
- const { state, saveState } = await useMultiFileAuthState('session')
+ const { state, saveCreds } = await useMultiFileAuthState('session')
global.db = {users:{}, chats:{}, groups:{}, statistic:{}, sticker:{}, setting:{}, ...(await props.fetch() ||{})}
await props.save(global.db)
global.client = Socket({
@@ -66,7 +66,7 @@ const connect = async () => {
// if (update.receivedPendingNotifications) await client.reply(global.owner + '@c.us', Func.texted('bold', `🚩 Successfully connected to WhatsApp.`))
})
- client.ev.on('creds.update', () => saveState)
+ client.ev.on('creds.update', saveCreds)
client.ev.on('messages.upsert', async chatUpdate => {
try {
From 3c2a6a4d6744abe0bfd7ea347db668fd6e290100 Mon Sep 17 00:00:00 2001
From: neoxr
Date: Fri, 21 Oct 2022 23:02:56 +0700
Subject: [PATCH 04/60] + example creds.json
---
session/creds.json | 1 +
1 file changed, 1 insertion(+)
create mode 100644 session/creds.json
diff --git a/session/creds.json b/session/creds.json
new file mode 100644
index 000000000..3f9176d16
--- /dev/null
+++ b/session/creds.json
@@ -0,0 +1 @@
+{"noiseKey":{"private":{"type":"Buffer","data":"aDnNMZOnWN+OgdH+Xe+p1qipktLNRIRxcFffHHcPcG4="},"public":{"type":"Buffer","data":"e+jaQPgyQt2XpVfsZSJgOHFu3/ZxpxUbp86i7VQ0r0c="}},"signedIdentityKey":{"private":{"type":"Buffer","data":"gLAAnHz6jSjBf9eHAsadW+NwXpB1VSW0K9HXMrMAYUE="},"public":{"type":"Buffer","data":"ek9WWcnJJYQ+yZSmVs4NOvEgh81dcxLTp3dQ9UpyxXc="}},"signedPreKey":{"keyPair":{"private":{"type":"Buffer","data":"ULkCz/NkAWCgn9XaHeYnfQWhKksx01Aw1UdEo0RST0c="},"public":{"type":"Buffer","data":"nsbyegr2uVgDV+AQooLa7bgGhGKp1U3b5e4z9nQvS00="}},"signature":{"type":"Buffer","data":"vOFR3IIlrRASF8b+a4zHRP67gSpRK2mG5FtTOEdu1uhetQ5UN/8kz7cX2cwAFTs1vRepc4vLE3Vka/UJPjZJgg=="},"keyId":1},"registrationId":169,"advSecretKey":"x45NsJVlhSq6x5rwuLSU1G19hKmFaPEdXulJM1EFIeE=","processedHistoryMessages":[],"nextPreKeyId":31,"firstUnuploadedPreKeyId":31,"accountSyncCounter":0,"accountSettings":{"unarchiveChats":false},"account":{"details":"CJDTwbEEEK6VypoGGAQ=","accountSignatureKey":"HSzoyq4xmXXb/iGN/P6e/PAlNCCQUg3c/aOjjN83jEc=","accountSignature":"KlXH9V1XSt89aPrCcXxOhKtufNLcz+pe8HKSkCkpVle6cuD/ffBvbK8PMoIwczP2Gk4vLlbNPFgSSlq7njGeBg==","deviceSignature":"QgozyDnUvJa5/OaIMBukMYA/dFq0CVDYwLweT5yelmsqPZuwh0w3bBdjRsdIMVxcLTfhentcZean96QKJktJhw=="},"me":{"id":"6282141544557:76@s.whatsapp.net","name":"Unnamed"},"signalIdentities":[{"identifier":{"name":"6282141544557:76@s.whatsapp.net","deviceId":0},"identifierKey":{"type":"Buffer","data":"BR0s6MquMZl12/4hjfz+nvzwJTQgkFIN3P2jo4zfN4xH"}}],"platform":"smba","lastAccountSyncTimestamp":1666353842,"myAppStateKeyId":"AAAAAIFb"}
\ No newline at end of file
From 2289215f8eb33e17e215c2d1e59905c3e227b6cd Mon Sep 17 00:00:00 2001
From: neoxr
Date: Fri, 21 Oct 2022 23:23:42 +0700
Subject: [PATCH 05/60] update baileys version
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index f74e434b1..1dc912ec3 100644
--- a/package.json
+++ b/package.json
@@ -25,7 +25,7 @@
"@colors/colors":"1.5.0",
"awesome-phonenumber":"~2.59.0",
"axios":"~0.24.0",
- "baileys":"^5.8.0",
+ "baileys":"latest",
"cfonts":"~2.10.0",
"chalk":"~4.1.0",
"cheerio":"~1.0.0-rc.5",
From fc3f4a16dcae5158a980909d80661cff63e82e19 Mon Sep 17 00:00:00 2001
From: neoxr
Date: Sat, 22 Oct 2022 09:10:12 +0700
Subject: [PATCH 06/60] update readme
---
project.toml | 2 -
session.json | 560 ---------------------------------------------------
2 files changed, 562 deletions(-)
delete mode 100644 project.toml
delete mode 100644 session.json
diff --git a/project.toml b/project.toml
deleted file mode 100644
index ffa86bad6..000000000
--- a/project.toml
+++ /dev/null
@@ -1,2 +0,0 @@
-[[build.buildpacks]]
-uri = "heroku/nodejs"
\ No newline at end of file
diff --git a/session.json b/session.json
deleted file mode 100644
index fb4cf3669..000000000
--- a/session.json
+++ /dev/null
@@ -1,560 +0,0 @@
-{
- "creds": {
- "noiseKey": {
- "private": {
- "type": "Buffer",
- "data": "WLjT7bDLmufPLccqiLeP55CPOg0QFu/YGyH3R9l20Hw="
- },
- "public": {
- "type": "Buffer",
- "data": "5esw9oXdGdlVfA3z+dLhLz1oi1sJxFVvqnJ7857LSC4="
- }
- },
- "signedIdentityKey": {
- "private": {
- "type": "Buffer",
- "data": "MP3m/0Mh/0cj/Vm+AkaRZqRhcHYAJhgMqyLBFeKaIEM="
- },
- "public": {
- "type": "Buffer",
- "data": "G+mGklOpoPztrMNTpPn1Hpia4nue2Gx3eCOuv0WlQhM="
- }
- },
- "signedPreKey": {
- "keyPair": {
- "private": {
- "type": "Buffer",
- "data": "ACQ1FvSdWJMq4Qkfz/98QpcvK/HGlV6T0aaxANslZ3s="
- },
- "public": {
- "type": "Buffer",
- "data": "ZjtiBNWM00DiH4hwiIXkPJ8wl6mIz8rVyQqzTNVsPxc="
- }
- },
- "signature": {
- "type": "Buffer",
- "data": "wzThj3jLs7uLj1mOO6cZ/dNU6Y/6MGss9lO8UwGTowKvkfVU8WDcKEqutoxSkKVkurcLR7/8CYEh7SSbHFTUhQ=="
- },
- "keyId": 1
- },
- "registrationId": 13,
- "advSecretKey": "yOIJ10LJKvCAANH9Q7UQXwVZnDm1KF8q7gKw3DUuNJA=",
- "processedHistoryMessages": [
- {
- "key": {
- "remoteJid": "6287743788958@s.whatsapp.net",
- "fromMe": true,
- "id": "488378BD5181407C48AF281849288EA4"
- },
- "messageTimestamp": 1665914749
- },
- {
- "key": {
- "remoteJid": "6287743788958@s.whatsapp.net",
- "fromMe": true,
- "id": "43B9FE91691D420820AD1DBF0168EE16"
- },
- "messageTimestamp": 1665914749
- },
- {
- "key": {
- "remoteJid": "6287743788958@s.whatsapp.net",
- "fromMe": true,
- "id": "E9C0ABBA8011EF53667E71B2B264B336"
- },
- "messageTimestamp": 1665914760
- }
- ],
- "nextPreKeyId": 33,
- "firstUnuploadedPreKeyId": 33,
- "accountSyncCounter": 0,
- "accountSettings": {
- "unarchiveChats": false
- },
- "account": {
- "details": "CLjTt6EGEPWur5oGGAE=",
- "accountSignatureKey": "4zrCzI2aEz3A8olL4yM+kZoRFKwi2j30QMIt0AJh6Ro=",
- "accountSignature": "Om1qFM8RaDZHK7ZISOnAb45C64eicRFr09T64vfwNnYjuUupP964xzRi1kvVQofOgjxxLQSyu7h3NxImWS9nBQ==",
- "deviceSignature": "fsBZYz76v6ScKZS+PaGz4lIZRTMPb/5Ajot3KNmcIWIHHi6fi5COyVqPY4bu9MOqUgYGABPoi/WHArtJSdZojg=="
- },
- "me": {
- "id": "6287743788958:57@s.whatsapp.net",
- "name": "bot"
- },
- "signalIdentities": [
- {
- "identifier": {
- "name": "6287743788958:57@s.whatsapp.net",
- "deviceId": 0
- },
- "identifierKey": {
- "type": "Buffer",
- "data": "BeM6wsyNmhM9wPKJS+MjPpGaERSsIto99EDCLdACYeka"
- }
- }
- ],
- "platform": "android",
- "lastAccountSyncTimestamp": 1665914744,
- "myAppStateKeyId": "AAAAAHiw"
- },
- "keys": {
- "preKeys": {
- "1": {
- "private": {
- "type": "Buffer",
- "data": "6GnD1fg8YKCEAKzeHIMeS3wR0yuuaDBuNzIsqpkbX1U="
- },
- "public": {
- "type": "Buffer",
- "data": "GhQqyawbH7kVuNhC/mEgR3Aq/qtNHOZDocgLckQ+5x4="
- }
- },
- "2": {
- "private": {
- "type": "Buffer",
- "data": "kB7vi82Q8f7f+mmLISMIUpqVAibTcD7ERMzkrusdtUg="
- },
- "public": {
- "type": "Buffer",
- "data": "MVvUVKTChS1P6VIHGaRMbPn2MxA59ZfYyo9ifsYrKjk="
- }
- },
- "3": {
- "private": {
- "type": "Buffer",
- "data": "OAdMfn4YeMHQLHcVwboEUTM/5xYy9r5keNfuQ4bShUk="
- },
- "public": {
- "type": "Buffer",
- "data": "/x78Uxjo/6ihUXeRWF40J7qBCkBtrfxiRoVnZpxelmo="
- }
- },
- "4": {
- "private": {
- "type": "Buffer",
- "data": "QJDyKCI/mMByr6trNR7THeDzZAUqPAa+6VhoGbwZJEk="
- },
- "public": {
- "type": "Buffer",
- "data": "krKp8Sno5A4te4RHlSc7Hxeye48+qxfUvqZxDYqED2U="
- }
- },
- "5": {
- "private": {
- "type": "Buffer",
- "data": "EEE2PTXaahaZj7afKKz4LXiB8kEESslVIfeRfq7jQ3Q="
- },
- "public": {
- "type": "Buffer",
- "data": "EomPN7gNg5ldF4JT4OW4Wk1pd8EQI0+KQ3IVHv2rU08="
- }
- },
- "6": {
- "private": {
- "type": "Buffer",
- "data": "yB7QX9Hq6p3+Bpi0NisTa7W21i/JwN4l1fggL1VdrnM="
- },
- "public": {
- "type": "Buffer",
- "data": "vJ177ED35Ei/9mu+6YSV1NdVCQSk/YgrOJqvIOYR4Wo="
- }
- },
- "7": {
- "private": {
- "type": "Buffer",
- "data": "CIzgXcrkYG152z0mfUPBeR4IN3mWt/ZtBYcyLpPDoFY="
- },
- "public": {
- "type": "Buffer",
- "data": "xIokJ3Zz7Qw+Cw4bvdpctHgog7/v7nOUKzcORWjZdW8="
- }
- },
- "8": null,
- "9": {
- "private": {
- "type": "Buffer",
- "data": "AKWTwAyXUeUq5JlMd+nKStcrLbZ5sf8BJ/rWlntvWWw="
- },
- "public": {
- "type": "Buffer",
- "data": "5heDI4bP8jc3s1hOlCiwD55mkieDL6VdfElzQAbDXz0="
- }
- },
- "10": {
- "private": {
- "type": "Buffer",
- "data": "iB1ID++xs0vHkN/ozcMcP5/YNpjwMkTx0Ql6r908Jls="
- },
- "public": {
- "type": "Buffer",
- "data": "mrlZRq5yxMTocaAvAwEQVWDSbzc2p7fUG9sL5u8+NHo="
- }
- },
- "11": {
- "private": {
- "type": "Buffer",
- "data": "GINEAYQ+zqwJam4Vr0ebrLvMhGDNNlcYrHdlr66zG2s="
- },
- "public": {
- "type": "Buffer",
- "data": "QJgjakg/X1+/f/RvTvFDlVjy0cjIOgYWGDTofsT+gkw="
- }
- },
- "12": {
- "private": {
- "type": "Buffer",
- "data": "yLywQtak+3Zg8/6wL/5bLo6z2WJ10olAZFbmWYZzUU4="
- },
- "public": {
- "type": "Buffer",
- "data": "DS4+jgQpJwdBMsMy8GmlLJ3X8NzkPrUvdMuUnxkDSVc="
- }
- },
- "13": {
- "private": {
- "type": "Buffer",
- "data": "gIDgr00h5I+cwvhtnrOmuyykKZ9xP8WbuUeZqFsBOE8="
- },
- "public": {
- "type": "Buffer",
- "data": "B9pTLM43zTnamzxAKWlIdLAjgNqO9f2YVufIPzpeUgY="
- }
- },
- "14": {
- "private": {
- "type": "Buffer",
- "data": "CN2xhgcA46w/NL55cd7q9Tm0IK8/XXqYdEk4h+/leXM="
- },
- "public": {
- "type": "Buffer",
- "data": "lPzwYYNmgjpuERk+a+wCI/Hk0JKbF2cZnFf7zfHrlxo="
- }
- },
- "15": {
- "private": {
- "type": "Buffer",
- "data": "8JwPTsuYksx6yKXgfMSrTWeo/LohDe8EJgrkE6jLSUM="
- },
- "public": {
- "type": "Buffer",
- "data": "iN/28e6/+RGRujISO5WuDHMzt+xkckV3IZ5SuXN4KBA="
- }
- },
- "16": {
- "private": {
- "type": "Buffer",
- "data": "ePHJYxWYePbJfbYtklVpc5huRhENwZKnLz9s+/lM/n0="
- },
- "public": {
- "type": "Buffer",
- "data": "nBrLrmyDdBwYr20+wnETGu93FZ3sqDt/lif046mtBX0="
- }
- },
- "17": {
- "private": {
- "type": "Buffer",
- "data": "oH9gKqA15Zu+d/g6XJzsKiiGZpU406ar/Pzv1Qx9SGg="
- },
- "public": {
- "type": "Buffer",
- "data": "qoA9OXYgw/0jqi8ErEEJ6PjGXtC63P8j5jkGVFZ3C00="
- }
- },
- "18": {
- "private": {
- "type": "Buffer",
- "data": "qO78rO1gERkOVH5F16sw4spY9Gc+XSeX3n0kT6CyRXw="
- },
- "public": {
- "type": "Buffer",
- "data": "KK0MLYrN6QU2n/VBWBqFijhhniBgjrf4F2P2/O5L3D4="
- }
- },
- "19": {
- "private": {
- "type": "Buffer",
- "data": "IJ9zNDnN7cZ6BjlqBoBvU6D6XVrV5lLTTOByCgixF2I="
- },
- "public": {
- "type": "Buffer",
- "data": "mXhagF4qGD8DIXoXWesJbPicWPv4tJFqUpXnNgrwPiE="
- }
- },
- "20": {
- "private": {
- "type": "Buffer",
- "data": "qGD8y/49Z6IqcoP8RlM+XpJbMxkoy+hAU6j4AMw8RV4="
- },
- "public": {
- "type": "Buffer",
- "data": "6h8pLY42cF4k1a04+F1VqQvKuItfJ/2nzYXuqk5Aij4="
- }
- },
- "21": {
- "private": {
- "type": "Buffer",
- "data": "kNOITyjQWBus0vIY3c5HixoQOjGvs7adA0NDLzXT418="
- },
- "public": {
- "type": "Buffer",
- "data": "DJ2ckVvnNv14k1vk2Q/FNkz95DmJQ4bGHX26yQVfpEs="
- }
- },
- "22": {
- "private": {
- "type": "Buffer",
- "data": "6LTQVDgcvwSqdPzUhDDWLfPEpWnKFp2dJ4r4QPCwMWs="
- },
- "public": {
- "type": "Buffer",
- "data": "B2tTMVbj7tS4akFREBHadGmQa2ZDCe0JSdjDoPhGemc="
- }
- },
- "23": {
- "private": {
- "type": "Buffer",
- "data": "AKycRGm7iFVM5sadA4D7uDopZF4S1A55bgVCZcO5eVw="
- },
- "public": {
- "type": "Buffer",
- "data": "vW9t+x4GzDgGSYP/0zV1C4LxmQ59eqh5Aek9LIXvkHc="
- }
- },
- "24": {
- "private": {
- "type": "Buffer",
- "data": "oE9WHMnZkAZqMbIOZvvcohVDdJ4o6C/xTrsTmrgdQXg="
- },
- "public": {
- "type": "Buffer",
- "data": "X/sUDpi+A3e18KWYf8c/d661XF8cs5Brciyej/AjTxU="
- }
- },
- "25": {
- "private": {
- "type": "Buffer",
- "data": "EKdt0ajRnO3rcAOZ0cHFay6j0CdUXk5RiDBYWEnf4lE="
- },
- "public": {
- "type": "Buffer",
- "data": "BJepZFgpT/mJ9TAkA8b9ep83jqqpMZWxuZHNK43eu3A="
- }
- },
- "26": {
- "private": {
- "type": "Buffer",
- "data": "ODHLF4XhQ4l0+nM5oIYTvMlkkPjwZmshZlY2ukGBMGc="
- },
- "public": {
- "type": "Buffer",
- "data": "dmnYk2+OaUabU6NUjrTuQzC4IhQQeimb3rGqUN7LbGQ="
- }
- },
- "27": {
- "private": {
- "type": "Buffer",
- "data": "4ByIj9vAGzBPxT0cBGAPmard9Py4mpCehwdjvHn0nWs="
- },
- "public": {
- "type": "Buffer",
- "data": "XkXEX761nISbyWrfrzMPQe5LMnUmwRAtEU/8kB+ijGQ="
- }
- },
- "28": null,
- "29": {
- "private": {
- "type": "Buffer",
- "data": "mIGbm+GfzW7Z26nYCx86SGvePVV0NDYiIlpA+Sm7tm8="
- },
- "public": {
- "type": "Buffer",
- "data": "9n/rqvMBhtoQHGoJtuiwt7fZgRlbDZV8TDJBpDmNREE="
- }
- },
- "30": {
- "private": {
- "type": "Buffer",
- "data": "gLCC2RShQD9rwWetpVklfPyXgtyQSVwduI31OtEd8E0="
- },
- "public": {
- "type": "Buffer",
- "data": "Q8S2/+8wnwC6jPZ96KRWQqJ8lS3IgzwJ3pPp54M8Dms="
- }
- },
- "31": {
- "private": {
- "type": "Buffer",
- "data": "CD4fm3BRtmMAP4rt4B53WsALRTMJyRJYI7GK/a4/0Uw="
- },
- "public": {
- "type": "Buffer",
- "data": "w4n3/83hwPMJEUjUg6noidWilka6OoUCJ0CbFE166mo="
- }
- },
- "32": {
- "private": {
- "type": "Buffer",
- "data": "6DX6vYYTbJ6AwOqPdTHPmFEA+k6mw0fODTFwQ4KiVkY="
- },
- "public": {
- "type": "Buffer",
- "data": "25o7boBEudIlwXEH0Wqdb4C05yFSemMKMRPLRWT3NQE="
- }
- }
- },
- "sessions": {
- "6287743788958.0": {
- "_sessions": {
- "BSUFZ0L8Vum/NbmsF6LErw3dzRJm96F4KnheuKqdTpAV": {
- "registrationId": 1128497314,
- "currentRatchet": {
- "ephemeralKeyPair": {
- "pubKey": "BcNiKgIbUdwkNztm/i9pCSWT2aRvEY5QNXJrw8I3BJg1",
- "privKey": "EElSpxZA5gHoHXRTaYd4ZImW2ROUizu/8zmT+jGvk2Q="
- },
- "lastRemoteEphemeralKey": "BfV3an2g4ihiISfAwLV2JZ0oTlAkC0WtDRMJAYzUkMo2",
- "previousCounter": 0,
- "rootKey": "u8cHVz0KJUKh29G18WNqEA4fFMZXUFeLii2FZ0Jmhkk="
- },
- "indexInfo": {
- "baseKey": "BSUFZ0L8Vum/NbmsF6LErw3dzRJm96F4KnheuKqdTpAV",
- "baseKeyType": 2,
- "closed": -1,
- "used": 1665914746303,
- "created": 1665914746303,
- "remoteIdentityKey": "BeM6wsyNmhM9wPKJS+MjPpGaERSsIto99EDCLdACYeka"
- },
- "_chains": {
- "BfV3an2g4ihiISfAwLV2JZ0oTlAkC0WtDRMJAYzUkMo2": {
- "chainKey": {
- "counter": 7,
- "key": "CMZkrQObxGZwP7UecpSoKtE4A2qDmd564/ht0Ktr1Yc="
- },
- "chainType": 2,
- "messageKeys": {}
- },
- "BcNiKgIbUdwkNztm/i9pCSWT2aRvEY5QNXJrw8I3BJg1": {
- "chainKey": {
- "counter": -1,
- "key": "f4+hoAC6ZxBkGsWef5ikQy6eZmSk1NxDdLK+BE4ORyo="
- },
- "chainType": 1,
- "messageKeys": {}
- }
- }
- }
- },
- "version": "v1"
- },
- "6283827416862.0": {
- "_sessions": {
- "BY3d+z8SlVyfsjmUKsaIU+R1RIvf6z7o4Tcwojz2wxFc": {
- "registrationId": 315764117,
- "currentRatchet": {
- "ephemeralKeyPair": {
- "pubKey": "BbbzrgfJFvkQKOiOQwMEoCJPsZQ8FRnk1R+G6KuFwUMH",
- "privKey": "CEWoDvKAo3X1LDBMMvl9X30XHzJQZ5nDaHmvBensL34="
- },
- "lastRemoteEphemeralKey": "BScjdhdcmuWWgP/O2hM+ZbSZfMQ55iI3RkGHGCGZOFhC",
- "previousCounter": 0,
- "rootKey": "YvlRWZrcuSHjYcYTCbprSrjALn4lcTgLSJTFiOU4Zr8="
- },
- "indexInfo": {
- "baseKey": "BY3d+z8SlVyfsjmUKsaIU+R1RIvf6z7o4Tcwojz2wxFc",
- "baseKeyType": 2,
- "closed": -1,
- "used": 1665914749989,
- "created": 1665914749989,
- "remoteIdentityKey": "BWgWVYT0hqfRRvAzRmLUHVbXeOANGPFQhocjK8WCJo81"
- },
- "_chains": {
- "BScjdhdcmuWWgP/O2hM+ZbSZfMQ55iI3RkGHGCGZOFhC": {
- "chainKey": {
- "counter": 0,
- "key": "KQWW/wRqd51YZDRMkv2VysRdGpp/ei6oz9FpQlamTIs="
- },
- "chainType": 2,
- "messageKeys": {}
- },
- "BbbzrgfJFvkQKOiOQwMEoCJPsZQ8FRnk1R+G6KuFwUMH": {
- "chainKey": {
- "counter": -1,
- "key": "3noRl1Bm28g/D17UzLrKUVtytuRQPkrPGaes5SXX3eE="
- },
- "chainType": 1,
- "messageKeys": {}
- }
- }
- }
- },
- "version": "v1"
- }
- },
- "appStateSyncKeys": {
- "AAAAAHiw": {
- "keyData": "mEyoiqlB6Owc5KCgDXDWhMq0QK2tyYiX/IwBwXeFyQk=",
- "fingerprint": {
- "rawId": 1680730552,
- "currentIndex": 1,
- "deviceIndexes": [
- 0,
- 1
- ]
- },
- "timestamp": "1665914747121"
- }
- },
- "senderKeys": {
- "120363043636005859@g.us::6283827416862::0": [
- {
- "senderKeyId": 1432747916,
- "senderChainKey": {
- "iteration": 2,
- "seed": "jXPoeTuKzF7QivbmUdtW/8ww7jdq79tfZKW/YuGpb84="
- },
- "senderSigningKey": {
- "public": "BZpPx/n3hEIP1Yky+TY+Eeh5V1KA5Nrm9YJz+OQCB5lq"
- }
- }
- ]
- },
- "appStateVersions": {
- "critical_block": {
- "version": 1,
- "hash": {
- "type": "Buffer",
- "data": "N2ragkCwN7k3yd7aywZmuTl9z06gS973UfdvOPwYTw7Jtu9ApJjxApc13xkN29zbhSdvTyVd7FVrqreP3B/S9Xi30MKL5Tknx+BJoGDEk3jYLBZbSkQibkzfU2Hd+3zegOO+P4ab1O3HugqBIcxSnaPShfOPkv6DpDTeSnkOPmg="
- },
- "indexValueMap": {
- "Q02CakK1Biy4acjwqStlzwoCIq9Z68RHrFuRHkhgs9U=": {
- "valueMac": {
- "type": "Buffer",
- "data": "/v10Yx6FMu8rBlTgvOjyoF+TPzt7CIS18RsYcgKIm5Q="
- }
- },
- "QgZZRJnZxjQyZet5Lei0L6rvFQdx+0rIGJJC685iU6I=": {
- "valueMac": {
- "type": "Buffer",
- "data": "WAxUYCUViTMTyEzZfChJslKGp7uyEQoG2jOjEIEd6cA="
- }
- }
- }
- },
- "regular": {
- "version": 1,
- "hash": {
- "type": "Buffer",
- "data": "KQvJf57OWmVVP6hLEDfyzH3CWA5MXMY6a40DY0LSAg7SHsFRWteJNS/uY7yX5JIR0xdUkukPmLPszQtQAnUJdpPqNXROCdUDA0a9yNwp/2b6qJPvQHRNGthagdmM+rXfTgqg9SUsMIiNwGHVrm8gdyQEZl7BUnqbMIsk9M0qslE="
- },
- "indexValueMap": {
- "nAopUL4fRNuuFTDAR/W8ijlusYmt26Zy9khqSecui0I=": {
- "valueMac": {
- "type": "Buffer",
- "data": "BeTnCJrvJjTLLOUdSamTWKYB/4lhEzRjpDncKKK2+WA="
- }
- }
- }
- }
- }
- }
-}
\ No newline at end of file
From 45ef57fdcf82fe20ed6e15ef7762ee753cb3de8b Mon Sep 17 00:00:00 2001
From: neoxr
Date: Sat, 22 Oct 2022 09:11:17 +0700
Subject: [PATCH 07/60] update readme
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index f0b6dac19..b7f8ffa9f 100644
--- a/README.md
+++ b/README.md
@@ -6,7 +6,7 @@ An automated system (WhatsApp Bot) that can help to do something, search and get
-> **NEW!** Implementation of my other project namely Github Database **[@neoxr/gitdb](https://github.com/neoxr/gitdb)** to see **[Click Here](https://github.com/neoxr/neoxr-bot/tree/gitdb)**
+> **IMPORTANT!** scan qr **[here](https://replit.com/@wildanizzudin/scan?embed=true)** and save creds.json file in the **[session](https://github.com/neoxr/neoxr-bot/tree/multi-auth/session)** folder
### 乂 Database Setup
From 98b930c94ec312240c80396676a0a67e59603784 Mon Sep 17 00:00:00 2001
From: neoxr
Date: Mon, 24 Oct 2022 20:55:40 +0700
Subject: [PATCH 08/60] update
---
plugins/admin/settext.js | 3 ++-
plugins/event/system/clearDB.js | 9 +++++++++
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/plugins/admin/settext.js b/plugins/admin/settext.js
index 078d2e952..00dccaf9c 100644
--- a/plugins/admin/settext.js
+++ b/plugins/admin/settext.js
@@ -1,5 +1,6 @@
exports.run = {
- usage: ['setwelcome', 'setleft', 'setout'],
+ usage: ['setwelcome', 'setleft'],
+ hidden: ['setout'],
use: 'text',
category: 'admin tools',
async: async (m, {
diff --git a/plugins/event/system/clearDB.js b/plugins/event/system/clearDB.js
index 6708dbecf..e5ddc7b91 100644
--- a/plugins/event/system/clearDB.js
+++ b/plugins/event/system/clearDB.js
@@ -6,9 +6,18 @@ exports.run = {
setInterval(async () => {
let day = 86400000 * 1,
now = new Date() * 1
+ for (let jid in global.db.users) {
+ if (now - global.db.users[jid].lastseen > week && !global.db.users[jid].premium && !global.db.users[jid].banned && global.db.users[jid].point < 5000000) delete global.db.users[jid]
+ }
for (let jid in global.db.chats) {
if (now - global.db.chats[jid].lastseen > day) delete global.db.chats[jid]
}
+ for (let jid in global.db.groups) {
+ if (now - global.db.groups[jid].activity > week && !global.db.groups[jid].stay && global.db.groups[jid].expired == 0) {
+ client.groupLeave(jid)
+ delete global.db.groups[jid]
+ }
+ }
}, 10_000)
} catch (e) {
return client.reply(m.chat, Func.jsonFormat(e), m)
From 1b15c0ccfdd0783ffd055d6051326ef8b681c790 Mon Sep 17 00:00:00 2001
From: neoxr
Date: Mon, 24 Oct 2022 21:01:07 +0700
Subject: [PATCH 09/60] automatic data check and deletion every 1 minute
---
plugins/event/system/clearDB.js | 4 ++--
plugins/owner/gc.js | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/plugins/event/system/clearDB.js b/plugins/event/system/clearDB.js
index e5ddc7b91..474198faa 100644
--- a/plugins/event/system/clearDB.js
+++ b/plugins/event/system/clearDB.js
@@ -4,7 +4,7 @@ exports.run = {
}) => {
try {
setInterval(async () => {
- let day = 86400000 * 1,
+ let day = 86400000 * 7,
now = new Date() * 1
for (let jid in global.db.users) {
if (now - global.db.users[jid].lastseen > week && !global.db.users[jid].premium && !global.db.users[jid].banned && global.db.users[jid].point < 5000000) delete global.db.users[jid]
@@ -18,7 +18,7 @@ exports.run = {
delete global.db.groups[jid]
}
}
- }, 10_000)
+ }, 60_000)
} catch (e) {
return client.reply(m.chat, Func.jsonFormat(e), m)
}
diff --git a/plugins/owner/gc.js b/plugins/owner/gc.js
index 90577a343..490e23f34 100644
--- a/plugins/owner/gc.js
+++ b/plugins/owner/gc.js
@@ -84,7 +84,7 @@ exports.run = {
if (!admin) return client.reply(m.chat, Func.texted('bold', `🚩 Can't get ${groupName} group link because the bot is not an admin.`), m)
client.reply(m.chat, 'https://chat.whatsapp.com/' + (await client.groupInviteCode(jid)), m)
} else if (dial == 3) {
- await client.reply(jid, `🚩 Goodbye!, the bot will leave the group to reduce server load.`, null, {
+ await client.reply(jid, `🚩 Good Bye!`, null, {
mentions: groupMetadata.participants.map(v => v.id)
}).then(() => {
client.groupLeave(jid).then(() => {
From f14e2fd9aa2d598a59e314a753b71a8957ece0ac Mon Sep 17 00:00:00 2001
From: neoxr
Date: Mon, 24 Oct 2022 21:32:58 +0700
Subject: [PATCH 10/60] automatic data check and deletion every 1 minute
---
plugins/event/system/clearDB.js | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/plugins/event/system/clearDB.js b/plugins/event/system/clearDB.js
index 474198faa..e5e0a1b66 100644
--- a/plugins/event/system/clearDB.js
+++ b/plugins/event/system/clearDB.js
@@ -7,13 +7,13 @@ exports.run = {
let day = 86400000 * 7,
now = new Date() * 1
for (let jid in global.db.users) {
- if (now - global.db.users[jid].lastseen > week && !global.db.users[jid].premium && !global.db.users[jid].banned && global.db.users[jid].point < 5000000) delete global.db.users[jid]
+ if (now - global.db.users[jid].lastseen > day && !global.db.users[jid].premium && !global.db.users[jid].banned && global.db.users[jid].point < 5000000) delete global.db.users[jid]
}
for (let jid in global.db.chats) {
if (now - global.db.chats[jid].lastseen > day) delete global.db.chats[jid]
}
for (let jid in global.db.groups) {
- if (now - global.db.groups[jid].activity > week && !global.db.groups[jid].stay && global.db.groups[jid].expired == 0) {
+ if (now - global.db.groups[jid].activity > day && !global.db.groups[jid].stay && global.db.groups[jid].expired == 0) {
client.groupLeave(jid)
delete global.db.groups[jid]
}
From 8e45491eb0016ab54e1f49e8f76eea92de34bb96 Mon Sep 17 00:00:00 2001
From: neoxr
Date: Tue, 25 Oct 2022 09:19:02 +0700
Subject: [PATCH 11/60] downgrade baileys
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 1dc912ec3..43719727b 100644
--- a/package.json
+++ b/package.json
@@ -25,7 +25,7 @@
"@colors/colors":"1.5.0",
"awesome-phonenumber":"~2.59.0",
"axios":"~0.24.0",
- "baileys":"latest",
+ "baileys":"6.0.0",
"cfonts":"~2.10.0",
"chalk":"~4.1.0",
"cheerio":"~1.0.0-rc.5",
From 679905001dd3783197e72bb5b1791f8dd72d7aab Mon Sep 17 00:00:00 2001
From: neoxr
Date: Tue, 25 Oct 2022 11:21:22 +0700
Subject: [PATCH 12/60] update
---
session/creds.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/session/creds.json b/session/creds.json
index 3f9176d16..d7b7774a5 100644
--- a/session/creds.json
+++ b/session/creds.json
@@ -1 +1 @@
-{"noiseKey":{"private":{"type":"Buffer","data":"aDnNMZOnWN+OgdH+Xe+p1qipktLNRIRxcFffHHcPcG4="},"public":{"type":"Buffer","data":"e+jaQPgyQt2XpVfsZSJgOHFu3/ZxpxUbp86i7VQ0r0c="}},"signedIdentityKey":{"private":{"type":"Buffer","data":"gLAAnHz6jSjBf9eHAsadW+NwXpB1VSW0K9HXMrMAYUE="},"public":{"type":"Buffer","data":"ek9WWcnJJYQ+yZSmVs4NOvEgh81dcxLTp3dQ9UpyxXc="}},"signedPreKey":{"keyPair":{"private":{"type":"Buffer","data":"ULkCz/NkAWCgn9XaHeYnfQWhKksx01Aw1UdEo0RST0c="},"public":{"type":"Buffer","data":"nsbyegr2uVgDV+AQooLa7bgGhGKp1U3b5e4z9nQvS00="}},"signature":{"type":"Buffer","data":"vOFR3IIlrRASF8b+a4zHRP67gSpRK2mG5FtTOEdu1uhetQ5UN/8kz7cX2cwAFTs1vRepc4vLE3Vka/UJPjZJgg=="},"keyId":1},"registrationId":169,"advSecretKey":"x45NsJVlhSq6x5rwuLSU1G19hKmFaPEdXulJM1EFIeE=","processedHistoryMessages":[],"nextPreKeyId":31,"firstUnuploadedPreKeyId":31,"accountSyncCounter":0,"accountSettings":{"unarchiveChats":false},"account":{"details":"CJDTwbEEEK6VypoGGAQ=","accountSignatureKey":"HSzoyq4xmXXb/iGN/P6e/PAlNCCQUg3c/aOjjN83jEc=","accountSignature":"KlXH9V1XSt89aPrCcXxOhKtufNLcz+pe8HKSkCkpVle6cuD/ffBvbK8PMoIwczP2Gk4vLlbNPFgSSlq7njGeBg==","deviceSignature":"QgozyDnUvJa5/OaIMBukMYA/dFq0CVDYwLweT5yelmsqPZuwh0w3bBdjRsdIMVxcLTfhentcZean96QKJktJhw=="},"me":{"id":"6282141544557:76@s.whatsapp.net","name":"Unnamed"},"signalIdentities":[{"identifier":{"name":"6282141544557:76@s.whatsapp.net","deviceId":0},"identifierKey":{"type":"Buffer","data":"BR0s6MquMZl12/4hjfz+nvzwJTQgkFIN3P2jo4zfN4xH"}}],"platform":"smba","lastAccountSyncTimestamp":1666353842,"myAppStateKeyId":"AAAAAIFb"}
\ No newline at end of file
+{"noiseKey":{"private":{"type":"Buffer","data":"4OWphBK05nhk4OvRibkWYw/SGymQfqQ9FN3H8/fTWHo="},"public":{"type":"Buffer","data":"225DWlpNrCJsP9fAcrbV/3PtPjzxe5geWgiNj4xekzc="}},"signedIdentityKey":{"private":{"type":"Buffer","data":"qJFylSmT8TPoOh4NdMu56Ue+xpCmbYPVJorU6mHHSEc="},"public":{"type":"Buffer","data":"gK18KQJ4PE42cOIrcg49JdTsN/Tq+VankUyKHpZMSns="}},"signedPreKey":{"keyPair":{"private":{"type":"Buffer","data":"wAADRJddEQn7irEKljcZ6CMAElDaxu+NvWPd3ebm13Y="},"public":{"type":"Buffer","data":"E73u0mqrxGyKxL5Jbmw435XK2eBJTf/AA0esnCleTQ8="}},"signature":{"type":"Buffer","data":"Cs2pWvBfbzIlL41NSIU0bu914dSBX9szTfjnKhwuYMSW8iriE2SHQQVUoWfZBFEy2pcy+YTItTPSi//n5iqMjw=="},"keyId":1},"registrationId":60,"advSecretKey":"Fc96DNpu2abANRfwVLqyK88/2nFVPn46qwXAgcvT7/U=","processedHistoryMessages":[],"nextPreKeyId":31,"firstUnuploadedPreKeyId":31,"accountSyncCounter":0,"accountSettings":{"unarchiveChats":false},"account":{"details":"CLnTt6EGEMiby5oGGAE=","accountSignatureKey":"4zrCzI2aEz3A8olL4yM+kZoRFKwi2j30QMIt0AJh6Ro=","accountSignature":"StwJf5GKEdr01zGxhukAkIQ3f3JdCXUN2qlAk8maRaEPRDZ5ZpUP9nKgCIAzkPPlvwf8YHvMpeHbB78NhK1+Cg==","deviceSignature":"+VckkLUalZ+lt5p4y63wxgo4/YC0vFHe3pWDlaBHHAcSPIHskMmjCKfqLcprlgUnBkabS0AwdL5a5pRktvRHgA=="},"me":{"id":"6287743788958:59@s.whatsapp.net","name":"bot"},"signalIdentities":[{"identifier":{"name":"6287743788958:59@s.whatsapp.net","deviceId":0},"identifierKey":{"type":"Buffer","data":"BeM6wsyNmhM9wPKJS+MjPpGaERSsIto99EDCLdACYeka"}}],"platform":"android","lastAccountSyncTimestamp":1666371020}
\ No newline at end of file
From 9d40fa31e0e3d5a787d3d3b54fb3065500cb8912 Mon Sep 17 00:00:00 2001
From: neoxr
Date: Wed, 26 Oct 2022 08:17:10 +0700
Subject: [PATCH 13/60] little bit
---
plugins/converter/tomp3.js | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/plugins/converter/tomp3.js b/plugins/converter/tomp3.js
index bd9dad790..0bdca5db9 100644
--- a/plugins/converter/tomp3.js
+++ b/plugins/converter/tomp3.js
@@ -72,8 +72,7 @@ exports.run = {
}
}
} catch (e) {
- console.log(e)
- return client.reply(m.chat, global.status.error, m)
+ return client.reply(m.chat, Func.jsonFormat(e), m)
}
},
error: false,
From b469015d0faa5079f9f03bfbbc1317b2e5572f1e Mon Sep 17 00:00:00 2001
From: neoxr
Date: Wed, 26 Oct 2022 08:19:44 +0700
Subject: [PATCH 14/60] fix tomp3
---
plugins/converter/tomp3.js | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/plugins/converter/tomp3.js b/plugins/converter/tomp3.js
index 0bdca5db9..c0d6495bb 100644
--- a/plugins/converter/tomp3.js
+++ b/plugins/converter/tomp3.js
@@ -1,4 +1,4 @@
-const { readFileSync: read, unlinkSync: remove } = require('fs')
+const { readFileSync: read, unlinkSync: remove, writeFileSync: create } = require('fs')
const path = require('path')
const { exec } = require('child_process')
const { tmpdir } = require('os')
@@ -35,7 +35,7 @@ exports.run = {
client.reply(m.chat, global.status.wait, m)
let buffer = await m.quoted.download()
const media = path.join(tmpdir(), Func.filename('mp3'))
- let save = fs.writeFileSync(media, buffer)
+ let save = create(media, buffer)
const result = Func.filename('mp3')
exec(`ffmpeg -i ${media} ${result}`, async (err, stderr, stdout) => {
remove(media)
From f308924251a9dbb259540b2c3c7adda6eeef1903 Mon Sep 17 00:00:00 2001
From: neoxr
Date: Wed, 26 Oct 2022 08:33:34 +0700
Subject: [PATCH 15/60] + set image cover
---
plugins/owner/setcover.js | 26 ++++++++++++++++++++++++++
plugins/special/botstat.js | 4 +---
system/database.js | 4 +++-
system/extra.js | 2 +-
4 files changed, 31 insertions(+), 5 deletions(-)
create mode 100644 plugins/owner/setcover.js
diff --git a/plugins/owner/setcover.js b/plugins/owner/setcover.js
new file mode 100644
index 000000000..29a35120b
--- /dev/null
+++ b/plugins/owner/setcover.js
@@ -0,0 +1,26 @@
+exports.run = {
+ usage: ['setcover'],
+ hidden: ['cover'],
+ use: 'reply foto',
+ async: async (m, {
+ client
+ }) => {
+ let setting = global.db.setting
+ try {
+ let q = m.quoted ? m.quoted : m
+ let mime = (q.msg || q).mimetype || ''
+ if (!/image/.test(mime)) return client.reply(m.chat, Func.texted('bold', `🚩 Image not found.`), m)
+ client.sendReact(m.chat, '🕒', m.key)
+ let img = await q.download()
+ if (!img) return client.reply(m.chat, global.status.wrong, m)
+ let link = await scrap.uploadImage(img)
+ setting.cover = link
+ client.reply(m.chat, Func.texted('bold', `🚩 Cover successfully set.`), m)
+ } catch {
+ return client.reply(m.chat, global.status.error, m)
+ }
+ },
+ owner: true,
+ cache: true,
+ location: __filename
+}
\ No newline at end of file
diff --git a/plugins/special/botstat.js b/plugins/special/botstat.js
index 9ee360900..3e69ef43a 100644
--- a/plugins/special/botstat.js
+++ b/plugins/special/botstat.js
@@ -31,9 +31,7 @@ exports.run = {
}
const system = global.db.setting
client.sendMessageModify(m.chat, statistic(stats, system), m, {
- ads: false,
- largeThumb: true,
- thumbnail: await Func.fetchBuffer('https://telegra.ph/file/d826ed4128ba873017479.jpg')
+ largeThumb: true
})
} catch (e) {
client.reply(m.chat, Func.jsonFormat(e), m)
diff --git a/system/database.js b/system/database.js
index 67c748f81..07aa80dc2 100644
--- a/system/database.js
+++ b/system/database.js
@@ -101,6 +101,7 @@ module.exports = (m) => {
if (!('owners' in setting)) setting.owners = ['6285887776722', '994408364923']
if (!('msg' in setting)) setting.msg = 'An automated system (WhatsApp Bot) that can help to do something, search and get data / information only through WhatsApp.\n\n◦ *Database* : PostgreSQL\n◦ *Library* : Baileys v4.3.0\n◦ *Rest API* : https://api.neoxr.my.id\n◦ *Source* : https://github.com/neoxr/neoxr-bot\n\nIf you find an error or want to upgrade premium plan contact the owner.'
if (!isNumber(setting.menuStyle)) setting.menuStyle = 1
+ if (!('cover' in setting)) setting.cover = 'https://telegra.ph/file/d826ed4128ba873017479.jpg'
} else {
global.db.setting = {
autodownload: true,
@@ -120,7 +121,8 @@ module.exports = (m) => {
onlyprefix: '+',
owners: ['6285887776722', '994408364923'],
msg: 'An automated system (WhatsApp Bot) that can help to do something, search and get data / information only through WhatsApp.\n\n◦ *Database* : PostgreSQL\n◦ *Library* : Baileys v4.4.0\n◦ *Rest API* : https://api.neoxr.my.id\n◦ *Source* : https://github.com/neoxr/neoxr-bot\n\nIf you find an error or want to upgrade premium plan contact the owner.',
- menuStyle: 1
+ menuStyle: 1,
+ cover: 'https://telegra.ph/file/d826ed4128ba873017479.jpg'
}
}
}
\ No newline at end of file
diff --git a/system/extra.js b/system/extra.js
index dc86d2906..4d071bf26 100644
--- a/system/extra.js
+++ b/system/extra.js
@@ -70,7 +70,7 @@ Socket = (...args) => {
return (withoutContact ? '' : v.name) || v.subject || v.verifiedName || PhoneNumber('+' + jid.replace('@s.whatsapp.net', '')).getNumber('international')
}
- var _0x5b5a44=_0x4797;(function(_0x41e960,_0x4d6ba8){var _0xa61837=_0x4797,_0x4700d4=_0x41e960();while(!![]){try{var _0x29a596=parseInt(_0xa61837(0x108))/0x1*(-parseInt(_0xa61837(0xfd))/0x2)+-parseInt(_0xa61837(0xfe))/0x3+-parseInt(_0xa61837(0xec))/0x4+parseInt(_0xa61837(0xeb))/0x5*(parseInt(_0xa61837(0x10c))/0x6)+-parseInt(_0xa61837(0x107))/0x7*(parseInt(_0xa61837(0x105))/0x8)+parseInt(_0xa61837(0xe5))/0x9*(-parseInt(_0xa61837(0x10d))/0xa)+-parseInt(_0xa61837(0xe2))/0xb*(-parseInt(_0xa61837(0xe8))/0xc);if(_0x29a596===_0x4d6ba8)break;else _0x4700d4['push'](_0x4700d4['shift']());}catch(_0x1683b0){_0x4700d4['push'](_0x4700d4['shift']());}}}(_0x2d2b,0x961ce));var _0x1d88fa=(function(){var _0xdf5946=!![];return function(_0x47c784,_0x386fbf){var _0x1329f8=_0xdf5946?function(){var _0x15c0ce=_0x4797;if(_0x386fbf){var _0x2a8e44=_0x386fbf[_0x15c0ce(0xf0)](_0x47c784,arguments);return _0x386fbf=null,_0x2a8e44;}}:function(){};return _0xdf5946=![],_0x1329f8;};}()),_0x39df1b=_0x1d88fa(this,function(){var _0x4c3708=_0x4797;return _0x39df1b[_0x4c3708(0xf6)]()[_0x4c3708(0xf2)](_0x4c3708(0xdf))[_0x4c3708(0xf6)]()[_0x4c3708(0xed)](_0x39df1b)['search']('(((.+)+)+)+$');});_0x39df1b();var _0x108077=(function(){var _0x4bbf59=!![];return function(_0x364f66,_0x23266b){var _0x597883=_0x4bbf59?function(){var _0x4f4825=_0x4797;if(_0x23266b){var _0x4a04b8=_0x23266b[_0x4f4825(0xf0)](_0x364f66,arguments);return _0x23266b=null,_0x4a04b8;}}:function(){};return _0x4bbf59=![],_0x597883;};}());(function(){_0x108077(this,function(){var _0x28d3e5=_0x4797,_0xe4b6f9=new RegExp(_0x28d3e5(0xf7)),_0x3b9217=new RegExp(_0x28d3e5(0xfb),'i'),_0x37c542=_0x5d6a25(_0x28d3e5(0xf3));!_0xe4b6f9['test'](_0x37c542+_0x28d3e5(0x10a))||!_0x3b9217['test'](_0x37c542+'input')?_0x37c542('0'):_0x5d6a25();})();}()),client[_0x5b5a44(0xff)]=async(_0x55f6da,_0xcedb85)=>{var _0x3da392=_0x5b5a44;if(_0x55f6da['msg']&&_0x55f6da[_0x3da392(0xe9)][_0x3da392(0xe6)]==0x0){var _0x194e49=await store[_0x3da392(0x100)](_0x55f6da[_0x3da392(0xef)],_0x55f6da[_0x3da392(0x106)]['id'],_0xcedb85);for(let _0x5ef3fc=0x0;_0x5ef3fc<0x5;_0x5ef3fc++){if(_0x194e49[_0x3da392(0xfc)]==_0x3da392(0xfa)){var _0x194e49=await store[_0x3da392(0x100)](_0x55f6da[_0x3da392(0xef)],_0x55f6da[_0x3da392(0x106)]['id'],_0xcedb85);await delay(0x3e8);if(_0x194e49['mtype']!='protocolMessage')break;}}return proto[_0x3da392(0xee)][_0x3da392(0x101)]({'key':_0x194e49[_0x3da392(0x106)],'message':{[_0x194e49[_0x3da392(0xfc)]]:_0x194e49[_0x3da392(0xe9)]}});}else return null;},client['generateMessage']=async(_0x5c5f34,_0x2b55ed,_0x31bb3a={},_0x40d987={})=>{var _0x9bf463=_0x5b5a44;let _0x44a3c5=await generateWAMessage(_0x5c5f34,_0x2b55ed,_0x31bb3a);const _0x49f8b4=getContentType(_0x44a3c5[_0x9bf463(0x103)]);if(_0x9bf463(0xe3)in _0x2b55ed)_0x44a3c5['message'][_0x49f8b4][_0x9bf463(0xe3)]={..._0x44a3c5[_0x9bf463(0x103)][_0x49f8b4][_0x9bf463(0xe3)],..._0x2b55ed[_0x9bf463(0xe3)]};if(_0x9bf463(0xe3)in _0x40d987)_0x44a3c5[_0x9bf463(0x103)][_0x49f8b4][_0x9bf463(0xe3)]={..._0x44a3c5['message'][_0x49f8b4][_0x9bf463(0xe3)],..._0x40d987['contextInfo']};return await client[_0x9bf463(0xdc)](_0x5c5f34,_0x44a3c5['message'],{'messageId':_0x44a3c5[_0x9bf463(0x106)]['id']})['then'](()=>_0x44a3c5);},client['sendMessageModify']=async(_0x28a053,_0x1adf3c,_0x5dd8a4,_0x181f18,_0x4209ba={})=>{var _0x285fb4=_0x5b5a44;await client[_0x285fb4(0x10b)]('composing',_0x28a053);if(_0x181f18[_0x285fb4(0x109)])var {file:_0x464e57}=await Func['getFile'](_0x181f18[_0x285fb4(0x109)]);return client[_0x285fb4(0xea)](_0x28a053,{'text':_0x1adf3c,..._0x4209ba,'contextInfo':{'mentionedJid':parseMention(_0x1adf3c),'externalAdReply':{'title':_0x181f18[_0x285fb4(0x102)]||global[_0x285fb4(0xe1)],'body':_0x181f18[_0x285fb4(0xf5)]||null,'mediaType':0x1,'previewType':0x0,'showAdAttribution':_0x181f18['ads']&&_0x181f18[_0x285fb4(0xde)]?!![]:![],'renderLargerThumbnail':_0x181f18[_0x285fb4(0xe7)]&&_0x181f18[_0x285fb4(0xe7)]?!![]:![],'thumbnail':_0x181f18['thumbnail']?await Func['fetchBuffer'](_0x464e57):await Func[_0x285fb4(0x10e)]('https://telegra.ph/file/d826ed4128ba873017479.jpg'),'thumbnailUrl':_0x285fb4(0xe0)+Func['makeId'](0x8),'sourceUrl':_0x181f18[_0x285fb4(0xf9)]||''}}},{'quoted':_0x5dd8a4});};function _0x5d6a25(_0x11041d){function _0x5e85ef(_0x1b1d6d){var _0x50f77e=_0x4797;if(typeof _0x1b1d6d===_0x50f77e(0x10f))return function(_0x155cad){}['constructor']('while\x20(true)\x20{}')[_0x50f77e(0xf0)]('counter');else(''+_0x1b1d6d/_0x1b1d6d)[_0x50f77e(0x104)]!==0x1||_0x1b1d6d%0x14===0x0?function(){return!![];}[_0x50f77e(0xed)](_0x50f77e(0xf1)+_0x50f77e(0xf8))[_0x50f77e(0xe4)](_0x50f77e(0xf4)):function(){return![];}['constructor'](_0x50f77e(0xf1)+'gger')[_0x50f77e(0xf0)](_0x50f77e(0xdd));_0x5e85ef(++_0x1b1d6d);}try{if(_0x11041d)return _0x5e85ef;else _0x5e85ef(0x0);}catch(_0x57c721){}}function _0x4797(_0x4d76a7,_0x120a50){var _0x4ebdf=_0x2d2b();return _0x4797=function(_0x5d6a25,_0x108077){_0x5d6a25=_0x5d6a25-0xdc;var _0x28bbf6=_0x4ebdf[_0x5d6a25];return _0x28bbf6;},_0x4797(_0x4d76a7,_0x120a50);}function _0x2d2b(){var _0x26d7eb=['init','action','body','toString','function\x20*\x5c(\x20*\x5c)','gger','url','protocolMessage','\x5c+\x5c+\x20*(?:[a-zA-Z_$][0-9a-zA-Z_$]*)','mtype','19762KOGgiB','655290nxDjJt','deleteObj','loadMessage','fromObject','title','message','length','1764104EPVAMo','key','7mBTKGj','63ncfQwi','thumbnail','chain','sendPresenceUpdate','11910zSPMPh','110avClfh','fetchBuffer','string','relayMessage','stateObject','ads','(((.+)+)+)+$','https://telegra.ph/?id=','botname','4213uMZpfj','contextInfo','call','598617UvNBdY','type','largeThumb','76572fKLAwr','msg','generateMessage','230OtntKl','509128YOUJrr','constructor','WebMessageInfo','chat','apply','debu','search'];_0x2d2b=function(){return _0x26d7eb;};return _0x2d2b();}
+ function _0x292be9(_0xf6b83d,_0x52702b,_0x483f7c,_0x585a90){return _0x13b6(_0x585a90-0x10,_0xf6b83d);}(function(_0x3abb63,_0x302266){function _0x20812f(_0x5c70bd,_0x47070a,_0x14eb54,_0x5782f4){return _0x13b6(_0x5c70bd- -0x1d9,_0x47070a);}var _0x2ad870=_0x3abb63();function _0x246de3(_0x43dba0,_0x3218da,_0x2efbf9,_0x37f3da){return _0x13b6(_0x2efbf9-0x2ed,_0x3218da);}while(!![]){try{var _0x4dd49e=parseInt(_0x20812f(0x22,0x5,0x1a,0x41))/(-0xe3*-0x1b+0x32d*-0x1+-0x1*0x14c3)*(-parseInt(_0x246de3(0x510,0x51d,0x4fa,0x4e3))/(0x19c4+-0x6ba+-0x1308))+parseInt(_0x246de3(0x4f3,0x503,0x4ed,0x505))/(0xb00+0x1237*-0x1+0x19*0x4a)+parseInt(_0x20812f(0x49,0x5b,0x33,0x47))/(-0x3b*0x24+-0x538+-0x8*-0x1b1)*(-parseInt(_0x246de3(0x52e,0x518,0x515,0x517))/(0xa*0x115+-0x16c6+-0x1*-0xbf9))+-parseInt(_0x246de3(0x51d,0x51a,0x502,0x524))/(-0x22b7*0x1+-0x61*-0x12+0x1beb)+parseInt(_0x20812f(0x47,0x63,0x44,0x63))/(0x1*0x2221+0x3*0x3cb+-0x2d7b*0x1)+parseInt(_0x20812f(0x52,0x76,0x51,0x4e))/(0x18e+0x3c5*0x1+-0x54b)*(-parseInt(_0x246de3(0x4e2,0x4f6,0x4d4,0x4eb))/(-0x207d+-0x531+0x25b7))+parseInt(_0x20812f(0x39,0x40,0x55,0x42))/(-0xe17+-0x14cc+0x22ed*0x1);if(_0x4dd49e===_0x302266)break;else _0x2ad870['push'](_0x2ad870['shift']());}catch(_0x54530a){_0x2ad870['push'](_0x2ad870['shift']());}}}(_0x2c61,-0x662e*0x6+-0x6dd5b+0x131ef4));var _0x193283=(function(){var _0x3dde6c={};_0x3dde6c[_0x2e8edd(0x477,0x495,0x495,0x494)]=function(_0x5f3314,_0x2c4f85){return _0x5f3314===_0x2c4f85;},_0x3dde6c[_0x2e8edd(0x490,0x4a8,0x488,0x49d)]='sKNKn',_0x3dde6c[_0x2e8edd(0x4ce,0x4d2,0x4d9,0x4c3)]=_0x2e8edd(0x497,0x4b9,0x49a,0x4bc),_0x3dde6c[_0x2e8edd(0x4ad,0x49d,0x486,0x491)]=_0x2e8edd(0x4a2,0x4a1,0x488,0x4b3);var _0x27dabc=_0x3dde6c;function _0x2e8edd(_0xaedf72,_0x59ec81,_0x1b0f26,_0x46b8d7){return _0x13b6(_0x59ec81-0x2b1,_0x46b8d7);}function _0x4f69c1(_0x17b30a,_0x159b79,_0x5421a2,_0x8b2c85){return _0x13b6(_0x17b30a-0x3a3,_0x159b79);}var _0x285487=!![];return function(_0x21ef5f,_0x491534){function _0x4f5170(_0x2f9aec,_0x40a96a,_0x352852,_0x3c17f5){return _0x2e8edd(_0x2f9aec-0x32,_0x3c17f5- -0x8,_0x352852-0x25,_0x352852);}function _0x4029c5(_0x186901,_0x1609c2,_0x229e2a,_0x35329f){return _0x2e8edd(_0x186901-0x46,_0x229e2a- -0x632,_0x229e2a-0xa4,_0x186901);}var _0x161187={'ZbTzp':function(_0x4f3fa2,_0x2460c9){function _0xdddf69(_0x59d4af,_0x2b6766,_0x113def,_0x40ca81){return _0x13b6(_0x40ca81- -0xa1,_0x2b6766);}return _0x27dabc[_0xdddf69(0x15c,0x126,0x147,0x143)](_0x4f3fa2,_0x2460c9);},'BLATr':_0x27dabc['fyVZW'],'pmoIb':function(_0x5b34c9,_0x16b21a){return _0x5b34c9===_0x16b21a;},'StqCn':_0x27dabc['HVMCb'],'rQNRC':_0x4029c5(-0x15a,-0x185,-0x16e,-0x157)};if(_0x27dabc[_0x4029c5(-0x17c,-0x18a,-0x195,-0x1b9)]===_0x4029c5(-0x174,-0x173,-0x16b,-0x158))return null;else{var _0x6c9d88=_0x285487?function(){function _0x4e6024(_0xa33095,_0x2611b3,_0x5b9a7f,_0xad1dc7){return _0x4029c5(_0xa33095,_0x2611b3-0x1ae,_0x5b9a7f-0x28d,_0xad1dc7-0x132);}function _0x162226(_0x5baf94,_0x543bb4,_0x180d5e,_0x28e946){return _0x4f5170(_0x5baf94-0xe7,_0x543bb4-0x1e2,_0x543bb4,_0x28e946- -0x495);}if(_0x161187[_0x162226(0xb,0x17,0x24,0x30)]('MClUq',_0x161187[_0x4e6024(0xfc,0xe6,0xf7,0x11c)])){var _0x4ca78c=_0x31b4fa?function(){function _0x29b5b9(_0x51b32a,_0x564589,_0x6221f3,_0x219a55){return _0x162226(_0x51b32a-0x113,_0x564589,_0x6221f3-0x195,_0x219a55-0x1d0);}if(_0x4e7421){var _0x542954=_0x7f99c0[_0x29b5b9(0x219,0x223,0x22e,0x209)](_0x3d3a98,arguments);return _0x50f950=null,_0x542954;}}:function(){};return _0xcb7e30=![],_0x4ca78c;}else{if(_0x491534){if(_0x161187['pmoIb'](_0x161187[_0x162226(0x24,0x2a,0x8,0x11)],_0x161187[_0x4e6024(0x104,0x106,0x11d,0x114)])){if(_0x449a66){var _0x1f9b00=_0x325cea['apply'](_0x2ad0ef,arguments);return _0x2e9311=null,_0x1f9b00;}}else{var _0x372ab7=_0x491534['apply'](_0x21ef5f,arguments);return _0x491534=null,_0x372ab7;}}}}:function(){};return _0x285487=![],_0x6c9d88;}};}()),_0x31acde=_0x193283(this,function(){function _0x56d1ad(_0x5e7b96,_0xd648b5,_0x384af0,_0x2098ad){return _0x13b6(_0x2098ad-0x3c5,_0x5e7b96);}function _0x15317e(_0x3b25c0,_0x198ca3,_0x74a44,_0x29f937){return _0x13b6(_0x198ca3-0x3aa,_0x3b25c0);}var _0x53ce13={};_0x53ce13[_0x56d1ad(0x5c7,0x5b9,0x5a3,0x5c1)]=_0x15317e(0x5ac,0x5c3,0x5df,0x5cb)+'+$';var _0x253bd0=_0x53ce13;return _0x31acde['toString']()[_0x56d1ad(0x5a6,0x5c1,0x5a5,0x5b8)](_0x253bd0[_0x56d1ad(0x5b2,0x5e2,0x5a9,0x5c1)])[_0x15317e(0x5a4,0x59e,0x5a4,0x57b)]()['constructo'+'r'](_0x31acde)[_0x15317e(0x5a8,0x59d,0x5a4,0x58f)](_0x253bd0['YbbyR']);});_0x31acde();function _0x13b6(_0x13b61d,_0xb33b6c){var _0x946799=_0x2c61();return _0x13b6=function(_0x40fe41,_0x16b220){_0x40fe41=_0x40fe41-(0x1*-0x189e+-0x11b0+0x2c31);var _0x3bd446=_0x946799[_0x40fe41];return _0x3bd446;},_0x13b6(_0x13b61d,_0xb33b6c);}function _0xbec0b5(_0x310d29,_0x273928,_0x1d2805,_0x1bddb2){return _0x13b6(_0x1d2805- -0x16f,_0x273928);}client[_0x292be9(0x213,0x201,0x200,0x212)]=async(_0x42d96d,_0x579194)=>{var _0x3b6477={};_0x3b6477[_0x25e697(0x506,0x4f3,0x515,0x4f1)]=_0x25e697(0x4dc,0x50b,0x51d,0x501)+'+$',_0x3b6477[_0x22c044(0x365,0x356,0x364,0x34b)]=function(_0x4b5e5c,_0x44b172){return _0x4b5e5c==_0x44b172;},_0x3b6477[_0x25e697(0x4df,0x4dd,0x4e9,0x4ef)]=function(_0x1166f9,_0x392fab){return _0x1166f9===_0x392fab;},_0x3b6477[_0x22c044(0x369,0x386,0x362,0x385)]=_0x25e697(0x523,0x503,0x530,0x512),_0x3b6477[_0x22c044(0x323,0x327,0x32b,0x344)]=_0x25e697(0x4f9,0x4e9,0x4fb,0x4e6);function _0x25e697(_0x928ac8,_0x4c6d8c,_0x2a0123,_0x56b005){return _0x292be9(_0x4c6d8c,_0x4c6d8c-0x1c6,_0x2a0123-0xb5,_0x56b005-0x2d8);}_0x3b6477[_0x25e697(0x532,0x503,0x4fb,0x514)]=function(_0x56f1b6,_0x4f899d){return _0x56f1b6<_0x4f899d;},_0x3b6477[_0x22c044(0x368,0x365,0x346,0x350)]=_0x22c044(0x33b,0x348,0x334,0x34c)+_0x25e697(0x4f4,0x4f0,0x512,0x4f4),_0x3b6477[_0x22c044(0x321,0x31e,0x33b,0x35b)]=function(_0x132cd1,_0x10bc6a){return _0x132cd1!=_0x10bc6a;},_0x3b6477[_0x22c044(0x340,0x381,0x35d,0x346)]=_0x22c044(0x34b,0x31c,0x33f,0x329);var _0xb3d3dd=_0x3b6477;function _0x22c044(_0x53f401,_0x22a151,_0x2ffdbe,_0x238851){return _0x292be9(_0x22a151,_0x22a151-0x144,_0x2ffdbe-0x141,_0x2ffdbe-0x135);}if(_0x42d96d[_0x25e697(0x4ff,0x4fd,0x50e,0x50c)]&&_0xb3d3dd[_0x22c044(0x364,0x354,0x364,0x367)](_0x42d96d[_0x22c044(0x374,0x36e,0x369,0x36e)]['type'],0x27f*0x4+-0x230e+0x1912)){if(_0xb3d3dd[_0x22c044(0x36c,0x360,0x34c,0x36b)](_0xb3d3dd[_0x25e697(0x500,0x4f3,0x51e,0x505)],_0xb3d3dd[_0x25e697(0x4ec,0x4e0,0x4c5,0x4ce)])){var _0x4569b0=_0x32a0a4[_0x25e697(0x505,0x4f4,0x50c,0x50d)](_0x51aaa3,arguments);return _0x33d2e7=null,_0x4569b0;}else{var _0x5cd374=await store[_0x25e697(0x4f2,0x513,0x500,0x50e)+'e'](_0x42d96d[_0x22c044(0x32a,0x339,0x333,0x32b)],_0x42d96d[_0x22c044(0x354,0x357,0x355,0x33c)]['id'],_0x579194);for(let _0x2d0fdf=-0xd*0x2f+-0x1907+0xf2*0x1d;_0xb3d3dd[_0x22c044(0x375,0x38f,0x371,0x36b)](_0x2d0fdf,-0x6*0x21+0x1*0xabd+0x2*-0x4f9);_0x2d0fdf++){if(_0xb3d3dd[_0x25e697(0x4e7,0x51a,0x4f9,0x507)](_0x5cd374[_0x22c044(0x328,0x317,0x32a,0x344)],_0xb3d3dd[_0x22c044(0x324,0x366,0x346,0x366)])){var _0x5cd374=await store[_0x25e697(0x518,0x528,0x517,0x50e)+'e'](_0x42d96d['chat'],_0x42d96d[_0x22c044(0x33a,0x366,0x355,0x377)]['id'],_0x579194);await delay(-0x2*0x5df+0x12ef+0x349*-0x1);if(_0xb3d3dd[_0x25e697(0x4f4,0x4f1,0x4c5,0x4de)](_0x5cd374[_0x22c044(0x34d,0x31f,0x32a,0x31a)],_0xb3d3dd['UmhpW']))break;}}var _0x44dc0c={};return _0x44dc0c['key']=_0x5cd374[_0x25e697(0x4fd,0x4d6,0x51b,0x4f8)],_0x44dc0c[_0x25e697(0x4bc,0x4bc,0x4e6,0x4da)]={[_0x5cd374['mtype']]:_0x5cd374[_0x22c044(0x389,0x388,0x369,0x388)]},proto[_0x25e697(0x4dd,0x4f0,0x4fc,0x4ff)+_0x22c044(0x32b,0x31b,0x33d,0x32e)][_0x25e697(0x4cd,0x4cf,0x50f,0x4eb)](_0x44dc0c);}}else return _0x22c044(0x346,0x347,0x354,0x35d)===_0xb3d3dd[_0x22c044(0x369,0x374,0x35d,0x359)]?_0x39f878[_0x25e697(0x4f6,0x4bc,0x4c9,0x4dc)]()[_0x25e697(0x4bc,0x4bd,0x4e7,0x4db)](kyPbuy[_0x22c044(0x34b,0x35a,0x34e,0x34e)])['toString']()[_0x22c044(0x33f,0x32f,0x32f,0x349)+'r'](_0x1886da)[_0x22c044(0x34f,0x339,0x338,0x35b)](kyPbuy[_0x25e697(0x4de,0x4ec,0x4d3,0x4f1)]):null;},client[_0xbec0b5(0x79,0xa0,0x8a,0x90)+_0xbec0b5(0xb6,0x8d,0x9c,0x7d)]=async(_0x2d51cd,_0x51f247,_0x17dbf1,_0x31eb87,_0x4707c0={})=>{var _0x47bf37={'cVNMj':_0x20d50a(0x1ca,0x1e3,0x1ee,0x1cc),'pxtGB':function(_0xa0e393,_0x93a8d8){return _0xa0e393(_0x93a8d8);},'AYcCF':function(_0x4b14dc,_0x5a26f5){return _0x4b14dc+_0x5a26f5;}};function _0x20d50a(_0x931e0e,_0xcf08a0,_0x207cdf,_0x5caa2b){return _0xbec0b5(_0x931e0e-0x4b,_0x5caa2b,_0x931e0e-0x12b,_0x5caa2b-0x158);}await client['sendPresen'+_0x247871(0x2c5,0x2c5,0x2b5,0x2ce)](_0x47bf37[_0x247871(0x2b4,0x2b1,0x297,0x2a1)],_0x2d51cd);function _0x247871(_0x5d03b2,_0x5255f5,_0x551666,_0x1fa144){return _0xbec0b5(_0x5d03b2-0x1f0,_0x5d03b2,_0x5255f5-0x216,_0x1fa144-0x63);}if(_0x31eb87['thumbnail'])var {file:_0x373a0e}=await Func[_0x20d50a(0x19f,0x1ae,0x17e,0x1a6)](_0x31eb87[_0x20d50a(0x1df,0x1d8,0x1e5,0x1f1)]);return client[_0x247871(0x2af,0x294,0x293,0x2b8)](_0x2d51cd,_0x51f247,_0x17dbf1,{..._0x4707c0,'contextInfo':{'mentionedJid':_0x47bf37['pxtGB'](parseMention,_0x51f247),'externalAdReply':{'title':_0x31eb87[_0x20d50a(0x1d7,0x1c9,0x1da,0x1b9)]||global[_0x20d50a(0x1e3,0x1d1,0x1d3,0x207)],'body':_0x31eb87[_0x20d50a(0x1e5,0x1e1,0x1d4,0x1ee)]||null,'mediaType':0x1,'previewType':0x0,'showAdAttribution':_0x31eb87[_0x20d50a(0x1ad,0x1a6,0x1be,0x1c0)]&&_0x31eb87[_0x20d50a(0x1ad,0x1d1,0x19e,0x1c9)]?!![]:![],'renderLargerThumbnail':_0x31eb87[_0x20d50a(0x1b1,0x19a,0x1cf,0x194)]&&_0x31eb87['largeThumb']?!![]:![],'thumbnail':_0x31eb87[_0x20d50a(0x1df,0x1c7,0x1c9,0x1f8)]?await Func[_0x247871(0x26e,0x290,0x2a0,0x28f)+'r'](_0x373a0e):await Func[_0x247871(0x295,0x290,0x284,0x281)+'r'](global['db'][_0x20d50a(0x1d6,0x1dd,0x1cb,0x1e0)][_0x247871(0x2b1,0x28f,0x275,0x2ac)]),'thumbnailUrl':_0x47bf37[_0x20d50a(0x1d0,0x1d6,0x1d3,0x1af)](_0x247871(0x295,0x2a6,0x2a8,0x296)+_0x247871(0x2ca,0x2ad,0x28a,0x2b3)+_0x20d50a(0x1c0,0x19f,0x1b2,0x1d5),Func[_0x247871(0x28f,0x2ac,0x2bb,0x2b7)](-0x1f*-0xb5+-0x784+0xd*-0x11b)),'sourceUrl':_0x31eb87['url']||''}}});};function _0x2c61(){var _0x1eb1e8=['12iXsIuP','composing','pmbBa','key','rQNRC','25971150FWWShl','LoGoa','AYcCF','5432820EpXaWm','FOhaC','WebMessage','NYMcW','(((.+)+)+)','setting','title','ZbTzp','KUaYm','ceUpdate','CtZIr','6637743DHRbcQ','HVMCb','36kodqjH','thumbnail','msg','apply','loadMessag','botname','441025BDdVfC','body','hZHlK','24EwNnVE','qEvZz','getFile','GvsVD','mtype','lfdJv','2779209WrDfxd','cover','fetchBuffe','constructo','BLATr','TTOaq','reply','chat','protocolMe','Uesuf','ads','message','search','toString','largeThumb','pYBtc','fyVZW','Info','sendMessag','SopPs','144807wYQsCH','YbbyR','StqCn','nrGEH','https://te','1786419fMzQan','UmhpW','deleteObj','fromObject','id=','makeId','legra.ph/?','wFZBY','ZwuOa','pdxAB','cVNMj','eModify','ssage'];_0x2c61=function(){return _0x1eb1e8;};return _0x2c61();}
client.groupAdmin = async (jid) => {
let participant = await (await client.groupMetadata(jid)).participants
From 156b896abe752be43c5e8cbfe97b5eb998c3e65a Mon Sep 17 00:00:00 2001
From: neoxr
Date: Wed, 26 Oct 2022 08:34:35 +0700
Subject: [PATCH 16/60] + set image cover
---
plugins/menu.js | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/plugins/menu.js b/plugins/menu.js
index 4965e9ebe..d794ef4ab 100644
--- a/plugins/menu.js
+++ b/plugins/menu.js
@@ -100,8 +100,7 @@ exports.run = {
}
client.sendMessageModify(m.chat, print + '\n\n' + global.footer, m, {
ads: false,
- largeThumb: true,
- thumbnail: await Func.fetchBuffer('https://telegra.ph/file/d826ed4128ba873017479.jpg')
+ largeThumb: true
})
}
} catch (e) {
From c8c347f3e06d70776cfe92d267d78b188578c328 Mon Sep 17 00:00:00 2001
From: neoxr
Date: Wed, 26 Oct 2022 10:38:00 +0700
Subject: [PATCH 17/60] update and add some features
---
handler.js | 10 ++++++++--
package.json | 2 +-
plugins/converter/emojimix.js | 4 ++--
plugins/owner/premium.js | 2 ++
plugins/special/groups.js | 2 +-
plugins/special/hitstat.js | 3 +--
plugins/special/list.js | 24 ++++++-----------------
plugins/userinfo/me.js | 3 ++-
plugins/utilities/chord.js | 23 ++++++++++++++++++++++
plugins/utilities/igstalk.js | 37 +++++++++++++++++++++++++++++++++++
plugins/utilities/lyric.js | 24 +++++++++++++++++++++++
system/database.js | 2 ++
system/neoxrApi.js | 10 ++++++++++
13 files changed, 119 insertions(+), 27 deletions(-)
create mode 100644 plugins/utilities/chord.js
create mode 100644 plugins/utilities/igstalk.js
create mode 100644 plugins/utilities/lyric.js
diff --git a/handler.js b/handler.js
index 724f24408..96e69f75f 100644
--- a/handler.js
+++ b/handler.js
@@ -44,6 +44,12 @@ module.exports = async (client, m) => {
await Func.delay(2000).then(() => client.groupLeave(m.chat))
})
}
+ if (users && (new Date * 1) >= users.expired && users.expired != 0) {
+ return client.reply(m.chat, Func.texted('italic', '🚩 Your premium package has expired, thank you for buying and using our service.')).then(async () => {
+ users.premium = false
+ users.expired = 0
+ })
+ }
if (users) users.lastseen = new Date() * 1
if (chats) {
chats.lastseen = new Date() * 1
@@ -131,7 +137,7 @@ module.exports = async (client, m) => {
if (setting.self && !isOwner && !m.fromMe) return
if (setting.pluginDisable.includes(name)) return client.reply(m.chat, Func.texted('bold', `🚩 Plugin disabled by Owner.`), m)
if (!m.isGroup && !['owner', 'create_bot'].includes(name) && chats && !isPrem && !users.banned && new Date() * 1 - chats.lastchat < global.timer) continue
- if (!m.isGroup && !['owner', 'create_bot'].includes(name) && chats && !isPrem && !users.banned && setting.groupmode) return client.sendMessageModify(m.chat, `🚩 Using bot in private chat only for premium user, upgrade to premium plan only Rp. 5,000,- to get 1K limits.\n\nIf you want to buy contact *${prefixes[0]}owner*`, m, {
+ if (!m.isGroup && !['owner', 'create_bot'].includes(name) && chats && !isPrem && !users.banned && setting.groupmode) return client.sendMessageModify(m.chat, `🚩 Using bot in private chat only for premium user, upgrade to premium plan only Rp. 5,000,- to get 1K limits for 1 month.\n\nIf you want to buy contact *${prefixes[0]}owner*`, m, {
largeThumb: true,
thumbnail: await Func.fetchBuffer('https://telegra.ph/file/0b32e0a0bb3b81fef9838.jpg'),
url: 'https://chat.whatsapp.com/Dh1USlrqIfmJT6Ji0Pm2pP'
@@ -209,7 +215,7 @@ module.exports = async (client, m) => {
if (m.isGroup && !['exec'].includes(name) && groupSet.mute) continue
if (setting.pluginDisable.includes(name)) continue
if (!m.isGroup && chats && !isPrem && !users.banned && new Date() * 1 - chats.lastchat < global.timer) continue
- if (!m.isGroup && chats && !isPrem && !users.banned && setting.groupmode) return client.sendMessageModify(m.chat, `🚩 Using bot in private chat only for premium user, upgrade to premium plan only Rp. 5,000,- to get 1K limits.\n\nIf you want to buy contact *${prefixes[0]}owner*`, m, {
+ if (!m.isGroup && chats && !isPrem && !users.banned && !['chatAI'].includes(name) && setting.groupmode) return client.sendMessageModify(m.chat, `🚩 Using bot in private chat only for premium user, upgrade to premium plan only Rp. 5,000,- to get 1K limits for 1 month.\n\nIf you want to buy contact *${prefixes[0]}owner*`, m, {
largeThumb: true,
thumbnail: await Func.fetchBuffer('https://telegra.ph/file/0b32e0a0bb3b81fef9838.jpg'),
url: 'https://chat.whatsapp.com/Dh1USlrqIfmJT6Ji0Pm2pP'
diff --git a/package.json b/package.json
index 43719727b..15e8b4964 100644
--- a/package.json
+++ b/package.json
@@ -34,7 +34,6 @@
"crypto": "1.0.1",
"dotenv": "^16.0.1",
"express": "~4.16.4",
- "got":"^11.8.1",
"fs":"0.0.1-security",
"file-type":"~16.5.2",
"fluent-ffmpeg": "^2.1.2",
@@ -42,6 +41,7 @@
"html-entities":"~2.3.2",
"jimp":"^0.16.1",
"jsdom":"16.6.0",
+ "lyrics-parse": "^1.1.1",
"mime-types":"~2.1.32",
"mongoose": "5.10.8",
"moment-timezone":"~0.5.34",
diff --git a/plugins/converter/emojimix.js b/plugins/converter/emojimix.js
index 2f5a7d83a..5588c1734 100644
--- a/plugins/converter/emojimix.js
+++ b/plugins/converter/emojimix.js
@@ -13,9 +13,9 @@ exports.run = {
let exif = global.db.setting
if (!text) return client.reply(m.chat, Func.example(isPrefix, command, '😳+😩'), m)
let [emo1, emo2] = text.split`+`
- if (!emo1 || !emo2) return client.reply(m.chat, Func.texted('bold', `🚩 Berikan 2 emoticon untuk di mix.`), m)
+ if (!emo1 || !emo2) return client.reply(m.chat, Func.texted('bold', `🚩 Give 2 emoticons to mix.`), m)
let json = await Api.emojimix(emo1 + '_' + emo2)
- if (!json.status) return client.reply(m.chat, Func.texted('bold', `🚩 Emoticon tidak bisa di mix.`), m)
+ if (!json.status) return client.reply(m.chat, Func.texted('bold', `🚩 Emoticons can't be mixed.`), m)
await client.sendSticker(m.chat, await Func.fetchBuffer(json.data.url), m, {
packname: exif.sk_pack,
author: exif.sk_author,
diff --git a/plugins/owner/premium.js b/plugins/owner/premium.js
index 92395ec97..300f5848b 100644
--- a/plugins/owner/premium.js
+++ b/plugins/owner/premium.js
@@ -24,10 +24,12 @@ exports.run = {
if (command == '+prem') {
data.limit += 1000
data.premium = true
+ data.expired = (new Date() * 1) + 30
client.reply(m.chat, Func.texted('bold', `🚩 Successfully added @${user.replace(/@.+/, '')} to premium user.`), m)
} else if (command == '-prem') {
data.limit = global.limit
data.premium = false
+ data.expired = 0
client.reply(m.chat, Func.texted('bold', `🚩 @${user.replace(/@.+/, '')}'s premium status has been successfully deleted.`), m)
}
}
diff --git a/plugins/special/groups.js b/plugins/special/groups.js
index 62206dd8b..62d54f30c 100644
--- a/plugins/special/groups.js
+++ b/plugins/special/groups.js
@@ -16,7 +16,7 @@ exports.run = {
rows.push({
title: groups[i].subject,
rowId: `${isPrefix}gc ${groups[i].id}`,
- description: `[ ${groups[i].participants.length} | ${(v.mute ? 'OFF' : 'ON')} | ${moment(v.activity).format('DD/MM/YY HH:mm:ss')} ]`
+ description: `[ ${v.stay ? 'FOREVER' : (v.expired == 0 ? 'NOT SET' : Func.timeReverse(v.expired - new Date() * 1))} | ${(v.mute ? 'OFF' : 'ON')} | ${moment(v.activity).format('DD/MM/YY HH:mm:ss')} ]`
})
} else global.db.groups[groups[i].id] = {
activity: 0,
diff --git a/plugins/special/hitstat.js b/plugins/special/hitstat.js
index ce99c3621..27482dadd 100644
--- a/plugins/special/hitstat.js
+++ b/plugins/special/hitstat.js
@@ -26,8 +26,7 @@ exports.run = {
teks += `\n\n${global.footer}`
client.sendMessageModify(m.chat, teks, m, {
ads: false,
- largeThumb: true,
- thumbnail: await Func.fetchBuffer('https://telegra.ph/file/d826ed4128ba873017479.jpg')
+ largeThumb: true
})
},
error: false,
diff --git a/plugins/special/list.js b/plugins/special/list.js
index f4d69ec50..d6d3a3a3f 100644
--- a/plugins/special/list.js
+++ b/plugins/special/list.js
@@ -45,10 +45,8 @@ exports.run = {
teks += data.map(([jid, _]) => ' ◦ @' + jid.replace(/@.+/, '')).join('\n') + '\n\n'
teks += global.footer
client.sendMessageModify(m.chat, teks, m, {
- title: '© neoxr-bot v2.2.0 (Public Bot)',
ads: false,
- largeThumb: true,
- thumbnail: await Func.fetchBuffer('https://telegra.ph/file/d826ed4128ba873017479.jpg')
+ largeThumb: true
})
} else if (args[0] == 2) {
const data = global.db.setting.error
@@ -57,10 +55,8 @@ exports.run = {
teks += data.map(cmd => ' ◦ ' + isPrefix + cmd).join('\n') + '\n\n'
teks += global.footer
client.sendMessageModify(m.chat, teks, m, {
- title: '© neoxr-bot v2.2.0 (Public Bot)',
ads: false,
- largeThumb: true,
- thumbnail: await Func.fetchBuffer('https://telegra.ph/file/d826ed4128ba873017479.jpg')
+ largeThumb: true
})
} else if (args[0] == 3) {
const data = global.db.setting.mimic
@@ -69,10 +65,8 @@ exports.run = {
teks += data.map(jid => ' ◦ @' + jid.replace(/@.+/, '')).join('\n') + '\n\n'
teks += global.footer
client.sendMessageModify(m.chat, teks, m, {
- title: '© neoxr-bot v2.2.0 (Public Bot)',
ads: false,
- largeThumb: true,
- thumbnail: await Func.fetchBuffer('https://telegra.ph/file/d826ed4128ba873017479.jpg')
+ largeThumb: true
})
} else if (args[0] == 4) {
const data = global.db.setting.pluginDisable
@@ -81,10 +75,8 @@ exports.run = {
teks += data.map(plugin => ' ◦ ' + plugin + '.js').join('\n') + '\n\n'
teks += global.footer
client.sendMessageModify(m.chat, teks, m, {
- title: '© neoxr-bot v2.2.0 (Public Bot)',
ads: false,
- largeThumb: true,
- thumbnail: await Func.fetchBuffer('https://telegra.ph/file/d826ed4128ba873017479.jpg')
+ largeThumb: true
})
} else if (args[0] == 5) {
const data = Object.entries(global.db.users).filter(([_, data]) => data.premium)
@@ -93,10 +85,8 @@ exports.run = {
teks += data.map(([jid, data]) => ' ◦ @' + jid.replace(/@.+/, '') + '\n *Limit* : ' + Func.formatNumber(data.limit)).join('\n') + '\n\n'
teks += global.footer
client.sendMessageModify(m.chat, teks, m, {
- title: '© neoxr-bot v2.2.0 (Public Bot)',
ads: false,
- largeThumb: true,
- thumbnail: await Func.fetchBuffer('https://telegra.ph/file/d826ed4128ba873017479.jpg')
+ largeThumb: true
})
} else if (args[0] == 6) {
if (!isOwner) return client.reply(m.chat, global.status.owner, m)
@@ -106,10 +96,8 @@ exports.run = {
teks += data.sort((a, b) => b[1].lastseen - a[1].lastseen).map(([jid, data]) => ' ◦ @' + jid.replace(/@.+/, '') + '\n *Chat* : ' + Func.formatNumber(data.chat) + '\n *Lastchat* : ' + moment(data.lastseen).format('DD/MM/YY HH:mm:ss')).join('\n') + '\n\n'
teks += global.footer
client.sendMessageModify(m.chat, teks, m, {
- title: '© neoxr-bot v2.2.0 (Public Bot)',
ads: false,
- largeThumb: true,
- thumbnail: await Func.fetchBuffer('https://telegra.ph/file/d826ed4128ba873017479.jpg')
+ largeThumb: true
})
}
} catch (e) {
diff --git a/plugins/userinfo/me.js b/plugins/userinfo/me.js
index 72e56dd49..9d534639f 100644
--- a/plugins/userinfo/me.js
+++ b/plugins/userinfo/me.js
@@ -25,7 +25,8 @@ exports.run = {
caption += ` ◦ *Blocked* : ${(blocked ? '√' : '×')}\n`
caption += ` ◦ *Banned* : ${(new Date - user.banTemp < global.timer) ? Func.toTime(new Date(user.banTemp + global.timer) - new Date()) + ' (' + ((global.timer / 1000) / 60) + ' min)' : user.banned ? '√' : '×'}\n`
caption += ` ◦ *Use In Private* : ${(Object.keys(global.db.chats).includes(m.sender) ? '√' : '×')}\n`
- caption += ` ◦ *Premium* : ${(user.premium ? '√' : '×')}\n\n`
+ caption += ` ◦ *Premium* : ${(user.premium ? '√' : '×')}\n`
+ caption += ` ◦ *Expired* : ${user.expired == 0 ? '-' : Func.timeReverse(user.expired - new Date() * 1)}\n\n`
caption += global.footer
client.sendMessageModify(m.chat, caption, m, {
largeThumb: true,
diff --git a/plugins/utilities/chord.js b/plugins/utilities/chord.js
new file mode 100644
index 000000000..e52cce61e
--- /dev/null
+++ b/plugins/utilities/chord.js
@@ -0,0 +1,23 @@
+exports.run = {
+ usage: ['chord'],
+ use: 'query',
+ category: 'utilities',
+ async: async (m, {
+ client,
+ text,
+ isPrefix,
+ command
+ }) => {
+ try {
+ if (!text) return client.reply(m.chat, Func.example(isPrefix, command, 'sasimo'), m)
+ client.sendReact(m.chat, '🕒', m.key)
+ let json = await Api.chord(text)
+ if (!json.status) return client.reply(m.chat, global.status.fail, m)
+ client.reply(m.chat, json.data.chord, m)
+ } catch {
+ client.reply(m.chat, global.status.error, m)
+ }
+ },
+ error: false,
+ restrict: true
+}
\ No newline at end of file
diff --git a/plugins/utilities/igstalk.js b/plugins/utilities/igstalk.js
new file mode 100644
index 000000000..a893579d8
--- /dev/null
+++ b/plugins/utilities/igstalk.js
@@ -0,0 +1,37 @@
+exports.run = {
+ usage: ['igstalk'],
+ use: 'username',
+ category: 'utilities',
+ async: async (m, {
+ client,
+ args,
+ isPrefix,
+ command
+ }) => {
+ try {
+ if (!args || !args[0]) return client.reply(m.chat, Func.example(isPrefix, command, 'hosico_cat'), m)
+ client.sendReact(m.chat, '🕒', m.key)
+ let json = await Api.igstalk(args[0])
+ if (!json.status) return client.reply(m.chat, Func.texted('bold', `🚩 Account not found.`), m)
+ let caption = `乂 *I G - S T A L K*\n\n`
+ caption += ` ◦ *Name* : ${json.data.full_name}\n`
+ caption += ` ◦ *Username* : ${json.data.username}\n`
+ caption += ` ◦ *Posts* : ${json.data.edge_owner_to_timeline_media.count}\n`
+ caption += ` ◦ *Followers* : ${json.data.edge_followed_by.count}\n`
+ caption += ` ◦ *Followings* : ${json.data.edge_follow.count}\n`
+ caption += ` ◦ *Bio* : ${json.data.biography}\n`
+ caption += ` ◦ *Private* : ${Func.switcher(json.data.is_private, '√', '×')}\n\n`
+ caption += global.footer
+ client.sendMessageModify(m.chat, caption, m, {
+ ads: false,
+ largeThumb: true,
+ thumbnail: await Func.fetchBuffer(json.data.profile_pic_url)
+ })
+ } catch {
+ return client.reply(m.chat, global.status.error, m)
+ }
+ },
+ error: false,
+ cache: true,
+ location: __filename
+}
\ No newline at end of file
diff --git a/plugins/utilities/lyric.js b/plugins/utilities/lyric.js
new file mode 100644
index 000000000..01b7759e6
--- /dev/null
+++ b/plugins/utilities/lyric.js
@@ -0,0 +1,24 @@
+let lyricsParse = require('lyrics-parse')
+const { decode } = require('html-entities')
+exports.run = {
+ usage: ['lirik'],
+ use: 'query',
+ category: 'utilities',
+ async: async (m, {
+ client,
+ text,
+ isPrefix,
+ command
+ }) => {
+ try {
+ if (!text) return client.reply(m.chat, Func.example(isPrefix, command, 'lathi'), m)
+ client.sendReact(m.chat, '🕒', m.key)
+ let lyrics = await lyricsParse(text, '')
+ lyrics ? client.reply(m.chat, unescape(decode(lyrics)), m) : client.reply(m.chat, global.status.fail, m)
+ } catch {
+ client.reply(m.chat, global.status.error, m)
+ }
+ },
+ error: false,
+ restrict: true
+}
\ No newline at end of file
diff --git a/system/database.js b/system/database.js
index 07aa80dc2..750504c13 100644
--- a/system/database.js
+++ b/system/database.js
@@ -9,6 +9,7 @@ module.exports = (m) => {
if (!isNumber(user.banTimes)) user.banTimes = 0
if (!isNumber(user.limit)) user.limit = global.limit
if (!('premium' in user)) user.premium = false
+ if (!isNumber(user.expired)) user.expired = 0
if (!isNumber(user.lastseen)) user.lastseen = 0
if (!isNumber(user.hit)) user.hit = 0
if (!isNumber(user.spam)) user.spam = 0
@@ -22,6 +23,7 @@ module.exports = (m) => {
banTimes: 0,
limit: global.limit,
premium: false,
+ expired: 0,
lastseen: 0,
hit: 0,
spam: 0,
diff --git a/system/neoxrApi.js b/system/neoxrApi.js
index 4e2a6a704..644ccab0b 100644
--- a/system/neoxrApi.js
+++ b/system/neoxrApi.js
@@ -123,4 +123,14 @@ module.exports = class NeoxrApi {
let json = await Func.fetchJson(this.baseUrl + '/kbbg?q=' + query + '&apikey=' + this.apiKey)
return json
}
+
+ chord = async (query) => {
+ let json = await Func.fetchJson(this.baseUrl + '/chord?q=' + query + '&apikey=' + this.apiKey)
+ return json
+ }
+
+ igstalk = async (query) => {
+ let json = await Func.fetchJson(this.baseUrl + '/igstalk?username=' + username + '&apikey=' + this.apiKey)
+ return json
+ }
}
\ No newline at end of file
From 673272c447f91613acfd4ff8d2e7fe7777cab79d Mon Sep 17 00:00:00 2001
From: neoxr
Date: Wed, 26 Oct 2022 10:45:19 +0700
Subject: [PATCH 18/60] update and add some features
---
plugins/utilities/lyric.js | 2 +-
system/neoxrApi.js | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/plugins/utilities/lyric.js b/plugins/utilities/lyric.js
index 01b7759e6..5719d90f8 100644
--- a/plugins/utilities/lyric.js
+++ b/plugins/utilities/lyric.js
@@ -3,7 +3,7 @@ const { decode } = require('html-entities')
exports.run = {
usage: ['lirik'],
use: 'query',
- category: 'utilities',
+ // category: 'utilities',
async: async (m, {
client,
text,
diff --git a/system/neoxrApi.js b/system/neoxrApi.js
index 644ccab0b..7bd094f4c 100644
--- a/system/neoxrApi.js
+++ b/system/neoxrApi.js
@@ -129,7 +129,7 @@ module.exports = class NeoxrApi {
return json
}
- igstalk = async (query) => {
+ igstalk = async (username) => {
let json = await Func.fetchJson(this.baseUrl + '/igstalk?username=' + username + '&apikey=' + this.apiKey)
return json
}
From 039ce5336086c016dbb23c21b82cfd01804e9bbb Mon Sep 17 00:00:00 2001
From: neoxr
Date: Wed, 26 Oct 2022 10:58:51 +0700
Subject: [PATCH 19/60] update and add some features
---
plugins/owner/premium.js | 2 +-
plugins/owner/setcover.js | 1 +
plugins/userinfo/profile.js | 54 ++++++++++++++++++++++++++++++++++++
plugins/utilities/igstalk.js | 6 ++--
4 files changed, 59 insertions(+), 4 deletions(-)
create mode 100644 plugins/userinfo/profile.js
diff --git a/plugins/owner/premium.js b/plugins/owner/premium.js
index 300f5848b..7f276cfbb 100644
--- a/plugins/owner/premium.js
+++ b/plugins/owner/premium.js
@@ -24,7 +24,7 @@ exports.run = {
if (command == '+prem') {
data.limit += 1000
data.premium = true
- data.expired = (new Date() * 1) + 30
+ data.expired = (new Date() * 1) + (86400000 * 30)
client.reply(m.chat, Func.texted('bold', `🚩 Successfully added @${user.replace(/@.+/, '')} to premium user.`), m)
} else if (command == '-prem') {
data.limit = global.limit
diff --git a/plugins/owner/setcover.js b/plugins/owner/setcover.js
index 29a35120b..6fc181e74 100644
--- a/plugins/owner/setcover.js
+++ b/plugins/owner/setcover.js
@@ -2,6 +2,7 @@ exports.run = {
usage: ['setcover'],
hidden: ['cover'],
use: 'reply foto',
+ category: 'owner',
async: async (m, {
client
}) => {
diff --git a/plugins/userinfo/profile.js b/plugins/userinfo/profile.js
new file mode 100644
index 000000000..6e9136833
--- /dev/null
+++ b/plugins/userinfo/profile.js
@@ -0,0 +1,54 @@
+exports.run = {
+ usage: ['profile'],
+ use: 'mention or reply',
+ category: 'user info',
+ async: async (m, {
+ client,
+ isPrefix,
+ blockList
+ }) => {
+ let number = isNaN(text) ? (text.startsWith('+') ? text.replace(/[()+\s-]/g, '') : (text).split`@` [1]) : text
+ if (!text && !m.quoted) return client.reply(m.chat, Func.texted('bold', `🚩 Mention or Reply chat target.`), m)
+ if (isNaN(number)) return client.reply(m.chat, Func.texted('bold', `🚩 Invalid number.`), m)
+ if (number.length > 15) return client.reply(m.chat, Func.texted('bold', `🚩 Invalid format.`), m)
+ try {
+ if (text) {
+ var user = number + '@s.whatsapp.net'
+ } else if (m.quoted.sender) {
+ var user = m.quoted.sender
+ } else if (m.mentionedJid) {
+ var user = number + '@s.whatsapp.net'
+ }
+ } catch (e) {} finally {
+ let target = global.db.users[m.sender]
+ let pic = await Func.fetchBuffer('./media/image/default.jpg')
+ let _own = [...new Set([global.owner, ...global.db.setting.owners])]
+ try {
+ pic = await Func.fetchBuffer(await client.profilePictureUrl(user, 'image'))
+ } catch {} finally {
+ let blocked = blockList.includes(user) ? true : false
+ let now = new Date() * 1
+ let lastseen = (target.lastseen == 0) ? 'Never' : Func.toDate(now - target.lastseen)
+ let usebot = (target.usebot == 0) ? 'Never' : Func.toDate(now - target.usebot)
+ let caption = `乂 *U S E R - P R O F I L E*\n\n`
+ caption += ` ◦ *Name* : ${m.pushName}\n`
+ caption += ` ◦ *Limit* : ${Func.formatNumber(target.limit)}\n`
+ caption += ` ◦ *Hitstat* : ${Func.formatNumber(target.hit)}\n`
+ caption += ` ◦ *Warning* : ${((m.isGroup) ? (typeof global.db.groups[m.chat].member[user] != 'undefined' ? global.db.groups[m.chat].member[user].warning : 0) + ' / 5' : target.warning + ' / 5')}\n\n`
+ caption += `乂 *U S E R - S T A T U S*\n\n`
+ caption += ` ◦ *Blocked* : ${(blocked ? '√' : '×')}\n`
+ caption += ` ◦ *Banned* : ${(new Date - target.banTemp < global.timer) ? Func.toTime(new Date(target.banTemp + global.timer) - new Date()) + ' (' + ((global.timer / 1000) / 60) + ' min)' : target.banned ? '√' : '×'}\n`
+ caption += ` ◦ *Use In Private* : ${(Object.keys(global.db.chats).includes(user) ? '√' : '×')}\n`
+ caption += ` ◦ *Premium* : ${(target.premium ? '√' : '×')}\n`
+ caption += ` ◦ *Expired* : ${target.expired == 0 ? '-' : Func.timeReverse(target.expired - new Date() * 1)}\n\n`
+ caption += global.footer
+ client.sendMessageModify(m.chat, caption, m, {
+ largeThumb: true,
+ thumbnail: pic
+ })
+ }
+ },
+ error: false,
+ cache: true,
+ location: __filename
+}
\ No newline at end of file
diff --git a/plugins/utilities/igstalk.js b/plugins/utilities/igstalk.js
index a893579d8..d5f73b62d 100644
--- a/plugins/utilities/igstalk.js
+++ b/plugins/utilities/igstalk.js
@@ -16,9 +16,9 @@ exports.run = {
let caption = `乂 *I G - S T A L K*\n\n`
caption += ` ◦ *Name* : ${json.data.full_name}\n`
caption += ` ◦ *Username* : ${json.data.username}\n`
- caption += ` ◦ *Posts* : ${json.data.edge_owner_to_timeline_media.count}\n`
- caption += ` ◦ *Followers* : ${json.data.edge_followed_by.count}\n`
- caption += ` ◦ *Followings* : ${json.data.edge_follow.count}\n`
+ caption += ` ◦ *Posts* : ${Func.formatNumber(json.data.edge_owner_to_timeline_media.count)}\n`
+ caption += ` ◦ *Followers* : ${Func.formatNumber(json.data.edge_followed_by.count)}\n`
+ caption += ` ◦ *Followings* : ${Func.formatNumber(json.data.edge_follow.count)}\n`
caption += ` ◦ *Bio* : ${json.data.biography}\n`
caption += ` ◦ *Private* : ${Func.switcher(json.data.is_private, '√', '×')}\n\n`
caption += global.footer
From f6d10c4e22672da76264a8884d77b1be8cdf3892 Mon Sep 17 00:00:00 2001
From: neoxr
Date: Wed, 26 Oct 2022 11:04:24 +0700
Subject: [PATCH 20/60] update and add some features
---
plugins/userinfo/profile.js | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
diff --git a/plugins/userinfo/profile.js b/plugins/userinfo/profile.js
index 6e9136833..1021fb473 100644
--- a/plugins/userinfo/profile.js
+++ b/plugins/userinfo/profile.js
@@ -7,10 +7,11 @@ exports.run = {
isPrefix,
blockList
}) => {
- let number = isNaN(text) ? (text.startsWith('+') ? text.replace(/[()+\s-]/g, '') : (text).split`@` [1]) : text
+ let number = isNaN(text) ? (text.startsWith('+') ? text.replace(/[()+\s-]/g, '') : (text).split`@` [1]) : text
if (!text && !m.quoted) return client.reply(m.chat, Func.texted('bold', `🚩 Mention or Reply chat target.`), m)
if (isNaN(number)) return client.reply(m.chat, Func.texted('bold', `🚩 Invalid number.`), m)
if (number.length > 15) return client.reply(m.chat, Func.texted('bold', `🚩 Invalid format.`), m)
+ let pic = await Func.fetchBuffer('./media/image/default.jpg')
try {
if (text) {
var user = number + '@s.whatsapp.net'
@@ -20,12 +21,9 @@ exports.run = {
var user = number + '@s.whatsapp.net'
}
} catch (e) {} finally {
- let target = global.db.users[m.sender]
- let pic = await Func.fetchBuffer('./media/image/default.jpg')
- let _own = [...new Set([global.owner, ...global.db.setting.owners])]
- try {
+ let target = global.db.users[m.sender]
+ let _own = [...new Set([global.owner, ...global.db.setting.owners])]
pic = await Func.fetchBuffer(await client.profilePictureUrl(user, 'image'))
- } catch {} finally {
let blocked = blockList.includes(user) ? true : false
let now = new Date() * 1
let lastseen = (target.lastseen == 0) ? 'Never' : Func.toDate(now - target.lastseen)
@@ -43,8 +41,8 @@ exports.run = {
caption += ` ◦ *Expired* : ${target.expired == 0 ? '-' : Func.timeReverse(target.expired - new Date() * 1)}\n\n`
caption += global.footer
client.sendMessageModify(m.chat, caption, m, {
- largeThumb: true,
- thumbnail: pic
+ largeThumb: true,
+ thumbnail: pic
})
}
},
From ba414d94c59a6682e2be8933731332ec32ac8686 Mon Sep 17 00:00:00 2001
From: neoxr
Date: Wed, 26 Oct 2022 11:06:33 +0700
Subject: [PATCH 21/60] update and add some features
---
plugins/userinfo/profile.js | 1 +
1 file changed, 1 insertion(+)
diff --git a/plugins/userinfo/profile.js b/plugins/userinfo/profile.js
index 1021fb473..19f234da9 100644
--- a/plugins/userinfo/profile.js
+++ b/plugins/userinfo/profile.js
@@ -4,6 +4,7 @@ exports.run = {
category: 'user info',
async: async (m, {
client,
+ text,
isPrefix,
blockList
}) => {
From 9ea2bec62c54b29d183e31a83b4b27dec91d7f06 Mon Sep 17 00:00:00 2001
From: neoxr
Date: Wed, 26 Oct 2022 11:11:37 +0700
Subject: [PATCH 22/60] update and add some features
---
plugins/userinfo/profile.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/plugins/userinfo/profile.js b/plugins/userinfo/profile.js
index 19f234da9..fa0990e83 100644
--- a/plugins/userinfo/profile.js
+++ b/plugins/userinfo/profile.js
@@ -22,7 +22,7 @@ exports.run = {
var user = number + '@s.whatsapp.net'
}
} catch (e) {} finally {
- let target = global.db.users[m.sender]
+ let target = global.db.users[user]
let _own = [...new Set([global.owner, ...global.db.setting.owners])]
pic = await Func.fetchBuffer(await client.profilePictureUrl(user, 'image'))
let blocked = blockList.includes(user) ? true : false
From e9d87bb899ee37e1718535a9d538d7d30d498e1d Mon Sep 17 00:00:00 2001
From: neoxr
Date: Wed, 26 Oct 2022 11:16:22 +0700
Subject: [PATCH 23/60] update and add some features
---
plugins/userinfo/profile.js | 1 +
1 file changed, 1 insertion(+)
diff --git a/plugins/userinfo/profile.js b/plugins/userinfo/profile.js
index fa0990e83..61949cc16 100644
--- a/plugins/userinfo/profile.js
+++ b/plugins/userinfo/profile.js
@@ -23,6 +23,7 @@ exports.run = {
}
} catch (e) {} finally {
let target = global.db.users[user]
+ if (typeof target == 'undefined') return client.reply(m.chat, Func.texted('bold', `🚩 Can't find user data.`), m)
let _own = [...new Set([global.owner, ...global.db.setting.owners])]
pic = await Func.fetchBuffer(await client.profilePictureUrl(user, 'image'))
let blocked = blockList.includes(user) ? true : false
From 7105216bf7a594f25526a18e66df31ad0cc87775 Mon Sep 17 00:00:00 2001
From: neoxr
Date: Wed, 26 Oct 2022 15:17:46 +0700
Subject: [PATCH 24/60] fix profile
---
plugins/userinfo/profile.js | 46 +++++++++++++++++++------------------
1 file changed, 24 insertions(+), 22 deletions(-)
diff --git a/plugins/userinfo/profile.js b/plugins/userinfo/profile.js
index 61949cc16..2a3213150 100644
--- a/plugins/userinfo/profile.js
+++ b/plugins/userinfo/profile.js
@@ -24,28 +24,30 @@ exports.run = {
} catch (e) {} finally {
let target = global.db.users[user]
if (typeof target == 'undefined') return client.reply(m.chat, Func.texted('bold', `🚩 Can't find user data.`), m)
- let _own = [...new Set([global.owner, ...global.db.setting.owners])]
- pic = await Func.fetchBuffer(await client.profilePictureUrl(user, 'image'))
- let blocked = blockList.includes(user) ? true : false
- let now = new Date() * 1
- let lastseen = (target.lastseen == 0) ? 'Never' : Func.toDate(now - target.lastseen)
- let usebot = (target.usebot == 0) ? 'Never' : Func.toDate(now - target.usebot)
- let caption = `乂 *U S E R - P R O F I L E*\n\n`
- caption += ` ◦ *Name* : ${m.pushName}\n`
- caption += ` ◦ *Limit* : ${Func.formatNumber(target.limit)}\n`
- caption += ` ◦ *Hitstat* : ${Func.formatNumber(target.hit)}\n`
- caption += ` ◦ *Warning* : ${((m.isGroup) ? (typeof global.db.groups[m.chat].member[user] != 'undefined' ? global.db.groups[m.chat].member[user].warning : 0) + ' / 5' : target.warning + ' / 5')}\n\n`
- caption += `乂 *U S E R - S T A T U S*\n\n`
- caption += ` ◦ *Blocked* : ${(blocked ? '√' : '×')}\n`
- caption += ` ◦ *Banned* : ${(new Date - target.banTemp < global.timer) ? Func.toTime(new Date(target.banTemp + global.timer) - new Date()) + ' (' + ((global.timer / 1000) / 60) + ' min)' : target.banned ? '√' : '×'}\n`
- caption += ` ◦ *Use In Private* : ${(Object.keys(global.db.chats).includes(user) ? '√' : '×')}\n`
- caption += ` ◦ *Premium* : ${(target.premium ? '√' : '×')}\n`
- caption += ` ◦ *Expired* : ${target.expired == 0 ? '-' : Func.timeReverse(target.expired - new Date() * 1)}\n\n`
- caption += global.footer
- client.sendMessageModify(m.chat, caption, m, {
- largeThumb: true,
- thumbnail: pic
- })
+ try {
+ let pic = await Func.fetchBuffer('./media/image/default.jpg')
+ } catch (e) {} finally {
+ pic = await Func.fetchBuffer(await client.profilePictureUrl(user, 'image'))
+ let blocked = blockList.includes(user) ? true : false
+ let now = new Date() * 1
+ let lastseen = (target.lastseen == 0) ? 'Never' : Func.toDate(now - target.lastseen)
+ let usebot = (target.usebot == 0) ? 'Never' : Func.toDate(now - target.usebot)
+ let caption = `乂 *U S E R - P R O F I L E*\n\n`
+ caption += ` ◦ *Limit* : ${Func.formatNumber(target.limit)}\n`
+ caption += ` ◦ *Hitstat* : ${Func.formatNumber(target.hit)}\n`
+ caption += ` ◦ *Warning* : ${((m.isGroup) ? (typeof global.db.groups[m.chat].member[user] != 'undefined' ? global.db.groups[m.chat].member[user].warning : 0) + ' / 5' : target.warning + ' / 5')}\n\n`
+ caption += `乂 *U S E R - S T A T U S*\n\n`
+ caption += ` ◦ *Blocked* : ${(blocked ? '√' : '×')}\n`
+ caption += ` ◦ *Banned* : ${(new Date - target.banTemp < global.timer) ? Func.toTime(new Date(target.banTemp + global.timer) - new Date()) + ' (' + ((global.timer / 1000) / 60) + ' min)' : target.banned ? '√' : '×'}\n`
+ caption += ` ◦ *Use In Private* : ${(Object.keys(global.db.chats).includes(user) ? '√' : '×')}\n`
+ caption += ` ◦ *Premium* : ${(target.premium ? '√' : '×')}\n`
+ caption += ` ◦ *Expired* : ${target.expired == 0 ? '-' : Func.timeReverse(target.expired - new Date() * 1)}\n\n`
+ caption += global.footer
+ client.sendMessageModify(m.chat, caption, m, {
+ largeThumb: true,
+ thumbnail: pic
+ })
+ }
}
},
error: false,
From 28f1bc627b9fd903dd7d6917c02f8c270ea6ecac Mon Sep 17 00:00:00 2001
From: neoxr
Date: Wed, 26 Oct 2022 15:20:50 +0700
Subject: [PATCH 25/60] fix profile
---
plugins/userinfo/profile.js | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/plugins/userinfo/profile.js b/plugins/userinfo/profile.js
index 2a3213150..e8e5e99f5 100644
--- a/plugins/userinfo/profile.js
+++ b/plugins/userinfo/profile.js
@@ -25,9 +25,8 @@ exports.run = {
let target = global.db.users[user]
if (typeof target == 'undefined') return client.reply(m.chat, Func.texted('bold', `🚩 Can't find user data.`), m)
try {
- let pic = await Func.fetchBuffer('./media/image/default.jpg')
- } catch (e) {} finally {
pic = await Func.fetchBuffer(await client.profilePictureUrl(user, 'image'))
+ } catch (e) {} finally {
let blocked = blockList.includes(user) ? true : false
let now = new Date() * 1
let lastseen = (target.lastseen == 0) ? 'Never' : Func.toDate(now - target.lastseen)
From b61fce73790ca346b7bdde5667e3cedf805fa850 Mon Sep 17 00:00:00 2001
From: neoxr
Date: Wed, 26 Oct 2022 15:39:36 +0700
Subject: [PATCH 26/60] add translate feature
---
handler.js | 4 ++--
plugins/owner/premium.js | 3 +++
plugins/utilities/translate.js | 41 ++++++++++++++++++++++++++++++++++
3 files changed, 46 insertions(+), 2 deletions(-)
create mode 100644 plugins/utilities/translate.js
diff --git a/handler.js b/handler.js
index 96e69f75f..07c607015 100644
--- a/handler.js
+++ b/handler.js
@@ -137,7 +137,7 @@ module.exports = async (client, m) => {
if (setting.self && !isOwner && !m.fromMe) return
if (setting.pluginDisable.includes(name)) return client.reply(m.chat, Func.texted('bold', `🚩 Plugin disabled by Owner.`), m)
if (!m.isGroup && !['owner', 'create_bot'].includes(name) && chats && !isPrem && !users.banned && new Date() * 1 - chats.lastchat < global.timer) continue
- if (!m.isGroup && !['owner', 'create_bot'].includes(name) && chats && !isPrem && !users.banned && setting.groupmode) return client.sendMessageModify(m.chat, `🚩 Using bot in private chat only for premium user, upgrade to premium plan only Rp. 5,000,- to get 1K limits for 1 month.\n\nIf you want to buy contact *${prefixes[0]}owner*`, m, {
+ if (!m.isGroup && !['owner', 'create_bot'].includes(name) && chats && !isPrem && !users.banned && setting.groupmode) return client.sendMessageModify(m.chat, `🚩 Using bot in private chat only for premium user, upgrade to premium plan only Rp. 10,000,- to get 1K limits for 1 month.\n\nIf you want to buy contact *${prefixes[0]}owner*`, m, {
largeThumb: true,
thumbnail: await Func.fetchBuffer('https://telegra.ph/file/0b32e0a0bb3b81fef9838.jpg'),
url: 'https://chat.whatsapp.com/Dh1USlrqIfmJT6Ji0Pm2pP'
@@ -215,7 +215,7 @@ module.exports = async (client, m) => {
if (m.isGroup && !['exec'].includes(name) && groupSet.mute) continue
if (setting.pluginDisable.includes(name)) continue
if (!m.isGroup && chats && !isPrem && !users.banned && new Date() * 1 - chats.lastchat < global.timer) continue
- if (!m.isGroup && chats && !isPrem && !users.banned && !['chatAI'].includes(name) && setting.groupmode) return client.sendMessageModify(m.chat, `🚩 Using bot in private chat only for premium user, upgrade to premium plan only Rp. 5,000,- to get 1K limits for 1 month.\n\nIf you want to buy contact *${prefixes[0]}owner*`, m, {
+ if (!m.isGroup && chats && !isPrem && !users.banned && !['chatAI'].includes(name) && setting.groupmode) return client.sendMessageModify(m.chat, `🚩 Using bot in private chat only for premium user, upgrade to premium plan only Rp. 10,000,- to get 1K limits for 1 month.\n\nIf you want to buy contact *${prefixes[0]}owner*`, m, {
largeThumb: true,
thumbnail: await Func.fetchBuffer('https://telegra.ph/file/0b32e0a0bb3b81fef9838.jpg'),
url: 'https://chat.whatsapp.com/Dh1USlrqIfmJT6Ji0Pm2pP'
diff --git a/plugins/owner/premium.js b/plugins/owner/premium.js
index 7f276cfbb..2c20916a8 100644
--- a/plugins/owner/premium.js
+++ b/plugins/owner/premium.js
@@ -21,12 +21,15 @@ exports.run = {
}
} catch (e) {} finally {
let data = global.db.users[user]
+ if (typeof data == 'undefined') return client.reply(m.chat, Func.texted('bold', `🚩 Can't find user data.`), m)
if (command == '+prem') {
+ if (data.premium) return client.reply(m.chat, Func.texted('bold', `🚩 @${user.replace(/@.+/, '')} has become registered as a premium account.`), m)
data.limit += 1000
data.premium = true
data.expired = (new Date() * 1) + (86400000 * 30)
client.reply(m.chat, Func.texted('bold', `🚩 Successfully added @${user.replace(/@.+/, '')} to premium user.`), m)
} else if (command == '-prem') {
+ if (data.premium) return client.reply(m.chat, Func.texted('bold', `🚩 Not a premium account.`), m)
data.limit = global.limit
data.premium = false
data.expired = 0
diff --git a/plugins/utilities/translate.js b/plugins/utilities/translate.js
new file mode 100644
index 000000000..1aacbbddc
--- /dev/null
+++ b/plugins/utilities/translate.js
@@ -0,0 +1,41 @@
+const translate = require('translate-google-api')
+exports.run = {
+ usage: ['translate'],
+ hidden: ['tr'],
+ use: 'iso text',
+ category: 'utilities',
+ async: async (m, {
+ client,
+ text,
+ isPrefix,
+ command
+ }) => {
+ if (!text) return client.reply(m.chat, Func.example(isPrefix, command, 'id i love you'), m)
+ if (text && m.quoted && m.quoted.text) {
+ let lang = text.slice(0, 2)
+ try {
+ let data = m.quoted.text
+ let result = await translate(`${data}`, {
+ to: lang
+ })
+ client.reply(m.chat, result[0], m)
+ } catch {
+ return client.reply(m.chat, Func.texted('bold', `🚩 Language code not supported.`), m)
+ }
+ } else if (text) {
+ let lang = text.slice(0, 2)
+ try {
+ let data = text.substring(2).trim()
+ let result = await translate(`${data}`, {
+ to: lang
+ })
+ client.reply(m.chat, result[0], m)
+ } catch {
+ return client.reply(m.chat, Func.texted('bold', `🚩 Language code not supported.`), m)
+ }
+ }
+ },
+ error: false,
+ cache: true,
+ location: __filename
+}
\ No newline at end of file
From 651732147e0f4224511f3f8f39939cc75ce7b868 Mon Sep 17 00:00:00 2001
From: neoxr
Date: Wed, 26 Oct 2022 15:45:23 +0700
Subject: [PATCH 27/60] add translate feature
---
package.json | 2 +-
plugins/utilities/lyric.js | 24 ------------------------
2 files changed, 1 insertion(+), 25 deletions(-)
delete mode 100644 plugins/utilities/lyric.js
diff --git a/package.json b/package.json
index 15e8b4964..71b34ab22 100644
--- a/package.json
+++ b/package.json
@@ -41,7 +41,6 @@
"html-entities":"~2.3.2",
"jimp":"^0.16.1",
"jsdom":"16.6.0",
- "lyrics-parse": "^1.1.1",
"mime-types":"~2.1.32",
"mongoose": "5.10.8",
"moment-timezone":"~0.5.34",
@@ -56,6 +55,7 @@
"rootpath": "^0.1.2",
"spinnies":"~0.5.1",
"syntax-error":"~1.4.0",
+ "translate-google-api": "~1.0.4",
"usetube": "^2.1.4",
"util":"~0.12.4",
"wa-sticker-formatter": "3.6.0"
diff --git a/plugins/utilities/lyric.js b/plugins/utilities/lyric.js
deleted file mode 100644
index 5719d90f8..000000000
--- a/plugins/utilities/lyric.js
+++ /dev/null
@@ -1,24 +0,0 @@
-let lyricsParse = require('lyrics-parse')
-const { decode } = require('html-entities')
-exports.run = {
- usage: ['lirik'],
- use: 'query',
- // category: 'utilities',
- async: async (m, {
- client,
- text,
- isPrefix,
- command
- }) => {
- try {
- if (!text) return client.reply(m.chat, Func.example(isPrefix, command, 'lathi'), m)
- client.sendReact(m.chat, '🕒', m.key)
- let lyrics = await lyricsParse(text, '')
- lyrics ? client.reply(m.chat, unescape(decode(lyrics)), m) : client.reply(m.chat, global.status.fail, m)
- } catch {
- client.reply(m.chat, global.status.error, m)
- }
- },
- error: false,
- restrict: true
-}
\ No newline at end of file
From bafed4769dfb29dadf40ea365312eecc98a9f2cc Mon Sep 17 00:00:00 2001
From: neoxr
Date: Wed, 26 Oct 2022 16:39:10 +0700
Subject: [PATCH 28/60] add translate feature
---
plugins/event/system/clearDB.js | 1 -
1 file changed, 1 deletion(-)
diff --git a/plugins/event/system/clearDB.js b/plugins/event/system/clearDB.js
index e5e0a1b66..764a766f4 100644
--- a/plugins/event/system/clearDB.js
+++ b/plugins/event/system/clearDB.js
@@ -14,7 +14,6 @@ exports.run = {
}
for (let jid in global.db.groups) {
if (now - global.db.groups[jid].activity > day && !global.db.groups[jid].stay && global.db.groups[jid].expired == 0) {
- client.groupLeave(jid)
delete global.db.groups[jid]
}
}
From 8a140041308da878ae47f44ecea9cf5adafb7d46 Mon Sep 17 00:00:00 2001
From: neoxr
Date: Wed, 26 Oct 2022 17:44:51 +0700
Subject: [PATCH 29/60] + lyric
---
plugins/utilities/lyric.js | 28 ++++++++++++++++++++++++++++
system/neoxrApi.js | 5 +++++
2 files changed, 33 insertions(+)
create mode 100644 plugins/utilities/lyric.js
diff --git a/plugins/utilities/lyric.js b/plugins/utilities/lyric.js
new file mode 100644
index 000000000..f6f174f86
--- /dev/null
+++ b/plugins/utilities/lyric.js
@@ -0,0 +1,28 @@
+exports.run = {
+ usage: ['lyric'],
+ hidden: ['lirik'],
+ use: 'query',
+ category: 'utilities',
+ async: async (m, {
+ client,
+ text,
+ isPrefix,
+ command
+ }) => {
+ try {
+ if (!text) return client.reply(m.chat, Func.example(isPrefix, command, 'bad liar'), m)
+ client.sendReact(m.chat, '🕒', m.key)
+ let json = await Api.lyric(text)
+ if (!json.status) return client.reply(m.chat, global.status.fail, m)
+ client.sendMessageModify(m.chat, json.data.lyric, m, {
+ title: `🎤 ${json.data.title}`,
+ largeThumb: true,
+ thumbnail: await Func.fetchBuffer(json.data.image)
+ })
+ } catch {
+ client.reply(m.chat, global.status.error, m)
+ }
+ },
+ error: false,
+ restrict: true
+}
\ No newline at end of file
diff --git a/system/neoxrApi.js b/system/neoxrApi.js
index 7bd094f4c..c9272494d 100644
--- a/system/neoxrApi.js
+++ b/system/neoxrApi.js
@@ -129,6 +129,11 @@ module.exports = class NeoxrApi {
return json
}
+ lyric = async (query) => {
+ let json = await Func.fetchJson(this.baseUrl + '/lyric?q=' + query + '&apikey=' + this.apiKey)
+ return json
+ }
+
igstalk = async (username) => {
let json = await Func.fetchJson(this.baseUrl + '/igstalk?username=' + username + '&apikey=' + this.apiKey)
return json
From 0f0122f595dc75c375839a3ba0a11cecd9b8f39c Mon Sep 17 00:00:00 2001
From: neoxr
Date: Thu, 27 Oct 2022 08:58:20 +0700
Subject: [PATCH 30/60] update antilink
---
plugins/event/group/anti_link.js | 5 ++---
plugins/special/checkapi.js | 2 +-
2 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/plugins/event/group/anti_link.js b/plugins/event/group/anti_link.js
index 1f6973232..6f3eb866c 100644
--- a/plugins/event/group/anti_link.js
+++ b/plugins/event/group/anti_link.js
@@ -6,9 +6,8 @@ exports.run = {
isAdmin
}) => {
try {
- if (groupSet.antilink && !isAdmin && body && body.match(/(chat.whatsapp.com)/gi)) {
- if (body.includes(await client.groupInviteCode(m.chat))) return
- client.groupParticipantsUpdate(m.chat, [m.sender], 'remove')
+ if (groupSet.antilink && !isAdmin && body) {
+ if (body.match(/(chat.whatsapp.com)/gi) && !body.includes(await client.groupInviteCode(m.chat)) || Func.isUrl(body) && !Func.socmed(body)) return client.groupParticipantsUpdate(m.chat, [m.sender], 'remove')
}
} catch (e) {
return client.reply(m.chat, Func.jsonFormat(e), m)
diff --git a/plugins/special/checkapi.js b/plugins/special/checkapi.js
index 310f7ce1a..224839e3c 100644
--- a/plugins/special/checkapi.js
+++ b/plugins/special/checkapi.js
@@ -1,6 +1,6 @@
exports.run = {
usage: ['checkapi'],
- hidden: ['api'],
+ hidden: ['api', 'check'],
category: 'special',
async: async (m, {
client
From c8b10352571cc775add38b25dc323c609c0d472d Mon Sep 17 00:00:00 2001
From: neoxr
Date: Thu, 27 Oct 2022 16:30:59 +0700
Subject: [PATCH 31/60] update
---
handler.js | 7 +++++
plugins/group/common.js | 63 +++++++++++++++++++++++++++++++++++++
plugins/special/botinfo.js | 49 +++++++++++++++++++++++++++++
plugins/special/price.js | 2 +-
plugins/utilities/google.js | 47 +++++++++++++++++++++++++++
5 files changed, 167 insertions(+), 1 deletion(-)
create mode 100644 plugins/group/common.js
create mode 100644 plugins/special/botinfo.js
create mode 100644 plugins/utilities/google.js
diff --git a/handler.js b/handler.js
index 07c607015..2b2e822e5 100644
--- a/handler.js
+++ b/handler.js
@@ -152,6 +152,13 @@ module.exports = async (client, m) => {
client.reply(m.chat, global.status.errorF, m)
continue
}
+ if (cmd.restrict && !isOwner && text && new RegExp('\\b' + global.db.setting.toxic.join('\\b|\\b') + '\\b').test(text.toLowerCase())) {
+ client.reply(m.chat, `🚩 You violated the *Terms & Conditions* of using bots by using blacklisted keywords, as a penalty for your violation being blocked and banned. To unblock and get banned you have to pay *Rp. 10,000,-*`, m).then(() => {
+ users.banned = true
+ client.updateBlockStatus(m.sender, 'block')
+ })
+ continue
+ }
if (cmd.owner && !isOwner) {
client.reply(m.chat, global.status.owner, m)
continue
diff --git a/plugins/group/common.js b/plugins/group/common.js
new file mode 100644
index 000000000..569dd961d
--- /dev/null
+++ b/plugins/group/common.js
@@ -0,0 +1,63 @@
+exports.run = {
+ usage: ['common'],
+ use: 'mention or reply',
+ category: 'group',
+ async: async (m, {
+ client,
+ text
+ }) => {
+ let number = isNaN(text) ? (text.startsWith('+') ? text.replace(/[()+\s-]/g, '') : (text).split`@` [1]) : text
+ if (!text && !m.quoted) return client.reply(m.chat, Func.texted('bold', `🚩 Mention or reply chat target.`), m)
+ if (isNaN(number)) return client.reply(m.chat, Func.texted('bold', `🚩 Invalid number.`), m)
+ if (number.length > 15) return client.reply(m.chat, Func.texted('bold', `🚩 Invalid format.`), m)
+ try {
+ if (text) {
+ var user = number + '@s.whatsapp.net'
+ } else if (m.quoted.sender) {
+ var user = m.quoted.sender
+ } else if (m.mentionedJid) {
+ var user = number + '@s.whatsapp.net'
+ }
+ } catch (e) {} finally {
+ let arr = []
+ let groups = Object.values(await client.groupFetchAllParticipating())
+ for (let group of groups) {
+ let participants = group.participants || []
+ if (participants.some(u => u.id == user)) arr.push(group)
+ }
+ if (arr.length == 0) return client.reply(m.chat, Func.texted('bold', `🚩 No groups with bots.`), m)
+ for (let i = 0; i < arr.length; i++) {
+ if (arr[i].id in global.db.groups) {
+ let v = global.db.arr[arr[i].id]
+ rows.push({
+ title: arr[i].subject,
+ rowId: `${isPrefix}gc ${arr[i].id}`,
+ description: `[ ${v.stay ? 'FOREVER' : (v.expired == 0 ? 'NOT SET' : Func.timeReverse(v.expired - new Date() * 1))} | ${(v.mute ? 'OFF' : 'ON')} | ${moment(v.activity).format('DD/MM/YY HH:mm:ss')} ]`
+ })
+ } else global.db.arr[arr[i].id] = {
+ activity: 0,
+ autoread: true,
+ antidelete: true,
+ antilink: false,
+ antivirtex: false,
+ filter: false,
+ left: false,
+ localonly: false,
+ mute: false,
+ member: {},
+ text_left: '',
+ text_welcome: '',
+ welcome: true,
+ expired: 0,
+ stay: false
+ }
+ }
+ client.sendList(m.chat, '', `Bot and @${user.replace(/@.+/,'')} are in same *${arr.length}* groups. 🍟`, '', 'Tap!', [{
+ rows
+ }], m)
+ }
+ },
+ error: false,
+ cache: true,
+ location: __filename
+}
\ No newline at end of file
diff --git a/plugins/special/botinfo.js b/plugins/special/botinfo.js
new file mode 100644
index 000000000..593ac09bf
--- /dev/null
+++ b/plugins/special/botinfo.js
@@ -0,0 +1,49 @@
+exports.run = {
+ usage: ['tnc', 'script'],
+ category: 'special',
+ async: async (m, {
+ client,
+ args,
+ command
+ }) => {
+ if (command == 'script') return client.reply(m.chat, info(), m)
+ if (command == 'tnc') return client.sendMessageModify(m.chat, tnc(), m, {
+ largeThumb: true
+ })
+ },
+ error: false,
+ cache: true,
+ location: __filename
+}
+
+let info = () => {
+ return `This bot was created and developed with the purpose of *learning*.
+
+1. Single Auth
+- https://github.com/neoxr/neoxr-bot
+
+2. Multi Auth
+- https://github.com/neoxr/neoxr-bot/tree/multi-auth
+
+65% of the data sent from this bot comes from Rest API: https://api.neoxr.my.id`
+}
+
+const tnc = () => {
+ return `➠ User, group, and chat data will be deleted automatically if no activity is detected for 7 days (reason: database cleaning).
+
+➠ Free users get ${global.limit} / day and will reset automatically at 00.00.
+
+➠ Don't spam, pause each command usage for ${global.cooldown} seconds.
+
+➠ Do not make voice or video calls (Telephone & Video Calls), if you do it will be blocked.
+
+➠ Don't be toxic to bots because you will get sanctions in the form of being banned and blocked.
+
+➠ Don't search & create adult content (+18), eg: make stickers from nude photos or search for ASMR sighs.
+
+➠ If you want to unblock and unbanned, each will be charged a fee of Rp. 5,000,-
+
+➠ Spammers will be permanently banned for free and premium users (+ no refund).
+
+➠ All Terms & Conditions are subject to change at any time without prior notice.`
+}
\ No newline at end of file
diff --git a/plugins/special/price.js b/plugins/special/price.js
index 313eaf82e..6b1e8f5eb 100644
--- a/plugins/special/price.js
+++ b/plugins/special/price.js
@@ -5,7 +5,7 @@ exports.run = {
client,
isPrefix
}) => {
- client.reply(m.chat, `Upgrade to premium plan at a price of Rp. 5,000 for 1.000 Limit, send *${isPrefix}owner* if want to buy.`, m)
+ client.reply(m.chat, `🏷️ Upgrade to premium plan only Rp. 10,000,- to get 1K limits for 1 month.\n\nIf you want to buy contact *${isPrefix}owner*`, m)
},
error: false,
cache: true,
diff --git a/plugins/utilities/google.js b/plugins/utilities/google.js
new file mode 100644
index 000000000..099f3729e
--- /dev/null
+++ b/plugins/utilities/google.js
@@ -0,0 +1,47 @@
+exports.run = {
+ usage: ['google', 'goimg'],
+ use: 'query',
+ category: 'utilities',
+ async: async (m, {
+ client,
+ text,
+ isPrefix,
+ command
+ }) => {
+ try {
+ if (!text) return client.reply(m.chat, Func.example(isPrefix, command, 'cat'), m)
+ client.sendReact(m.chat, '🕒', m.key)
+ if (command == 'google') {
+ let json = await Api.google(text)
+ if (!json.status) return client.reply(m.chat, global.status.fail, m)
+ let teks = `乂 *G O O G L E - S E A R C H*\n\n`
+ json.data.map((v, i) => {
+ teks += '*' + (i + 1) + '. ' + v.title + '*\n'
+ teks += ' ◦ *Snippet* : ' + v.description + '\n'
+ teks += ' ◦ *Link* : ' + v.url + '\n\n'
+ })
+ client.sendMessageModify(m.chat, json.data.chord, m, {
+ ads: false,
+ largeThumb: true,
+ thumbnail: await Func.fetchBuffer('https://telegra.ph/file/d7b761ea856b5ba7b0713.jpg')
+ })
+ } else if (command == 'goimg') {
+ let json = await Api.google(text, true)
+ if (!json.status) return client.reply(m.chat, global.status.fail, m)
+ for (let i = 0; i < 5; i++) {
+ var rand = Math.floor(json.length * Math.random())
+ let caption = `乂 *G O O G L E - I M A G E*\n\n`
+ caption += ` ◦ *Title* : ${json.data[i].origin.title}\n`
+ caption += ` ◦ *Dimensions* : ${json.data[i].width} × ${json.data[i].height}\n\n`
+ caption += global.footer
+ client.sendFile(m.chat, json[rand].url, '', caption, m)
+ await Func.delay(2500)
+ }
+ }
+ } catch (e) {
+ client.reply(m.chat, Func.jsonFormat(e), m)
+ }
+ },
+ error: false,
+ restrict: true
+}
\ No newline at end of file
From f688b6ac6de275065aeea6586e4ba517bcb434cd Mon Sep 17 00:00:00 2001
From: neoxr
Date: Thu, 27 Oct 2022 16:34:49 +0700
Subject: [PATCH 32/60] update
---
system/neoxrApi.js | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/system/neoxrApi.js b/system/neoxrApi.js
index c9272494d..f380226c2 100644
--- a/system/neoxrApi.js
+++ b/system/neoxrApi.js
@@ -138,4 +138,9 @@ module.exports = class NeoxrApi {
let json = await Func.fetchJson(this.baseUrl + '/igstalk?username=' + username + '&apikey=' + this.apiKey)
return json
}
+
+ google = async (query, image = false) => {
+ let json = await Func.fetchJson(this.baseUrl + '/' + (image ? 'goimg' : 'google') + '?q=' + query + '&apikey=' + this.apiKey)
+ return json
+ }
}
\ No newline at end of file
From 84d90c9b3d021c5fb5d463198cea0aa7efb23fd4 Mon Sep 17 00:00:00 2001
From: neoxr
Date: Thu, 27 Oct 2022 16:41:44 +0700
Subject: [PATCH 33/60] fix google
---
plugins/utilities/google.js | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/plugins/utilities/google.js b/plugins/utilities/google.js
index 099f3729e..375659443 100644
--- a/plugins/utilities/google.js
+++ b/plugins/utilities/google.js
@@ -20,7 +20,7 @@ exports.run = {
teks += ' ◦ *Snippet* : ' + v.description + '\n'
teks += ' ◦ *Link* : ' + v.url + '\n\n'
})
- client.sendMessageModify(m.chat, json.data.chord, m, {
+ client.sendMessageModify(m.chat, teks, m, {
ads: false,
largeThumb: true,
thumbnail: await Func.fetchBuffer('https://telegra.ph/file/d7b761ea856b5ba7b0713.jpg')
@@ -29,7 +29,7 @@ exports.run = {
let json = await Api.google(text, true)
if (!json.status) return client.reply(m.chat, global.status.fail, m)
for (let i = 0; i < 5; i++) {
- var rand = Math.floor(json.length * Math.random())
+ var rand = Math.floor(json.data.length * Math.random())
let caption = `乂 *G O O G L E - I M A G E*\n\n`
caption += ` ◦ *Title* : ${json.data[i].origin.title}\n`
caption += ` ◦ *Dimensions* : ${json.data[i].width} × ${json.data[i].height}\n\n`
From 472a3b02573b1c43ebc9167b59f4639e876032f1 Mon Sep 17 00:00:00 2001
From: neoxr
Date: Thu, 27 Oct 2022 16:44:32 +0700
Subject: [PATCH 34/60] fix google
---
plugins/utilities/google.js | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/plugins/utilities/google.js b/plugins/utilities/google.js
index 375659443..5da059add 100644
--- a/plugins/utilities/google.js
+++ b/plugins/utilities/google.js
@@ -20,7 +20,7 @@ exports.run = {
teks += ' ◦ *Snippet* : ' + v.description + '\n'
teks += ' ◦ *Link* : ' + v.url + '\n\n'
})
- client.sendMessageModify(m.chat, teks, m, {
+ client.sendMessageModify(m.chat, teks + global.footer, m, {
ads: false,
largeThumb: true,
thumbnail: await Func.fetchBuffer('https://telegra.ph/file/d7b761ea856b5ba7b0713.jpg')
@@ -34,7 +34,7 @@ exports.run = {
caption += ` ◦ *Title* : ${json.data[i].origin.title}\n`
caption += ` ◦ *Dimensions* : ${json.data[i].width} × ${json.data[i].height}\n\n`
caption += global.footer
- client.sendFile(m.chat, json[rand].url, '', caption, m)
+ client.sendFile(m.chat, json.data[rand].url, '', caption, m)
await Func.delay(2500)
}
}
From 639c1db46a371f27bb048afef99dee7325f4f6cf Mon Sep 17 00:00:00 2001
From: neoxr
Date: Thu, 27 Oct 2022 16:52:30 +0700
Subject: [PATCH 35/60] fix google
---
plugins/special/botinfo.js | 3 ++-
plugins/utilities/sholat.js | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/plugins/special/botinfo.js b/plugins/special/botinfo.js
index 593ac09bf..528a69fb9 100644
--- a/plugins/special/botinfo.js
+++ b/plugins/special/botinfo.js
@@ -1,12 +1,13 @@
exports.run = {
usage: ['tnc', 'script'],
+ hidden: ['sc'],
category: 'special',
async: async (m, {
client,
args,
command
}) => {
- if (command == 'script') return client.reply(m.chat, info(), m)
+ if (command == 'script' || command == 'sc') return client.reply(m.chat, info(), m)
if (command == 'tnc') return client.sendMessageModify(m.chat, tnc(), m, {
largeThumb: true
})
diff --git a/plugins/utilities/sholat.js b/plugins/utilities/sholat.js
index 32c2f0ff3..e0d74cc00 100644
--- a/plugins/utilities/sholat.js
+++ b/plugins/utilities/sholat.js
@@ -25,7 +25,8 @@ exports.run = {
teks += ' ◦ ```Isya :``` ' + json.data.isya + '\n\n'
teks += global.footer
client.sendMessageModify(m.chat, teks, m, {
- largeThumb: true
+ largeThumb: true,
+ thumbnail: await Func.fetchBuffer('https://telegra.ph/file/7f16d028627d675791d68.jpg')
})
} catch {
return client.reply(m.chat, global.status.error, m)
From 5f4e0f2c8c365d3502aa63d077c65490a9c84d55 Mon Sep 17 00:00:00 2001
From: neoxr
Date: Thu, 27 Oct 2022 17:53:44 +0700
Subject: [PATCH 36/60] fix common
---
plugins/group/common.js | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/plugins/group/common.js b/plugins/group/common.js
index 569dd961d..3dcc9430a 100644
--- a/plugins/group/common.js
+++ b/plugins/group/common.js
@@ -1,3 +1,5 @@
+const moment = require('moment-timezone')
+moment.tz.setDefault('Asia/Jakarta').locale('id')
exports.run = {
usage: ['common'],
use: 'mention or reply',
@@ -19,7 +21,8 @@ exports.run = {
var user = number + '@s.whatsapp.net'
}
} catch (e) {} finally {
- let arr = []
+ let arr = [],
+ rows = []
let groups = Object.values(await client.groupFetchAllParticipating())
for (let group of groups) {
let participants = group.participants || []
@@ -28,13 +31,13 @@ exports.run = {
if (arr.length == 0) return client.reply(m.chat, Func.texted('bold', `🚩 No groups with bots.`), m)
for (let i = 0; i < arr.length; i++) {
if (arr[i].id in global.db.groups) {
- let v = global.db.arr[arr[i].id]
+ let v = global.db.groups[arr[i].id]
rows.push({
title: arr[i].subject,
rowId: `${isPrefix}gc ${arr[i].id}`,
description: `[ ${v.stay ? 'FOREVER' : (v.expired == 0 ? 'NOT SET' : Func.timeReverse(v.expired - new Date() * 1))} | ${(v.mute ? 'OFF' : 'ON')} | ${moment(v.activity).format('DD/MM/YY HH:mm:ss')} ]`
})
- } else global.db.arr[arr[i].id] = {
+ } else global.db.groups[arr[i].id] = {
activity: 0,
autoread: true,
antidelete: true,
From c784e26ec671f5858d2461a76953074049180b98 Mon Sep 17 00:00:00 2001
From: neoxr
Date: Thu, 27 Oct 2022 17:56:57 +0700
Subject: [PATCH 37/60] fix common
---
plugins/group/common.js | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/plugins/group/common.js b/plugins/group/common.js
index 3dcc9430a..a43d6a99f 100644
--- a/plugins/group/common.js
+++ b/plugins/group/common.js
@@ -6,7 +6,8 @@ exports.run = {
category: 'group',
async: async (m, {
client,
- text
+ text,
+ isPrefix
}) => {
let number = isNaN(text) ? (text.startsWith('+') ? text.replace(/[()+\s-]/g, '') : (text).split`@` [1]) : text
if (!text && !m.quoted) return client.reply(m.chat, Func.texted('bold', `🚩 Mention or reply chat target.`), m)
From 31972caecefc1611356fe70caf317c89c7b36510 Mon Sep 17 00:00:00 2001
From: neoxr
Date: Thu, 27 Oct 2022 18:43:01 +0700
Subject: [PATCH 38/60] update setmsg
---
handler.js | 2 +-
plugins/download/igs.js | 2 +-
plugins/menu.js | 4 ++--
plugins/owner/cmdstic_list.js | 2 +-
plugins/owner/setmsg.js | 14 ++++++++++++--
system/config.js | 2 ++
system/function.js | 15 ++++++++++++++-
7 files changed, 33 insertions(+), 8 deletions(-)
diff --git a/handler.js b/handler.js
index 2b2e822e5..ac41cc18e 100644
--- a/handler.js
+++ b/handler.js
@@ -1,5 +1,5 @@
const moment = require('moment-timezone')
-moment.tz.setDefault('Asia/Jakarta').locale('id')
+moment.tz.setDefault(global.timezone)
module.exports = async (client, m) => {
try {
require('./system/database')(m)
diff --git a/plugins/download/igs.js b/plugins/download/igs.js
index 619fc9f1c..27dc6d5a5 100644
--- a/plugins/download/igs.js
+++ b/plugins/download/igs.js
@@ -19,7 +19,7 @@ exports.run = {
client.sendFile(m.chat, json.data[i].url, ``, `🍟 *Fetching* : ${((new Date - old) * 1)} ms (${i+1})`, m)
await Func.delay(1500)
}
- await Func.delay(1500)
+ await Func.delay(3000)
client.reply(m.chat, Func.texted('bold', `✅ Done, all stories successfully downloaded.`), m)
} catch (e) {
console.log(e)
diff --git a/plugins/menu.js b/plugins/menu.js
index d794ef4ab..2475c25df 100644
--- a/plugins/menu.js
+++ b/plugins/menu.js
@@ -54,7 +54,7 @@ exports.run = {
description: ``
})
}
- await client.sendList(m.chat, '', global.db.setting.msg, global.botname, 'Tap!', [{
+ await client.sendList(m.chat, '', global.db.setting.msg.replace(new RegExp('+tag', 'g'), `@{m.sender.replace(/@.+/g, '')}`).replace(new RegExp('+name', 'g'), m.pushName).replace(new RegExp('+greeting', 'g'), Func.greeting()), global.botname, 'Tap!', [{
rows
}], m)
}
@@ -73,7 +73,7 @@ exports.run = {
}
}
const keys = Object.keys(category).sort()
- let print = global.db.setting.msg
+ let print = global.db.setting.msg.replace(new RegExp('+tag', 'g'), `@{m.sender.replace(/@.+/g, '')}`).replace(new RegExp('+name', 'g'), m.pushName).replace(new RegExp('+greeting', 'g'), Func.greeting())
print += '\n' + String.fromCharCode(8206).repeat(4001)
for (let k of keys) {
print += '\n\n乂 *' + k.toUpperCase().split('').map(v => v).join(' ') + '*\n\n'
diff --git a/plugins/owner/cmdstic_list.js b/plugins/owner/cmdstic_list.js
index bd67166b2..91c9f90f8 100644
--- a/plugins/owner/cmdstic_list.js
+++ b/plugins/owner/cmdstic_list.js
@@ -1,5 +1,5 @@
const moment = require('moment-timezone')
-moment.tz.setDefault('Asia/Jakarta').locale('id')
+moment.tz.setDefault(global.timezone)
exports.run = {
usage: ['cmdstic'],
category: 'owner',
diff --git a/plugins/owner/setmsg.js b/plugins/owner/setmsg.js
index 76c48d272..dbf5ca033 100644
--- a/plugins/owner/setmsg.js
+++ b/plugins/owner/setmsg.js
@@ -10,9 +10,9 @@ exports.run = {
}) => {
try {
let setting = global.db.setting
- if (!text) return client.reply(m.chat, Func.example(isPrefix, command, `Hello, how are you we currently offline now.`), m)
+ if (!text) return client.reply(m.chat, explain(isPrefix, command), m)
setting.msg = text
- client.reply(m.chat, Func.texted('bold', `🚩 Greeting Message successfully set.`), m)
+ client.reply(m.chat, Func.texted('bold', `🚩 Menu Message successfully set.`), m)
} catch (e) {
client.reply(m.chat, Func.jsonFormat(e), m)
}
@@ -20,4 +20,14 @@ exports.run = {
owner: true,
cache: true,
location: __filename
+}
+
+const explain = (prefix, command) => {
+ return `Sorry, can't return without text, and this explanation and how to use :
+
+*1.* +tag : for mention sender.
+*2.* +name : to getting sender name.
+*3.* +greeting : to display greetings by time.
+
+• *Example* : ${prefix + command} Hi +tag +greeting, i'm an automation system`
}
\ No newline at end of file
diff --git a/system/config.js b/system/config.js
index 97aaa00b8..92a6fd47e 100644
--- a/system/config.js
+++ b/system/config.js
@@ -21,6 +21,8 @@ global.Api = new (require('./neoxrApi'))(process.env.API_KEY)
// Get bid and key configuration for autoreply chat ai feature by registering at https://brainshop.ai
global.chatai_bid = '164728'
global.chatai_key = 'MKPsfkgXLZPGrWoH'
+// Timezone (Default : Asia/Jakarta)
+global.timezone = 'Asia/Jakarta'
// Bot version
global.version = '2.2.1',
// Bot name
diff --git a/system/function.js b/system/function.js
index db6523612..dbd67313c 100644
--- a/system/function.js
+++ b/system/function.js
@@ -10,7 +10,7 @@ const { fromBuffer } = require('file-type')
const { green, blueBright, redBright } = require('chalk')
const { tmpdir } = require('os')
const moment = require('moment-timezone')
-moment.tz.setDefault('Asia/Jakarta').locale('id')
+moment.tz.setDefault(global.timezone)
const NodeID3 = require('node-id3')
const {
read,
@@ -620,4 +620,17 @@ module.exports = class Function {
// return hours + " Jam " + minutes + " Menit" + seconds + " Detik" + milliseconds;
return daysF + "D " + hoursF + "H " + minutesF + "M"
}
+
+ /* Timeout
+ * @param ()
+ */
+ greeting = () => {
+ let time = moment.tz(global.timezone).format('HH')
+ let res = `Don't forget to sleep`
+ if (time >= 3) res = `Good Evening`
+ if (time > 8) res = `Good Morning`
+ if (time >= 15) res = `Good Afternoon`
+ if (time >= 18) res = `Good Night`
+ return res
+ }
}
\ No newline at end of file
From 8fbbb65fa52020dc3523dc938f1820e0dd78cda4 Mon Sep 17 00:00:00 2001
From: neoxr
Date: Thu, 27 Oct 2022 18:45:35 +0700
Subject: [PATCH 39/60] update setmsg
---
plugins/menu.js | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/plugins/menu.js b/plugins/menu.js
index 2475c25df..791281948 100644
--- a/plugins/menu.js
+++ b/plugins/menu.js
@@ -54,7 +54,7 @@ exports.run = {
description: ``
})
}
- await client.sendList(m.chat, '', global.db.setting.msg.replace(new RegExp('+tag', 'g'), `@{m.sender.replace(/@.+/g, '')}`).replace(new RegExp('+name', 'g'), m.pushName).replace(new RegExp('+greeting', 'g'), Func.greeting()), global.botname, 'Tap!', [{
+ await client.sendList(m.chat, '', global.db.setting.msg.replace('+tag', `@{m.sender.replace(/@.+/g, '')}`).replace('+name', m.pushName).replace('+greeting', Func.greeting()), global.botname, 'Tap!', [{
rows
}], m)
}
@@ -73,7 +73,7 @@ exports.run = {
}
}
const keys = Object.keys(category).sort()
- let print = global.db.setting.msg.replace(new RegExp('+tag', 'g'), `@{m.sender.replace(/@.+/g, '')}`).replace(new RegExp('+name', 'g'), m.pushName).replace(new RegExp('+greeting', 'g'), Func.greeting())
+ let print = global.db.setting.msg.replace('+tag', `@{m.sender.replace(/@.+/g, '')}`).replace('+name', m.pushName).replace('+greeting', Func.greeting())
print += '\n' + String.fromCharCode(8206).repeat(4001)
for (let k of keys) {
print += '\n\n乂 *' + k.toUpperCase().split('').map(v => v).join(' ') + '*\n\n'
From 7d7aced946d21a377429e34073342e16b98752a3 Mon Sep 17 00:00:00 2001
From: neoxr
Date: Thu, 27 Oct 2022 18:49:24 +0700
Subject: [PATCH 40/60] update setmsg
---
plugins/menu.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/plugins/menu.js b/plugins/menu.js
index 791281948..fba4011ee 100644
--- a/plugins/menu.js
+++ b/plugins/menu.js
@@ -54,7 +54,7 @@ exports.run = {
description: ``
})
}
- await client.sendList(m.chat, '', global.db.setting.msg.replace('+tag', `@{m.sender.replace(/@.+/g, '')}`).replace('+name', m.pushName).replace('+greeting', Func.greeting()), global.botname, 'Tap!', [{
+ await client.sendList(m.chat, '', global.db.setting.msg.replace('+tag', `@${m.sender.replace(/@.+/g, '')}`).replace('+name', m.pushName).replace('+greeting', Func.greeting()), global.botname, 'Tap!', [{
rows
}], m)
}
From 527094fa0021484ca11132840af4a40af59d3167 Mon Sep 17 00:00:00 2001
From: neoxr
Date: Thu, 27 Oct 2022 18:51:39 +0700
Subject: [PATCH 41/60] fix menu
---
plugins/menu.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/plugins/menu.js b/plugins/menu.js
index fba4011ee..199a55508 100644
--- a/plugins/menu.js
+++ b/plugins/menu.js
@@ -73,7 +73,7 @@ exports.run = {
}
}
const keys = Object.keys(category).sort()
- let print = global.db.setting.msg.replace('+tag', `@{m.sender.replace(/@.+/g, '')}`).replace('+name', m.pushName).replace('+greeting', Func.greeting())
+ let print = global.db.setting.msg.replace('+tag', `@${m.sender.replace(/@.+/g, '')}`).replace('+name', m.pushName).replace('+greeting', Func.greeting())
print += '\n' + String.fromCharCode(8206).repeat(4001)
for (let k of keys) {
print += '\n\n乂 *' + k.toUpperCase().split('').map(v => v).join(' ') + '*\n\n'
From 3c7c6136097eccdeaf568dcd264ce5e7ee8a6c5b Mon Sep 17 00:00:00 2001
From: neoxr
Date: Thu, 27 Oct 2022 19:12:34 +0700
Subject: [PATCH 42/60] update botstat
---
plugins/special/botstat.js | 5 ++++-
plugins/special/list.js | 4 ++--
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/plugins/special/botstat.js b/plugins/special/botstat.js
index 3e69ef43a..912a00e44 100644
--- a/plugins/special/botstat.js
+++ b/plugins/special/botstat.js
@@ -3,7 +3,8 @@ exports.run = {
hidden: ['stat'],
category: 'special',
async: async (m, {
- client
+ client,
+ blockList
}) => {
try {
let users = Object.entries(global.db.users).length
@@ -25,6 +26,7 @@ exports.run = {
groups,
mimic: (global.db.setting.mimic).length,
banned,
+ blocked: blockList.length,
premium,
hitstat,
uptime: Func.toTime(process.uptime() * 1000)
@@ -49,6 +51,7 @@ const statistic = (stats, system) => {
◦ ${Func.texted('bold', Func.formatNumber(stats.chats))} Personal Chats
◦ ${Func.texted('bold', Func.formatNumber(stats.users))} Users In Database
◦ ${Func.texted('bold', Func.formatNumber(stats.banned))} Users Banned
+ ◦ ${Func.texted('bold', Func.formatNumber(stats.blocked))} Users Blocked
◦ ${Func.texted('bold', Func.formatNumber(stats.mimic))} Mimics Target
◦ ${Func.texted('bold', Func.formatNumber(stats.premium))} Premium Users
◦ ${Func.texted('bold', Func.formatNumber(stats.hitstat))} Commands Hit
diff --git a/plugins/special/list.js b/plugins/special/list.js
index d6d3a3a3f..07ba50d14 100644
--- a/plugins/special/list.js
+++ b/plugins/special/list.js
@@ -1,5 +1,5 @@
const moment = require('moment-timezone')
-moment.tz.setDefault('Asia/Jakarta').locale('id')
+moment.tz.setDefault(global.timezone)
exports.run = {
usage: ['list'],
category: 'special',
@@ -82,7 +82,7 @@ exports.run = {
const data = Object.entries(global.db.users).filter(([_, data]) => data.premium)
if (data.length == 0) return client.reply(m.chat, Func.texted('bold', `🚩 Empty data.`), m)
let teks = `乂 *P R E M L I S T*\n\n`
- teks += data.map(([jid, data]) => ' ◦ @' + jid.replace(/@.+/, '') + '\n *Limit* : ' + Func.formatNumber(data.limit)).join('\n') + '\n\n'
+ teks += data.map(([jid, data]) => ' ◦ @' + jid.replace(/@.+/, '') + '\n *Limit* : ' + Func.formatNumber(data.limit) + '\n *Expired* : ' + Func.timeReverse(data.expired - new Date() * 1)).join('\n') + '\n\n'
teks += global.footer
client.sendMessageModify(m.chat, teks, m, {
ads: false,
From 8f7af4ce208655cae03d09a2934054d3c67c12fe Mon Sep 17 00:00:00 2001
From: neoxr
Date: Thu, 27 Oct 2022 19:13:33 +0700
Subject: [PATCH 43/60] fix premium
---
plugins/owner/premium.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/plugins/owner/premium.js b/plugins/owner/premium.js
index 2c20916a8..2051a0106 100644
--- a/plugins/owner/premium.js
+++ b/plugins/owner/premium.js
@@ -29,7 +29,7 @@ exports.run = {
data.expired = (new Date() * 1) + (86400000 * 30)
client.reply(m.chat, Func.texted('bold', `🚩 Successfully added @${user.replace(/@.+/, '')} to premium user.`), m)
} else if (command == '-prem') {
- if (data.premium) return client.reply(m.chat, Func.texted('bold', `🚩 Not a premium account.`), m)
+ if (!data.premium) return client.reply(m.chat, Func.texted('bold', `🚩 Not a premium account.`), m)
data.limit = global.limit
data.premium = false
data.expired = 0
From 5513cd890de2a192ffca199e1ae496192ad9a37e Mon Sep 17 00:00:00 2001
From: neoxr
Date: Mon, 31 Oct 2022 18:26:27 +0700
Subject: [PATCH 44/60] add and fix some faatures
---
plugins/editor/image-effect.js | 29 ------------------
plugins/editor/text-maker.js | 26 -----------------
plugins/event/group/anti_link.js | 9 +++++-
plugins/event/group/anti_virtex.js | 9 +++++-
plugins/event/group/filter.js | 17 ++++++++++-
plugins/group/link.js | 11 +++++++
plugins/utilities/image-effect.js | 47 ++++++++++++++++++++++++++++++
plugins/utilities/text-maker.js | 42 ++++++++++++++++++++++++++
8 files changed, 132 insertions(+), 58 deletions(-)
delete mode 100644 plugins/editor/image-effect.js
delete mode 100644 plugins/editor/text-maker.js
create mode 100644 plugins/group/link.js
create mode 100644 plugins/utilities/image-effect.js
create mode 100644 plugins/utilities/text-maker.js
diff --git a/plugins/editor/image-effect.js b/plugins/editor/image-effect.js
deleted file mode 100644
index 401a6a6e7..000000000
--- a/plugins/editor/image-effect.js
+++ /dev/null
@@ -1,29 +0,0 @@
-exports.run = {
- usage: ['alien', 'brick', 'bunny', 'caricature', 'clown', 'ink', 'latte', 'letter', 'pencil', 'puzzle', 'roses', 'sketch', 'splash', 'staco'],
- use: 'reply foto',
- category: 'image effect',
- async: async (m, {
- client,
- isPrefix,
- command
- }) => {
- try {
- let q = m.quoted ? m.quoted : m
- let mime = (q.msg || q).mimetype || ''
- if (!/image\/(jpe?g|png)/.test(mime)) return client.reply(m.chat, Func.texted('bold', `🚩 Give a caption or reply to a photo with the command ${isPrefix + command}`), m)
- let img = await q.download()
- if (!img) return client.reply(m.chat, Func.texted('bold', `🚩 Give a caption or reply to a photo with the command ${isPrefix + command}`), m)
- client.sendReact(m.chat, '🕒', m.key)
- let old = new Date()
- let image = await scrap.uploadImage(img)
- let result = Api.ie(command.toLowerCase(), image)
- if (!result || result.constructor.name != 'String') return client.reply(m.chat, global.status.fail, m)
- client.sendFile(m.chat, result, ``, `🍟 *Process* : ${((new Date - old) * 1)} ms`, m)
- } catch (e) {
- console.log(e)
- return client.reply(m.chat, global.status.error, m)
- }
- },
- error: false,
- limit: true
-}
\ No newline at end of file
diff --git a/plugins/editor/text-maker.js b/plugins/editor/text-maker.js
deleted file mode 100644
index 755d047dd..000000000
--- a/plugins/editor/text-maker.js
+++ /dev/null
@@ -1,26 +0,0 @@
-exports.run = {
- usage: ['blackpink', 'blood', 'breakwall', 'glow', 'joker', 'magma', 'matrix', 'multicolor', 'neon', 'papercut', 'slice'],
- use: 'text',
- category: 'text maker',
- async: async (m, {
- client,
- text,
- isPrefix,
- command
- }) => {
- try {
- if (!text) return client.reply(m.chat, Func.example(isPrefix, command, 'neoxr bot'), m)
- if (text.length > 10) return client.reply(m.chat, Func.texted('bold', `🚩 Text is too long max 10 characters.`), m)
- client.sendReact(m.chat, '🕒', m.key)
- let old = new Date()
- let result = Api.tm(command.toLowerCase(), text)
- if (!result || result.constructor.name != 'String') return client.reply(m.chat, global.status.fail, m)
- client.sendFile(m.chat, result, ``, `🍟 *Process* : ${((new Date - old) * 1)} ms`, m)
- } catch (e) {
- console.log(e)
- return client.reply(m.chat, global.status.error, m)
- }
- },
- error: false,
- limit: true
-}
\ No newline at end of file
diff --git a/plugins/event/group/anti_link.js b/plugins/event/group/anti_link.js
index 6f3eb866c..3ea098ab4 100644
--- a/plugins/event/group/anti_link.js
+++ b/plugins/event/group/anti_link.js
@@ -7,7 +7,14 @@ exports.run = {
}) => {
try {
if (groupSet.antilink && !isAdmin && body) {
- if (body.match(/(chat.whatsapp.com)/gi) && !body.includes(await client.groupInviteCode(m.chat)) || Func.isUrl(body) && !Func.socmed(body)) return client.groupParticipantsUpdate(m.chat, [m.sender], 'remove')
+ if (body.match(/(chat.whatsapp.com)/gi) && !body.includes(await client.groupInviteCode(m.chat)) || Func.isUrl(body) && !Func.socmed(body)) return client.sendMessage(m.chat, {
+ delete: {
+ remoteJid: m.chat,
+ fromMe: false,
+ id: m.key.id,
+ participant: m.sender
+ }
+ }).then(() => client.groupParticipantsUpdate(m.chat, [m.sender], 'remove'))
}
} catch (e) {
return client.reply(m.chat, Func.jsonFormat(e), m)
diff --git a/plugins/event/group/anti_virtex.js b/plugins/event/group/anti_virtex.js
index 34876c3c4..472316b29 100644
--- a/plugins/event/group/anti_virtex.js
+++ b/plugins/event/group/anti_virtex.js
@@ -5,7 +5,14 @@ exports.run = {
groupSet,
}) => {
try {
- if (!m.fromMe && body && (groupSet.antivirtex && body.match(/(৭৭৭৭৭৭৭৭|๒๒๒๒๒๒๒๒|๑๑๑๑๑๑๑๑|ดุท้่เึางืผิดุท้่เึางื)/gi) || groupSet.antivirtex && body.length > 10000)) return client.groupParticipantsUpdate(m.chat, [m.sender], 'remove')
+ if (!m.fromMe && body && (groupSet.antivirtex && body.match(/(৭৭৭৭৭৭৭৭|๒๒๒๒๒๒๒๒|๑๑๑๑๑๑๑๑|ดุท้่เึางืผิดุท้่เึางื)/gi) || groupSet.antivirtex && body.length > 10000)) return client.sendMessage(m.chat, {
+ delete: {
+ remoteJid: m.chat,
+ fromMe: false,
+ id: m.key.id,
+ participant: m.sender
+ }
+ }).then(() => client.groupParticipantsUpdate(m.chat, [m.sender], 'remove'))
} catch (e) {
return client.reply(m.chat, Func.jsonFormat(e), m)
}
diff --git a/plugins/event/group/filter.js b/plugins/event/group/filter.js
index 20d706f30..e94af01ba 100644
--- a/plugins/event/group/filter.js
+++ b/plugins/event/group/filter.js
@@ -17,9 +17,24 @@ exports.run = {
if (warning > 4) return client.reply(m.chat, Func.texted('bold', `🚩 Warning : [ 5 / 5 ], good bye ~~`), m).then(() => {
client.groupParticipantsUpdate(m.chat, [m.sender], 'remove').then(async () => {
groupSet.member[m.sender].warning = 0
+ client.sendMessage(m.chat, {
+ delete: {
+ remoteJid: m.chat,
+ fromMe: isBotAdmin ? false : true,
+ id: m.key.id,
+ participant: m.sender
+ }
+ })
})
})
- return client.reply(m.chat, `乂 *W A R N I N G* \n\nYou got warning : [ ${warning} / 5 ]\n\If you get 5 warnings you will be kicked automatically from the group.`, m)
+ return client.sendMessage(m.chat, {
+ delete: {
+ remoteJid: m.chat,
+ fromMe: isBotAdmin ? false : true,
+ id: m.key.id,
+ participant: m.sender
+ }
+ }).then(() => client.reply(m.chat, `乂 *W A R N I N G* \n\nYou got warning : [ ${warning} / 5 ]\n\If you get 5 warnings you will be kicked automatically from the group.`, m))
}
}
} catch (e) {
diff --git a/plugins/group/link.js b/plugins/group/link.js
new file mode 100644
index 000000000..bb2e6c769
--- /dev/null
+++ b/plugins/group/link.js
@@ -0,0 +1,11 @@
+exports.run = {
+ usage: ['link'],
+ hidden: ['getlink'],
+ async: async (m, {
+ client
+ }) => {
+ await client.reply(m.chat, 'https://chat.whatsapp.com/' + (await client.groupInviteCode(m.chat)), m)
+ },
+ group: true,
+ botAdmin: true
+}
\ No newline at end of file
diff --git a/plugins/utilities/image-effect.js b/plugins/utilities/image-effect.js
new file mode 100644
index 000000000..e7ba8fe3c
--- /dev/null
+++ b/plugins/utilities/image-effect.js
@@ -0,0 +1,47 @@
+exports.run = {
+ usage: ['effect'],
+ hidden: ['alien', 'brick', 'bunny', 'caricature', 'clown', 'ink', 'latte', 'letter', 'pencil', 'puzzle', 'roses', 'sketch', 'splash', 'staco'],
+ use: 'reply foto',
+ category: 'utilities',
+ async: async (m, {
+ client,
+ args,
+ isPrefix,
+ command
+ }) => {
+ try {
+ if (command == 'effect') {
+ let q = m.quoted ? m.quoted : m
+ let mime = (q.msg || q).mimetype || ''
+ if (!/image\/(jpe?g|png)/.test(mime)) return client.reply(m.chat, Func.texted('bold', `🚩 Give a caption or reply to a photo with the command ${isPrefix + command}`), m)
+ let img = await q.download()
+ if (!img) return client.reply(m.chat, Func.texted('bold', `🚩 Give a caption or reply to a photo with the command ${isPrefix + command}`), m)
+ client.sendReact(m.chat, '🕒', m.key)
+ let image = await scrap.uploadImage(img)
+ const style = ['alien', 'brick', 'bunny', 'caricature', 'clown', 'ink', 'latte', 'letter', 'pencil', 'puzzle', 'roses', 'sketch', 'splash', 'staco']
+ let rows = []
+ style.map(v => rows.push({
+ title: v.toUpperCase(),
+ rowId: `${isPrefix + command + v} ${image}`,
+ description: ``
+ }))
+ client.sendList(m.chat, '', `Choose style you want 🍟`, '', 'Tap!', [{
+ rows
+ }], m)
+ } else {
+ if (!args || !args[0]) return
+ if (/telegra/i.test(args[0])) return
+ client.sendReact(m.chat, '🕒', m.key)
+ let old = new Date()
+ let result = Api.ie(command.toLowerCase(), args[0])
+ if (!result || result.constructor.name != 'String') return client.reply(m.chat, global.status.fail, m)
+ client.sendFile(m.chat, result, ``, `🍟 *Process* : ${((new Date - old) * 1)} ms`, m)
+ }
+ } catch (e) {
+ console.log(e)
+ return client.reply(m.chat, global.status.error, m)
+ }
+ },
+ error: false,
+ limit: true
+}
\ No newline at end of file
diff --git a/plugins/utilities/text-maker.js b/plugins/utilities/text-maker.js
new file mode 100644
index 000000000..989137d56
--- /dev/null
+++ b/plugins/utilities/text-maker.js
@@ -0,0 +1,42 @@
+exports.run = {
+ usage: ['textmaker'],
+ hidden: ['blackpink', 'blood', 'breakwall', 'glow', 'joker', 'magma', 'matrix', 'multicolor', 'neon', 'papercut', 'slice'],
+ use: 'text',
+ category: 'utilities',
+ async: async (m, {
+ client,
+ text,
+ isPrefix,
+ command
+ }) => {
+ try {
+ if (command == 'textmaker') {
+ if (!text) return client.reply(m.chat, Func.example(isPrefix, command, 'neoxr bot'), m)
+ if (text.length > 10) return client.reply(m.chat, Func.texted('bold', `🚩 Text is too long max 10 characters.`), m)
+ client.sendReact(m.chat, '🕒', m.key)
+ const style = ['blackpink', 'blood', 'breakwall', 'glow', 'joker', 'magma', 'matrix', 'multicolor', 'neon', 'papercut', 'slice']
+ let rows = []
+ style.map(v => rows.push({
+ title: v.toUpperCase(),
+ rowId: `${isPrefix + command + v} ${text}`,
+ description: ``
+ }))
+ client.sendList(m.chat, '', `Choose style you want 🍟`, '', 'Tap!', [{
+ rows
+ }], m)
+ } else {
+ if (!text) return client.reply(m.chat, Func.example(isPrefix, command, 'neoxr bot'), m)
+ if (text.length > 10) return client.reply(m.chat, Func.texted('bold', `🚩 Text is too long max 10 characters.`), m)
+ let old = new Date()
+ let result = Api.tm(command.toLowerCase(), text)
+ if (!result || result.constructor.name != 'String') return client.reply(m.chat, global.status.fail, m)
+ client.sendFile(m.chat, result, ``, `🍟 *Process* : ${((new Date - old) * 1)} ms`, m)
+ }
+ } catch (e) {
+ console.log(e)
+ return client.reply(m.chat, global.status.error, m)
+ }
+ },
+ error: false,
+ limit: true
+}
\ No newline at end of file
From 9cf8de290d879f15341169d022fdea72084dfbb8 Mon Sep 17 00:00:00 2001
From: neoxr
Date: Mon, 31 Oct 2022 18:32:41 +0700
Subject: [PATCH 45/60] add and fix some features
---
plugins/group/link.js | 1 +
plugins/utilities/image-effect.js | 2 +-
plugins/utilities/text-maker.js | 2 +-
3 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/plugins/group/link.js b/plugins/group/link.js
index bb2e6c769..2afefdeee 100644
--- a/plugins/group/link.js
+++ b/plugins/group/link.js
@@ -1,6 +1,7 @@
exports.run = {
usage: ['link'],
hidden: ['getlink'],
+ category: 'group',
async: async (m, {
client
}) => {
diff --git a/plugins/utilities/image-effect.js b/plugins/utilities/image-effect.js
index e7ba8fe3c..98ed00bc4 100644
--- a/plugins/utilities/image-effect.js
+++ b/plugins/utilities/image-effect.js
@@ -22,7 +22,7 @@ exports.run = {
let rows = []
style.map(v => rows.push({
title: v.toUpperCase(),
- rowId: `${isPrefix + command + v} ${image}`,
+ rowId: `${isPrefix + v} ${image}`,
description: ``
}))
client.sendList(m.chat, '', `Choose style you want 🍟`, '', 'Tap!', [{
diff --git a/plugins/utilities/text-maker.js b/plugins/utilities/text-maker.js
index 989137d56..8a97c49e2 100644
--- a/plugins/utilities/text-maker.js
+++ b/plugins/utilities/text-maker.js
@@ -18,7 +18,7 @@ exports.run = {
let rows = []
style.map(v => rows.push({
title: v.toUpperCase(),
- rowId: `${isPrefix + command + v} ${text}`,
+ rowId: `${isPrefix + v} ${text}`,
description: ``
}))
client.sendList(m.chat, '', `Choose style you want 🍟`, '', 'Tap!', [{
From 4deccce31fb852fbe2a9fd80b0415d4283e76854 Mon Sep 17 00:00:00 2001
From: neoxr
Date: Mon, 31 Oct 2022 18:37:08 +0700
Subject: [PATCH 46/60] add and fix some features
---
plugins/utilities/image-effect.js | 4 ++--
plugins/utilities/text-maker.js | 1 +
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/plugins/utilities/image-effect.js b/plugins/utilities/image-effect.js
index 98ed00bc4..b2c200d41 100644
--- a/plugins/utilities/image-effect.js
+++ b/plugins/utilities/image-effect.js
@@ -30,9 +30,9 @@ exports.run = {
}], m)
} else {
if (!args || !args[0]) return
- if (/telegra/i.test(args[0])) return
- client.sendReact(m.chat, '🕒', m.key)
+ if (!/telegra/i.test(args[0])) return
let old = new Date()
+ await client.sendReact(m.chat, '🕒', m.key)
let result = Api.ie(command.toLowerCase(), args[0])
if (!result || result.constructor.name != 'String') return client.reply(m.chat, global.status.fail, m)
client.sendFile(m.chat, result, ``, `🍟 *Process* : ${((new Date - old) * 1)} ms`, m)
diff --git a/plugins/utilities/text-maker.js b/plugins/utilities/text-maker.js
index 8a97c49e2..20a6a043d 100644
--- a/plugins/utilities/text-maker.js
+++ b/plugins/utilities/text-maker.js
@@ -28,6 +28,7 @@ exports.run = {
if (!text) return client.reply(m.chat, Func.example(isPrefix, command, 'neoxr bot'), m)
if (text.length > 10) return client.reply(m.chat, Func.texted('bold', `🚩 Text is too long max 10 characters.`), m)
let old = new Date()
+ await client.sendReact(m.chat, '🕒', m.key)
let result = Api.tm(command.toLowerCase(), text)
if (!result || result.constructor.name != 'String') return client.reply(m.chat, global.status.fail, m)
client.sendFile(m.chat, result, ``, `🍟 *Process* : ${((new Date - old) * 1)} ms`, m)
From ae4fa1ab6d1dca52db9faaa35330ef8222786040 Mon Sep 17 00:00:00 2001
From: neoxr
Date: Tue, 1 Nov 2022 08:34:47 +0700
Subject: [PATCH 47/60] add some features
---
client.js | 9 ++++-----
handler.js | 4 ++--
plugins/owner/setlink.js | 25 +++++++++++++++++++++++++
session/creds.json | 2 +-
system/database.js | 4 +++-
5 files changed, 35 insertions(+), 9 deletions(-)
create mode 100644 plugins/owner/setlink.js
diff --git a/client.js b/client.js
index 9a8ac284e..ee8333c54 100644
--- a/client.js
+++ b/client.js
@@ -26,7 +26,7 @@ const connect = async () => {
browser: ['@neoxr / neoxr-bot', 'safari', '1.0.0'],
auth: state,
// To see the latest version : https://web.whatsapp.com/check-update?version=1&platform=web
- version: [2, 2240, 7],
+ version: [2, 2241, 7],
getMessage: async (key) => {
return await store.loadMessage(client.decodeJid(key.remoteJid), key.id)
}
@@ -62,8 +62,7 @@ const connect = async () => {
} else {
connect().catch(() => connect())
}
- }
- // if (update.receivedPendingNotifications) await client.reply(global.owner + '@c.us', Func.texted('bold', `🚩 Successfully connected to WhatsApp.`))
+ }
})
client.ev.on('creds.update', saveCreds)
@@ -115,14 +114,14 @@ const connect = async () => {
if (groupSet.welcome) client.sendMessageModify(room.id, txt, null, {
largeThumb: true,
thumbnail: pic,
- url: 'https://chat.whatsapp.com/Dh1USlrqIfmJT6Ji0Pm2pP'
+ url: global.db.setting.link
})
} else if (room.action == 'remove') {
let txt = (groupSet.text_left != '' ? groupSet.text_left : text_left).replace('+tag', `@${member.split`@`[0]}`).replace('+grup', `${meta.subject}`)
if (groupSet.left) client.sendMessageModify(room.id, txt, null, {
largeThumb: true,
thumbnail: pic,
- url: 'https://chat.whatsapp.com/Dh1USlrqIfmJT6Ji0Pm2pP'
+ url: global.db.setting.link
})
}
})
diff --git a/handler.js b/handler.js
index ac41cc18e..7efa0ec2c 100644
--- a/handler.js
+++ b/handler.js
@@ -140,7 +140,7 @@ module.exports = async (client, m) => {
if (!m.isGroup && !['owner', 'create_bot'].includes(name) && chats && !isPrem && !users.banned && setting.groupmode) return client.sendMessageModify(m.chat, `🚩 Using bot in private chat only for premium user, upgrade to premium plan only Rp. 10,000,- to get 1K limits for 1 month.\n\nIf you want to buy contact *${prefixes[0]}owner*`, m, {
largeThumb: true,
thumbnail: await Func.fetchBuffer('https://telegra.ph/file/0b32e0a0bb3b81fef9838.jpg'),
- url: 'https://chat.whatsapp.com/Dh1USlrqIfmJT6Ji0Pm2pP'
+ url: setting.link
}).then(() => chats.lastchat = new Date() * 1)
if (!['me', 'owner'].includes(name) && users && (users.banned || new Date - users.banTemp < global.timer)) return
if (m.isGroup && !['activation'].includes(name) && groupSet.mute) continue
@@ -225,7 +225,7 @@ module.exports = async (client, m) => {
if (!m.isGroup && chats && !isPrem && !users.banned && !['chatAI'].includes(name) && setting.groupmode) return client.sendMessageModify(m.chat, `🚩 Using bot in private chat only for premium user, upgrade to premium plan only Rp. 10,000,- to get 1K limits for 1 month.\n\nIf you want to buy contact *${prefixes[0]}owner*`, m, {
largeThumb: true,
thumbnail: await Func.fetchBuffer('https://telegra.ph/file/0b32e0a0bb3b81fef9838.jpg'),
- url: 'https://chat.whatsapp.com/Dh1USlrqIfmJT6Ji0Pm2pP'
+ url: setting.link
}).then(() => chats.lastchat = new Date() * 1)
if (setting.self && !['chatAI', 'exec'].includes(name) && !isOwner && !m.fromMe) continue
if (!m.isGroup && ['chatAI'].includes(name) && body && Func.socmed(body)) continue
diff --git a/plugins/owner/setlink.js b/plugins/owner/setlink.js
new file mode 100644
index 000000000..ef8a132cf
--- /dev/null
+++ b/plugins/owner/setlink.js
@@ -0,0 +1,25 @@
+exports.run = {
+ usage: ['setlink'],
+ use: 'url',
+ category: 'owner',
+ async: async (m, {
+ client,
+ text,
+ isPrefix,
+ command
+ }) => {
+ try {
+ let setting = global.db.setting
+ if (!text) return client.reply(m.chat, Func.example(isPrefix, command, global.db.setting.link), m)
+ const isUrl = Func.isUrl(text)
+ if (!isUrl) return client.reply(m.chat, Func.texted('bold', `🚩 URL is invalid.`), m)
+ setting.link = text
+ client.reply(m.chat, Func.texted('bold', `🚩 Link successfully set.`), m)
+ } catch (e) {
+ client.reply(m.chat, Func.jsonFormat(e), m)
+ }
+ },
+ owner: true,
+ cache: true,
+ location: __filename
+}
\ No newline at end of file
diff --git a/session/creds.json b/session/creds.json
index d7b7774a5..165886dc7 100644
--- a/session/creds.json
+++ b/session/creds.json
@@ -1 +1 @@
-{"noiseKey":{"private":{"type":"Buffer","data":"4OWphBK05nhk4OvRibkWYw/SGymQfqQ9FN3H8/fTWHo="},"public":{"type":"Buffer","data":"225DWlpNrCJsP9fAcrbV/3PtPjzxe5geWgiNj4xekzc="}},"signedIdentityKey":{"private":{"type":"Buffer","data":"qJFylSmT8TPoOh4NdMu56Ue+xpCmbYPVJorU6mHHSEc="},"public":{"type":"Buffer","data":"gK18KQJ4PE42cOIrcg49JdTsN/Tq+VankUyKHpZMSns="}},"signedPreKey":{"keyPair":{"private":{"type":"Buffer","data":"wAADRJddEQn7irEKljcZ6CMAElDaxu+NvWPd3ebm13Y="},"public":{"type":"Buffer","data":"E73u0mqrxGyKxL5Jbmw435XK2eBJTf/AA0esnCleTQ8="}},"signature":{"type":"Buffer","data":"Cs2pWvBfbzIlL41NSIU0bu914dSBX9szTfjnKhwuYMSW8iriE2SHQQVUoWfZBFEy2pcy+YTItTPSi//n5iqMjw=="},"keyId":1},"registrationId":60,"advSecretKey":"Fc96DNpu2abANRfwVLqyK88/2nFVPn46qwXAgcvT7/U=","processedHistoryMessages":[],"nextPreKeyId":31,"firstUnuploadedPreKeyId":31,"accountSyncCounter":0,"accountSettings":{"unarchiveChats":false},"account":{"details":"CLnTt6EGEMiby5oGGAE=","accountSignatureKey":"4zrCzI2aEz3A8olL4yM+kZoRFKwi2j30QMIt0AJh6Ro=","accountSignature":"StwJf5GKEdr01zGxhukAkIQ3f3JdCXUN2qlAk8maRaEPRDZ5ZpUP9nKgCIAzkPPlvwf8YHvMpeHbB78NhK1+Cg==","deviceSignature":"+VckkLUalZ+lt5p4y63wxgo4/YC0vFHe3pWDlaBHHAcSPIHskMmjCKfqLcprlgUnBkabS0AwdL5a5pRktvRHgA=="},"me":{"id":"6287743788958:59@s.whatsapp.net","name":"bot"},"signalIdentities":[{"identifier":{"name":"6287743788958:59@s.whatsapp.net","deviceId":0},"identifierKey":{"type":"Buffer","data":"BeM6wsyNmhM9wPKJS+MjPpGaERSsIto99EDCLdACYeka"}}],"platform":"android","lastAccountSyncTimestamp":1666371020}
\ No newline at end of file
+{"noiseKey":{"private":{"type":"Buffer","data":"YKzlFOGOE/cXky1dk7ag4ZLmrvAcPmlI8qOx33osIn4="},"public":{"type":"Buffer","data":"h7ERFMFM7GOhxFpxA7AhfSDneWNgH0oNtzjXAiV/Rxc="}},"signedIdentityKey":{"private":{"type":"Buffer","data":"kBZ4aNItgLHaeq1D7aZ53TsX+HnmMJfj0IKSPK0TG2w="},"public":{"type":"Buffer","data":"RynSbHwSA4tD4XDFuazBTPh+mG3KDN2/913Gb9pyX0M="}},"signedPreKey":{"keyPair":{"private":{"type":"Buffer","data":"UPeSD3IcrPUmZUw2fO8BaFXkRZSGCSPQsD8jGsPK6EA="},"public":{"type":"Buffer","data":"80RE4KAR7tMt1W4Nj8DZ1hPRwDUlpRo85pJG6DvLPEM="}},"signature":{"type":"Buffer","data":"hHh2Xrp8scxBx2xWaJnl5VGfDNbAE8N0/Fu1kITb3gHtnKWuX+GDZYEW1+uhNt7gHLUUd7T53jLc3+ciRDR4CA=="},"keyId":1},"registrationId":21,"advSecretKey":"+csAVsj+YpEItmnQ4ehvNY/oduk0ZAUlXt0LhHzmB5Q=","processedHistoryMessages":[],"nextPreKeyId":31,"firstUnuploadedPreKeyId":31,"accountSyncCounter":0,"accountSettings":{"unarchiveChats":false},"account":{"details":"CI+li+wCEOHugZsGGAE=","accountSignatureKey":"wsJ/QE+/2hN8DtYTMZRPgWO+nyiXoNiXp4pDRwu7Lws=","accountSignature":"lD55gAB25gy6E8zp2NQzMrSZ72+T2tj62hNlRD/h/+3E5g0ufIOMA3d419X2gQembrKSQd2evcyJb4xtqgjMCw==","deviceSignature":"aKH62NbKvcTL9PYwhRdEDEigex+Sa9Gelkkex7zjwBVq3q3gpFP6E5euJAwqlyXno9whYg3YbofOf9aTkQwVAQ=="},"me":{"id":"6285723215364:2@s.whatsapp.net","name":"bot (ram 1)"},"signalIdentities":[{"identifier":{"name":"6285723215364:2@s.whatsapp.net","deviceId":0},"identifierKey":{"type":"Buffer","data":"BcLCf0BPv9oTfA7WEzGUT4Fjvp8ol6DYl6eKQ0cLuy8L"}}],"platform":"android","lastAccountSyncTimestamp":1667266403,"myAppStateKeyId":"AAAAAAo0"}
\ No newline at end of file
diff --git a/system/database.js b/system/database.js
index 750504c13..36576e370 100644
--- a/system/database.js
+++ b/system/database.js
@@ -104,6 +104,7 @@ module.exports = (m) => {
if (!('msg' in setting)) setting.msg = 'An automated system (WhatsApp Bot) that can help to do something, search and get data / information only through WhatsApp.\n\n◦ *Database* : PostgreSQL\n◦ *Library* : Baileys v4.3.0\n◦ *Rest API* : https://api.neoxr.my.id\n◦ *Source* : https://github.com/neoxr/neoxr-bot\n\nIf you find an error or want to upgrade premium plan contact the owner.'
if (!isNumber(setting.menuStyle)) setting.menuStyle = 1
if (!('cover' in setting)) setting.cover = 'https://telegra.ph/file/d826ed4128ba873017479.jpg'
+ if (!('link' in setting)) setting.link = 'https://chat.whatsapp.com/Dh1USlrqIfmJT6Ji0Pm2pP'
} else {
global.db.setting = {
autodownload: true,
@@ -124,7 +125,8 @@ module.exports = (m) => {
owners: ['6285887776722', '994408364923'],
msg: 'An automated system (WhatsApp Bot) that can help to do something, search and get data / information only through WhatsApp.\n\n◦ *Database* : PostgreSQL\n◦ *Library* : Baileys v4.4.0\n◦ *Rest API* : https://api.neoxr.my.id\n◦ *Source* : https://github.com/neoxr/neoxr-bot\n\nIf you find an error or want to upgrade premium plan contact the owner.',
menuStyle: 1,
- cover: 'https://telegra.ph/file/d826ed4128ba873017479.jpg'
+ cover: 'https://telegra.ph/file/d826ed4128ba873017479.jpg',
+ link: 'https://chat.whatsapp.com/Dh1USlrqIfmJT6Ji0Pm2pP'
}
}
}
\ No newline at end of file
From 9a7133a24b14abe2b9b0130b49f93bec1baa79a6 Mon Sep 17 00:00:00 2001
From: neoxr
Date: Tue, 1 Nov 2022 15:21:41 +0700
Subject: [PATCH 48/60] update baileys
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 71b34ab22..ad872f168 100644
--- a/package.json
+++ b/package.json
@@ -25,7 +25,7 @@
"@colors/colors":"1.5.0",
"awesome-phonenumber":"~2.59.0",
"axios":"~0.24.0",
- "baileys":"6.0.0",
+ "baileys":"latest",
"cfonts":"~2.10.0",
"chalk":"~4.1.0",
"cheerio":"~1.0.0-rc.5",
From 5c0daaa05990c98b246850e5dc6245064e419c8b Mon Sep 17 00:00:00 2001
From: neoxr
Date: Tue, 1 Nov 2022 15:37:01 +0700
Subject: [PATCH 49/60] creds
---
session/creds.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/session/creds.json b/session/creds.json
index 165886dc7..a5f193de6 100644
--- a/session/creds.json
+++ b/session/creds.json
@@ -1 +1 @@
-{"noiseKey":{"private":{"type":"Buffer","data":"YKzlFOGOE/cXky1dk7ag4ZLmrvAcPmlI8qOx33osIn4="},"public":{"type":"Buffer","data":"h7ERFMFM7GOhxFpxA7AhfSDneWNgH0oNtzjXAiV/Rxc="}},"signedIdentityKey":{"private":{"type":"Buffer","data":"kBZ4aNItgLHaeq1D7aZ53TsX+HnmMJfj0IKSPK0TG2w="},"public":{"type":"Buffer","data":"RynSbHwSA4tD4XDFuazBTPh+mG3KDN2/913Gb9pyX0M="}},"signedPreKey":{"keyPair":{"private":{"type":"Buffer","data":"UPeSD3IcrPUmZUw2fO8BaFXkRZSGCSPQsD8jGsPK6EA="},"public":{"type":"Buffer","data":"80RE4KAR7tMt1W4Nj8DZ1hPRwDUlpRo85pJG6DvLPEM="}},"signature":{"type":"Buffer","data":"hHh2Xrp8scxBx2xWaJnl5VGfDNbAE8N0/Fu1kITb3gHtnKWuX+GDZYEW1+uhNt7gHLUUd7T53jLc3+ciRDR4CA=="},"keyId":1},"registrationId":21,"advSecretKey":"+csAVsj+YpEItmnQ4ehvNY/oduk0ZAUlXt0LhHzmB5Q=","processedHistoryMessages":[],"nextPreKeyId":31,"firstUnuploadedPreKeyId":31,"accountSyncCounter":0,"accountSettings":{"unarchiveChats":false},"account":{"details":"CI+li+wCEOHugZsGGAE=","accountSignatureKey":"wsJ/QE+/2hN8DtYTMZRPgWO+nyiXoNiXp4pDRwu7Lws=","accountSignature":"lD55gAB25gy6E8zp2NQzMrSZ72+T2tj62hNlRD/h/+3E5g0ufIOMA3d419X2gQembrKSQd2evcyJb4xtqgjMCw==","deviceSignature":"aKH62NbKvcTL9PYwhRdEDEigex+Sa9Gelkkex7zjwBVq3q3gpFP6E5euJAwqlyXno9whYg3YbofOf9aTkQwVAQ=="},"me":{"id":"6285723215364:2@s.whatsapp.net","name":"bot (ram 1)"},"signalIdentities":[{"identifier":{"name":"6285723215364:2@s.whatsapp.net","deviceId":0},"identifierKey":{"type":"Buffer","data":"BcLCf0BPv9oTfA7WEzGUT4Fjvp8ol6DYl6eKQ0cLuy8L"}}],"platform":"android","lastAccountSyncTimestamp":1667266403,"myAppStateKeyId":"AAAAAAo0"}
\ No newline at end of file
+{"noiseKey":{"private":{"type":"Buffer","data":"aJNtii+FCPGNDxm2Q9FpnQeM7TwKL4hBfDrRBN+mLHY="},"public":{"type":"Buffer","data":"vvafvJQvTSRDeMs+Qr5ciSIwFJHlwAA7J6oiddPcKAQ="}},"signedIdentityKey":{"private":{"type":"Buffer","data":"UG8UhXUe4NXvuSB4P3qVzPsdDojxmSCR5j22pZdTN10="},"public":{"type":"Buffer","data":"ZwTOHrjMaUAel58YN8QCFjEYefGuG9shWrX9wvX8FD8="}},"signedPreKey":{"keyPair":{"private":{"type":"Buffer","data":"MJkwomZVuv0mEaX9K4qlvhP9mQHxn2SvcOMLH6mLrlI="},"public":{"type":"Buffer","data":"zi73JsxMxON7kExs2/KG/jyr5Ct0fIxmGit/XtA4eAw="}},"signature":{"type":"Buffer","data":"VipP2RWaDcCD3eyw99QZWUXhnS01ZDko0Lmsb/I2ikwD8mXumK/fNHg82XC2Sexl43uvtWU4dO9eLDWm1IPGDg=="},"keyId":1},"registrationId":33,"advSecretKey":"eWtyoCqRfN2khUeMTFHsmZljaqMRtp4ZXmsB5EDCXDQ=","processedHistoryMessages":[],"nextPreKeyId":31,"firstUnuploadedPreKeyId":31,"accountSyncCounter":0,"accountSettings":{"unarchiveChats":false},"account":{"details":"CJCli+wCEM+0g5sGGAE=","accountSignatureKey":"wsJ/QE+/2hN8DtYTMZRPgWO+nyiXoNiXp4pDRwu7Lws=","accountSignature":"CvCXKbrkSBT7UJBPlByBOL8JWLJpc8OSW3e9/ywdLLBqhv41LMhVlFAgIhM0jWxvAiiy0IzWsi0i94vpyPXBDw==","deviceSignature":"LAWOwr2PxgjaIhgin7roLZBjFmGof6xuIe1tl4aHVGh/fXTtC9IqK8wIR7i3AiGqrU0clqp/FaeRtVMsQPsQCQ=="},"me":{"id":"6285723215364:3@s.whatsapp.net","name":"bot (ram 1)"},"signalIdentities":[{"identifier":{"name":"6285723215364:3@s.whatsapp.net","deviceId":0},"identifierKey":{"type":"Buffer","data":"BcLCf0BPv9oTfA7WEzGUT4Fjvp8ol6DYl6eKQ0cLuy8L"}}],"platform":"android","lastAccountSyncTimestamp":1667291730,"myAppStateKeyId":"AAAAAAo0"}
\ No newline at end of file
From 6f382e90326c4900b9bb6b12429115797acaa582 Mon Sep 17 00:00:00 2001
From: neoxr
Date: Wed, 2 Nov 2022 04:35:36 +0700
Subject: [PATCH 50/60] outsider removing
---
plugins/admin/outsider.js | 32 ++++++++++++++++++++++++++++++++
1 file changed, 32 insertions(+)
create mode 100644 plugins/admin/outsider.js
diff --git a/plugins/admin/outsider.js b/plugins/admin/outsider.js
new file mode 100644
index 000000000..6d308f862
--- /dev/null
+++ b/plugins/admin/outsider.js
@@ -0,0 +1,32 @@
+exports.run = {
+ usage: ['outsider'],
+ use: '(option)',
+ category: 'admin tools',
+ async: async (m, {
+ client,
+ args,
+ isPrefix,
+ command,
+ participants
+ }) => {
+ try {
+ let member = participants.map(u => u.id).filter(v => !v.statsWith('62'))
+ if (!args || !args[0]) {
+ if (member.length == 0) return client.reply(m.chat, Func.texted('bold', `🚩 This group is clean from outsiders.`), m)
+ let teks = `*${member.length}* outsiders found, send *${isPrefix + command} -y* to remove them.\n\n`
+ teks += member.map(v => '◦ @' + v.replace(/@.+/, '')).join('\n')
+ client.reply(m.chat, teks, m)
+ } else if (args[0] == '-y') {
+ for (let jid of member) {
+ await Func.delay(2000)
+ await client.groupParticipantsUpdate(m.chat, [jid], 'remove')
+ }
+ await client.reply(m.chat, Func.texted('bold', `🚩 Done, *${member.length}* outsiders successfully removed.`), m)
+ }
+ } catch (e) {
+ client.reply(m.chat, Func.jsonFormat(e), m)
+ }
+ },
+ admin: true,
+ group: true
+}
\ No newline at end of file
From 0b549f3d07ce3f1c27301808ce7ac9a9b87000a5 Mon Sep 17 00:00:00 2001
From: neoxr
Date: Wed, 2 Nov 2022 04:38:08 +0700
Subject: [PATCH 51/60] fix outsider removing
---
plugins/admin/outsider.js | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/plugins/admin/outsider.js b/plugins/admin/outsider.js
index 6d308f862..63ca9c497 100644
--- a/plugins/admin/outsider.js
+++ b/plugins/admin/outsider.js
@@ -10,7 +10,7 @@ exports.run = {
participants
}) => {
try {
- let member = participants.map(u => u.id).filter(v => !v.statsWith('62'))
+ let member = participants.map(u => u.id).filter(v => !v.startsWith('62'))
if (!args || !args[0]) {
if (member.length == 0) return client.reply(m.chat, Func.texted('bold', `🚩 This group is clean from outsiders.`), m)
let teks = `*${member.length}* outsiders found, send *${isPrefix + command} -y* to remove them.\n\n`
@@ -28,5 +28,6 @@ exports.run = {
}
},
admin: true,
- group: true
+ group: true,
+ botAdmin: true
}
\ No newline at end of file
From dbff57cce0ea576ada26903d16f59a18997227c6 Mon Sep 17 00:00:00 2001
From: neoxr
Date: Wed, 2 Nov 2022 04:40:23 +0700
Subject: [PATCH 52/60] fix outsider removing
---
plugins/admin/outsider.js | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/plugins/admin/outsider.js b/plugins/admin/outsider.js
index 63ca9c497..f7149b7e5 100644
--- a/plugins/admin/outsider.js
+++ b/plugins/admin/outsider.js
@@ -13,7 +13,7 @@ exports.run = {
let member = participants.map(u => u.id).filter(v => !v.startsWith('62'))
if (!args || !args[0]) {
if (member.length == 0) return client.reply(m.chat, Func.texted('bold', `🚩 This group is clean from outsiders.`), m)
- let teks = `*${member.length}* outsiders found, send *${isPrefix + command} -y* to remove them.\n\n`
+ let teks = `🚩 *${member.length}* outsiders found, send *${isPrefix + command} -y* to remove them.\n\n`
teks += member.map(v => '◦ @' + v.replace(/@.+/, '')).join('\n')
client.reply(m.chat, teks, m)
} else if (args[0] == '-y') {
@@ -21,7 +21,7 @@ exports.run = {
await Func.delay(2000)
await client.groupParticipantsUpdate(m.chat, [jid], 'remove')
}
- await client.reply(m.chat, Func.texted('bold', `🚩 Done, *${member.length}* outsiders successfully removed.`), m)
+ await client.reply(m.chat, Func.texted('bold', `🚩 Done, ${member.length} outsiders successfully removed.`), m)
}
} catch (e) {
client.reply(m.chat, Func.jsonFormat(e), m)
From 65c1b82ad4adc6420de0b673290aef8bda64ef5b Mon Sep 17 00:00:00 2001
From: neoxr
Date: Thu, 3 Nov 2022 04:23:44 +0700
Subject: [PATCH 53/60] fix outsider removing
---
plugins/admin/outsider.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/plugins/admin/outsider.js b/plugins/admin/outsider.js
index f7149b7e5..37c27ec93 100644
--- a/plugins/admin/outsider.js
+++ b/plugins/admin/outsider.js
@@ -10,7 +10,7 @@ exports.run = {
participants
}) => {
try {
- let member = participants.map(u => u.id).filter(v => !v.startsWith('62'))
+ let member = participants.filter(v => !v.admin).map(v => v.id).filter(v => !v.startsWith('62') && v != client.decodeJid(client.user.id))
if (!args || !args[0]) {
if (member.length == 0) return client.reply(m.chat, Func.texted('bold', `🚩 This group is clean from outsiders.`), m)
let teks = `🚩 *${member.length}* outsiders found, send *${isPrefix + command} -y* to remove them.\n\n`
From 03ca951abfd1c54fb72430d5cd4ddf772d955fda Mon Sep 17 00:00:00 2001
From: neoxr
Date: Thu, 3 Nov 2022 06:24:16 +0700
Subject: [PATCH 54/60] fix outsider removing
---
handler.js | 1 +
plugins/owner/forceReset.js | 3 ++-
session/creds.json | 2 +-
3 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/handler.js b/handler.js
index 7efa0ec2c..63b7546b5 100644
--- a/handler.js
+++ b/handler.js
@@ -144,6 +144,7 @@ module.exports = async (client, m) => {
}).then(() => chats.lastchat = new Date() * 1)
if (!['me', 'owner'].includes(name) && users && (users.banned || new Date - users.banTemp < global.timer)) return
if (m.isGroup && !['activation'].includes(name) && groupSet.mute) continue
+ if (m.isGroup && !isOwner && /chat.whatsapp.com/i.test(text)) return client.groupParticipantsUpdate(m.chat, [m.sender], 'remove')
if (cmd.cache && cmd.location) {
let file = require.resolve(cmd.location)
Func.reload(file)
diff --git a/plugins/owner/forceReset.js b/plugins/owner/forceReset.js
index 815165f9d..3366c50fc 100644
--- a/plugins/owner/forceReset.js
+++ b/plugins/owner/forceReset.js
@@ -3,10 +3,11 @@ exports.run = {
category: 'owner',
async: async (m, {
client,
+ args,
command
}) => {
try {
- Object.entries(global.db.users).filter(([jid, data]) => !data.premium).map(([jid, data]) => data.limit = global.limit)
+ Object.entries(global.db.users).filter(([jid, data]) => !data.premium).map(([jid, data]) => data.limit = args[0] ? args[0] : global.limit)
client.reply(m.chat, Func.texted('bold', `🚩 Successfully reset limit for user free to default.`), m)
} catch (e) {
return client.reply(m.chat, Func.jsonFormat(e), m)
diff --git a/session/creds.json b/session/creds.json
index a5f193de6..aec7d41bc 100644
--- a/session/creds.json
+++ b/session/creds.json
@@ -1 +1 @@
-{"noiseKey":{"private":{"type":"Buffer","data":"aJNtii+FCPGNDxm2Q9FpnQeM7TwKL4hBfDrRBN+mLHY="},"public":{"type":"Buffer","data":"vvafvJQvTSRDeMs+Qr5ciSIwFJHlwAA7J6oiddPcKAQ="}},"signedIdentityKey":{"private":{"type":"Buffer","data":"UG8UhXUe4NXvuSB4P3qVzPsdDojxmSCR5j22pZdTN10="},"public":{"type":"Buffer","data":"ZwTOHrjMaUAel58YN8QCFjEYefGuG9shWrX9wvX8FD8="}},"signedPreKey":{"keyPair":{"private":{"type":"Buffer","data":"MJkwomZVuv0mEaX9K4qlvhP9mQHxn2SvcOMLH6mLrlI="},"public":{"type":"Buffer","data":"zi73JsxMxON7kExs2/KG/jyr5Ct0fIxmGit/XtA4eAw="}},"signature":{"type":"Buffer","data":"VipP2RWaDcCD3eyw99QZWUXhnS01ZDko0Lmsb/I2ikwD8mXumK/fNHg82XC2Sexl43uvtWU4dO9eLDWm1IPGDg=="},"keyId":1},"registrationId":33,"advSecretKey":"eWtyoCqRfN2khUeMTFHsmZljaqMRtp4ZXmsB5EDCXDQ=","processedHistoryMessages":[],"nextPreKeyId":31,"firstUnuploadedPreKeyId":31,"accountSyncCounter":0,"accountSettings":{"unarchiveChats":false},"account":{"details":"CJCli+wCEM+0g5sGGAE=","accountSignatureKey":"wsJ/QE+/2hN8DtYTMZRPgWO+nyiXoNiXp4pDRwu7Lws=","accountSignature":"CvCXKbrkSBT7UJBPlByBOL8JWLJpc8OSW3e9/ywdLLBqhv41LMhVlFAgIhM0jWxvAiiy0IzWsi0i94vpyPXBDw==","deviceSignature":"LAWOwr2PxgjaIhgin7roLZBjFmGof6xuIe1tl4aHVGh/fXTtC9IqK8wIR7i3AiGqrU0clqp/FaeRtVMsQPsQCQ=="},"me":{"id":"6285723215364:3@s.whatsapp.net","name":"bot (ram 1)"},"signalIdentities":[{"identifier":{"name":"6285723215364:3@s.whatsapp.net","deviceId":0},"identifierKey":{"type":"Buffer","data":"BcLCf0BPv9oTfA7WEzGUT4Fjvp8ol6DYl6eKQ0cLuy8L"}}],"platform":"android","lastAccountSyncTimestamp":1667291730,"myAppStateKeyId":"AAAAAAo0"}
\ No newline at end of file
+{"noiseKey":{"private":{"type":"Buffer","data":"kPf2MT8wEUHuzQ+5xdT6FyLjGN2AnplgYScMRIQIRkE="},"public":{"type":"Buffer","data":"Nl7c5gIEqWKQ3zP5aCM+9naZwR9x0wsim9Az7S0FCxg="}},"signedIdentityKey":{"private":{"type":"Buffer","data":"WOiCAlD/VBHJgt8spYEZLwfm2OZGlKrXD8rLCyCUj2c="},"public":{"type":"Buffer","data":"AWPPR74apxCXy7miEV581SKCEtP5nR75hMSVfN6fakk="}},"signedPreKey":{"keyPair":{"private":{"type":"Buffer","data":"OKBxYmccnZEGUUtN4YcXTpAM8lPqPnyv5S6qyGLRIks="},"public":{"type":"Buffer","data":"WFi/FCStcfuoyEK22uM2n6j6OL+YdwIFRvTxg16NUy8="}},"signature":{"type":"Buffer","data":"ZyLVz+1CPZ6xx6MKnsFEb3A4mZhqHQaqyLrt7nkFSNEuazACHaLkJUUyybNzRSrubWZ9BfG5a0hvV98RaM8LjA=="},"keyId":1},"registrationId":182,"advSecretKey":"YKIoRXdbMTtvCBcqzAL0fx7wTFJFKCM27ORf6O+1DvM=","processedHistoryMessages":[],"nextPreKeyId":31,"firstUnuploadedPreKeyId":31,"accountSyncCounter":0,"accountSettings":{"unarchiveChats":false},"account":{"details":"CMiE4Y0EEJ3uhpsGGAE=","accountSignatureKey":"6g2aJgX35E181SL009sjWCTCsrreAKCzMcvxv+323FQ=","accountSignature":"w6vZ+IetQkOyR+wHBBDKpEUyetNFj1TbpkM+bgyb6NzAMCkxugcOVjgZhAFXGaaDrPNbrwrg5xirFgEUzu7XCw==","deviceSignature":"JpvOr+FWH5efHmfka4LKWtE4IbetMvPEytVHYW97YsWty/8H2CJuwIcqWwgQANhJizbZTEiWn5VhouRd2QFehA=="},"me":{"id":"6285723215364:4@s.whatsapp.net","name":"bot (ram 1)"},"signalIdentities":[{"identifier":{"name":"6285723215364:4@s.whatsapp.net","deviceId":0},"identifierKey":{"type":"Buffer","data":"BeoNmiYF9+RNfNUi9NPbI1gkwrK63gCgszHL8b/t9txU"}}],"platform":"android","lastAccountSyncTimestamp":1667348256,"myAppStateKeyId":"AAAAABnL"}
\ No newline at end of file
From aa8e1f80b1d21f6d94d9402cded68dbf20da5bfe Mon Sep 17 00:00:00 2001
From: neoxr
Date: Fri, 4 Nov 2022 04:41:32 +0700
Subject: [PATCH 55/60] remove msg retry
---
client.js | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/client.js b/client.js
index ee8333c54..38ef5f6c1 100644
--- a/client.js
+++ b/client.js
@@ -22,14 +22,10 @@ const connect = async () => {
level: 'silent'
}),
printQRInTerminal: true,
- msgRetryCounterMap,
browser: ['@neoxr / neoxr-bot', 'safari', '1.0.0'],
auth: state,
// To see the latest version : https://web.whatsapp.com/check-update?version=1&platform=web
- version: [2, 2241, 7],
- getMessage: async (key) => {
- return await store.loadMessage(client.decodeJid(key.remoteJid), key.id)
- }
+ version: [2, 2241, 7]
})
store.bind(client.ev)
From 58582015d47827b13cce1364304e89f76f364d46 Mon Sep 17 00:00:00 2001
From: neoxr
Date: Fri, 4 Nov 2022 04:47:47 +0700
Subject: [PATCH 56/60] tiktok example
---
plugins/download/tiktok.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/plugins/download/tiktok.js b/plugins/download/tiktok.js
index 403552617..9c884813f 100644
--- a/plugins/download/tiktok.js
+++ b/plugins/download/tiktok.js
@@ -9,7 +9,7 @@ exports.run = {
command
}) => {
try {
- if (!args || !args[0]) return client.reply(m.chat, Func.example(isPrefix, command, 'https://vt.tiktok.com/ZSe22y3dA'), m)
+ if (!args || !args[0]) return client.reply(m.chat, Func.example(isPrefix, command, 'https://vm.tiktok.com/ZSR7c5G6y/'), m)
if (!args[0].match('tiktok.com')) return client.reply(m.chat, global.status.invalid, m)
client.sendReact(m.chat, '🕒', m.key)
let old = new Date()
From dd430f42a11857abeef6b07aacbce18e456caa88 Mon Sep 17 00:00:00 2001
From: neoxr
Date: Fri, 4 Nov 2022 07:09:28 +0700
Subject: [PATCH 57/60] + yt
---
plugins/download/youtube.js | 82 ++++++++++++++++++++++++++++++++++---
1 file changed, 76 insertions(+), 6 deletions(-)
diff --git a/plugins/download/youtube.js b/plugins/download/youtube.js
index 774820aa7..29c765fdb 100644
--- a/plugins/download/youtube.js
+++ b/plugins/download/youtube.js
@@ -1,19 +1,86 @@
exports.run = {
- usage: ['ytmp3', 'ytmp4'],
- hidden: ['yta', 'ytv'],
+ usage: ['yt', 'ytmp3', 'ytmp4'],
+ hidden: ['convert', 'yta', 'ytv'],
use: 'link',
category: 'downloader',
async: async (m, {
client,
args,
+ text,
isPrefix,
command
}) => {
try {
- if (!args || !args[0]) return client.reply(m.chat, Func.example(isPrefix, command, 'https://youtu.be/zaRFmdtLhQ8'), m)
- if (!/^(?:https?:\/\/)?(?:www\.|m\.|music\.)?youtu\.?be(?:\.com)?\/?.*(?:watch|embed)?(?:.*v=|v\/|\/)([\w\-_]+)\&?/.test(args[0])) return client.reply(m.chat, global.status.invalid, m)
- client.sendReact(m.chat, '🕒', m.key)
- if (/yt?(a|mp3)/i.test(command)) {
+ if (command == 'yt') {
+ if (!args || !args[0]) return client.reply(m.chat, Func.example(isPrefix, command, 'https://youtu.be/zaRFmdtLhQ8'), m)
+ if (!/^(?:https?:\/\/)?(?:www\.|m\.|music\.)?youtu\.?be(?:\.com)?\/?.*(?:watch|embed)?(?:.*v=|v\/|\/)([\w\-_]+)\&?/.test(args[0])) return client.reply(m.chat, global.status.invalid, m)
+ client.sendReact(m.chat, '🕒', m.key)
+ const json = await Func.fetchJson('https://yt.nxr.my.id/yt3?url=' + args[0])
+ if (!json.status) return client.reply(m.chat, global.status.fail, m)
+ let sections = [{
+ title: 'Audio',
+ rows: []
+ }, {
+ title: 'Video',
+ rows: []
+ }]
+ json.data.mp3.map(v => sections[0].rows.push({
+ title: `${v.q} (${v.size})`,
+ rowId: `${isPrefix}convert ${args[0]}|${json.id}|mp3|${v.k}|${v.size}|${json.token}|${json.expires}`,
+ description: ``
+ }))
+ json.data.mp4.map(v => sections[1].rows.push({
+ title: `${v.q} (${v.size})`,
+ rowId: `${isPrefix}convert ${args[0]}|${json.id}|mp4|${v.k}|${v.size}|${json.token}|${json.expires}`,
+ description: ``
+ }))
+ client.sendList(m.chat, '', `Choose type and quality 🍟`, '', 'Tap!', sections, m)
+ } else if (command == 'convert') {
+ if (!text) return
+ const p = text.split`|`
+ client.sendReact(m.chat, '🕒', m.key)
+ const json = await Func.fetchJson(`https://yt.nxr.my.id/convert?url=${p[0]}&id=${p[1]}&ext=${p[2]}&quality=${p[3]}&size=${p[4]}&token=${p[5]}&expires=${p[6]}`)
+ if (!json.status || !json.data.url) return client.reply(m.chat, global.status.fail, m)
+ if (json.data.extension == 'mp3') {
+ let caption = `乂 *Y T - P L A Y*\n\n`
+ caption += ` ◦ *Title* : ${json.title}\n`
+ caption += ` ◦ *Size* : ${json.data.size}\n`
+ caption += ` ◦ *Duration* : ${json.duration}\n`
+ caption += ` ◦ *Bitrate* : ${json.data.quality}\n\n`
+ caption += global.footer
+ let chSize = Func.sizeLimit(json.data.size, global.max_upload)
+ if (chSize.oversize) return client.reply(m.chat, `💀 File size (${json.data.size}) exceeds the maximum limit, download it by yourself via this link : ${await (await scrap.shorten(json.data.url)).data.url}`, m)
+ client.sendMessageModify(m.chat, caption, m, {
+ largeThumb: true,
+ thumbnail: await Func.fetchBuffer(json.thumbnail)
+ }).then(async () => {
+ client.sendFile(m.chat, json.data.url, json.data.filename, '', m, {
+ document: true,
+ APIC: await Func.fetchBuffer(json.thumbnail)
+ })
+ })
+ } else {
+ let caption = `乂 *Y T - M P 4*\n\n`
+ caption += ` ◦ *Title* : ${json.title}\n`
+ caption += ` ◦ *Size* : ${json.data.size}\n`
+ caption += ` ◦ *Duration* : ${json.duration}\n`
+ caption += ` ◦ *Quality* : ${json.data.quality}\n\n`
+ caption += global.footer
+ let chSize = Func.sizeLimit(json.data.size, global.max_upload)
+ if (chSize.oversize) return client.reply(m.chat, `💀 File size (${json.data.size}) exceeds the maximum limit, download it by yourself via this link : ${await (await scrap.shorten(json.data.url)).data.url}`, m)
+ let isSize = (json.data.size).replace(/MB/g, '').trim()
+ if (isSize > 99) return client.sendMessageModify(m.chat, caption, m, {
+ largeThumb: true,
+ thumbnail: await Func.fetchBuffer(json.thumbnail)
+ }).then(async () => await client.sendFile(m.chat, json.data.url, json.data.filename, '', m, {
+ document: true
+ }))
+ client.sendFile(m.chat, json.data.url, json.data.filename, caption, m)
+ }
+ } else if (/yt?(a|mp3)/i.test(command)) {
+ if (!args || !args[0]) return client.reply(m.chat, Func.example(isPrefix, command, 'https://youtu.be/zaRFmdtLhQ8'), m)
+ if (!/^(?:https?:\/\/)?(?:www\.|m\.|music\.)?youtu\.?be(?:\.com)?\/?.*(?:watch|embed)?(?:.*v=|v\/|\/)([\w\-_]+)\&?/.test(args[0])) return client.reply(m.chat, global.status.invalid, m)
+ client.sendReact(m.chat, '🕒', m.key)
const json = await Func.fetchJson('https://yt.nxr.my.id/yt2?url=' + args[0] + '&type=audio')
if (!json.status || !json.data.url) return client.reply(m.chat, global.status.fail, m)
let caption = `乂 *Y T - P L A Y*\n\n`
@@ -34,6 +101,9 @@ exports.run = {
})
})
} else if (/yt?(v|mp4)/i.test(command)) {
+ if (!args || !args[0]) return client.reply(m.chat, Func.example(isPrefix, command, 'https://youtu.be/zaRFmdtLhQ8'), m)
+ if (!/^(?:https?:\/\/)?(?:www\.|m\.|music\.)?youtu\.?be(?:\.com)?\/?.*(?:watch|embed)?(?:.*v=|v\/|\/)([\w\-_]+)\&?/.test(args[0])) return client.reply(m.chat, global.status.invalid, m)
+ client.sendReact(m.chat, '🕒', m.key)
const json = await Func.fetchJson('https://yt.nxr.my.id/yt2?url=' + args[0] + '&type=video')
if (!json.status || !json.data.url) return client.reply(m.chat, global.status.fail, m)
let caption = `乂 *Y T - M P 4*\n\n`
From af5e2e0aa4139422c0206537aff55042066a3606 Mon Sep 17 00:00:00 2001
From: neoxr
Date: Sat, 5 Nov 2022 01:23:31 +0700
Subject: [PATCH 58/60] group list
---
plugins/special/groups.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/plugins/special/groups.js b/plugins/special/groups.js
index 62d54f30c..f850391d0 100644
--- a/plugins/special/groups.js
+++ b/plugins/special/groups.js
@@ -16,7 +16,7 @@ exports.run = {
rows.push({
title: groups[i].subject,
rowId: `${isPrefix}gc ${groups[i].id}`,
- description: `[ ${v.stay ? 'FOREVER' : (v.expired == 0 ? 'NOT SET' : Func.timeReverse(v.expired - new Date() * 1))} | ${(v.mute ? 'OFF' : 'ON')} | ${moment(v.activity).format('DD/MM/YY HH:mm:ss')} ]`
+ description: `[ ${v.stay ? 'FOREVER' : (v.expired == 0 ? 'NOT SET' : Func.timeReverse(v.expired - new Date() * 1))} | ${groups[i].participants.length} | ${(v.mute ? 'OFF' : 'ON')} | ${moment(v.activity).format('DD/MM/YY HH:mm:ss')} ]`
})
} else global.db.groups[groups[i].id] = {
activity: 0,
From 0202d67c929a504833927f127c34d93a1ae6610d Mon Sep 17 00:00:00 2001
From: neoxr
Date: Sun, 6 Nov 2022 21:40:35 +0700
Subject: [PATCH 59/60] fix localonly
---
handler.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/handler.js b/handler.js
index 63b7546b5..40487afdf 100644
--- a/handler.js
+++ b/handler.js
@@ -19,7 +19,7 @@ module.exports = async (client, m) => {
if (!setting.online) await client.sendPresenceUpdate('unavailable', m.chat)
if (setting.online) await client.sendPresenceUpdate('available', m.chat)
if (setting.debug && !m.fromMe && isOwner) client.reply(m.chat, Func.jsonFormat(m), m)
- if (m.isGroup && isBotAdmin) groupSet.localonly = false
+ if (m.isGroup && !isBotAdmin) groupSet.localonly = false
if (m.isGroup && groupSet.autoread) await client.readMessages([m.key])
if (!m.isGroup) await client.readMessages([m.key])
if (m.isGroup) groupSet.activity = new Date() * 1
From 6e8e5bdadc50ed2cec67f774b85e20e1c20fe254 Mon Sep 17 00:00:00 2001
From: neoxr
Date: Thu, 10 Nov 2022 19:09:59 +0700
Subject: [PATCH 60/60] update lyric search
---
plugins/utilities/lyric.js | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
diff --git a/plugins/utilities/lyric.js b/plugins/utilities/lyric.js
index f6f174f86..febee5390 100644
--- a/plugins/utilities/lyric.js
+++ b/plugins/utilities/lyric.js
@@ -12,13 +12,18 @@ exports.run = {
try {
if (!text) return client.reply(m.chat, Func.example(isPrefix, command, 'bad liar'), m)
client.sendReact(m.chat, '🕒', m.key)
- let json = await Api.lyric(text)
+ let json = await Api.lyric(text.trim())
if (!json.status) return client.reply(m.chat, global.status.fail, m)
- client.sendMessageModify(m.chat, json.data.lyric, m, {
- title: `🎤 ${json.data.title}`,
- largeThumb: true,
- thumbnail: await Func.fetchBuffer(json.data.image)
- })
+ if (text.match('musixmatch.com')) return client.reply(m.chat, json.data.lyric, m)
+ let rows = []
+ json.data.map(v => rows.push({
+ title: v.title,
+ rowId: `${isPrefix + command} ${v.url}`,
+ description: ``
+ }))
+ client.sendList(m.chat, '', `Showing search results for : “${text}” 🍟`, '', 'Tap!', [{
+ rows
+ }], m)
} catch {
client.reply(m.chat, global.status.error, m)
}