Skip to content

Instantly share code, notes, and snippets.

@souravkl11
Last active December 18, 2022 05:46
Show Gist options
  • Save souravkl11/2607bcc2550a2e2325d985dcfa882cb6 to your computer and use it in GitHub Desktop.
Save souravkl11/2607bcc2550a2e2325d985dcfa882cb6 to your computer and use it in GitHub Desktop.
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