-
-
Notifications
You must be signed in to change notification settings - Fork 579
/
Copy pathbuscadores.js
170 lines (147 loc) · 5.53 KB
/
buscadores.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
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
import { googleIt } from '@bochilteam/scraper'
import fetch from 'node-fetch'
import axios from 'axios'
import yts from 'yt-search'
import fs from 'fs'
let handler = async (m, { conn, command, usedPrefix, args, text }) => {
const isCommand1 = /^(googlef?)$/i.test(command)
const isCommand2 = /(openai|chatgpt|ia|ai)/i.test(command)
const isCommand3 = /^(bot|simi|simsimi|alexa|bixby|cortana|siri|okgoogle)$/i.test(command)
const isCommand4 = /^(githubstalk|usuariogithub|usergithub)$/i.test(command)
const isCommand5 = /^(yt(s|search))$/i.test(command)
let fkontak = { "key": { "participants":"[email protected]", "remoteJid": "status@broadcast", "fromMe": false, "id": "Halo" }, "message": { "contactMessage": { "vcard": `BEGIN:VCARD\nVERSION:3.0\nN:Sy;Bot;;;\nFN:y\nitem1.TEL;waid=${m.sender.split('@')[0]}:${m.sender.split('@')[0]}\nitem1.X-ABLabel:Ponsel\nEND:VCARD` }}, "participant": "[email protected]" }
async function reportError(e) {
await m.reply(lenguajeGB['smsMalError3']() + '\n*' + lenguajeGB.smsMensError1() + '*\n*' + usedPrefix + `${lenguajeGB.lenguaje() == 'es' ? 'reporte' : 'report'}` + '* ' + `${lenguajeGB.smsMensError2()} ` + usedPrefix + command)
console.log(`❗❗ ${lenguajeGB['smsMensError2']()} ${usedPrefix + command} ❗❗`)
console.log(e)
}
switch (true) {
case isCommand1:
if (!text) return conn.reply(m.chat, lenguajeGB.smsAvisoMG() + lenguajeGB.smsMalused2() + `\n*${usedPrefix + command} Qué es Matemáticas?*` , m)
try{
const fetch = (await import('node-fetch')).default
let full = /f$/i.test(command)
let text = args.join` `
let url = 'https://google.com/search?q=' + encodeURIComponent(text)
let search = await googleIt(text, { limit: 30 });
let msg = search.articles.map(({ title, url, description }) => { return `*${title}*\n_${url}_\n_${description}_` }).join('\n\n')
m.reply(msg)
} catch (e) {
reportError(e)
}
break
case isCommand2:
if (!text) return conn.reply(m.chat, lenguajeGB.smsOpenai1() + `\n*${usedPrefix + command}* ${lenguajeGB.smsOpenai2()}\n\n*${usedPrefix + command}* ${lenguajeGB.smsOpenai3()}` , m)
try {
await conn.sendPresenceUpdate('composing', m.chat)
let tiores = await fetch(`https://api.lolhuman.xyz/api/openai?apikey=${lolkeysapi}&text=${text}&user=user-unique-id`)
let hasil = await tiores.json()
m.reply(`${hasil.result}`.trim())
} catch (e) {
reportError(e)
}
break
case isCommand3:
if (!text) return conn.reply(m.chat, lenguajeGB.smsMalused2() + `\n*${usedPrefix + command} ${lenguajeGB.smsCreA()}*` , m)
try{
await conn.sendPresenceUpdate('composing', m.chat)
let res = await fetch (`https://api.simsimi.net/v2/?text=${text}&lc=${lenguajeGB.lenguaje()}`)
let json = await res.json()
let tes = json.success.replace('simsimi', 'simsimi').replace('Simsimi', 'Simsimi').replace('sim simi', 'sim simi')
m.reply(`${tes}`)
} catch (e) {
reportError(e)
}
break
case isCommand4:
if (!text) return conn.reply(m.chat, lenguajeGB.smsGit1(usedPrefix, command), m)
await m.reply(lenguajeGB.smsGit2())
try{
let err = lenguajeGB.smsGit14()
let request = await githubstalk(text)
let { username, following, followers, type, bio, company, blog, location, email, public_repo, public_gists, profile_pic } = request
let thumb = await (profile_pic)
let cont = `*╭• • • • • G I T H U B • • • • •╮*\n
${lenguajeGB.smsGit3()}
${username || err}
${lenguajeGB.smsGit4()}
${bio || err}
${lenguajeGB.smsGit5()}
${company || err}
${lenguajeGB.smsGit6()}
${email || err}
${lenguajeGB.smsGit7()}
${blog || err}
${lenguajeGB.smsGit8()}
${public_repo || err}
${lenguajeGB.smsGit9()}
${public_gists || err}
${lenguajeGB.smsGit10()}
${followers || err}
${lenguajeGB.smsGit11()}
${following || err}
${lenguajeGB.smsGit12()}
${location || err}
${lenguajeGB.smsGit13()}
${type || err}`
await conn.sendFile(m.chat, thumb || gataMenu.getRandom(), 'githubstalk.jpg', cont, fkontak)
} catch (e) {
reportError(e)
}
break
case isCommand5:
if (!text) throw lenguajeGB.smsMalused2() + `*${usedPrefix + command}* GataBot`
try{
await conn.reply(m.chat, global.wait, m)
let results = await yts(text)
let tes = results.all
let teks = results.all.map(v => {
switch (v.type) {
case 'video': return `
⁖❤️꙰༻ *TÍTULO*
» ${v.title || lenguajeGB.smsGit14()}
⁖🩵꙰༻ *ENLACE*
» ${v.url || lenguajeGB.smsGit14()}
⁖💜꙰༻ *DURACIÓN*
» ${v.timestamp || lenguajeGB.smsGit14()}
⁖💚꙰༻ *SUBIDO*
» ${v.ago || lenguajeGB.smsGit14()}
⁖🧡꙰༻ *VISTAS*
» ${v.views || lenguajeGB.smsGit14()}`.trim()
}}).filter(v => v).join('\n\n••••••••••••••••••••••••••••••••••••\n\n')
await conn.sendFile(m.chat, tes[0].thumbnail, 'yts.jpeg', teks, m)
} catch (e) {
reportError(e)
}
break
}}
handler.command = /^(googlef?|openai|chatgpt|ia|ai|bot|simi|simsimi|alexa|bixby|cortana|siri|okgoogle|githubstalk|usuariogithub|usergithub|(yt(s|search)))$/i
handler.register = true
export default handler
async function githubstalk(user) {
return new Promise((resolve, reject) => {
axios.get('https://api.github.com/users/'+user)
.then(({ data }) => {
let hasil = {
username: data.login,
nickname: data.name,
bio: data.bio,
id: data.id,
nodeId: data.node_id,
profile_pic: data.avatar_url,
url: data.html_url,
type: data.type,
admin: data.site_admin,
company: data.company,
blog: data.blog,
location: data.location,
email: data.email,
public_repo: data.public_repos,
public_gists: data.public_gists,
followers: data.followers,
following: data.following,
ceated_at: data.created_at,
updated_at: data.updated_at
}
resolve(hasil)})})
}