Repository navigation
Expand file tree
/
Copy pathpush.js
More file actions
307 lines (220 loc) · 8.69 KB
/
Copy pathpush.js
File metadata and controls
307 lines (220 loc) · 8.69 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
const {
"default": makeWASocket,
downloadContentFromMessage,
fetchLatestBaileysVersion,
useMultiFileAuthState,
makeInMemoryStore,
DisconnectReason,
WAGroupMetadata,
relayWAMessage,
MediaPathMap,
mentionedJid,
processTime,
MediaType,
Browser,
MessageType,
Presence,
Mimetype,
Browsers,
delay,
MessageRetryMap
} = require("@whiskeysockets/baileys");
// MÓDULOS ABAIXO..
const { Boom } = require("@hapi/boom");
const axios = require("axios");
const fs = require("fs-extra");
const cheerio = require("cheerio");
const crypto = require("crypto");
const util = require("util");
const P = require("pino");
const NodeCache = require("node-cache");
const linkfy = require("linkifyjs");
const request = require("request");
const ms = require("ms");
const ffmpeg = require("fluent-ffmpeg");
const fetch = require("node-fetch");
const qrterminal = require("qrcode-terminal");
const { exec, spawn, execSync } = require("child_process");
const moment = require("moment-timezone");
const colors = require("colors");
const time = moment.tz("America/Sao_Paulo").format("HH:mm:ss");
const hora = moment.tz("America/Sao_Paulo").format("HH:mm:ss");
const date = moment.tz("America/Sao_Paulo").format("DD/MM/YY");
// FUNÇÕES ABAIXO...
const webp_mp4 = require("./armor/js/webp_mp4.js");
const { sendVideoAsSticker, sendImageAsSticker } = require("./armor/sticker/rename.js");
const { sendVideoAsSticker2, sendImageAsSticker2 } = require("./armor/sticker/rename2.js");
const { addLimit, getLimit } = require("./armor/js/limit.js");
const { addBanned, unBanned, BannedExpired, cekBannedUser } = require("./armor/js/banned.js");
const { validmove, setGame } = require("./armor/tictactoe");
const { addComandosId, deleteComandos, getComandoBlock, getComandos, addComandos } = require("./armor/js/addcmd.js");
const { wait, getExtension, generateMessageID, getMembros, getGroupAdmins, getRandom, banner, banner2, banner3, temporizador, chyt, getBuffer, fetchJson, fetchText, createExif, getBase64, convertSticker, nit, getpc, supre, recognize, FormData } = require("./armor/funcoes/functions.js"); // FUNÇÕES NESCESSARIAS PRA FUNFAR ALGUMAS COISAS
// JSON FUNÇÕES ABAIXO CONSTS >
const rg_aluguel = JSON.parse(fs.readFileSync("./armor/json/rg_aluguel.json"));
const rgp = JSON.parse(fs.readFileSync("./armor/json/TMGP.json"));
const sotoy = JSON.parse(fs.readFileSync("./armor/json/sotoy.json"));
try {
var countMessage = JSON.parse(fs.readFileSync("./armor/countmsg.json"));
} catch {
fs.writeFileSync("./armor/countmsg.json", JSON.stringify([]));
}
const comandos = JSON.parse(fs.readFileSync("./armor/comandos.json"));
const daily = JSON.parse(fs.readFileSync("./datab/usuarios/diario.json"));
const nescessario = JSON.parse(fs.readFileSync("./dono/nescessario.json"));
const premium = JSON.parse(fs.readFileSync("./armor/premium.json"));
const ban = JSON.parse(fs.readFileSync("./datab/usuarios/banned.json"));
const limitefll = JSON.parse(fs.readFileSync("./datab/usuarios/flood.json"));
const patentes = JSON.parse(fs.readFileSync("./armor/patentes.json"));
const antispam = JSON.parse(fs.readFileSync("./dono/media/antispam.json"));
const rggold = JSON.parse(fs.readFileSync("./armor/json/golds.json"));
const anotar = JSON.parse(fs.readFileSync("./armor/json/anotar.json"));
const setting = JSON.parse(fs.readFileSync("./dono.json"));
const logoslink = JSON.parse(fs.readFileSync("./armor/logos.json"));
const black_ = JSON.parse(fs.readFileSync("./datab/grupos/AVISOS.json"));
//\\
// JS DE MENUS / INFORMAÇÕES DE UTILIZAR \
const { menu, adms, menudono, menulogos, menuprem, brincadeiras, efeitos, alteradores } = require("./dono/menus/menus.js");
const { infobemvindo, infobancarac, infolistanegra, infopalavrao, infocontador, infosorteio, tabela, cmd_termux, infoduelo, idiomagtts, infotransmitir, infoaluguel, anotacao } = require("./dono/infos/infos_global.js");
const { infodono } = require("./dono/menus/infodono.js");
const { gitdobot } = require("./dono/gitdobot.js");
const { configbot } = require("./dono/menus/configurar.js");
const { conselhob } = require("./armor/js/conselhob.js");
const { palavrasc } = require("./armor/js/conselhos.js");
//\\
// PEGAR LINK DA IMAGEM
function upload(midia) {
return new Promise(async (resolve, reject) => {
try {
const { fromBuffer } = require("file-type");
const { ext } = await fromBuffer(midia);
const form = new FormData();
form.append("file", midia, "tmp." + ext);
fetch("https://telegra.ph/upload", {
method: "POST",
body: form
}).then((response) => response.json())
.then((data) => {
resolve("https://telegra.ph" + data[0].src);
}).catch((error) => reject(error));
} catch (error) {
console.log(error);
reject(error);
}
});
}
// DELETAR ARQUIVO..
function DLT_FL(file) {
try {
fs.unlinkSync(file);
} catch (error) {
}
}
// CONVERTER BYTES EM KB / MB / GB / TB
const convertBytes = function(bytes) {
const sizes = ["Bytes", "KB", "MB", "GB", "TB"];
if(bytes == 0) {
return "n/a";
}
const i = parseInt(Math.floor(Math.log(bytes) / Math.log(1024)));
if(i == 0) {
return bytes + " " + sizes[i];
}
return (bytes / Math.pow(1024, i)).toFixed(1) + " " + sizes[i];
};
// ANTI NOME MODIFICADA / EMOJI
function ANT_LTR_MD_EMJ(str) {
for (let i = 0, n = str.length; i < n; i++) {
if(str.charCodeAt(i) > 255) {
return true;
}
}
return false;
}
// Transformar segundos em hora/minutos
function kyun(seconds){
function pad(s){
return (s < 10 ? "0" : "") + s;
}
var dias = Math.floor(seconds / (60*60) / (24));
var horas = Math.floor(seconds / (60*60) % (24));
var minutos = Math.floor(seconds % (60*60) / 60);
var segundos = Math.floor(seconds % 60);
return `${pad(dias)} Dia(s) ${pad(horas)} Hora(s) ${pad(minutos)} Minuto(s) ${pad(segundos)} Segundo(s)`;
}
// FUNÇÃO DO BAILES PRA PUXAR MÍDIA ENVIADA, E EXECUTAR AÇÃO..
const getFileBuffer = async (mediakey, MediaType) => {
const stream = await downloadContentFromMessage(mediakey, MediaType);
let buffer = Buffer.from([]);
for await(const chunk of stream) {
buffer = Buffer.concat([buffer, chunk]);
}
return buffer;
};
// Tudo abaixo await sleep(1000) vai demorar 1 segundo pra funcionar, 1000 é igual 1 segundo..
const sleep = async (ms) => {return new Promise(resolve => setTimeout(resolve, ms));
};
// ENVIAR FIGU EM URL
const enviarfiguUrl = async (conn, from, link, mr) => {
ranp = getRandom(".gif");
rano = getRandom(".webp");
ini_buffer = `${link}`;
exec(`wget ${ini_buffer} -O ${ranp} && ffmpeg -i ${ranp} -vcodec libwebp -filter:v fps=fps=15 -lossless 1 -loop 0 -preset default -an -vsync 0 -s 320:320 ${rano}`, (err) => {
DLT_FL(ranp);
buff = fs.readFileSync(rano);
conn.sendMessage(from, {sticker: buff}, {quoted: mr}).catch(() => {
return console.log("Erro..");
});
DLT_FL(rano);
});
};
const comand = (conn, info, prefix, isGroup, Res_SoGrupo, sender, pushname, command, reply, args, from, mentions, Res_SoAdm, Res_BotADM, isGroupAdmins, isBotGroupAdmins, upsert) => {
async function comandos_que_nao_usa_muito() {
switch(command) {
}
}
comandos_que_nao_usa_muito().catch(e => {
console.log(e+" - CSFJ")
})
}
// INTELIGENCIA-ARTIFICIAL
const simih = async (text) => {
try {
datasimi = await fetchJson(`https://api.simsimi.vn/v1/simtalk`, {method: "POST",
headers: {"content-type": "application/x-www-form-urlencoded"},
body: "text="+text+"&lc=pt"})
if(datasimi.message == "Required parameter is not present") return
return datasimi.message
} catch (e){
return
}}
module.exports = {
// MÓDULOS ABAIXO >
P, fs, util, Boom, axios, linkfy, request, ms, ffmpeg, fetch,
qrterminal, exec, spawn,
execSync, limitefll, moment, time, hora, date,
// FUNÇÕES JS ABAIXO >
comand, getBuffer, convertSticker, fetchJson,
fetchText, getBase64, createExif, addLimit,
getLimit, upload, nit,
addBanned, unBanned, BannedExpired,
cekBannedUser, validmove, setGame,
addComandosId, deleteComandos, getComandoBlock,
getComandos, addComandos, getpc, supre, wait,
getExtension, generateMessageID, getGroupAdmins,
getMembros, getRandom, banner, banner2, banner3,
temporizador, chyt, webp_mp4, simih,
// JSON FUNÇÕES ABAIXO >
patentes, rggold, antispam, anotar, sotoy, countMessage, comandos, daily,
nescessario, premium, ban, black_, rgp, rg_aluguel,
// JSON JUNÇÕES DE ATIconst / DESATIconst
setting, logoslink,
// JS DE MENUS, INFORMAÇÕES DE UTILIZAR COMANDOS \\
menu, infosorteio, infoaluguel, idiomagtts, infotransmitir, anotacao, menudono, adms, menulogos,
efeitos, menuprem, brincadeiras,
infocontador, infobemvindo, infolistanegra,
infopalavrao, infobancarac, infodono, gitdobot,
configbot, cmd_termux, infoduelo, alteradores, tabela, conselhob, palavrasc,
recognize, colors, cheerio, NodeCache,
// FUNÇÃO...
kyun, sendVideoAsSticker, sendImageAsSticker, sendVideoAsSticker2,sendImageAsSticker2, enviarfiguUrl, getFileBuffer, DLT_FL, sleep, ANT_LTR_MD_EMJ, convertBytes
}