Removed unused imports and cleaned up
This commit is contained in:
@@ -5,9 +5,9 @@ const { applicationsChannel } = require('../../config/options.json');
|
||||
const { qu1, qu2, qu3, qu4, qu5, qu6, qu7, qu8 } = require('../../config/questions.json');
|
||||
const { rq1, rq2, rq3, rq4, rq5, rq6, rq7, rq8 } = require('../../config/questions.json');
|
||||
const { guildRole } = require('../../config/roles.json')
|
||||
const { getUUID } = require('../../utils/utils.js')
|
||||
const mongoose = require('mongoose');
|
||||
const guildapp = require('../../schemas/guildAppSchema.js');
|
||||
const fetch = require('axios');
|
||||
|
||||
module.exports = {
|
||||
name: 'guildapply',
|
||||
@@ -127,9 +127,8 @@ module.exports = {
|
||||
})
|
||||
return
|
||||
}
|
||||
try {
|
||||
var userCheck = await fetch(mojangAPI + answer1.first().content);
|
||||
} catch (error) {
|
||||
const uuid = await getUUID(answer1.first().content)
|
||||
if (!uuid) {
|
||||
await user.send({
|
||||
embeds: [{
|
||||
description: "That is not a valid Minecraft username.\n" +
|
||||
@@ -441,8 +440,6 @@ module.exports = {
|
||||
}]
|
||||
})
|
||||
|
||||
const uuid = userCheck.data.id
|
||||
|
||||
const newGuildApp = new guildapp({
|
||||
_id: new mongoose.Types.ObjectId(),
|
||||
userID: user.id,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
const { ButtonBuilder, ButtonStyle, ActionRowBuilder, EmbedBuilder } = require('discord.js');
|
||||
const { color } = require('../../config/options.json');
|
||||
const { largeM, smallM, ignM } = require('../../config/limitmessages.json')
|
||||
const { largeM, ignM } = require('../../config/limitmessages.json')
|
||||
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');
|
||||
@@ -8,7 +8,7 @@ const { guildRole, guildStaff } = require('../../config/roles.json')
|
||||
const mongoose = require('mongoose');
|
||||
const staffapp = require('../../schemas/staffAppSchema.js');
|
||||
const settings = require("../../schemas/settingsSchema.js");
|
||||
const fetch = require('axios');
|
||||
const { getUUID } = require('../../utils/utils.js')
|
||||
|
||||
module.exports = {
|
||||
name: 'staffapply',
|
||||
@@ -23,7 +23,6 @@ module.exports = {
|
||||
const guild = interaction.guild;
|
||||
const embedColor = Number(color.replace("#", "0x"));
|
||||
const userRoles = interaction.member.roles.cache;
|
||||
const mojangAPI = "https://api.mojang.com/users/profiles/minecraft/"
|
||||
const setting = await settings.findOne({ name: "staffAppStatus" })
|
||||
const status = setting.value;
|
||||
|
||||
@@ -137,9 +136,8 @@ module.exports = {
|
||||
})
|
||||
return
|
||||
}
|
||||
try {
|
||||
await fetch(mojangAPI + answer1.first().content)
|
||||
} catch (error) {
|
||||
const uuid = await getUUID(answer1.first().content)
|
||||
if (!uuid) {
|
||||
await user.send({
|
||||
embeds: [{
|
||||
description: "That is not a valid Minecraft username.\n" +
|
||||
@@ -375,9 +373,6 @@ module.exports = {
|
||||
}]
|
||||
})
|
||||
|
||||
const userCheck = await fetch(mojangAPI + answer1_1)
|
||||
const uuid = userCheck.data.id
|
||||
|
||||
const newStaffApp = new staffapp({
|
||||
_id: new mongoose.Types.ObjectId(),
|
||||
userID: user.id,
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
const { ModalBuilder, ActionRowBuilder, TextInputBuilder, TextInputStyle } = require('discord.js')
|
||||
const { color } = require('../../config/options.json')
|
||||
|
||||
module.exports = {
|
||||
name: 'verify',
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
const mongoose = require('mongoose');
|
||||
const waitinglist = require('../../schemas/waitinglistSchema.js');
|
||||
const key = process.env.HYPIXELAPIKEY;
|
||||
const { getGuild } = require('../../utils/utils.js');
|
||||
const { hypixelGuildID } = require("../../config/options.json")
|
||||
const fetch = require("axios");
|
||||
|
||||
module.exports = {
|
||||
name: 'waitinglistupdate',
|
||||
@@ -19,15 +17,13 @@ module.exports = {
|
||||
const message = interaction.message;
|
||||
const embed = message.embeds[0];
|
||||
const accepted = await waitinglist.find()
|
||||
const guildAPI = "https://api.hypixel.net/guild"
|
||||
const guild = guildAPI + "?key=" + key + "&player="
|
||||
|
||||
for (let i = 0; i < accepted.length; i++) {
|
||||
|
||||
const uuid = accepted[i].uuid
|
||||
const check = await fetch(guild + uuid)
|
||||
const guild = await getGuild(uuid)
|
||||
|
||||
if (check.data.guild && check.data.guild._id === hypixelGuildID) {
|
||||
if (guild && guild._id === hypixelGuildID) {
|
||||
await waitinglist.findOneAndDelete({ uuid: uuid })
|
||||
continue
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user