Last active
December 18, 2022 05:46
-
-
Save souravkl11/2607bcc2550a2e2325d985dcfa882cb6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let e = require('../events'); | |
let { | |
MessageType, | |
Mimetype | |
} = require('@adiwajshing/baileys'); | |
let w = require('../config'); | |
let { | |
query | |
} = require('raganork-bot'); | |
let a = w.WORKTYPE == 'public' ? false : true; | |
e.addCommand({ | |
pattern: 'spdf ?(.*)', | |
fromMe: a, | |
desc: 'Prints url to a pdf file' | |
}, (async (m, te) => { | |
if (!te[1]) return await m.sendMessage("_Give me a url!_") | |
var res = await query.skbuffer(`https://api.html2pdf.app/v1/generate?url=${te[1]}&apiKey=ZuGkDsLiohALLPIbeRY8T0j764bDyRknQjAYlcu1RdIGeEQ2RMWfUVdYhnPuB2tG`) | |
return await m.client.sendMessage(m.jid, res, MessageType.document, { | |
filename: 'Site_PDF_Format', | |
mimetype: Mimetype.pdf, | |
quoted: m.data | |
}); | |
})); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment