Skip to content

Commit fe21a6f

Browse files
authored
π‘»π’†π’‚π’Ž π‘΅π’”π’Œ
1 parent 8d37b24 commit fe21a6f

File tree

1 file changed

+110
-2
lines changed

1 file changed

+110
-2
lines changed

β€Žplugins/propietario(a)-reporte.jsβ€Ž

Lines changed: 110 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,112 @@
1-
let handler = async (m, { conn, text, usedPrefix, command }) => {
1+
const OWNER1 = "50250101139@s.whatsapp.net
2+
const ACTIVE_CONVERSATIONS = {};
3+
4+
let handler = async (m, { conn, text, command }) => {
5+
let activeConversation = Object.entries(ACTIVE_CONVERSATIONS).find(([id, convo]) => convo.active && convo.userId === m.sender && convo.chatId === m.chat);
6+
7+
if (activeConversation) {
8+
let [reportId, conversation] = activeConversation;
9+
10+
await conn.sendMessage(OWNER1, {text: `πŸ“© *Mensaje del usuario @${m.sender.split("@")[0]} (ID: ${reportId}):*\n${text}`, mentions: [m.sender]}, { quoted: m });
11+
await delay(1000)
12+
return;
13+
}
14+
15+
if (command === 'report' || command === 'reporte') {
16+
if (!text && !m.quoted) return m.reply(`${mg}*π™€π™¨π™˜π™§π™žπ™—π™– π™šπ™‘ π™§π™šπ™₯π™€π™§π™©π™š*\n\n*π™€π™…π™€π™ˆπ™‹π™‡π™Š:*\n*${usedPrefix + command} el comando ${usedPrefix}infobot no funka.*`);
17+
if (text.length < 8) throw `*MΓ­nimo 10 caracteres para hacer El Reporte.*`
18+
if (text.length > 1000) throw `*MΓ‘ximo 1000 caracteres para hacer El Reporte.*`
19+
20+
let reportId = Math.floor(Math.random() * 901);
21+
22+
ACTIVE_CONVERSATIONS[reportId] = {
23+
userId: m.sender,
24+
userName: m.pushName || 'Usuario desconocido',
25+
active: true,
26+
chatId: m.chat };
27+
28+
let reportText = text || (m.quoted && m.quoted.text);
29+
let ownerMessage = `*╭━━[ π™π™€π™‹π™Šπ™π™π™€ ]━━━⬣*\n*┃*\n*┃* *π™‰π™π™ˆπ™€π™π™Š*\n┃ ✦ Wa.me/${m.sender.split("@")[0]}\n*┃*\n*┃* *π™ˆπ™€π™‰π™Žπ˜Όπ™…π™€*\n*┃* ✦ ${reportText}\n*┃*\n*╰━━━━━━━━━━━━━━━━━━⬣*\n\n> Responde al mensaje con: *"responder ${reportId} [mensaje]"* para interactuar con el usuarios.\n> Usa *.fin ${reportId}* para finalizar la conversaciΓ³n.`;
30+
31+
await conn.sendMessage(OWNER1, { text: ownerMessage, mentions: [m.sender] }, { quoted: m });
32+
await delay(1000)
33+
await conn.reply(m.chat, `β•°βŠ± *π™€Μπ™“π™„π™π™Š*\n\n*El reporte ha sido enviado a mΓ­ Creadora. TendrΓ‘ una respuesta pronto. De ser Falso serΓ‘ Ignorado el reporte.*`);
34+
return;
35+
}};
36+
37+
handler.before = async (m, { conn }) => {
38+
let activeConversation = Object.entries(ACTIVE_CONVERSATIONS).find(([id, convo]) => convo.active && convo.userId === m.sender && convo.chatId === m.chat );
39+
40+
if (activeConversation && m.text) {
41+
let [reportId] = activeConversation;
42+
43+
await conn.sendMessage(OWNER1, { text: `*πŸ“© Respuesta del usuario @${m.sender.split("@")[0]} (ID: ${reportId}):*\n${m.text}`, mentions: [m.sender] }, { quoted: m });
44+
await delay(1000)
45+
return false;
46+
}
47+
48+
let matchResponder = m.text.match(/^responder (\S+) (.+)/i);
49+
if (matchResponder) {
50+
let [_, reportId, ownerMessage] = matchResponder;
51+
52+
if (!ACTIVE_CONVERSATIONS[reportId] || !ACTIVE_CONVERSATIONS[reportId].active) return await conn.reply(m.chat, `No se encontrΓ³ ninguna conversaciΓ³n activa con ese ID.`, m);
53+
54+
let { userId } = ACTIVE_CONVERSATIONS[reportId];
55+
await conn.reply(userId, `*Respuesta de mi propietario:*\n${ownerMessage}`);
56+
return;
57+
}
58+
59+
if (m.quoted && m.quoted.text) {
60+
let quotedTextMatch = m.quoted.text.match(/ID: (\d+)/);
61+
if (quotedTextMatch) {
62+
let reportId = quotedTextMatch[1];
63+
if (ACTIVE_CONVERSATIONS[reportId] && ACTIVE_CONVERSATIONS[reportId].active) {
64+
let { userId } = ACTIVE_CONVERSATIONS[reportId];
65+
await conn.reply(userId, `*Respuesta de Mi propietario:*\n${m.text}`);
66+
return;
67+
}}}
68+
69+
let matchFin = m.text.match(/^\.fin (\S+)/i);
70+
if (matchFin) {
71+
let [_, reportId] = matchFin;
72+
73+
if (!ACTIVE_CONVERSATIONS[reportId]) return await conn.reply(m.chat, `No se encontrΓ³ ninguna conversaciΓ³n activa con ese ID.`, m);
74+
75+
let { userId } = ACTIVE_CONVERSATIONS[reportId];
76+
ACTIVE_CONVERSATIONS[reportId].active = false;
77+
await conn.reply(userId, `πŸ”’ *La conversaciΓ³n ha sido cerrada por el propietario.*`);
78+
await conn.reply(m.chat, `βœ”οΈ ConversaciΓ³n ${reportId} cerrada.`);
79+
return;
80+
}};
81+
82+
handler.help = ['reporte', 'request'].map(v => v + ' <teks>')
83+
handler.tags = ['info']
84+
handler.exp = 25
85+
handler.command = /^(report|request|reporte|bugs|bug|report-owner|reportes|reportar)$/i
86+
export default handler
87+
88+
const delay = (ms) => new Promise((resolve) => setTimeout(resolve, ms))
89+
90+
91+
92+
93+
94+
95+
96+
97+
98+
99+
100+
101+
102+
103+
104+
105+
106+
107+
108+
109+
/*let handler = async (m, { conn, text, usedPrefix, command }) => {
2110
if (!text) throw `𝙻𝙾 𝙰𝙷 πš„πš‚π™°π™³π™Ύ 𝙳𝙴 π™Όπ™°π™½π™΄πšπ™° π™Έπ™½π™²π™Ύπšπ™΄π™²πšƒπ™°\n\n*π™΄πš‚π™²πšπ™Έπ™±π™° 𝙴𝙻 πšπ™΄π™Ώπ™Ύπšπšƒπ™΄*\n\n*𝙴𝙹𝙴𝙼𝙿𝙻𝙾:*\n*${usedPrefix + command} el comando ${usedPrefix}play no funka.*`
3111
if (text.length < 8) throw `*MΓ­nimo 10 caracteres para hacer El Reporte.*`
4112
if (text.length > 1000) throw `*MΓ‘ximo 1000 caracteres para hacer El Reporte.*`
@@ -19,4 +127,4 @@ handler.help = ['reporte', 'request'].map(v => v + ' <teks>')
19127
handler.tags = ['info']
20128
handler.exp = 25
21129
handler.command = /^(report|request|reporte|report-owner|reportes|reportar)$/i
22-
export default handler
130+
export default handler*/

0 commit comments

Comments
Β (0)