Skip to content

Commit

Permalink
[Enhancement] Documented the functions, rewrote embedSimple
Browse files Browse the repository at this point in the history
  • Loading branch information
naseif committed Sep 30, 2021
1 parent 996f402 commit 6992809
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 10 deletions.
20 changes: 14 additions & 6 deletions modules/commandsReadMe.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
const mdtable = require("mdtable");
const { writeFileSync } = require("fs");
module.exports.commandsReadMe = (commands) => {
const { writeFileSync } = require("fs");

/**
*
* @param {array} commands
*/

module.exports.commandsReadMe = (commands) => {
const tableData = {
header: ["Name", "Description"],
alignment: ["L", "C"],
Expand All @@ -12,11 +17,14 @@ module.exports.commandsReadMe = (commands) => {
padding: 1,
};

commands.map(command => {
tableData.rows.push([`**/${command.data.name}**`, command.data.description])
})
commands.map((command) => {
tableData.rows.push([
`**/${command.data.name}**`,
command.data.description,
]);
});

const commandsTable = mdtable(tableData, tableSettings)
const commandsTable = mdtable(tableData, tableSettings);

writeFileSync("./Commands.md", commandsTable, "utf-8");
};
13 changes: 9 additions & 4 deletions modules/embedSimple.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
function embedMessage(color, description) {
/**
*
* @param {string} color
* @param {string} description
* @returns
*/

module.exports.embedMessage = (color, description) => {
const embed = {
color: color,
description: description,
};

return embed;
}

module.exports = { embedMessage };
};

0 comments on commit 6992809

Please sign in to comment.