🚨 Fixed more JS-0116
This commit is contained in:
parent
6be605a8e3
commit
f34cf8dd91
2 changed files with 6 additions and 6 deletions
|
@ -13,28 +13,28 @@ export default async (client: Client) => {
|
||||||
logger.info("Gathering command list");
|
logger.info("Gathering command list");
|
||||||
|
|
||||||
await Promise.all(
|
await Promise.all(
|
||||||
client.commands.map(async (commandData: ICommand) => {
|
client.commands.map((commandData: ICommand) => {
|
||||||
commandList.push(commandData.builder.toJSON());
|
commandList.push(commandData.builder.toJSON());
|
||||||
|
|
||||||
logger.verbose(`${commandData.builder.name} pushed to list`);
|
logger.verbose(`${commandData.builder.name} pushed to list`);
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
.then(async () => {
|
.then(() => {
|
||||||
logger.info(`Finished gathering command list.`);
|
logger.info(`Finished gathering command list.`);
|
||||||
})
|
})
|
||||||
.catch(async (error) => {
|
.catch((error) => {
|
||||||
throw new Error(`Could not gather command list: ${error}`);
|
throw new Error(`Could not gather command list: ${error}`);
|
||||||
});
|
});
|
||||||
|
|
||||||
await client.application?.commands
|
await client.application?.commands
|
||||||
.set(commandList, process.env.DISCORD_GUILD_ID)
|
.set(commandList, process.env.DISCORD_GUILD_ID)
|
||||||
.then(async () => {
|
.then(() => {
|
||||||
logger.info(`Finished updating command list.`);
|
logger.info(`Finished updating command list.`);
|
||||||
});
|
});
|
||||||
|
|
||||||
if (process.env.NODE_ENV !== "production") {
|
if (process.env.NODE_ENV !== "production") {
|
||||||
await client.application?.commands
|
await client.application?.commands
|
||||||
.set(commandList)
|
.set(commandList)
|
||||||
.then(async () => logger.info(`Finished updating guild command list.`));
|
.then(() => logger.info(`Finished updating guild command list.`));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -2,6 +2,6 @@ import fs from "fs";
|
||||||
const fsPromises = fs.promises;
|
const fsPromises = fs.promises;
|
||||||
|
|
||||||
export default async (path: string) => {
|
export default async (path: string) => {
|
||||||
const result = fsPromises.readdir(path);
|
const result = await fsPromises.readdir(path);
|
||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue