Skip to content

Instantly share code, notes, and snippets.

@mistershubhamkumar
Created September 17, 2025 02:24
Show Gist options
  • Select an option

  • Save mistershubhamkumar/b6576a8147f7d83640c24e1aa1ab9291 to your computer and use it in GitHub Desktop.

Select an option

Save mistershubhamkumar/b6576a8147f7d83640c24e1aa1ab9291 to your computer and use it in GitHub Desktop.
๐Ÿ‘‘Owner
const { bot, getBuffer, jidToNum, genThumbnail } = require('../lib/');
const { VERSION } = require('../config');
const { textToStylist, getUptime, getRam } = require('../lib/');
const url = 'https://files.catbox.moe/bro5sm.jpeg';
bot(
{
pattern: 'menu ?(.*)',
desc: 'Advanced Custom Menu',
type: 'settings',
},
async (message, match, ctx) => {
const jid = message.jid;
const number = message.client.user.jid;
const pushName = message.pushName || jidToNum(jid);
const date = new Date();
// โœ… Safe thumbnail fetch
const [thumb, thumbnail] = await Promise.all([getBuffer(url), getBuffer(url)]);
const uptime = getUptime();
const ramUsage = getRam();
const sorted = ctx.commands.sort((a, b) =>
a.name && b.name ? a.name.localeCompare(b.name) : 0
);
const commands = {};
let totalCmds = 0;
// โœ… Collect all commands
ctx.commands.forEach((command) => {
if (!command.dontAddCommandList && command.pattern) {
let cmdType = command.type ? command.type.toLowerCase() : 'misc';
if (!commands[cmdType]) commands[cmdType] = [];
let isDisabled = command.active === false;
let cmd = command.name ? command.name.trim() : 'unknown';
let formattedCmd = '.' + cmd.charAt(0).toUpperCase() + cmd.slice(1);
formattedCmd = textToStylist(formattedCmd, 'mono');
commands[cmdType].push(isDisabled ? `${formattedCmd} [disabled]` : formattedCmd);
totalCmds++;
}
});
// โœ… Category icons
const categoryIcons = {
owner: '๐Ÿ‘‘',
bot: '๐Ÿค–',
audio: '๐ŸŽต',
sticker: '๐Ÿ–ผ๏ธ',
search: '๐Ÿ”',
downloader: 'โฌ‡๏ธ',
group: '๐Ÿ‘ฅ',
game: '๐ŸŽฎ',
fun: '๐Ÿ˜‚',
tools: '๐Ÿ› ๏ธ',
user: '๐Ÿ™‹โ€โ™‚๏ธ',
misc: '๐Ÿงฉ',
photo: '๐Ÿ“ธ',
text: '๐Ÿ“',
anime: '๐ŸŽŒ',
ai: '๐Ÿง ',
textmaker: 'โœ๏ธ',
vars: '๐Ÿ“Š',
plugin: '๐Ÿ”Œ',
document: '๐Ÿ“ƒ',
autoreply: '๐Ÿค–',
schedule: '๐Ÿ“…',
personal: '๐Ÿงโ€โ™‚๏ธ',
budget: '๐Ÿ’ฐ',
video: '๐ŸŽฌ',
whatsapp: '๐Ÿ“ฑ',
};
// โœ… Header
let CMD_HELP = `*โ•ญโ”โ”โใ€˜๏ผณ๏ผจ๏ผต๏ผข๏ผจ๏ผก๏ผญ-๏ผธ-๏ผญ๏ผคใ€™โโ”โ”โ•ฎ*\n`;
CMD_HELP += `*โ”ƒ๐Ÿ‘‘ Owner:* ๐ŸซŸ๏ผณสœแดœส™สœแด€แด Sษชส€๐Ÿชพ\n`;
CMD_HELP += `*โ”ƒ๐Ÿ™‹ User:* ${pushName}\n`;
CMD_HELP += `*โ”ƒ๐Ÿ“ฆ Version:* ${VERSION}\n`;
CMD_HELP += `*โ”ƒ๐Ÿ“Š Total Cmds:* ${totalCmds}\n`;
CMD_HELP += `*โ”ƒโฑ๏ธ Uptime:* ${uptime}\n`;
CMD_HELP += `*โ”ƒ๐Ÿชป RAM:* ${ramUsage}\n`;
CMD_HELP += `*โ”ƒ๐Ÿ“… Date:* ${date.toLocaleDateString()}\n`;
CMD_HELP += `*โ”ƒ๐Ÿ•’ Time:* ${date.toLocaleTimeString()}\n`;
CMD_HELP += `*โ”ƒโ„๏ธ Day:* ${date.toLocaleString('en', { weekday: 'long' })}\n`;
CMD_HELP += `*โ•ฐโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•ฏ*\n`;
// โœ… Commands list by category
for (let cmdType in commands) {
const icon = categoryIcons[cmdType] || '๐Ÿ“';
CMD_HELP += `\n*โ•ญโ”€โ”€โ ${icon} ${cmdType.toUpperCase()} โ*\n`;
commands[cmdType].forEach((cmd) => {
CMD_HELP += `*โ”œโฌก ${cmd}*\n`;
});
CMD_HELP += `*โ”•โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ*\n`;
}
// โœ… Footer (Owner info)
CMD_HELP += `\n*โ•ญโ”โ”โ”[ ๐™Š๐™’๐™‰๐™€๐™ ๐™„๐™‰๐™๐™Š ]โ”โ”โ”โ•ฎ*\n`;
CMD_HELP += `*โ”ƒ ๐™‰๐™–๐™ข๐™š:* Sสœแดœส™สœแด€แด แด‹แดœแดแด€ส€\n`;
CMD_HELP += `*โ”ƒ ๐™‰๐™ช๐™ข๐™—๐™š๐™ง:* +916260273863\n`;
CMD_HELP += `*โ”ƒ ๐™„๐™‰๐™Ž๐™๐˜ผ:* @๐˜”๐˜ด๐˜ณ_๐˜ดสœแดœส™สœแด€แด_แด‹\n`;
CMD_HELP += `*โ”ƒ ๐™”๐™:* yt/shubham777k\n`;
CMD_HELP += `*โ”ƒ ๐™€Mail:* [email protected]\n`;
CMD_HELP += `*โ•ฐโ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ•ฏ*`;
// โœ… Fix: buffer issue
const Data = {
linkPreview: {
renderLargerThumbnail: true,
showAdAttribution: true,
head: 'ส•ใฃโ€ขแดฅโ€ขส”ใฃ-๊œฑสœแดœส™สœแด€แด-x-แดแด…',
body: '๐ŸซŸ๏ผณสœแดœส™สœแด€แด X-MD-',
mediaType: 1,
thumbnail: thumb.buffer, // fixed
sourceUrl: 'https://instagram.com/msr_shubham_k',
},
quoted: {
key: {
fromMe: false,
participant: '[email protected]',
remoteJid: 'status@broadcast',
},
message: {
contactMessage: {
displayName: `${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), // fixed
},
},
},
};
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