Spaces:
Paused
Paused
| const bot = require('../lib/events') | |
| const { | |
| addSpace, | |
| textToStylist, | |
| getUptime, | |
| getRam, | |
| getDate, | |
| getPlatform, | |
| } = require('../lib/') | |
| bot.addCommand( | |
| { | |
| pattern: 'help ?(.*)', | |
| dontAddCommandList: true, | |
| }, | |
| async (message, match, ctx) => { | |
| const sorted = ctx.commands.sort((a, b) => { | |
| if (a.name && b.name) { | |
| return a.name.localeCompare(b.name) | |
| } | |
| return 0 | |
| }) | |
| const [date, time] = getDate() | |
| let CMD_HELP = `โญโโโโโโโโโโโโโโโโโฎ | |
| สแดแด แดษดแดแดส | |
| โฐโโโโโโโโโโโโโโโโโฏ | |
| โญโโโโโโโโโโโโโโโโ | |
| โ Prefix : ${ctx.PREFIX} | |
| โ User : ${message.pushName} | |
| โ Time : ${time} | |
| โ Day : ${date.toLocaleString('en', { weekday: 'long' })} | |
| โ Date : ${date.toLocaleDateString('hi')} | |
| โ Version : ${ctx.VERSION} | |
| โ Plugins : ${ctx.pluginsCount} | |
| โ Ram : ${getRam()} | |
| โ Uptime : ${getUptime('t')} | |
| โ Platform : ${getPlatform()} | |
| โฐโโโโโโโโโโโโโโโโ | |
| โญโโโโโโโโโโโโโโโโ | |
| ` | |
| sorted.map(async (command, i) => { | |
| if (command.dontAddCommandList === false && command.pattern !== undefined) { | |
| CMD_HELP += `โ ${i + 1} ${addSpace(i + 1, sorted.length)}${textToStylist( | |
| command.name.toUpperCase(), | |
| 'mono' | |
| )}\n` | |
| } | |
| }) | |
| CMD_HELP += `โฐโโโโโโโโโโโโโโโโ` | |
| return await message.send('```' + CMD_HELP + '```') | |
| } | |
| ) | |
| bot.addCommand( | |
| { | |
| pattern: 'list ?(.*)', | |
| dontAddCommandList: true, | |
| }, | |
| async (message, match, ctx) => { | |
| let msg = '' | |
| const sorted = ctx.commands.sort((a, b) => { | |
| if (a.name && b.name) { | |
| return a.name.localeCompare(b.name) | |
| } | |
| return 0 | |
| }) | |
| sorted.map(async (command, index) => { | |
| if (command.dontAddCommandList === false && command.pattern !== undefined) { | |
| msg += `${index + 1} ${command.name}\n${command.desc}\n\n` | |
| } | |
| }) | |
| await message.send('```' + msg.trim() + '```') | |
| } | |
| ) | |
| bot.addCommand( | |
| { | |
| pattern: 'menu ?(.*)', | |
| dontAddCommandList: true, | |
| }, | |
| async (message, match, ctx) => { | |
| 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 isDiabled = command.active === false | |
| let cmd = command.name.trim() | |
| commands[cmdType].push(isDiabled ? cmd + ' [disabled]' : cmd) | |
| } | |
| }) | |
| const [date, time] = getDate() | |
| let msg = `\`\`\`โญโโโ LEVANTER โโโโท | |
| โโโญโโโโโโโโโโโโโโ | |
| โโโ Prefix : ${ctx.PREFIX} | |
| โโโ User : ${message.pushName} | |
| โโโ Time : ${time} | |
| โโโ Day : ${date.toLocaleString('en', { weekday: 'long' })} | |
| โโโ Date : ${date.toLocaleDateString('hi')} | |
| โโโ Version : ${ctx.VERSION} | |
| โโโ Plugins : ${ctx.pluginsCount} | |
| โโโ Ram : ${getRam()} | |
| โโโ Uptime : ${getUptime('t')} | |
| โโโ Platform : ${getPlatform()} | |
| โโโฐโโโโโโโโโโโโโโโ | |
| โฐโโโโโโโโโโโโโโโโโโท\`\`\`\n` | |
| if (match && commands[match]) { | |
| msg += ` โญโโ ${textToStylist(match.toLowerCase(), 'smallcaps')} โ\n` | |
| for (const plugin of commands[match]) | |
| msg += ` โ ${textToStylist(plugin.toUpperCase(), 'mono')}\n` | |
| msg += ` โฐโโโโโโโโโโโโโโโโโ` | |
| return await message.send(msg) | |
| } | |
| for (const command in commands) { | |
| msg += ` โญโโ ${textToStylist(command.toLowerCase(), 'smallcaps')} โ\n` | |
| for (const plugin of commands[command]) | |
| msg += ` โ ${textToStylist(plugin.toUpperCase(), 'mono')}\n` | |
| msg += ` โฐโโโโโโโโโโโโโโโโโ\n` | |
| } | |
| await message.send(msg.trim()) | |
| } | |
| ) | |