mirror of
https://github.com/ahmadk953/poixpixel-discord-bot.git
synced 2025-05-01 03:09:35 +00:00
General Updates
This commit is contained in:
parent
a67829c6f1
commit
cdb82b771e
10 changed files with 161 additions and 129 deletions
|
@ -15,7 +15,6 @@ export const deployCommands = async () => {
|
|||
try {
|
||||
console.log(`Started refreshing ${commandFiles.length} application (/) commands.`);
|
||||
|
||||
// Prepare the commands array
|
||||
const commands = commandFiles.map(async (file) => {
|
||||
const filePath = path.join('file://', commandsPath, file);
|
||||
const commandModule = await import(filePath);
|
||||
|
@ -29,10 +28,8 @@ export const deployCommands = async () => {
|
|||
}
|
||||
});
|
||||
|
||||
// Filter out any null values from the commands array
|
||||
const validCommands = await Promise.all(commands.filter(command => command !== null));
|
||||
|
||||
// Use the provided way of registering commands
|
||||
const data: any = await rest.put(
|
||||
Routes.applicationGuildCommands(clientId, guildId),
|
||||
{ body: validCommands },
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue