added help and say commands
This commit is contained in:
parent
66e3d8c2d2
commit
ae1f1eac43
3 changed files with 97 additions and 0 deletions
34
commands/help.js
Normal file
34
commands/help.js
Normal file
|
@ -0,0 +1,34 @@
|
|||
const fs = require('fs');
|
||||
const Discord = require('discord.js');
|
||||
const {prefix} = require('../config.json');
|
||||
|
||||
|
||||
module.exports = {
|
||||
name: 'help',
|
||||
description: 'List all available commands.',
|
||||
execute(message) {
|
||||
let str = '';
|
||||
const commandFiles = fs.readdirSync('./commands').filter(file => file.endsWith('.js'));
|
||||
|
||||
const embed = new Discord.MessageEmbed()
|
||||
.setColor(15780145)
|
||||
.setTitle("Help")
|
||||
.setTimestamp()
|
||||
.setAuthor("soilens bot", "https://cdn.discordapp.com/avatars/481128222147477506/1a30f57f8e403f54aaca502012aeff14.png?size=2048")
|
||||
|
||||
|
||||
|
||||
for (const file of commandFiles) {
|
||||
const command = require(`./${file}`);
|
||||
str += `Name: ${command.name}, Description: ${command.description} \n`;
|
||||
|
||||
|
||||
embed.addFields(
|
||||
{ name: prefix+command.name, value: command.description },
|
||||
)
|
||||
}
|
||||
|
||||
message.channel.send(embed);
|
||||
},
|
||||
};
|
||||
|
7
commands/say.js
Normal file
7
commands/say.js
Normal file
|
@ -0,0 +1,7 @@
|
|||
module.exports = {
|
||||
name: 'say',
|
||||
description: 'Repeats arguments',
|
||||
execute(message, args) {
|
||||
message.channel.send(args.join(" "))
|
||||
}
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue