Skip to content

Commit

Permalink
[ Jessi-md 4.8.1 ⏱️ ]
Browse files Browse the repository at this point in the history
  • Loading branch information
whiteshadowofficial authored Jan 4, 2024
1 parent 635b45f commit 150afbf
Show file tree
Hide file tree
Showing 23 changed files with 1,287 additions and 20 deletions.
19 changes: 19 additions & 0 deletions plugins/_anticall.js
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")
}
}
21 changes: 21 additions & 0 deletions plugins/_autoban.js
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
61 changes: 61 additions & 0 deletions plugins/_autosticker.js
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'))
}
44 changes: 38 additions & 6 deletions plugins/enable.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,47 @@ let handler = async (m, { conn, usedPrefix, command, args, isOwner, isAdmin, isR
chat.delete = isEnable
break
case 'nsfw':
case '+18':
if (m.isGroup) {
if (!(isAdmin || isOwner)) {
global.dfail('admin', m, conn)
throw false
}}
chat.nsfw = isEnable
break
case 'premnsfwchat':
if (m.isGroup) {
if (!isROwner) {
global.dfail('rowner', m, conn)
throw false
}}
chat.premnsfw = isEnable
break
case 'autoSticker':
if (m.isGroup) {
if (!(isAdmin || isOwner)) {
global.dfail('admin', m, conn)
throw false
}
}
chat.autoSticker = isEnable
break
case 'antispam':
if (m.isGroup) {
if (!(isAdmin || isOwner)) {
global.dfail('admin', m, conn)
throw false
}
}
chat.nsfw = isEnable
break
throw false
}
}
chat.antiSpam = isEnable
break
case 'anticall':
isAll = true
if (!isOwner) {
global.dfail('rowner', m, conn)
throw false
}
chat.anticall = isEnable
break
case 'antidelete':
if (m.isGroup) {
if (!(isAdmin || isOwner)) {
Expand Down
32 changes: 32 additions & 0 deletions plugins/group-kick.js
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
31 changes: 17 additions & 14 deletions plugins/group-promote.js
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))
12 changes: 12 additions & 0 deletions plugins/group-tagme.js
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
30 changes: 30 additions & 0 deletions plugins/info-grouplist.js
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
12 changes: 12 additions & 0 deletions plugins/owner-leavegc.js
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
Loading

0 comments on commit 150afbf

Please sign in to comment.