Skip to content

Commit

Permalink
[ Jessi-md V- 5.0.0☇ ]
Browse files Browse the repository at this point in the history
  • Loading branch information
whiteshadowofficial authored Apr 23, 2024
1 parent b2ed282 commit 5fb3311
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions plugins/tools-bitly.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { bitly } from '@shizodevs/wabotmodule';

let handler = async (m, { conn, args }) => {
try {
const longURL = args[0];
if (!longURL) {
return conn.reply(m.chat, 'Please provide a long URL.', m);
}
const { shortURL, qrCode } = await bitly(longURL);
await conn.sendFile(m.chat, qrCode, 'qrcode.png', `Successfuly Shorted Your Link ✅
🏴‍☠️ *Original Link:* ${longURL}
🧟‍♂️ *Shorted Link:* ` + shortURL + `
📢 *Powered by:* Bit.ly
👨‍🎓 *Developer:* ${author}`, m);
} catch (error) {
console.error(error);
conn.reply(m.chat, 'Failed to create short URL and QR code.\n' + error, m);
}
};
handler.help = ['shortlink <longLink>', 'bitly <longlink>'];
handler.tags = ['tools'];
handler.command = /^(shortlink|bitly)$/i;

export default handler;

0 comments on commit 5fb3311

Please sign in to comment.