Skip to content

Commit

Permalink
Create ranscrape.js
Browse files Browse the repository at this point in the history
  • Loading branch information
SkulZOnTheYT authored Nov 12, 2023
1 parent e827cba commit 7290d0c
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions plugins/nsfw/ranscrape.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { pickRandom } from '../../lib/func.js'
import { sticker } from '../../lib/sticker.js'

let handler = async (m, { conn, usedPrefix, command }) => {
try {
let res = await fetch(`https://raw.githubusercontent.com/clicknetcafe/Databasee/main/nsfw/${command.replace('manga2nsfw','manga').replace('nekonimensfw','nekonime')}.json`)
let anu = pickRandom(await res.json())
if (!anu) throw Error('error : no url')
if (anu.split('.').pop() == 'gif') {
let buffer = await sticker(false, anu, packname, author)
await conn.sendFile(m.chat, buffer, '', '', m)
} else await conn.sendFile(m.chat, anu, '', `_Random pic : ${command}_`, m)
} catch (e) {
console.log(e)
m.reply('scrape failed')
}
}

handler.menunsfw = ['eba','foot','gifs','jahy','manga2nsfw','neko2','nekonimensfw','nsfwloli','nsfwmanga','nsfwneko','panties','zettai']
handler.tagsnsfw = ['randompic']
handler.command = /^(eba|foot|gifs|jahy|manga2nsfw|neko2|nekonimensfw|nsfwloli|nsfwmanga|nsfwneko|panties|zettai)$/i

handler.premium = false
handler.limit = true
handler.nsfw = true

export default handler

0 comments on commit 7290d0c

Please sign in to comment.