Haha-Yes/commands/owner/load.js
2022-12-21 21:19:50 +01:00

22 lines
626 B
JavaScript

import { SlashCommandBuilder } from 'discord.js';
export default {
data: new SlashCommandBuilder()
.setName('load')
.setDescription('load a command.')
.addStringOption(option =>
option.setName('file')
.setDescription('File location of the command.')
.setRequired(true)),
category: 'owner',
ownerOnly: true,
async execute(interaction, args, client) {
await interaction.deferReply();
let command = await import(`../../${args.file}`);
command = command.default;
client.commands.set(command.data.name, command);
return await interaction.editReply(`${command.data.name} has been loaded.`);
},
};