-
Notifications
You must be signed in to change notification settings - Fork 9
/
filter.js
43 lines (40 loc) · 935 Bytes
/
filter.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
const uploadImage = require("../lib/uploadImage");
let handler = async (m, { conn, args, usedPrefix, command }) => {
let filt = `
balas foto dengan caption opsi di bawah ini:
┌〔 Opsi 〕
├ greyscale
├ invert
├ invertgreyscale
├ brightness
├ threshold
├ sepia
├ red
├ green
├ blue
├ blurple
├ blurple2
└────
`.trim();
if (!args[0]) throw filt;
let q = m.quoted ? m.quoted : m;
let mime = (q.msg || q).mimetype || "";
if (!mime) throw filt;
let media = await q.download();
let link = await uploadImage(media).catch(
(_) => "https://telegra.ph/file/24fa902ead26340f3df2c.png"
);
conn.sendFile(
m.chat,
API("https://some-random-api.ml", "/canvas/" + args[0], {
avatar: link,
}),
"",
args[0],
m
);
};
handler.help = ["filter"].map((v) => v + " <foto>");
handler.tags = ["tools"];
handler.command = /^(filter|filters)$/i;
module.exports = handler;