From 0089e8a1b44f8630ee87439bbe0d481ec5dced87 Mon Sep 17 00:00:00 2001 From: Taken Date: Mon, 11 Sep 2023 14:15:18 +0200 Subject: [PATCH] Added disable option for staff applications --- .env.example | 3 ++- events/buttons/staffapply.js | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.env.example b/.env.example index 0696fcf..e8bb7de 100644 --- a/.env.example +++ b/.env.example @@ -5,4 +5,5 @@ DEV= CLIENTID= DEVID= GUILDID= -HYPIXELAPIKEY= \ No newline at end of file +HYPIXELAPIKEY= +STAFFAPPSTATUS= diff --git a/events/buttons/staffapply.js b/events/buttons/staffapply.js index 4794e12..1429ae9 100644 --- a/events/buttons/staffapply.js +++ b/events/buttons/staffapply.js @@ -5,6 +5,8 @@ const { staffApplicationsChannel } = require('../../config/options.json'); const { sq1, sq2, sq3, sq4, sq5, sq6 } = require('../../config/questions.json'); const { rsq1, rsq2, rsq3, rsq4, rsq5, rsq6 } = require('../../config/questions.json'); const { guildRole, guildStaff } = require('../../config/roles.json') +const env = require('dotenv').config(); +const status = process.env.STAFFAPPSTATUS; const mongoose = require('mongoose'); const staffapp = require('../../schemas/staffAppSchema.js'); const fetch = require('axios'); @@ -26,6 +28,11 @@ module.exports = { await interaction.deferReply({ ephemeral: true }); + if (status === false) { + await interaction.editReply({ content: "Staff applications are currently closed.", ephemeral: true }); + return + } + if (!userRoles.has(guildRole)) { await interaction.editReply({ content: "You must be a member of the guild to apply for staff.", ephemeral: true }); return