Skip to content

Instantly share code, notes, and snippets.

@glitchisno1
Forked from techgod143/Own*MENU*Levanter
Created February 4, 2025 19:18
Show Gist options
  • Save glitchisno1/ff2706c429deff5d5db34e7464b0b632 to your computer and use it in GitHub Desktop.
Save glitchisno1/ff2706c429deff5d5db34e7464b0b632 to your computer and use it in GitHub Desktop.
Levanter own menu
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/ax07iz.jpeg';
const url2 = 'https://files.catbox.moe/7rrcre.jpeg';
bot(
{
pattern: 'men ?(.*)',
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 = `╭━─━─━─≪✠≫─━─━─━╮
*Tech God👑🖤🎧*
╰━─━─━─≪✠≫─━─━─━╯
╭━─━─━─≪✠≫─━─━─━╮
│ 📅 *Date:* ${date.toLocaleDateString('en')}
│ ⏰ *Time:* ${date.toLocaleTimeString()}
│ ❄️ *Day:* ${date.toLocaleString('en', { weekday: 'long' })}
│ ✨ *Version:* ${VERSION}
│ 🪻 *RAM:* ${getRam()}
│ ⏳ *Uptime:* ${getUptime('t')}
╰━─━─━─≪✠≫─━─━─━╯
`;
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: '🤍Bot By Tech God🇮🇳•',
body: '〆 Thanks for use Levanter bot𓆩愛𓆪',
mediaType: 1,
thumbnail: thumb.buffer,
sourceUrl: 'https://whatsapp.com/channel/0029Va9Ufzi8kyyEnEHvOm1h',
};
Data.quoted = {
key: {
fromMe: false,
participant: '0@s.whatsapp.net',
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