-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
and fix double apostrophy in the wrong places
- Loading branch information
1 parent
8059ced
commit 7296f74
Showing
8 changed files
with
28 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
import { config } from "../../config.js"; | ||
|
||
export function commandsDisabled(command) { | ||
if (!config.slash.enabled) { | ||
if (!config.commands.slash.enabled) { | ||
let disabledResponse; | ||
|
||
if (!config.text.enabled) { // Idiot proofing | ||
if (!config.commands.text.enabled) { // Idiot proofing | ||
disabledResponse = "Commands are disabled! :sob: \nTry setting one of the command values to `true` in `config.json` to enable commands."; | ||
return; | ||
} | ||
|
||
disabledResponse = `Slash commands are disabled.\nTry \`${config.text.prefix}${command}\` instead` | ||
disabledResponse = `Slash commands are disabled.\nTry \`${config.commands.text.prefix}${command}\` instead` | ||
return disabledResponse; | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,14 @@ | ||
import { SlashCommandBuilder } from "discord.js"; | ||
import { help } from "../functions/help_reponse.js"; | ||
import { commandsDisabled } from "../functions/disabled_commands.js"; | ||
import { help } from "../functions/help_response.js"; | ||
import { handleCommand } from "../command_handler.js"; | ||
|
||
export default { | ||
data: new SlashCommandBuilder() | ||
.setName("help") | ||
.setDescription("Shows the available commands."), | ||
async execute(interaction) { | ||
let areCommandsDisabled = commandsDisabled("help"); | ||
if (areCommandsDisabled) { | ||
await interaction.reply(areCommandsDisabled, { ephemeral: true }); | ||
return; | ||
} | ||
|
||
await interaction.reply(help("/")); | ||
await handleCommand(interaction, "help", async (interaction) => { | ||
await interaction.reply(help("/")); | ||
}); | ||
}, | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,14 @@ | ||
import { SlashCommandBuilder } from "discord.js"; | ||
import { serverStart } from "../../api/start_server.js"; | ||
import { commandsDisabled } from "../functions/disabled_commands.js"; | ||
import { handleCommand } from "../command_handler.js"; | ||
|
||
export default { | ||
data: new SlashCommandBuilder() | ||
.setName("start") | ||
.setDescription("Starts the server."), | ||
async execute(interaction) { | ||
const areCommandsDisabled = commandsDisabled("start"); | ||
if (areCommandsDisabled) { | ||
interaction.reply(areCommandsDisabled, { ephemeral: true }); | ||
return; | ||
} | ||
await interaction.reply(await serverStart()); | ||
await handleCommand(interaction, "start", async (interaction) => { | ||
await interaction.reply(await serverStart()); | ||
}); | ||
}, | ||
}; |