fix: cannot config without perm
Node.js CI / Lint and Test (push) Failing after 30s

This commit is contained in:
2025-08-14 23:17:23 -07:00
parent c9ec681471
commit 415bc11897
+7
View File
@@ -4,6 +4,7 @@
* @author Naomi Carrigan * @author Naomi Carrigan
*/ */
import { PermissionFlagBits } from "discord.js";
import { errorHandler } from "../utils/errorHandler.js"; import { errorHandler } from "../utils/errorHandler.js";
import { isTheme } from "../utils/typeguards.js"; import { isTheme } from "../utils/typeguards.js";
import type { Command } from "../interfaces/command.js"; import type { Command } from "../interfaces/command.js";
@@ -15,6 +16,12 @@ import type { Command } from "../interfaces/command.js";
*/ */
export const config: Command = async(pavelle, interaction) => { export const config: Command = async(pavelle, interaction) => {
try { try {
if (!interaction.member.permissions.has(PermissionFlagBits.ManageServer)) {
await interaction.editReply({
content: "No no no, you cannot do this.",
});
return;
}
const theme = interaction.options.getString("theme"); const theme = interaction.options.getString("theme");
const spoiler = interaction.options.getBoolean("spoiler"); const spoiler = interaction.options.getBoolean("spoiler");
const query: { theme?: string; spoiler?: boolean } = {}; const query: { theme?: string; spoiler?: boolean } = {};