22 lines
474 B
JavaScript
22 lines
474 B
JavaScript
const fs = require("fs");
|
|
|
|
const command = {
|
|
name: "commands",
|
|
desc: "get list of commands",
|
|
restricted: false,
|
|
run: async (client, msg) => {
|
|
const commandFiles = fs
|
|
.readdirSync("./commands")
|
|
.map((cmd) => cmd.replace(".js", ""));
|
|
|
|
await client
|
|
.say(
|
|
msg.channelName,
|
|
`${msg.displayName}, List of commands: ${commandFiles.join(", ")}`
|
|
)
|
|
.catch((err) => console.log(err));
|
|
},
|
|
};
|
|
|
|
module.exports = { command };
|