!help command
unknown
plain_text
2 years ago
2.0 kB
2
Indexable
Never
const { Client, Collection, MessageEmbed, Attachment} = require(`discord.js`); const { PREFIX, approveemoji, denyemoji } = require(`../config.json`); module.exports = { name: `help`, description: `Gives you a list of all help Commands`, aliases: ["h","commands"], cooldown: 3, edesc: "Type help to get a short preview of all Commands, Type help <COMMANDNAME> to get extended information about this one command!", execute(message,args,client) { let commands = message.client.commands.array(); let helpEmbed = new MessageEmbed() .setTitle("HELP MENU") .setDescription('Welcome to CPT. Iced Tea, for all the commands [click here](https://bentleycoop100.wixsite.com/cpticedtea), if you need more help feel free to dm me at Bentley100#6367 😀 ') .setColor("RED"); let ifargstruedothis = -1; switch(args[0]){ default: if(!message.guild) { if(!args[0]) {message.react(approveemoji);return message.channel.send(helpEmbed);} return } message.channel.send(helpEmbed); break; } if(ifargstruedothis>=0){ let aliases = commands[ifargstruedothis].aliases; if(aliases === undefined || !aliases) aliases="No Aliases!"; let cooldown = commands[ifargstruedothis].cooldown; if(cooldown === undefined || !cooldown) cooldown="No Cooldown!"; helpEmbed.addField( `**${message.client.prefix}${commands[ifargstruedothis].name}**`, `\`\`\`fix\n${commands[ifargstruedothis].edesc}\n\`\`\`\n\`${commands[ifargstruedothis].description}\`` ); helpEmbed.addField( `**:notes: Aliases:**`, `\`${aliases}\`` ); helpEmbed.addField( `**:wrench: Cooldown:**`, `\`${cooldown}\`` ); if(!message.guild) return message.channel.send(helpEmbed); message.channel.send(helpEmbed); } } }