Skip to content
This repository has been archived by the owner on Jul 7, 2024. It is now read-only.

add docker compose infra for local mongo, refactor command disabled checking #41

Merged
merged 3 commits into from
Nov 9, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix: fixed more permission validation issues
  • Loading branch information
zleyyij committed Sep 10, 2023
commit 1dca9bb0ffbbf48baf6b66c91a035bfe1f640503
18 changes: 7 additions & 11 deletions src/core/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,18 +161,14 @@ function listenForSlashCommands() {
commandPath.push(subcommand);
}
const resolutionResult = resolveModule(commandPath);
// if a module was found
if (resolutionResult.foundModule !== null) {
// first see if the root module is enabled
if (!resolutionResult.foundModule.config ?? {enabled: false}.enabled) {
if (
resolutionResult.foundModule.config ??
{enabled: false}.enabled !== true
) {
replyToInteraction(interaction, {
embeds: [embed.errorEmbed('This command is disabled.')],
ephemeral: true,
});
}
if (resolutionResult.foundModule.config.enabled !== true) {
replyToInteraction(interaction, {
embeds: [embed.errorEmbed('This command is disabled.')],
ephemeral: true,
});
return;
}

// validate permissions
Expand Down