Instantly share code, notes, and snippets.
-
Star
0
(0)
You must be signed in to star a gist -
Fork
0
(0)
You must be signed in to fork a gist
-
-
Save kajju027/b6ef8be3cd622ccc8ced6dbe12b289e1 to your computer and use it in GitHub Desktop.
๐Owner
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, getRam } = require('../lib/'); | |
| const url = 'https://i.ibb.co/67kqLrB4/file-00000000db347209b1d054fac0b2788e.png'; | |
| 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 = `*โญโโโใS A Y A Nใโโโโฎ*\n`; | |
| CMD_HELP += `*โ๐ Owner:* ๐ซ๊ถแดสแดษด แดแดษช๐ชพ\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 += `*โ ๐๐๐ข๐:* ๊ถแดสแดษด แดแดษช\n`; | |
| CMD_HELP += `*โ ๐๐ช๐ข๐๐๐ง:* +918972767390\n`; | |
| CMD_HELP += `*โ ๐๐๐๐๐ผ:* @SAYAN.COMM\n`; | |
| CMD_HELP += `*โ ๐๐:* yt/FUCKINGTUBE\n`; | |
| CMD_HELP += `*โ ๐Mail:* sayanbusiness027@gmail.com\n`; | |
| CMD_HELP += `*โฐโโโโโโโโโโโโโโโโโโโโโโฏ*`; | |
| // โ Fix: buffer issue | |
| const Data = { | |
| linkPreview: { | |
| renderLargerThumbnail: true, | |
| showAdAttribution: true, | |
| head: 'แฎแดแดกแดสแดแด แดส ๊ถแดสแดษด แดแดษช ๐', | |
| body: '๐ซ ๊ถแดสแดษด แดแดษช ', | |
| mediaType: 1, | |
| thumbnail: thumb.buffer, // fixed | |
| sourceUrl: 'https://wa.me/918972767390', | |
| }, | |
| quoted: { | |
| key: { | |
| fromMe: false, | |
| participant: '0@s.whatsapp.net', | |
| 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