forked from embee/woomy
sans
This commit is contained in:
parent
da1ca8f986
commit
1a6cd52d06
2 changed files with 129 additions and 43 deletions
|
@ -11,8 +11,8 @@ exports.help = {
|
||||||
name: 'help',
|
name: 'help',
|
||||||
category: 'General',
|
category: 'General',
|
||||||
description: 'Sends you a list of Woomy\'s commands.',
|
description: 'Sends you a list of Woomy\'s commands.',
|
||||||
usage: '`help <command>`\n`help all` - View full command list.',
|
usage: '`help` - Lists all commands.\n`help <command>` - Receive more information on a command.',
|
||||||
params: '`<command>` - The name of the command you want more information on.'
|
examples: '`help`\n`help roleinfo`'
|
||||||
}
|
}
|
||||||
|
|
||||||
const Discord = require('discord.js')
|
const Discord = require('discord.js')
|
||||||
|
@ -29,75 +29,51 @@ exports.run = (client, message, args, level, data) => {
|
||||||
const categories = []
|
const categories = []
|
||||||
|
|
||||||
if (!args[0]) {
|
if (!args[0]) {
|
||||||
embed.setTitle('Woomy Help')
|
embed.setTitle('Woomy Commands')
|
||||||
embed.setDescription(`• Prefixes: ${'`' + prefixes.join('`, `') + '`'}\n• Use \`help <command>\` to recieve more information about a command!\n• Use \`help all\` to view hidden commands!\n• [Join my support server](https://discord.gg/HCF8mdv) if you have any issues/questions while using me!\n• [click here](https://discordapp.com/oauth2/authorize?client_id=435961704145485835&permissions=8&scope=bot) to add me to your own server!`)
|
embed.setDescription(`• Prefixes: ${'`' + prefixes.join('`, `') + '`'}\n• Use \`help <command>\` to recieve more information about a command!\n• [Join my support server](https://discord.gg/HCF8mdv)`)
|
||||||
const commands = message.guild ? client.commands.filter(
|
|
||||||
cmd => client.levelCache[cmd.conf.permLevel] <= level
|
|
||||||
) : client.commands.filter(
|
|
||||||
cmd => client.levelCache[cmd.conf.permLevel] <= level && cmd.conf.guildOnly !== true
|
|
||||||
)
|
|
||||||
|
|
||||||
commands.forEach((cmd) => {
|
|
||||||
if (!categories.includes(cmd.help.category)) {
|
|
||||||
categories.push(cmd.help.category)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
categories.sort().forEach((cat) => {
|
|
||||||
const filtered = commands.filter((cmd) => cmd.help.category === cat)
|
|
||||||
embed.addField(cat + ` [${filtered.size}]`, filtered.map((cmd) => '`' + cmd.help.name + '`').join(', '), true)
|
|
||||||
})
|
|
||||||
|
|
||||||
if (message.guild && data.guild.customCommands.length > 0) {
|
|
||||||
embed.addField('Custom', data.guild.customCommands.map((cmd) => '`' + cmd.name + '`').join(' '))
|
|
||||||
}
|
|
||||||
|
|
||||||
return message.channel.send(embed)
|
|
||||||
} else if (args[0].toLowerCase() === 'all') {
|
|
||||||
embed.setTitle('Woomy Help')
|
|
||||||
embed.setDescription(`• Prefixes: ${'`' + prefixes.join('`, `') + '`'}\n• Use \`help <command>\` to recieve more information about a command!\n• [Join my support server](https://discord.gg/HCF8mdv) if you have any issues/questions while using me!\n• [click here](https://discordapp.com/oauth2/authorize?client_id=435961704145485835&permissions=8&scope=bot) to add me to your own server!`)
|
|
||||||
const commands = client.commands
|
const commands = client.commands
|
||||||
|
|
||||||
commands.forEach((cmd) => {
|
commands.forEach((cmd) => {
|
||||||
if (!categories.includes(cmd.help.category)) {
|
if (!categories.includes(cmd.help.category)) {
|
||||||
|
if (cmd.help.category === 'Developer' && !client.config.devs.includes('message.author.id')) {
|
||||||
|
return
|
||||||
|
}
|
||||||
categories.push(cmd.help.category)
|
categories.push(cmd.help.category)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
categories.sort().forEach((cat) => {
|
categories.sort().forEach((cat) => {
|
||||||
const filtered = commands.filter((cmd) => cmd.help.category === cat)
|
const filtered = commands.filter((cmd) => cmd.help.category === cat)
|
||||||
embed.addField(cat + ` [${filtered.size}]`, filtered.map((cmd) => '`' + cmd.help.name + '`').join(' '))
|
embed.addField(cat, filtered.map((cmd) => '`' + cmd.help.name + '`').join(', '))
|
||||||
})
|
})
|
||||||
|
|
||||||
if (message.guild && data.guild.customCommands.length > 0) {
|
if (message.guild && data.guild.customCommands.length > 0) {
|
||||||
embed.addField('Custom', data.guild.customCommands.map((cmd) => '`' + cmd.name + '`').join(' '))
|
embed.addField('Custom', data.guild.customCommands.map((cmd) => '`' + cmd.name + '`').join(' '))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
embed.addField('Invite', '[Invite](https://discordapp.com/oauth2/authorize?client_id=435961704145485835&permissions=8&scope=bot) | [Discord Server](https://discord.gg/HCF8mdv)')
|
||||||
return message.channel.send(embed)
|
return message.channel.send(embed)
|
||||||
} else if (args[0]) {
|
} else {
|
||||||
const command = args.shift().toLowerCase()
|
const command = args.shift().toLowerCase()
|
||||||
const cmd = client.commands.get(command) || client.commands.get(client.aliases.get(command))
|
const cmd = client.commands.get(command) || client.commands.get(client.aliases.get(command))
|
||||||
if (!cmd) {
|
if (!cmd) {
|
||||||
return message.channel.send('Command/alias doesn\'t exist')
|
return message.channel.send('Command/alias doesn\'t exist')
|
||||||
}
|
}
|
||||||
|
|
||||||
let aliases = ''
|
let desc = ''
|
||||||
|
|
||||||
if (cmd.conf.aliases.length > 0) {
|
if (cmd.conf.aliases.length > 0) {
|
||||||
aliases = cmd.conf.aliases.join(', ')
|
desc += `*(Aliases: ${cmd.conf.aliases.join(', ')})*\n\n`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
desc += cmd.help.description + `\n\n**You need the \`${cmd.conf.permLevel}\` rank to run this command! This command has a cooldown of \`${cmd.conf.cooldown / 1000}\` seconds per user.**`
|
||||||
|
|
||||||
embed.setTitle(cmd.help.category.toLowerCase() + ':' + cmd.help.name)
|
embed.setTitle(cmd.help.category.toLowerCase() + ':' + cmd.help.name)
|
||||||
embed.setDescription(`*(Aliases: ${aliases})*\n\n${cmd.help.description}`)
|
embed.setDescription(desc)
|
||||||
embed.addField('**Usage:**', cmd.help.usage)
|
embed.addField('**Usage**', cmd.help.usage)
|
||||||
if (cmd.help.params.length > 0) {
|
if (cmd.help.examples.length > 0) {
|
||||||
embed.addField('**Parameters:**', cmd.help.params)
|
embed.addField('**Examples**', cmd.help.examples)
|
||||||
}
|
}
|
||||||
if (aliases) {
|
|
||||||
embed.addField('**Aliases:**', aliases)
|
|
||||||
}
|
|
||||||
embed.addField('**Permission level:**', cmd.conf.permLevel, true)
|
|
||||||
embed.addField('**Server only**', cmd.conf.guildOnly, true)
|
|
||||||
embed.addField('**Cooldown**', cmd.conf.cooldown / 1000 + ' seconds', true)
|
|
||||||
embed.setFooter('< > = optional, [ ] = required. Don\'t include the brackets in the command itself!')
|
embed.setFooter('< > = optional, [ ] = required. Don\'t include the brackets in the command itself!')
|
||||||
message.channel.send(embed)
|
message.channel.send(embed)
|
||||||
}
|
}
|
||||||
|
|
110
file.log
110
file.log
|
@ -1436,3 +1436,113 @@
|
||||||
2020-04-08T19:30:12 | [36minfo[39m | index.js | Loading 7 events.
|
2020-04-08T19:30:12 | [36minfo[39m | index.js | Loading 7 events.
|
||||||
2020-04-08T19:30:12 | [36minfo[39m | mongoose.js | Connected to the database.
|
2020-04-08T19:30:12 | [36minfo[39m | mongoose.js | Connected to the database.
|
||||||
2020-04-08T19:30:15 | [32mready[39m | ready.js | Connected to Discord as WoomyDev#4547
|
2020-04-08T19:30:15 | [32mready[39m | ready.js | Connected to Discord as WoomyDev#4547
|
||||||
|
2020-04-08T22:26:56 | [36minfo[39m | index.js | Loading 5 commands.
|
||||||
|
2020-04-08T22:26:56 | [36minfo[39m | index.js | Loading 7 events.
|
||||||
|
2020-04-08T22:26:56 | [36minfo[39m | mongoose.js | Connected to the database.
|
||||||
|
2020-04-08T22:26:59 | [32mready[39m | ready.js | Connected to Discord as WoomyDev#4547
|
||||||
|
2020-04-08T22:39:52 | [37mlog[39m | message.js | Command ran: help
|
||||||
|
2020-04-08T22:40:35 | [37mlog[39m | message.js | Command ran: help
|
||||||
|
2020-04-08T22:40:46 | [37mlog[39m | message.js | Command ran: help
|
||||||
|
2020-04-08T22:40:52 | [37mlog[39m | message.js | Command ran: help
|
||||||
|
2020-04-08T22:44:22 | [36minfo[39m | index.js | Loading 5 commands.
|
||||||
|
2020-04-08T22:44:22 | [36minfo[39m | index.js | Loading 7 events.
|
||||||
|
2020-04-08T22:44:23 | [36minfo[39m | mongoose.js | Connected to the database.
|
||||||
|
2020-04-08T22:44:26 | [32mready[39m | ready.js | Connected to Discord as WoomyDev#4547
|
||||||
|
2020-04-08T22:44:32 | [37mlog[39m | message.js | Command ran: help
|
||||||
|
2020-04-08T22:44:37 | [37mlog[39m | message.js | Command ran: help
|
||||||
|
2020-04-08T22:44:43 | [37mlog[39m | message.js | Command ran: help
|
||||||
|
2020-04-08T22:49:00 | [36minfo[39m | index.js | Loading 5 commands.
|
||||||
|
2020-04-08T22:49:00 | [36minfo[39m | index.js | Loading 7 events.
|
||||||
|
2020-04-08T22:49:00 | [36minfo[39m | mongoose.js | Connected to the database.
|
||||||
|
2020-04-08T22:49:03 | [32mready[39m | ready.js | Connected to Discord as WoomyDev#4547
|
||||||
|
2020-04-08T22:49:03 | [37mlog[39m | message.js | Command ran: help
|
||||||
|
2020-04-08T23:01:27 | [36minfo[39m | index.js | Loading 5 commands.
|
||||||
|
2020-04-08T23:01:27 | [36minfo[39m | index.js | Loading 7 events.
|
||||||
|
2020-04-08T23:01:27 | [36minfo[39m | mongoose.js | Connected to the database.
|
||||||
|
2020-04-08T23:01:30 | [32mready[39m | ready.js | Connected to Discord as WoomyDev#4547
|
||||||
|
2020-04-08T23:10:20 | [36minfo[39m | index.js | Loading 5 commands.
|
||||||
|
2020-04-08T23:10:20 | [36minfo[39m | index.js | Loading 7 events.
|
||||||
|
2020-04-08T23:10:20 | [36minfo[39m | mongoose.js | Connected to the database.
|
||||||
|
2020-04-08T23:10:23 | [32mready[39m | ready.js | Connected to Discord as WoomyDev#4547
|
||||||
|
2020-04-08T23:10:30 | [37mlog[39m | message.js | Command ran: help
|
||||||
|
2020-04-08T23:10:44 | [37mlog[39m | message.js | Command ran: help
|
||||||
|
2020-04-08T23:10:59 | [36minfo[39m | index.js | Loading 5 commands.
|
||||||
|
2020-04-08T23:11:00 | [36minfo[39m | index.js | Loading 7 events.
|
||||||
|
2020-04-08T23:11:00 | [36minfo[39m | mongoose.js | Connected to the database.
|
||||||
|
2020-04-08T23:11:02 | [32mready[39m | ready.js | Connected to Discord as WoomyDev#4547
|
||||||
|
2020-04-08T23:11:07 | [37mlog[39m | message.js | Command ran: help
|
||||||
|
2020-04-08T23:13:14 | [37mlog[39m | message.js | Command ran: help
|
||||||
|
2020-04-08T23:13:28 | [36minfo[39m | index.js | Loading 5 commands.
|
||||||
|
2020-04-08T23:13:28 | [36minfo[39m | index.js | Loading 7 events.
|
||||||
|
2020-04-08T23:13:28 | [36minfo[39m | mongoose.js | Connected to the database.
|
||||||
|
2020-04-08T23:13:31 | [32mready[39m | ready.js | Connected to Discord as WoomyDev#4547
|
||||||
|
2020-04-08T23:13:40 | [36minfo[39m | index.js | Loading 5 commands.
|
||||||
|
2020-04-08T23:13:40 | [36minfo[39m | index.js | Loading 7 events.
|
||||||
|
2020-04-08T23:13:40 | [36minfo[39m | mongoose.js | Connected to the database.
|
||||||
|
2020-04-08T23:13:42 | [32mready[39m | ready.js | Connected to Discord as WoomyDev#4547
|
||||||
|
2020-04-08T23:13:42 | [37mlog[39m | message.js | Command ran: help
|
||||||
|
2020-04-08T23:13:46 | [37mlog[39m | message.js | Command ran: help
|
||||||
|
2020-04-08T23:14:01 | [36minfo[39m | index.js | Loading 5 commands.
|
||||||
|
2020-04-08T23:14:01 | [36minfo[39m | index.js | Loading 7 events.
|
||||||
|
2020-04-08T23:14:02 | [36minfo[39m | mongoose.js | Connected to the database.
|
||||||
|
2020-04-08T23:14:04 | [32mready[39m | ready.js | Connected to Discord as WoomyDev#4547
|
||||||
|
2020-04-08T23:14:06 | [37mlog[39m | message.js | Command ran: help
|
||||||
|
2020-04-08T23:14:39 | [37mlog[39m | message.js | Command ran: help
|
||||||
|
2020-04-08T23:26:22 | [36minfo[39m | index.js | Loading 5 commands.
|
||||||
|
2020-04-08T23:26:22 | [36minfo[39m | index.js | Loading 7 events.
|
||||||
|
2020-04-08T23:26:22 | [36minfo[39m | mongoose.js | Connected to the database.
|
||||||
|
2020-04-08T23:26:25 | [32mready[39m | ready.js | Connected to Discord as WoomyDev#4547
|
||||||
|
2020-04-08T23:27:27 | [36minfo[39m | index.js | Loading 5 commands.
|
||||||
|
2020-04-08T23:27:27 | [36minfo[39m | index.js | Loading 7 events.
|
||||||
|
2020-04-08T23:27:27 | [36minfo[39m | mongoose.js | Connected to the database.
|
||||||
|
2020-04-08T23:27:29 | [32mready[39m | ready.js | Connected to Discord as WoomyDev#4547
|
||||||
|
2020-04-08T23:27:48 | [37mlog[39m | message.js | Command ran: help
|
||||||
|
2020-04-08T23:28:53 | [36minfo[39m | index.js | Loading 5 commands.
|
||||||
|
2020-04-08T23:28:53 | [36minfo[39m | index.js | Loading 7 events.
|
||||||
|
2020-04-08T23:28:53 | [36minfo[39m | mongoose.js | Connected to the database.
|
||||||
|
2020-04-08T23:28:56 | [32mready[39m | ready.js | Connected to Discord as WoomyDev#4547
|
||||||
|
2020-04-08T23:28:56 | [37mlog[39m | message.js | Command ran: help
|
||||||
|
2020-04-08T23:29:12 | [36minfo[39m | index.js | Loading 5 commands.
|
||||||
|
2020-04-08T23:29:12 | [36minfo[39m | index.js | Loading 7 events.
|
||||||
|
2020-04-08T23:29:12 | [36minfo[39m | mongoose.js | Connected to the database.
|
||||||
|
2020-04-08T23:29:14 | [32mready[39m | ready.js | Connected to Discord as WoomyDev#4547
|
||||||
|
2020-04-08T23:29:34 | [36minfo[39m | index.js | Loading 5 commands.
|
||||||
|
2020-04-08T23:29:34 | [36minfo[39m | index.js | Loading 7 events.
|
||||||
|
2020-04-08T23:29:34 | [36minfo[39m | mongoose.js | Connected to the database.
|
||||||
|
2020-04-08T23:29:37 | [32mready[39m | ready.js | Connected to Discord as WoomyDev#4547
|
||||||
|
2020-04-08T23:29:37 | [37mlog[39m | message.js | Command ran: help
|
||||||
|
2020-04-08T23:30:14 | [36minfo[39m | index.js | Loading 5 commands.
|
||||||
|
2020-04-08T23:30:14 | [36minfo[39m | index.js | Loading 7 events.
|
||||||
|
2020-04-08T23:30:14 | [36minfo[39m | mongoose.js | Connected to the database.
|
||||||
|
2020-04-08T23:30:16 | [32mready[39m | ready.js | Connected to Discord as WoomyDev#4547
|
||||||
|
2020-04-08T23:30:18 | [37mlog[39m | message.js | Command ran: help
|
||||||
|
2020-04-08T23:30:32 | [36minfo[39m | index.js | Loading 5 commands.
|
||||||
|
2020-04-08T23:30:32 | [36minfo[39m | index.js | Loading 7 events.
|
||||||
|
2020-04-08T23:30:32 | [36minfo[39m | mongoose.js | Connected to the database.
|
||||||
|
2020-04-08T23:30:34 | [32mready[39m | ready.js | Connected to Discord as WoomyDev#4547
|
||||||
|
2020-04-08T23:30:38 | [37mlog[39m | message.js | Command ran: help
|
||||||
|
2020-04-08T23:34:18 | [36minfo[39m | index.js | Loading 5 commands.
|
||||||
|
2020-04-08T23:34:18 | [36minfo[39m | index.js | Loading 7 events.
|
||||||
|
2020-04-08T23:34:18 | [36minfo[39m | mongoose.js | Connected to the database.
|
||||||
|
2020-04-08T23:34:21 | [32mready[39m | ready.js | Connected to Discord as WoomyDev#4547
|
||||||
|
2020-04-08T23:34:23 | [37mlog[39m | message.js | Command ran: help
|
||||||
|
2020-04-08T23:34:30 | [37mlog[39m | message.js | Command ran: help
|
||||||
|
2020-04-08T23:35:00 | [37mlog[39m | message.js | Command ran: help
|
||||||
|
2020-04-08T23:35:24 | [36minfo[39m | index.js | Loading 5 commands.
|
||||||
|
2020-04-08T23:35:24 | [36minfo[39m | index.js | Loading 7 events.
|
||||||
|
2020-04-08T23:35:24 | [36minfo[39m | mongoose.js | Connected to the database.
|
||||||
|
2020-04-08T23:35:26 | [32mready[39m | ready.js | Connected to Discord as WoomyDev#4547
|
||||||
|
2020-04-08T23:35:38 | [36minfo[39m | index.js | Loading 5 commands.
|
||||||
|
2020-04-08T23:35:38 | [36minfo[39m | index.js | Loading 7 events.
|
||||||
|
2020-04-08T23:35:38 | [36minfo[39m | mongoose.js | Connected to the database.
|
||||||
|
2020-04-08T23:35:41 | [32mready[39m | ready.js | Connected to Discord as WoomyDev#4547
|
||||||
|
2020-04-08T23:35:41 | [37mlog[39m | message.js | Command ran: help
|
||||||
|
2020-04-08T23:39:05 | [36minfo[39m | index.js | Loading 5 commands.
|
||||||
|
2020-04-08T23:39:05 | [36minfo[39m | index.js | Loading 7 events.
|
||||||
|
2020-04-08T23:39:05 | [36minfo[39m | mongoose.js | Connected to the database.
|
||||||
|
2020-04-08T23:39:07 | [32mready[39m | ready.js | Connected to Discord as WoomyDev#4547
|
||||||
|
2020-04-08T23:39:15 | [37mlog[39m | message.js | Command ran: help
|
||||||
|
2020-04-09T00:06:52 | [36minfo[39m | index.js | Loading 5 commands.
|
||||||
|
2020-04-09T00:06:52 | [36minfo[39m | index.js | Loading 7 events.
|
||||||
|
2020-04-09T00:06:53 | [36minfo[39m | mongoose.js | Connected to the database.
|
||||||
|
2020-04-09T00:06:56 | [32mready[39m | ready.js | Connected to Discord as WoomyDev#4547
|
||||||
|
|
Loading…
Reference in a new issue