Skip to content

Commit

Permalink
fix: fix deploy script
Browse files Browse the repository at this point in the history
  • Loading branch information
dev-737 committed Oct 1, 2023
1 parent 4036abd commit eef50d2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 16 deletions.
15 changes: 3 additions & 12 deletions src/Commands/Apps/deleteMsg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,25 +20,16 @@ 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 (
!interchatStaff &&
!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
Expand Down
2 changes: 1 addition & 1 deletion src/Utils/deploy-commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
6 changes: 3 additions & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"moduleResolution": "Node",
"resolveJsonModule": true,
"allowJs": false,
"rootDir": "./src/",
"outDir": "./build/",
"rootDir": "src",
"outDir": "build",
"esModuleInterop": true,
"strict": true,
"sourceMap": true,
Expand All @@ -18,7 +18,7 @@
"skipLibCheck": true
},
"include": [
"src/**/*",
"src/**/*.ts",
"src/**/*.json",
// "typings/**/*"
]
Expand Down

0 comments on commit eef50d2

Please sign in to comment.