Spaces:
Paused
Paused
File size: 3,986 Bytes
bb69f9b |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 |
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())
}
)
|