-
Notifications
You must be signed in to change notification settings - Fork 1
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
99 changed files
with
6,160 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,29 @@ | ||
const handler = (m) => m; | ||
handler.before = async function(m, {conn, isAdmin, isBotAdmin, isOwner, isROwner} ) { | ||
/* if (m.message) { | ||
console.log(m.message) | ||
}*/ | ||
if (!m.isGroup) return !1; | ||
const chat = global.db.data.chats[m.chat]; | ||
const bot = global.db.data.settings[conn.user.jid] || {}; | ||
if (isBotAdmin && chat.antiArab2 && !isAdmin && !isOwner && !isROwner && bot.restrict) { | ||
if (m.sender.startsWith('212' || '212')) { | ||
m.reply(`*[❗] 𝓔𝓝 𝓔𝓢𝓣𝓔 𝓖ℛ𝓤𝓟𝓞 𝓝𝓞 𝓢𝓔 𝓟𝓔ℛℳ𝓘𝓣𝓔𝓝 𝓝𝓤ℳ𝓔ℛ𝓞𝓢 ℛ𝓐ℛ𝓞𝓢 𝓞 𝓐ℛ𝓐ℬ𝓔𝓢, 𝓟𝓞ℛ ℒ𝓞 𝓠𝓤𝓔 ℳ𝓔 𝓣𝓔𝓝𝓖𝓞 𝓞ℬℒ𝓘𝓖𝓐𝓓𝓞 𝓐 𝓔𝓧𝓟𝓤ℒ𝓢𝓐ℛℒ𝓞 𝓓𝓔ℒ 𝓖ℛ𝓤𝓟𝓞*`); | ||
const responseb = await conn.groupParticipantsUpdate(m.chat, [m.sender], 'remove'); | ||
if (responseb[0].status === '404') return; | ||
} | ||
|
||
if (m.sender.startsWith('265' || '265')) { | ||
m.reply(`*[❗] 𝓔𝓝 𝓔𝓢𝓣𝓔 𝓖ℛ𝓤𝓟𝓞 𝓝𝓞 𝓢𝓔 𝓟𝓔ℛℳ𝓘𝓣𝓔𝓝 𝓝𝓤ℳ𝓔ℛ𝓞𝓢 ℛ𝓐ℛ𝓞𝓢 𝓞 𝓐ℛ𝓐ℬ𝓔𝓢, 𝓟𝓞ℛ ℒ𝓞 𝓠𝓤𝓔 ℳ𝓔 𝓣𝓔𝓝𝓖𝓞 𝓞ℬℒ𝓘𝓖𝓐𝓓𝓞 𝓐 𝓔𝓧𝓟𝓤ℒ𝓢𝓐ℛℒ𝓞 𝓓𝓔ℒ 𝓖ℛ𝓤𝓟𝓞*`); | ||
const responseb = await conn.groupParticipantsUpdate(m.chat, [m.sender], 'remove'); | ||
if (responseb[0].status === '404') return; | ||
} | ||
|
||
if (m.sender.startsWith('92' || '92')) { | ||
m.reply(`*[❗] 𝓔𝓝 𝓔𝓢𝓣𝓔 𝓖ℛ𝓤𝓟𝓞 𝓝𝓞 𝓢𝓔 𝓟𝓔ℛℳ𝓘𝓣𝓔𝓝 𝓝𝓤ℳ𝓔ℛ𝓞𝓢 ℛ𝓐ℛ𝓞𝓢 𝓞 𝓐ℛ𝓐ℬ𝓔𝓢, 𝓟𝓞ℛ ℒ𝓞 𝓠𝓤𝓔 ℳ𝓔 𝓣𝓔𝓝𝓖𝓞 𝓞ℬℒ𝓘𝓖𝓐𝓓𝓞 𝓐 𝓔𝓧𝓟𝓤ℒ𝓢𝓐ℛℒ𝓞 𝓓𝓔ℒ 𝓖ℛ𝓤𝓟𝓞*`); | ||
const responseb = await conn.groupParticipantsUpdate(m.chat, [m.sender], 'remove'); | ||
if (responseb[0].status === '404') return; | ||
} | ||
} | ||
}; | ||
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,29 @@ | ||
const linkRegex = /chat.whatsapp.com\/([0-9A-Za-z]{20,24})/i; | ||
export async function before(m, {conn, isAdmin, isBotAdmin}) { | ||
if (m.isBaileys && m.fromMe) { | ||
return !0; | ||
} | ||
if (!m.isGroup) return !1; | ||
const chat = global.db.data.chats[m.chat]; | ||
const delet = m.key.participant; | ||
const bang = m.key.id; | ||
const bot = global.db.data.settings[this.user.jid] || {}; | ||
const user = `@${m.sender.split`@`[0]}`; | ||
const isGroupLink = linkRegex.exec(m.text); | ||
const grupo = `https://chat.whatsapp.com`; | ||
if (isAdmin && chat.antiLink && m.text.includes(grupo)) return m.reply('*ℋ𝓔𝓨!!! 𝓔ℒ 𝓐𝓝𝓣𝓘ℒ𝓘𝓝𝓚 𝓔𝓢𝓣𝓐 𝓐𝓒𝓣𝓘𝓥𝓐𝓓𝓞, 𝓟𝓔ℛ𝓞 𝓒𝓞ℳ𝓞 𝓔ℛ𝓔𝓢 𝓐𝓓ℳ𝓘𝓝 𝓣𝓔 𝓢𝓐ℒ𝓥𝓐𝓢, 𝓢𝓐ℒ𝓥𝓐𝓓𝓞/𝓐!*'); | ||
if (chat.antiLink && isGroupLink && !isAdmin) { | ||
if (isBotAdmin) { | ||
const linkThisGroup = `https://chat.whatsapp.com/${await this.groupInviteCode(m.chat)}`; | ||
if (m.text.includes(linkThisGroup)) return !0; | ||
} | ||
await this.sendMessage(m.chat, {text: `*「 𝐀𝐍𝐓𝐈 𝐋𝐈𝐍𝐊𝐒 」*\n*𝓐𝓓𝓘𝓞𝓢 ℬ𝓐𝓠𝓤𝓔ℛ𝓞👋 ${user} ℛ𝓞ℳ𝓟𝓘𝓢𝓣𝓔 ℒ𝓐𝓢 ℛ𝓔𝓖ℒ𝓐𝓢 𝓓𝓔ℒ 𝓖ℛ𝓤𝓟𝓞, 𝓝𝓞𝓢 𝓥𝓔ℳ𝓞𝓢 𝓔𝓝 𝓔ℒ 𝓞𝓣ℛ𝓞 ℳ𝓤𝓝𝓓𝓞...!!*`, mentions: [m.sender]}, {quoted: m}); | ||
if (!isBotAdmin) return m.reply('*[❗𝐈𝐍𝐅𝐎❗] 𝓔ℒ ℬ𝓞𝓣 𝓝𝓞 𝓔𝓢 𝓐𝓓ℳ𝓘𝓝, 𝓝𝓞 𝓟𝓤𝓔𝓓𝓔 𝓔𝓧𝓟𝓤ℒ𝓢𝓐ℛ 𝓖𝓔𝓝𝓣𝓔*'); | ||
if (isBotAdmin && bot.restrict) { | ||
await conn.sendMessage(m.chat, {delete: {remoteJid: m.chat, fromMe: false, id: bang, participant: delet}}); | ||
const responseb = await conn.groupParticipantsUpdate(m.chat, [m.sender], 'remove'); | ||
if (responseb[0].status === '404') return; | ||
} else if (!bot.restrict) return m.reply('*[❗𝐈𝐍𝐅𝐎❗] 𝓔ℒ 𝓟ℛ𝓞𝓟𝓘𝓔𝓣𝓐ℛ𝓘𝓞 𝓓𝓔ℒ ℬ𝓞𝓣 𝓝𝓞 𝓣𝓘𝓔𝓝𝓔 𝓐𝓒𝓣𝓘𝓥𝓐𝓓𝓞 ℒ𝓐𝓢 ℛ𝓔𝓢𝓣ℛ𝓘𝓒𝓒𝓘𝓞𝓝𝓔𝓢 (#𝚎𝚗𝚊𝚋𝚕𝚎 𝚛𝚎𝚜𝚝𝚛𝚒𝚌𝚝) 𝓔𝓢𝓒ℛ𝓘ℬ𝓔ℒ𝓔 𝓟𝓐ℛ𝓐 𝓠𝓤𝓔 ℒ𝓞 𝓐𝓒𝓣𝓘𝓥𝓔*'); | ||
} | ||
return !0; | ||
} |
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 @@ | ||
// manden porno test | ||
const linkRegex = /https:/i; | ||
export async function before(m, {conn, isAdmin, isBotAdmin, text}) { | ||
if (m.isBaileys && m.fromMe) { | ||
return !0; | ||
} | ||
if (!m.isGroup) return !1; | ||
const chat = global.db.data.chats[m.chat]; | ||
const delet = m.key.participant; | ||
const bang = m.key.id; | ||
const bot = global.db.data.settings[this.user.jid] || {}; | ||
const user = `@${m.sender.split`@`[0]}`; | ||
const isGroupLink = linkRegex.exec(m.text); | ||
if (chat.antiLink2 && isGroupLink && !isAdmin) { | ||
if (isBotAdmin) { | ||
const linkThisGroup = `https://chat.whatsapp.com/${await this.groupInviteCode(m.chat)}`; | ||
const linkThisGroup2 = `https://www.youtube.com/`; | ||
const linkThisGroup3 = `https://youtu.be/`; | ||
if (m.text.includes(linkThisGroup)) return !0; | ||
if (m.text.includes(linkThisGroup2)) return !0; | ||
if (m.text.includes(linkThisGroup3)) return !0; | ||
} | ||
await this.sendMessage(m.chat, {text: `*「 𝐀𝐍𝐓𝐈 𝐋𝐈𝐍𝐊𝐒 」*\n*𝓐𝓓𝓘𝓞𝓢 ℬ𝓐𝓠𝓤𝓔ℛ𝓞 👋 ${user} ℛ𝓞ℳ𝓟𝓘𝓢𝓣𝓔 ℒ𝓐𝓢 ℛ𝓔𝓖ℒ𝓐𝓢 𝓓𝓔ℒ 𝓖ℛ𝓤𝓟𝓞, 𝓝𝓞𝓢 𝓥𝓔ℳ𝓞𝓢 𝓔𝓝 𝓔ℒ 𝓞𝓣ℛ𝓞 ℳ𝓤𝓝𝓓𝓞...!!*`, mentions: [m.sender]}, {quoted: m}); | ||
if (!isBotAdmin) return m.reply('*[❗𝐈𝐍𝐅𝐎❗] 𝓔ℒ ℬ𝓞𝓣 𝓝𝓞 𝓔𝓢 𝓐𝓓ℳ𝓘𝓝, 𝓝𝓞 𝓟𝓤𝓔𝓓𝓔 𝓔𝓧𝓟𝓤ℒ𝓢𝓐ℛ 𝓖𝓔𝓝𝓣𝓔*'); | ||
if (isBotAdmin && bot.restrict) { | ||
await conn.sendMessage(m.chat, {delete: {remoteJid: m.chat, fromMe: false, id: bang, participant: delet}}); | ||
const responseb = await conn.groupParticipantsUpdate(m.chat, [m.sender], 'remove'); | ||
if (responseb[0].status === '404') return; | ||
} else if (!bot.restrict) return m.reply('*[❗𝐈𝐍𝐅𝐎❗] 𝓔ℒ 𝓟ℛ𝓞𝓟𝓘𝓔𝓣𝓐ℛ𝓘𝓞 𝓓𝓔ℒ ℬ𝓞𝓣 𝓝𝓞 𝓣𝓘𝓔𝓝𝓔 𝓐𝓒𝓣𝓘𝓥𝓐𝓓𝓞 ℒ𝓐𝓢 ℛ𝓔𝓢𝓣ℛ𝓘𝓒𝓒𝓘𝓞𝓝𝓔𝓢 (#𝚎𝚗𝚊𝚋𝚕𝚎 𝚛𝚎𝚜𝚝𝚛𝚒𝚌𝚝) 𝓔𝓢𝓒ℛ𝓘ℬ𝓔ℒ𝓔 𝓟𝓐ℛ𝓐 𝓠𝓤𝓔 ℒ𝓞 𝓐𝓒𝓣𝓘𝓥𝓔*'); | ||
} | ||
return !0; | ||
} |
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,13 @@ | ||
export async function before(m, {conn, isAdmin, isBotAdmin, isOwner, isROwner}) { | ||
if (m.isBaileys && m.fromMe) return !0; | ||
if (m.isGroup) return !1; | ||
if (!m.message) return !0; | ||
if (m.text.includes('PIEDRA') || m.text.includes('PAPEL') || m.text.includes('TIJERA') || m.text.includes('serbot') || m.text.includes('jadibot')) return !0; | ||
const chat = global.db.data.chats[m.chat]; | ||
const bot = global.db.data.settings[this.user.jid] || {}; | ||
if (bot.antiPrivate && !isOwner && !isROwner) { | ||
await m.reply(`*[❗] ℋ𝓸𝓵𝓪 @${m.sender.split`@`[0]}, 𝖊𝖘𝖙𝖆 𝖕𝖗𝖔𝖍𝖎𝖇𝖎𝖉𝖔 𝖍𝖆𝖇𝖑𝖆𝖗𝖑𝖊 𝖆𝖑 𝖕𝖗𝖎𝖛𝖆𝖉𝖔 𝖉𝖊𝖑 𝖇𝖔𝖙, 𝖒𝖊 𝖛𝖊𝖔 𝖔𝖇𝖑𝖎𝖌𝖆𝖉𝖔 𝖆 𝖇𝖑𝖔𝖖𝖚𝖊𝖆𝖗𝖑𝖔.*`, false, {mentions: [m.sender]}); | ||
await this.updateBlockStatus(m.chat, 'block'); | ||
} | ||
return !1; | ||
} |
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,28 @@ | ||
const toxicRegex = /puto|puta|rata|estupido|imbecil|rctmre|mrd|verga|vrga|maricon/i; | ||
|
||
export async function before(m, {isAdmin, isBotAdmin, isOwner}) { | ||
if (m.isBaileys && m.fromMe) { | ||
return !0; | ||
} | ||
if (!m.isGroup) { | ||
return !1; | ||
} | ||
const user = global.db.data.users[m.sender]; | ||
const chat = global.db.data.chats[m.chat]; | ||
const bot = global.db.data.settings[mconn.conn.user.jid] || {}; | ||
const isToxic = toxicRegex.exec(m.text); | ||
|
||
if (isToxic && chat.antiToxic && !isOwner && !isAdmin) { | ||
user.warn += 1; | ||
if (!(user.warn >= 5)) await m.reply('*[❗] ' + `${user.warn == 1 ? `Hola @${m.sender.split`@`[0]}` : `@${m.sender.split`@`[0]}`}, decir la palabra "${isToxic}" está prohibido en este grupo. Advertencia: ${user.warn}/5.` + '*', false, {mentions: [m.sender]}); | ||
} | ||
|
||
if (user.warn >= 5) { | ||
user.warn = 0; | ||
await m.reply(`*[❗] Hola @${m.sender.split`@`[0]}, superaste las 5 advertencias por lo que serás eliminado de este grupo por tu comportamiento.*`, false, {mentions: [m.sender]}); | ||
user.banned = true; | ||
await mconn.conn.groupParticipantsUpdate(m.chat, [m.sender], 'remove'); | ||
// await this.updateBlockStatus(m.sender, 'block') | ||
} | ||
return !1; | ||
} |
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,33 @@ | ||
// | ||
// By @NeKosmic || https://github.com/NeKosmic/ | ||
// | ||
|
||
import * as fs from 'fs'; | ||
|
||
export async function before(m, {conn, isAdmin, isBotAdmin, usedPrefix}) { | ||
if (m.isBaileys && m.fromMe) { | ||
return !0; | ||
} | ||
if (!m.isGroup) return !1; | ||
const chat = global.db.data.chats[m.chat]; | ||
const bot = global.db.data.settings[this.user.jid] || {}; | ||
const delet = m.key.participant; | ||
const bang = m.key.id; | ||
const name = await conn.getName(m.sender); | ||
const fakemek = {'key': {'participant': '0@s.whatsapp.net', 'remoteJid': '0@s.whatsapp.net'}, 'message': {'groupInviteMessage': {'groupJid': '51995386439-1616969743@g.us', 'inviteCode': 'm', 'groupName': 'P', 'caption': '𝚃𝚑𝚎 𝙼𝚢𝚜𝚝𝚒𝚌 - 𝙱𝚘𝚝', 'jpegThumbnail': null}}}; | ||
if (chat.antiTraba && m.text.length > 5000) { // Cantidad máxima de caracteres aceptados en un mensaje// | ||
if (isAdmin) return conn.sendMessage(m.chat, {text: `El administrador @${m.sender.split('@')[0]} acaba de enviar un texto que contiene muchos caracteres -.-!`, mentions: [m.sender]}, {quoted: fakemek}); | ||
conn.sendMessage(m.chat, `*[ ! ] Se detecto un mensaje que contiene muchos caracteres [ ! ]*\n`, `${isBotAdmin ? '' : 'No soy administrador, no puedo hacer nada :/'}`, m); | ||
// await conn.sendButton(m.chat, `*[ ! ] Se detecto un mensaje que contiene muchos caracteres [ ! ]*\n`, `${isBotAdmin ? '' : 'No soy administrador, no puedo hacer nada :/'}`, author, ['[ DESACTIVAR ANTI TRABAS ]', usedPrefix+'apagar antitraba'], fakemek ) | ||
if (isBotAdmin && bot.restrict) { | ||
conn.sendMessage(m.chat, {delete: {remoteJid: m.chat, fromMe: false, id: bang, participant: delet}}); | ||
setTimeout(() => { | ||
conn.sendMessage(m.chat, {text: `Marcar el chat como leido ✓\n${'\n'.repeat(400)}\n=> El número : wa.me/${m.sender.split('@')[0]}\n=> Alias : ${name}\n[ ! ] Acaba de enviar un texto que contiene muchos caracteres que puede ocasionar fallos en los dispositivos`, mentions: [m.sender]}, {quoted: fakemek}); | ||
}, 0); | ||
setTimeout(() => { | ||
conn.groupParticipantsUpdate(m.chat, [m.sender], 'remove'); | ||
}, 1000); | ||
} else if (!bot.restrict) return m.reply('[ ! ] Para realizar acciones de eliminación, mi dueño tiene que encender el modo restringido!'); | ||
} | ||
return !0; | ||
} |
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,22 @@ | ||
const {downloadContentFromMessage} = (await import('@whiskeysockets/baileys')); | ||
|
||
export async function before(m, {isAdmin, isBotAdmin}) { | ||
const chat = db.data.chats[m.chat]; | ||
if (/^[.~#/\$,](read)?viewonce/.test(m.text)) return; | ||
if (!chat?.antiviewonce || chat?.isBanned) return; | ||
if (m.mtype == 'viewOnceMessageV2') { | ||
const msg = m.message.viewOnceMessageV2.message; | ||
const type = Object.keys(msg)[0]; | ||
const media = await downloadContentFromMessage(msg[type], type == 'imageMessage' ? 'image' : 'video'); | ||
let buffer = Buffer.from([]); | ||
for await (const chunk of media) { | ||
buffer = Buffer.concat([buffer, chunk]); | ||
} | ||
const cap = '*- En este grupo, no permitimos que ocultes nada.*' | ||
if (/video/.test(type)) { | ||
return mconn.conn.sendFile(m.chat, buffer, 'error.mp4', `${msg[type].caption ? msg[type].caption + '\n\n' + cap : cap}`, m); | ||
} else if (/image/.test(type)) { | ||
return mconn.conn.sendFile(m.chat, buffer, 'error.jpg', `${msg[type].caption ? msg[type].caption + '\n\n' + cap : cap}`, m); | ||
} | ||
} | ||
} |
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,52 @@ | ||
const INACTIVITY_TIMEOUT_MS = 30 * 60 * 1000; | ||
|
||
async function deleteInactiveUserData(m) { | ||
const user = global.chatgpt.data.users[m.sender]; | ||
if (!user) return; // Si no existe el usuario, no hace nada | ||
|
||
const lastUpdateTime = user.lastUpdate || 0; | ||
const currentTime = new Date().getTime(); | ||
|
||
if (currentTime - lastUpdateTime > INACTIVITY_TIMEOUT_MS) { | ||
delete global.chatgpt.data.users[m.sender]; | ||
// console.log(`Datos del usuario ${m.sender} eliminados después de ${INACTIVITY_TIMEOUT_MS / 1000 / 60} minutos de inactividad.`); | ||
} | ||
} | ||
|
||
export async function all(m) { | ||
const user = global.chatgpt.data.users[m.sender]; | ||
|
||
if (user) { | ||
user.lastUpdate = new Date().getTime(); | ||
global.chatgpt.data.users[m.sender] = user; | ||
} else { | ||
return; // Si no existe el usuario, no hace nada | ||
} | ||
|
||
setTimeout(() => deleteInactiveUserData(m), INACTIVITY_TIMEOUT_MS); | ||
} | ||
|
||
/* const INACTIVITY_TIMEOUT_MS = 30 * 60 * 1000; | ||
async function deleteInactiveUserData(m) { | ||
const user = global.chatgpt.data.users[m.sender]; | ||
const lastUpdateTime = user?.lastUpdate || 0; | ||
const currentTime = new Date().getTime(); | ||
if (currentTime - lastUpdateTime > INACTIVITY_TIMEOUT_MS) { | ||
delete global.chatgpt.data.users[m.sender]; | ||
//console.log(`Datos del usuario ${m.sender} eliminados después de ${INACTIVITY_TIMEOUT_MS / 1000 / 60} minutos de inactividad.`); | ||
} | ||
} | ||
export async function all(m) { | ||
let user = global.chatgpt.data.users[m.sender]; | ||
if (user) { | ||
user.lastUpdate = new Date().getTime(); | ||
global.chatgpt.data.users[m.sender] = user; | ||
} | ||
setTimeout(() => deleteInactiveUserData(m), INACTIVITY_TIMEOUT_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,38 @@ | ||
import {sticker} from '../lib/sticker.js'; | ||
|
||
const handler = (m) => m; | ||
|
||
handler.all = async function(m) { | ||
const chat = db.data.chats[m.chat]; | ||
const user = db.data.users[m.sender]; | ||
|
||
if (chat.autosticker && m.isGroup) { | ||
const q = m; | ||
let stiker = false; | ||
const mime = (q.msg || q).mimetype || q.mediaType || ''; | ||
if (/webp/g.test(mime)) return; | ||
if (/image/g.test(mime)) { | ||
const img = await q.download?.(); | ||
if (!img) return; | ||
stiker = await sticker(img, false, packname, author); | ||
} else if (/video/g.test(mime)) { | ||
if (/video/g.test(mime)) if ((q.msg || q).seconds > 8) return await m.reply(`*[❗𝐈𝐍𝐅𝐎❗] 𝙴𝙻 𝚅𝙸𝙳𝙴𝙾 𝙽𝙾 𝙿𝚄𝙴𝙳𝙴 𝙳𝚄𝚁𝙰𝚁 𝙼𝙰𝚂 𝙳𝙴 7 𝚂𝙴𝙶𝚄𝙽𝙳𝙾𝚂*\n\n𝙿𝙰𝚁𝙰 𝙳𝙴𝚂𝙰𝙲𝚃𝙸𝚅𝙰𝚁 𝙴𝚂𝚃𝙰 𝙾𝙿𝙲𝙸𝙾́𝙽 𝙴𝚂𝙲𝚁𝙸𝙱𝙰 (#𝚍𝚒𝚜𝚊𝚋𝚕𝚎 𝚊𝚞𝚝𝚘𝚜𝚝𝚒𝚌𝚔𝚎𝚛)`); | ||
// await this.sendButton(m.chat, '*[❗𝐈𝐍𝐅𝐎❗] 𝙴𝙻 𝚅𝙸𝙳𝙴𝙾 𝙽𝙾 𝙿𝚄𝙴𝙳𝙴 𝙳𝚄𝚁𝙰𝚁 𝙼𝙰𝚂 𝙳𝙴 7 𝚂𝙴𝙶𝚄𝙽𝙳𝙾𝚂*', wm, [['𝙳𝙴𝚂𝙰𝙲𝚃𝙸𝚅𝙰𝚁 𝙰𝚄𝚃𝙾𝚂𝚃𝙸𝙲𝙺𝙴𝚁', '/disable autosticker']], m) | ||
const img = await q.download(); | ||
if (!img) return; | ||
stiker = await sticker(img, false, packname, author); | ||
} else if (m.text.split(/\n| /i)[0]) { | ||
if (isUrl(m.text)) stiker = await sticker(false, m.text.split(/\n| /i)[0], packname, author); | ||
else return; | ||
} | ||
if (stiker) { | ||
await mconn.conn.sendFile(m.chat, stiker, null, {asSticker: true}); | ||
} | ||
} | ||
return !0; | ||
}; | ||
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|mp4)/, '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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
const { | ||
proto, | ||
generateWAMessage, | ||
areJidsSameUser, | ||
} = (await import('@whiskeysockets/baileys')).default; | ||
|
||
export async function all(m, chatUpdate) { | ||
if (m.isBaileys) return; | ||
if (!m.message) return; | ||
if (!m.msg.fileSha256) return; | ||
if (!(Buffer.from(m.msg.fileSha256).toString('base64') in global.db.data.sticker)) return; | ||
|
||
const hash = global.db.data.sticker[Buffer.from(m.msg.fileSha256).toString('base64')]; | ||
const {text, mentionedJid} = hash; | ||
const messages = await generateWAMessage(m.chat, {text: text, mentions: mentionedJid}, { | ||
userJid: this.user.id, | ||
quoted: m.quoted && m.quoted.fakeObj, | ||
}); | ||
messages.key.fromMe = areJidsSameUser(m.sender, this.user.id); | ||
messages.key.id = m.key.id; | ||
messages.pushName = m.pushName; | ||
if (m.isGroup) messages.participant = m.sender; | ||
const msg = { | ||
...chatUpdate, | ||
messages: [proto.WebMessageInfo.fromObject(messages)], | ||
type: 'append', | ||
}; | ||
this.ev.emit('messages.upsert', msg); | ||
} |
Oops, something went wrong.