text: //made by Anshul
  const uploadImage = require('../lib/uploadImage')
  const { sticker } = require('../lib/sticker')
  const { MessageType } = require('@adiwajshing/baileys')
  const effects = ['greyscale', 'invert', 'brightness', 'threshold', 'sepia', 'red', 'green', 'blue', 'blurple', 'pixelate', 'blur']
  
  let handler = async (m, { conn, usedPrefix, text, command }) => {
    let effect = text.trim().toLowerCase()
    if (!effects.includes(effect)) throw `
  ┌─〔 Daftar Efek 〕
  ${effects.map(effect => `├ ${effect}`).join('\n')}
  └────
  contoh: 
  ${usedPrefix + command} greyscale
  `.trim()
    let q = m.quoted ? m.quoted : m
    let mime = (q.msg || q).mimetype || ''
    if (!mime) throw 'balas gambarnya!'
    if (!/image\/(jpe?g|png)/.test(mime)) throw `Mime ${mime} tidak didukung`
    let img = await q.download()
    let url = await uploadImage(img)
    let apiUrl = global.API('https://some-random-api.ml/canvas/', encodeURIComponent(effect), {
      avatar: url
    })
    try {
      let stiker = await sticker(null, apiUrl, global.packname, global.author)
      await conn.sendMessage(m.chat, stiker, MessageType.sticker, {
        quoted: m
      })
    } catch (e) {
      await conn.sendFile(m.chat, apiUrl, 'image.png', null, m, 0, { thumbnail: await (await fetch(apiUrl)).buffer() })
    }
  }
  
  handler.help = ['stikerfilter']
  handler.tags = ['sticker']
  handler.command = /^(s(tic?ker)?filter)$/i
  
  module.exports = handler