mirror of
https://github.com/warengroup/eximiabots-radiox.git
synced 2024-12-23 09:53:18 +00:00
Moved commands map to commands.js
This commit is contained in:
parent
ebf1d0759e
commit
8d5291cbb0
@ -59,12 +59,6 @@ class RadioClient extends Client {
|
|||||||
this.funcs.logger("Maintenance Mode", "Enabled");
|
this.funcs.logger("Maintenance Mode", "Enabled");
|
||||||
this.config.maintenanceMode = true;
|
this.config.maintenanceMode = true;
|
||||||
|
|
||||||
const commandFiles = fs.readdirSync(path.join("./src/client/commands")).filter(f => f.endsWith(".js"));
|
|
||||||
for (const file of commandFiles) {
|
|
||||||
const command = require(`./client/commands/${file}`);
|
|
||||||
this.commands.set(command.name, command);
|
|
||||||
}
|
|
||||||
|
|
||||||
this.on("ready", () => {
|
this.on("ready", () => {
|
||||||
require(`${events}ready`).execute(this);
|
require(`${events}ready`).execute(this);
|
||||||
});
|
});
|
||||||
|
@ -6,11 +6,14 @@ const path = require ('path');
|
|||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
async execute(client) {
|
async execute(client) {
|
||||||
|
|
||||||
const commands = [];
|
const commands = [];
|
||||||
const commandFiles = fs.readdirSync(path.join("./src/client/commands")).filter(f => f.endsWith(".js"));
|
const commandFiles = fs.readdirSync(path.join("./src/client/commands")).filter(f => f.endsWith(".js"));
|
||||||
|
|
||||||
for (const file of commandFiles) {
|
for (const file of commandFiles) {
|
||||||
const command = require(`./commands/${file}`);
|
const command = require(`./commands/${file}`);
|
||||||
|
client.commands.set(command.name, command);
|
||||||
|
|
||||||
command.data = new SlashCommandBuilder()
|
command.data = new SlashCommandBuilder()
|
||||||
.setName(command.name)
|
.setName(command.name)
|
||||||
.setDescription(command.description);
|
.setDescription(command.description);
|
||||||
|
Loading…
Reference in New Issue
Block a user