Fix: change readdir to async
This commit is contained in:
@@ -6,7 +6,7 @@ import { logger } from '../logger';
|
|||||||
|
|
||||||
export async function loadCommands(client: ExtendedClient): Promise<Array<string>>{
|
export async function loadCommands(client: ExtendedClient): Promise<Array<string>>{
|
||||||
const foldersPath = path.join(__dirname, '../commands');
|
const foldersPath = path.join(__dirname, '../commands');
|
||||||
const commandFolders = readdirSync(foldersPath);
|
const commandFolders = await readdir(foldersPath);
|
||||||
const commands: Array<string> = [];
|
const commands: Array<string> = [];
|
||||||
for(const folder of commandFolders){
|
for(const folder of commandFolders){
|
||||||
const commandsPath = path.join(foldersPath, folder);
|
const commandsPath = path.join(foldersPath, folder);
|
||||||
|
|||||||
Reference in New Issue
Block a user