Skip to content

Instantly share code, notes, and snippets.

@Mr-rabbit-xd
Last active March 30, 2025 16:13
Show Gist options
  • Save Mr-rabbit-xd/6137c645f81c98ce7b36d55b8bc95b7e to your computer and use it in GitHub Desktop.
Save Mr-rabbit-xd/6137c645f81c98ce7b36d55b8bc95b7e to your computer and use it in GitHub Desktop.
const { bot, lang } = require('../lib/');
const axios = require('axios');
bot(
{
pattern: 'short ?(.*)',
desc: 'Shorten a long URL',
type: 'utility',
},
async (_0xabc1, _0xdef2) => {
if (!_0xdef2) return await _0xabc1.send('\u274C Please provide a URL!\nExample: .short https://example.com');
try {
const _0x1234 = new Date().getTime();
await _0xabc1.send('\uD83D\uDD17 Shortening URL...');
const _0x5678 = await axios.get('https://tinyurl.com/api-create.php?url=' + encodeURIComponent(_0xdef2));
const _0x9abc = _0x5678.data;
const _0x7890 = new Date().getTime();
// "POWERED BY MR RABBIT"
const _0xhex = '504f5745524544204259204d5220524142424954';
const _0xsecret = Buffer.from(_0xhex, 'hex').toString('utf-8');
return await _0xabc1.send(
'\u2705 Shortened URL: ' + _0x9abc + '\n\n> \uD83D\uDD17 *' + _0xsecret + '*'
);
} catch (_0xfedc) {
console.error(_0xfedc);
return await _0xabc1.send('\u274C Failed to shorten the link. Try again!');
}
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment