-
-
Notifications
You must be signed in to change notification settings - Fork 382
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
1 parent
635b45f
commit 150afbf
Showing
23 changed files
with
1,287 additions
and
20 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,19 @@ | ||
const { WAMessageStubType } = (await import('@adiwajshing/baileys')).default | ||
const isNumber = x => typeof x === 'number' && !isNaN(x) | ||
const delay = ms => isNumber(ms) && new Promise(resolve => setTimeout(function () { | ||
clearTimeout(this) | ||
resolve() | ||
}, ms)) | ||
|
||
export async function all(m) { | ||
if (m.fromMe && m.isBaileys) return !0 | ||
let text; | ||
let setting = global.db.data.settings[this.user.jid] | ||
if(!setting.anticall) return | ||
|
||
if (m.messageStubType === (WAMessageStubType.CALL_MISSED_VOICE || WAMessageStubType.CALL_MISSED_VIDEO )) { | ||
await delay(1000) | ||
await conn.reply(m.chat, `Don't call Bot!!`, fakes) | ||
return conn.updateBlockStatus(m.chat, "block") | ||
} | ||
} |
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,21 @@ | ||
let handler = m => m | ||
|
||
handler.before = async function (m) { | ||
if (m.sender.startsWith('212' || '212')) { | ||
global.db.data.users[m.sender].banned = true | ||
} | ||
|
||
if (m.sender.startsWith('265' || '265')) { | ||
global.db.data.users[m.sender].banned = true | ||
} | ||
|
||
if (m.sender.startsWith('91' || '91')) { | ||
global.db.data.users[m.sender].banned = true | ||
} | ||
|
||
if (m.sender.startsWith('90' || '90')) { | ||
global.db.data.users[m.sender].banned = 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,61 @@ | ||
import { sticker } from '../lib/sticker.js' | ||
import * as WSF from 'wa-sticker-formatter' | ||
let handler = m => m | ||
|
||
handler.before = async function (m) { | ||
let chat = global.db.data.chats[m.chat] | ||
let user = global.db.data.users[m.sender] | ||
if (chat.autoSticker && !user.banned && !chat.isBanned && !m.fromMe && !m.isBaileys) { | ||
// try { | ||
let q = m | ||
let stiker = false | ||
let wsf = false | ||
let mime = (q.msg || q).mimetype || '' | ||
if (/webp/.test(mime)) return | ||
if (/image/.test(mime)) { | ||
let img = await q.download() | ||
if (!img) return | ||
wsf = new WSF.Sticker(img, { | ||
pack: packname, | ||
author: author, | ||
crop: false, | ||
}) | ||
} else if (/video/.test(mime)) { | ||
if ((q.msg || q).seconds > 11) return m.reply('Maksimal 10 detik!') | ||
let img = await q.download() | ||
if (!img) return | ||
wsf = new WSF.Sticker(img, { | ||
pack: packname, | ||
author: author, | ||
crop: false, | ||
}) | ||
} else if (m.text.split` `[0]) { | ||
if (isUrl(m.text.split` `[0])) stiker = await sticker(false, m.text.split` `[0], packname, author) | ||
else return | ||
} | ||
if (wsf) { | ||
await wsf.build() | ||
const sticBuffer = await wsf.get() | ||
if (sticBuffer) await this.sendMessage(m.chat, { sticker: sticBuffer }, { | ||
quoted: m, | ||
mimetype: 'image/webp', | ||
ephemeralExpiration: 86400 | ||
}) | ||
} | ||
if (stiker) await this.sendMessage(m.chat, { sticker: stiker }, { | ||
quoted: m, | ||
mimetype: 'image/webp', | ||
ephemeralExpiration: 86400 | ||
}) | ||
// } finally { | ||
// if (stiker) { | ||
// } | ||
// } | ||
} | ||
return true | ||
} | ||
export default handler | ||
|
||
const isUrl = (text) => { | ||
return text.match(new RegExp(/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&/=]*)(jpe?g|gif|png)/, 'gi')) | ||
} |
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
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,32 @@ | ||
// Code by Xnuvers007 | ||
// https://github.com/Xnuvers007/ | ||
|
||
import { areJidsSameUser } from '@adiwajshing/baileys' | ||
|
||
let handler = async (m, { conn, participants, isAdmin }) => { | ||
if (!isAdmin) { | ||
return m.reply('Perintah ini hanya dapat digunakan oleh admin grup') | ||
} | ||
|
||
let users = m.mentionedJid.filter(u => !areJidsSameUser(u, conn.user.id)) | ||
let kickedUser = [] | ||
for (let user of users) | ||
if (user.endsWith('@s.whatsapp.net') && !(participants.find(v => areJidsSameUser(v.id, user)) || { admin: true }).admin) { | ||
const res = await conn.groupParticipantsUpdate(m.chat, [user], "remove") | ||
kickedUser.concat(res) | ||
await delay(1 * 1000) | ||
} | ||
m.reply(`Mampos Dikick Kau ${kickedUser.map(v => '@' + v.split('@')[0])}`, null, { mentions: kickedUser }) | ||
} | ||
|
||
handler.help = ['kick'].map(v => v + ' @user') | ||
handler.tags = ['group'] | ||
handler.command = /^(kick)$/i | ||
|
||
handler.owner = false | ||
handler.group = true | ||
handler.botAdmin = true | ||
handler.admin = true // hanya admin grup yang dapat menggunakan perintah ini | ||
|
||
const delay = (ms) => new Promise((resolve) => setTimeout(resolve, ms)) | ||
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 |
---|---|---|
@@ -1,20 +1,23 @@ | ||
let handler = async (m, { conn }) => { | ||
let who = m.quoted ? m.quoted.sender : m.mentionedJid ? m.mentionedJid[0] : '' | ||
if (!who || who.includes(conn.user.jid)) throw `*quote / @tag* one or other !` | ||
try { | ||
await conn.groupParticipantsUpdate(m.chat, [who], 'promote') | ||
m.reply('Succes promote') | ||
} catch (e) { | ||
console.log(e) | ||
} | ||
} | ||
import { areJidsSameUser } from '@adiwajshing/baileys' | ||
let handler = async (m, { conn, participants }) => { | ||
let users = m.mentionedJid.filter(u => !areJidsSameUser(u, conn.user.id)) | ||
let promoteUser = [] | ||
for (let user of users) | ||
if (user.endsWith('@s.whatsapp.net') && !(participants.find(v => areJidsSameUser(v.id, user)) || { admin: true }).admin) { | ||
const res = await conn.groupParticipantsUpdate(m.chat, [user], 'promote') | ||
await delay(1 * 1000) | ||
} | ||
m.reply('Succes') | ||
|
||
handler.menugroup = ['promote @tag'] | ||
handler.tagsgroup = ['group'] | ||
} | ||
handler.help = ['promote @tag'] | ||
handler.tags = ['group'] | ||
handler.command = /^(promote)$/i | ||
|
||
handler.admin = true | ||
handler.botAdmin = true | ||
handler.group = true | ||
handler.botAdmin = true | ||
|
||
export default handler | ||
|
||
export default handler | ||
const delay = (ms) => new Promise((resolve) => setTimeout(resolve, ms)) |
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,12 @@ | ||
let handler = async (m, { conn, text }) => { | ||
let tag = `@${m.sender.replace(/@.+/, '')}` | ||
let mentionedJid = [m.sender] | ||
conn.reply(m.chat, tag, m, { contextInfo: { mentionedJid }}) | ||
} | ||
handler.help = ['tagme'] | ||
handler.tags = ['group'] | ||
handler.command = /^tagme$/i | ||
|
||
handler.group = false | ||
|
||
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,30 @@ | ||
const handler = async (m, { conn, isOwner }) => { | ||
let groups = Object.values(await conn.groupFetchAllParticipating()) | ||
|
||
let str = Object.keys(groups).map((i, index) => { | ||
return `*${dmenut}* ${1 + index} | ||
*${dmenub} Name :* ${groups[i].subject} | ||
*${dmenub} Owner :* ${groups[i].owner ? "@" + groups[i].owner.split("@")[0] : "Unknown"} | ||
*${dmenub} Subject Owner :* ${groups[i].subjectOwner ? "@" + groups[i].subjectOwner.split("@")[0] : "Unknown"} | ||
*${dmenub} ID :* ${groups[i].id} | ||
*${dmenub} Restrict :* ${groups[i].restrict} | ||
*${dmenub} Announce :* ${groups[i].announce} | ||
*${dmenub} Ephemeral :* ${new Date(groups[i].ephemeralDuration* 1000).toDateString()} | ||
*${dmenub} Desc ID :* ${groups[i].descId} | ||
*${dmenub} Description :* ${groups[i].desc?.toString().slice(0, 10) + '...' || 'unknown'} | ||
*${dmenub} Admins :* ${groups[i].participants.filter(p => p.admin).map((v, i) => `\n${dmenub} ${i + 1}. @${v.id.split('@')[0]}`).join(' [admin]')} | ||
${isOwner ? `*${dmenub} Participants :* ${groups[i].participants.length}` : ''} | ||
${isOwner ? `*${dmenub} isBotAdmin :* [ ${!!groups[i].participants.find(v => v.id == conn.user.jid).admin} ]` : ''} | ||
*${dmenub} Created :* ${new Date(groups[i].subjectTime* 1000).toDateString()} | ||
*${dmenub} Creation :* ${new Date(groups[i].creation* 1000).toDateString()} | ||
*${dmenub} Size :* ${groups[i].size} | ||
${dmenuf}`.trim() | ||
}).join('\n\n') | ||
await conn.reply(m.chat, str, fakes) | ||
} | ||
|
||
handler.help = ['groups', 'grouplist'] | ||
handler.tags = ['group'] | ||
handler.command = /^((gro?ups?list)|(listgro?ups?)|(listgc))$/i | ||
|
||
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,12 @@ | ||
let handler = async (m, { conn, args, command }) => { | ||
let group = m.chat | ||
await m.reply('Good bye , , ! 👋😃', m.chat,fkontak) | ||
await conn.groupLeave(group) | ||
} | ||
handler.help = ['leavegc', 'out'] | ||
handler.tags = ['owner'] | ||
handler.command = /^(out|leavegc)$/i | ||
|
||
handler.rowner = true | ||
|
||
export default handler |
Oops, something went wrong.