-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgoogle.js
More file actions
30 lines (26 loc) 路 1.02 KB
/
Copy pathgoogle.js
File metadata and controls
30 lines (26 loc) 路 1.02 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
let fetch = require('node-fetch')
let googleIt = require('google-it')
let handler = async (m, { conn, command, args }) => {
let full = /f$/i.test(command)
let text = args.join` `
if (!text) return conn.reply(m.chat, 'Tidak ada teks untuk di cari', m)
let url = 'https://google.com/search?q=' + encodeURIComponent(text)
let search = await googleIt({ query: text })
let msg = search.map(({ title, link, snippet}) => {
return `*${title}*\n_${link}_\n_${snippet}_`
}).join`\n\n`
let ss = await (await fetch('https://nurutomo.herokuapp.com/api/ssweb?delay=1000&url=' + encodeURIComponent(url) + '&full=' + full)).buffer()
conn.sendFile(m.chat, ss, 'screenshot.png', url + '\n\n' + msg, m)
}
handler.help = ['google', 'googlef'].map(v => v + ' <pencarian>')
handler.tags = ['internet']
handler.command = /^googlef?$/i
handler.owner = false
handler.mods = false
handler.premium = false
handler.group = false
handler.private = false
handler.admin = false
handler.botAdmin = false
handler.fail = null
module.exports = handler