Instantly share code, notes, and snippets.
Last active
April 4, 2025 03:00
-
Star
0
(0)
You must be signed in to star a gist -
Fork
1
(1)
You must be signed in to fork a gist
-
Save Mr-rabbit-xd/f1073f079f3e49b182e5eb047a25b40c to your computer and use it in GitHub Desktop.
This file contains hidden or 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
const { bot, getBuffer, jidToNum, genThumbnail } = require('../lib/'); | |
const { VERSION } = require('../config'); | |
const { | |
textToStylist, | |
getUptime, | |
PLUGINS, | |
getRam, | |
addSpace, | |
} = require('../lib/'); | |
const url1 = 'https://files.catbox.moe/x7g4x8.jpeg'; | |
const url2 = 'https://files.catbox.moe/jf826z.jpeg'; | |
bot( | |
{ | |
pattern: 'menu ?(.*)', | |
desc: 'custom Menu', | |
type: 'misc', | |
}, | |
async (message, match, ctx) => { | |
const jid = message.jid; | |
const number = message.client.user.jid; | |
const thumb = await getBuffer(url1); | |
const thumbnail = await getBuffer(url2); | |
const date = new Date(); | |
const sorted = ctx.commands.sort((a, b) => { | |
if (a.name && b.name) { | |
return a.name.localeCompare(b.name); | |
} | |
return 0; | |
}); | |
const commands = {}; | |
ctx.commands.map(async (command, index) => { | |
if (command.dontAddCommandList === false && command.pattern !== undefined) { | |
let cmdType = command.type.toLowerCase(); | |
if (!commands[cmdType]) commands[cmdType] = []; | |
let isDisabled = command.active === false; | |
let cmd = command.name.trim(); | |
commands[cmdType].push(isDisabled ? cmd + ' [disabled]' : cmd); | |
} | |
}); | |
let CMD_HELP = `╭━━━〔 MR- Rabbit 〕━━━···▸ | |
┃╭──────────────···▸ | |
┃❍│▸ 𝐑𝐔𝐍: ${getUptime('t')} | |
┃❍│▸ 𝐌𝐎𝐃𝐄 : Private | |
┃❍│▸ 𝐑𝐀𝐌: ${getRam()} | |
┃❍│▸ 𝐂𝐑𝐄𝐀𝐓𝐎𝐑: — MR- Rabbit | |
┃❍│▸ 𝐀𝐋𝐖𝐀𝐘𝐒 𝐎𝐍𝐋𝐈𝐍𝐄: true | |
┃❍│▸ 𝐕𝐄𝐑𝐒𝐈𝐎𝐍 : ${VERSION} | |
┃╰──────────────···▸ | |
╰━━━━━━━━━━━━━━━···▸ | |
ɪғ ʏᴏᴜ ᴡᴀɴᴛ ʙᴏᴛ ᴄᴏɴᴛᴀᴄᴛ ᴛᴏ .ᴏᴡɴᴇʀ | |
♡︎•━━━━━━☻︎━━━━━━•♡︎ | |
*〈│MR- Rabbit 𝐌𝐄𝐍𝐔 𝐋𝐈𝐒𝐓│〉*" | |
`; | |
for (let cmdType in commands) { | |
CMD_HELP += `╭━─━─━─≪❥≫ | |
│ *${cmdType.toUpperCase()} ❞* | |
╰━─━─━─≪❥≫\n`; | |
commands[cmdType].forEach((cmd) => { | |
CMD_HELP += `*│ ${textToStylist(cmd, 'mono')}\n`; | |
}); | |
} | |
const Data = {}; | |
Data.linkPreview = { | |
renderLargerThumbnail: true, | |
showAdAttribution: false, | |
head: '𝐌𝐔𝐋𝐓𝐈𝐏𝐋𝐀𝐘𝐄𝐑 𝐃𝐄𝐕𝐈𝐂𝐄 𝐁𝐎𝐓⏳🌻💀', | |
body: 'ᴘᴏᴡᴇʀ ʙʏ- MR- Rabbit', | |
mediaType: 1, | |
thumbnail: thumb.buffer, | |
sourceUrl: 'https://whatsapp.com/channel/0029VaqdVpYGU3BTWmGp5Z2r', | |
}; | |
Data.quoted = { | |
key: { | |
fromMe: false, | |
participant: '[email protected]', | |
remoteJid: 'status@broadcast', | |
}, | |
message: { | |
contactMessage: { | |
displayName: `${message.pushName}`, | |
vcard: `BEGIN:VCARD\nVERSION:3.0\nN:XL;${message.client.user.name},;;;\nFN:${message.client.user.name},\nitem1.TEL;waid=${jidToNum(number)}\nitem1.X-ABLabel:WhatsApp\nEND:VCARD`, | |
jpegThumbnail: await genThumbnail(thumbnail.buffer), | |
}, | |
}, | |
}; | |
return await message.send(`${CMD_HELP}`, Data); | |
} | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment