Skip to content

Commit 8bf024d

Browse files
authored
Merge branch 'amiruldev20:main' into main
2 parents ee64b0a + 51f9d46 commit 8bf024d

20 files changed

+276
-54
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@
33
node_modules
44
temp
55
temp/*
6+
.idx
67

78
# files
9+
tes.js
810
mywadb.json
911
up.sh
1012
load.sh

client.js

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
/*
2-
terimakasih telah menggunakan source code saya. apabila ada masalah, silahkan hubungi saya:
2+
terimakasih telah menggunakan source code saya. apabila ada masalah, silahkan hubungi saya
3+
4+
Thank you for using my source code. If there is a problem, please contact me
5+
36
- Facebook: fb.com/amiruldev.ci
47
- Instagram: instagram.com/amirul.dev
58
- Telegram: t.me/amiruldev20
69
- Github: @amiruldev20
10+
- WhatsApp: 085157489446
711
*/
812

913
/* module external */
@@ -60,7 +64,6 @@ if (!db || Object.keys(db).length === 0) {
6064
}
6165
let phone = db?.setting?.number
6266
const handler = new CommandHandler()
63-
6467
const loadFile = async (filePath) => {
6568
try {
6669
const resolvedPath = path.resolve(filePath)
@@ -135,16 +138,16 @@ function watchDirectory(dirPath) {
135138
const isSupportedFile = ['.js', '.cjs', '.mjs'].some(ext => filename.endsWith(ext))
136139

137140
if (stats.isFile() && isSupportedFile) {
138-
console.log(`[INFO] File changed or added: ${filename}`)
141+
console.log(color.cyan(`[INFO] File updated: ${filename}`))
139142
await loadFile(filePath)
140143
} else if (stats.isDirectory()) {
141-
console.log(`[INFO] Directory added: ${filename}`)
144+
console.log(color.green(`[INFO] Directory added: ${filename}`))
142145
await processDirectory(filePath)
143146
watchDirectory(filePath)
144147
}
145148
} catch (err) {
146149
if (err.code === 'ENOENT') {
147-
console.log(`[INFO] File or directory removed: ${filename}`)
150+
console.log(color.red(`[INFO] File or directory removed: ${filename}`))
148151
handler.clear()
149152
await loadCommands(cmdDir)
150153
} else {
@@ -351,6 +354,7 @@ async function connectWA() {
351354
for (const update of updates) {
352355
const id = update.id
353356
if (db.groupMetadata[id]) {
357+
console.log(color.green('[+] Group Metadata Updated!!'))
354358
db.groupMetadata[id] = {
355359
...(db.groupMetadata[id] || {}),
356360
...(update || {})
@@ -377,6 +381,7 @@ async function connectWA() {
377381
for (const participant of metadata.participants) {
378382
const id = baileys.jidNormalizedUser(participant.id)
379383
if (participants.includes(id)) {
384+
console.log(`${color.green(`[ ${action} ]`)} ${id.split("@")[0]} in group ${color.cyan(metadata.subject)}`)
380385
participant.admin =
381386
action === "promote" ? "admin" : null
382387
}
@@ -394,7 +399,7 @@ async function connectWA() {
394399
// interval save db
395400
setInterval(async () => {
396401
await mydb.write(db)
397-
}, 30000)
402+
}, 3000)
398403
}
399404

400405
connectWA()

cmd/ai/chatgpt.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import axios from 'axios'
2-
2+
// pr from @Abuzzpoet
33
export default (handler) => {
44
handler.reg({
55
cmd: ['chatgpt', 'openai'],
@@ -19,8 +19,7 @@ export default (handler) => {
1919

2020
return response.data.result
2121
} catch (error) {
22-
console.error("Terjadi kesalahan:", error.message)
23-
throw new Error("Gagal mendapatkan respons dari AI.")
22+
return error
2423
}
2524
}
2625

@@ -30,9 +29,8 @@ export default (handler) => {
3029
const result = await fetchWithModel(budy, model)
3130

3231
const output = typeof result === 'object' ? JSON.stringify(result, null, 2) : result
33-
m.reply(output)
34-
} catch (error) {
35-
console.error("Error:", error.message)
32+
m.reply(output, true)
33+
} catch {
3634
m.reply("Terjadi kesalahan dalam mendapatkan respons.", true)
3735
}
3836
},

cmd/ai/claude.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import axios from 'axios'
2+
// pr from @Abuzzpoet
23
export default (handler) => {
34
handler.reg({
45
cmd: ['claude', 'claudeai'],
@@ -18,18 +19,16 @@ export default (handler) => {
1819

1920
return response.data.result
2021
} catch (error) {
21-
console.error("Terjadi kesalahan:", error.message)
22-
throw new Error("Gagal mendapatkan respons dari AI.")
22+
return error
2323
}
2424
}
2525

2626
try {
2727
const model = 'claude-sonnet-3.5'
2828
const result = await fetchWithModel(m.quoted ? m.quoted.body : m.text, model)
2929
const output = typeof result === 'object' ? JSON.stringify(result, null, 2) : result
30-
m.reply(output)
31-
} catch (error) {
32-
console.error("Error:", error.message)
30+
m.reply(output, true)
31+
} catch {
3332
m.reply("Terjadi kesalahan dalam mendapatkan respons.", true)
3433
}
3534
},

cmd/ai/gemini.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import axios from 'axios'
2-
2+
// pr from @Abuzzpoet
33
export default (handler) => {
44
handler.reg({
55
cmd: ['gemini', 'geminiai'],
@@ -19,8 +19,7 @@ export default (handler) => {
1919

2020
return response.data.result
2121
} catch (error) {
22-
console.error("Terjadi kesalahan:", error.message)
23-
throw new Error("Gagal mendapatkan respons dari AI.")
22+
return error
2423
}
2524
}
2625

@@ -29,9 +28,8 @@ export default (handler) => {
2928
const model = 'gemini-pro'
3029
const result = await fetchWithModel(budy, model)
3130
const output = typeof result === 'object' ? JSON.stringify(result, null, 2) : result
32-
m.reply(output)
33-
} catch (error) {
34-
console.error("Error:", error.message)
31+
m.reply(output, true)
32+
} catch {
3533
m.reply("Terjadi kesalahan dalam mendapatkan respons.", true)
3634
}
3735
},

cmd/ai/luminai.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import axios from 'axios'
2-
2+
// pr from @Abuzzpoet
33
export default (handler) => {
44
handler.reg({
55
cmd: ['lumin', 'luminai'],
@@ -19,8 +19,7 @@ export default (handler) => {
1919

2020
return response.data.result
2121
} catch (error) {
22-
console.error("Terjadi kesalahan:", error.message)
23-
throw new Error("Gagal mendapatkan respons dari AI.")
22+
return error
2423
}
2524
}
2625

@@ -31,7 +30,6 @@ export default (handler) => {
3130
const output = typeof result === 'object' ? JSON.stringify(result, null, 2) : result
3231
m.reply(output)
3332
} catch (error) {
34-
console.error("Error:", error.message)
3533
m.reply("Terjadi kesalahan dalam mendapatkan respons.", true)
3634
}
3735
},

cmd/downloader/facebook.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ export default (handler) => {
88
isLimit: true,
99
run: async (m, { sock, func }) => {
1010
if (!m.text) return m.reply('Silahkan masukan link facebook/contoh: .fb https://www.facebook.com/100084113192055/videos/1260496541801423/?mibextid=BXdpk9X53FVjvJiK', true)
11-
const scrape = await func.loads("amiruldev/fbdl.js")
12-
const ok = await scrape(cheerio, m.text)
13-
if (!ok.result.url) return m.reply('Permintaan tidak dapat diproses!!', true)
11+
const scrape = await func.loads("amiruldev/aio.js")
12+
const ok = await scrape(func, m.text)
13+
if (!ok.response.gif) return m.reply('Permintaan tidak dapat diproses!!', true)
1414
await m.react("⏱️")
15-
await sock.sendMedia(m.from, ok.result.hd, m, { fileName: 'FBDL-MyWABOT.mp4' })
15+
await sock.sendMedia(m.from, ok.response.gif.url, m, { fileName: 'FBDL-MyWABOT.mp4' })
1616
m.react("✅")
1717
}
1818
})

cmd/downloader/instagram.cjs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ module.exports = (handler) => {
99
run: async (m, { sock, func }) => {
1010
if (!m.text) return m.reply('Silahkan masukan link instagram (support reel/story)', true)
1111
const scrape = await func.loads("amiruldev/igdl.js")
12-
const ok = await scrape(axios, m.text)
13-
if (!ok.status) return m.reply('Permintaan tidak dapat diproses!!', true)
12+
const ok = await scrape(func, m.text)
13+
14+
if (!ok.data) return m.reply('Permintaan tidak dapat diproses!!', true)
1415
m.react("⏱️")
1516
await Promise.all(ok.data.map(it => sock.sendMedia(m.from, it.url, m)))
1617
m.react("✅")

cmd/downloader/mediafire.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
export default (handler) => {
2+
handler.reg({
3+
cmd: ['mediafire', 'mf'],
4+
tags: 'downloader',
5+
desc: 'Mediafire downloader',
6+
isLimit: true,
7+
run: async (m, { func, sock }) => {
8+
if (!m.text) return m.reply('Silahkan masukan url mediafire\ncontoh: .mediafire https://www.mediafire.com/file/jzn9gfjkupdmwou/Simple-Botz-V3_share_by_misterius.zip/file', true)
9+
await m.react("⏱️")
10+
const gmf = await func.loads("amiruldev/mediafire.js")
11+
const res = await gmf(func, m.text)
12+
sock.sendMedia(m.from, res.download, m, { fileName: res.filename, mimetype: res.mimetype })
13+
m.react("✅")
14+
}
15+
})
16+
}

cmd/main/ping.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ export default (handler) => {
66
tags: 'main',
77
desc: 'Detail server',
88
run: async (m, { func }) => {
9+
let { performance } = (await import('perf_hooks')).default
10+
let eold = performance.now()
911
const used = process.memoryUsage()
1012
const cpus = os.cpus().map(cpu => {
1113
cpu.total = Object.keys(cpu.times).reduce(
@@ -38,6 +40,7 @@ export default (handler) => {
3840
}
3941
)
4042
let heapStat = v8.getHeapStatistics()
43+
let neow = performance.now()
4144
const x = "`"
4245
const myip = await func.fetchJson("https://ipinfo.io/json")
4346
function hideIp(ip) {
@@ -51,11 +54,8 @@ export default (handler) => {
5154
}
5255
}
5356
const ips = hideIp(myip.ip)
54-
const resp = `${(Date.now() - new Date(m.timestamps * 1000)) / 1000
55-
} Detik`
56-
5757
let teks = `${x}INFO SERVER${x}
58-
- Speed Respons: _${resp}_
58+
- Speed Respons: _${Number(neow - eold).toFixed(2)} Milisecond(s)_
5959
- Hostname: _amiruldev_
6060
- CPU Core: _${cpus.length}_
6161
- Platform : _${os.platform()}_

cmd/maker/sticker.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/*export default (handler) => {
2+
handler.reg({
3+
cmd: ['sticker', 'stiker', 'st'],
4+
tags: 'maker',
5+
desc: 'Sticker maker',
6+
run: async (m, { func, sock, db }) => {
7+
if (!m?.quoted?.isMedia) {
8+
m.react("❌")
9+
return m.reply(`Silahkan post / reply media`, true)
10+
}
11+
let media = m.quoted ? await m.quoted.download() : await m.download()
12+
13+
if (/image|video|sticker/.test(m.quoted.msg.mimetype)) {
14+
if (m.quoted.msg.seconds > 15) return m.reply(`Max video 15 second`)
15+
const gf = await func.getFile(media)
16+
const buf = await func.writeExif(gf, { wm: `${m.pushName} • ${db.setting.packname}` })
17+
sock.sendMessage(
18+
m.from,
19+
{ sticker: buf },
20+
{
21+
quoted: m,
22+
ephemeralExpiration: m.expiration,
23+
messageId: func.rand(32)
24+
}
25+
)
26+
}
27+
}
28+
})
29+
}*/

eslint.config.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
/*
2+
terimakasih telah menggunakan source code saya. apabila ada masalah, silahkan hubungi saya
3+
4+
Thank you for using my source code. If there is a problem, please contact me
5+
6+
- Facebook: fb.com/amiruldev.ci
7+
- Instagram: instagram.com/amirul.dev
8+
- Telegram: t.me/amiruldev20
9+
- Github: @amiruldev20
10+
- WhatsApp: 085157489446
11+
*/
112
import globals from "globals"
213
import pluginJs from "@eslint/js"
314

index.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
/*
2-
terimakasih telah menggunakan source code saya. apabila ada masalah, silahkan hubungi saya:
2+
terimakasih telah menggunakan source code saya. apabila ada masalah, silahkan hubungi saya
3+
4+
Thank you for using my source code. If there is a problem, please contact me
5+
36
- Facebook: fb.com/amiruldev.ci
47
- Instagram: instagram.com/amirul.dev
58
- Telegram: t.me/amiruldev20
69
- Github: @amiruldev20
10+
- WhatsApp: 085157489446
711
*/
12+
13+
/* module external */
814
import { spawn } from "child_process"
915
import path from "path"
1016
import { fileURLToPath } from "url"

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"license": "MIT",
2020
"description": "Best WhatsApp Bot Base 2025",
2121
"dependencies": {
22-
"baileys": "npm:baileys-beta@6.7.7",
22+
"baileys": "github:amiruldev20/Baileys",
2323
"cheerio": "latest",
2424
"file-type": "^19.6.0",
2525
"session": "npm:baileys-mongodb@1.0.5"
@@ -29,4 +29,4 @@
2929
"eslint": "^9.14.0",
3030
"globals": "^15.12.0"
3131
}
32-
}
32+
}

setting.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
/*
2-
pengaturan lainnya ada di db.setting. anda bisa gunakan command owner
2+
pengaturan lainnya ada di db.setting. anda bisa gunakan command owner. default bahasa adalah id. lakukan perintah - db.setting.lang = "en" atau kode bahasa lainnya untuk mengubahnya
3+
-
4+
Other settings are in db.setting. you can use the owner command. default language is id. do the command - db.setting.lang = "en" or any other language code to change it
35
*/
46
export default {
57
owner: ["6285157489446"],

0 commit comments

Comments
 (0)