-
-
Notifications
You must be signed in to change notification settings - Fork 13
/
صفعه.js
39 lines (36 loc) · 1.44 KB
/
صفعه.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import {sticker} from "../lib/sticker.js";
import fetch from "node-fetch";
const handler = async (m, { conn, args, usedPrefix, command }) => {
const datas = global
const idioma = datas.db.data.users[m.sender].language
const _translate = JSON.parse(fs.readFileSync(`./language/${idioma}.json`))
const tradutor = _translate.plugins.sticker_slap
let who;
if (m.isGroup) {
who = m.mentionedJid[0] ? m.mentionedJid[0] : m.quoted ? m.quoted.sender : false;
} else {
who = m.chat;
}
const textquien = `${tradutor.texto1}\n◉ ${usedPrefix + command} @${global.suittag}`;
if (who === m.chat && m.isGroup || !who && m.isGroup) return m.reply(textquien, m.chat, {mentions: conn.parseMention(textquien)});
try {
let name;
if (who === m.chat) {
name = "𝚃𝚑𝚎 𝙼𝚢𝚜𝚝𝚒𝚌 - 𝙱𝚘𝚝";
} else {
name = conn.getName(who);
}
let name2 = conn.getName(m.sender);
let apislap = await fetch(`https://api.waifu.pics/sfw/slap`);
let jkis = await apislap.json();
let { url } = jkis;
let stiker = await sticker(null, url, `${name2} le dio una bofetada a ${name}`, null);
conn.sendFile(m.chat, stiker, null, {asSticker: true}, m, true, {contextInfo: {forwardingScore: 200, isForwarded: true}}, {quoted: m});
} catch {
throw tradutor.texto2;
};
};
handler.help = ["slap"];
handler.tags = ["General"];
handler.command = /^(slap|bofetada)$/i;
export default handler;