From eef50d23d91b5e414b634c7bc89592f8d367a34f Mon Sep 17 00:00:00 2001 From: dev-737 <73829355+dev-737@users.noreply.github.com> Date: Sun, 1 Oct 2023 18:52:44 +0530 Subject: [PATCH] fix: fix deploy script --- src/Commands/Apps/deleteMsg.ts | 15 +++------------ src/Utils/deploy-commands.ts | 2 +- tsconfig.json | 6 +++--- 3 files changed, 7 insertions(+), 16 deletions(-) diff --git a/src/Commands/Apps/deleteMsg.ts b/src/Commands/Apps/deleteMsg.ts index 9b3a637d..ff37a81c 100644 --- a/src/Commands/Apps/deleteMsg.ts +++ b/src/Commands/Apps/deleteMsg.ts @@ -20,12 +20,7 @@ export default { include: { hub: true }, }); - if (!messageInDb) { - return interaction.reply({ - content: 'Unknown Message. If it has been sent in the past minute, please wait few more seconds and try again.', - ephemeral: true, - }); - } + if (!messageInDb) return await interaction.editReply('Unknown Message. If it has been sent in the past minute, please wait few more seconds and try again.'); const interchatStaff = checkIfStaff(interaction.user.id); if ( @@ -33,12 +28,8 @@ export default { !messageInDb.hub?.moderators.find((m) => m.userId === interaction.user.id) && messageInDb.hub?.ownerId !== interaction.user.id && interaction.user.id !== messageInDb.authorId - ) { - return interaction.reply({ - content: `${emoji.no} You are not the author of this message.`, - ephemeral: true, - }); - } + ) return await interaction.editReply(`${emoji.no} You are not the author of this message.`); + const results = messageInDb.channelAndMessageIds.map(async (element) => { // fetch each channel the message was sent to diff --git a/src/Utils/deploy-commands.ts b/src/Utils/deploy-commands.ts index 5eab932d..cc946b72 100644 --- a/src/Utils/deploy-commands.ts +++ b/src/Utils/deploy-commands.ts @@ -22,7 +22,7 @@ function deployCommands(staff = false) { // Only proceed if dir is inside staffCommands array (for deploying only staff commands) if (staff && !staffCommands.includes(dir)) return; - if (!staffCommands.includes(dir) && fs.statSync(`${commandsPath}/${dir}`).isDirectory()) { + if (fs.statSync(`${commandsPath}/${dir}`).isDirectory()) { const commandFiles = fs.readdirSync(`${commandsPath}/${dir}`).filter(file => file.endsWith('.js')); for (const commandFile of commandFiles) { diff --git a/tsconfig.json b/tsconfig.json index 3ac348ae..bf23e568 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -8,8 +8,8 @@ "moduleResolution": "Node", "resolveJsonModule": true, "allowJs": false, - "rootDir": "./src/", - "outDir": "./build/", + "rootDir": "src", + "outDir": "build", "esModuleInterop": true, "strict": true, "sourceMap": true, @@ -18,7 +18,7 @@ "skipLibCheck": true }, "include": [ - "src/**/*", + "src/**/*.ts", "src/**/*.json", // "typings/**/*" ]