Added eslintrc config and updated all files to it

This commit is contained in:
2023-11-22 23:50:21 +01:00
parent 10771fd04e
commit 3d4fc1fccb
70 changed files with 1276 additions and 1234 deletions

View File

@@ -1,26 +1,26 @@
const { ButtonBuilder, ButtonStyle, ActionRowBuilder, EmbedBuilder } = require('discord.js');
const { color } = require('../../config/options.json');
const { largeM, smallM, ignM } = require('../../config/limitmessages.json')
const { applicationsChannel } = require('../../config/options.json');
const questions = 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 { ButtonBuilder, ButtonStyle, ActionRowBuilder, EmbedBuilder } = require("discord.js")
const { color } = require("../../config/options.json")
const { largeM, smallM, ignM } = require("../../config/limitmessages.json")
const { applicationsChannel } = require("../../config/options.json")
const questions = 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")
module.exports = {
name: 'guildapply',
description: 'Guild application button.',
type: 'button',
name: "guildapply",
description: "Guild application button.",
type: "button",
/** @param {import('discord.js').ButtonInteraction} interaction */
async execute(interaction) {
const user = interaction.user;
const guild = interaction.guild;
const embedColor = Number(color.replace("#", "0x"));
const userRoles = guild.members.cache.get(user.id).roles.cache.map(role => role.id);
const user = interaction.user
const guild = interaction.guild
const embedColor = Number(color.replace("#", "0x"))
const userRoles = guild.members.cache.get(user.id).roles.cache.map(role => role.id)
const guildQuestions = questions.guild
function qu(n) {
@@ -31,19 +31,19 @@ module.exports = {
return guildQuestions[n - 1].r
}
if (interaction.customId === 'guildapply') {
if (interaction.customId === "guildapply") {
await interaction.deferReply({ ephemeral: true });
await interaction.deferReply({ ephemeral: true })
if (userRoles.includes(guildRole)) {
await interaction.editReply({ content: "You are already a member of the guild.", ephemeral: true });
await interaction.editReply({ content: "You are already a member of the guild.", ephemeral: true })
return
}
const application = await guildapp.findOne({ userID: user.id });
const application = await guildapp.findOne({ userID: user.id })
if (application) {
await interaction.editReply({ content: "You already have an application in progress.", ephemeral: true });
await interaction.editReply({ content: "You already have an application in progress.", ephemeral: true })
return
}
@@ -60,7 +60,7 @@ module.exports = {
try {
await user.send({
embeds: [{
title: 'Guild Application',
title: "Guild Application",
description: "Please answer the following questions to apply for the guild.\n" +
"If you wish to cancel your application, please type `cancel` at any time.\n" +
"If you wish to proceed with your application, please type `yes`.\n\n" +
@@ -70,7 +70,7 @@ module.exports = {
}]
})
} catch (error) {
await interaction.editReply({ content: "Please enable your DMs.", ephemeral: true });
await interaction.editReply({ content: "Please enable your DMs.", ephemeral: true })
return
}
@@ -81,17 +81,17 @@ module.exports = {
filter: m => m.author.id === user.id,
max: 1,
time: 1000 * 60
});
})
if (input.size === 0) {
await user.send({ embeds: [tooLong] });
await user.send({ embeds: [tooLong] })
return
}
if (input.first().content.toLowerCase() !== 'yes') {
await user.send({ embeds: [cancelled] });
if (input.first().content.toLowerCase() !== "yes") {
await user.send({ embeds: [cancelled] })
return
}
if (input.first().attachments.size > 0) {
await user.send({ embeds: [attachments] });
await user.send({ embeds: [attachments] })
return
}
@@ -110,17 +110,17 @@ module.exports = {
filter: m => m.author.id === user.id,
max: 1,
time: 1000 * 60 * 5,
});
})
if (answer1.size === 0) {
await user.send({ embeds: [tooLong] })
return
}
if (answer1.first().content.toLowerCase() === 'cancel') {
if (answer1.first().content.toLowerCase() === "cancel") {
await user.send({ embeds: [cancelled] })
return
}
if (answer1.first().attachments.size > 0) {
await user.send({ embeds: [attachments] });
await user.send({ embeds: [attachments] })
return
}
if (answer1.first().content > 16) {
@@ -160,17 +160,17 @@ module.exports = {
filter: m => m.author.id === user.id,
max: 1,
time: 1000 * 60 * 15
});
})
if (answer2.size === 0) {
await user.send({ embeds: [tooLong] })
return
}
if (answer2.first().content.toLowerCase() === 'cancel') {
if (answer2.first().content.toLowerCase() === "cancel") {
await user.send({ embeds: [cancelled] })
return
}
if (answer2.first().attachments.size > 0) {
await user.send({ embeds: [attachments] });
await user.send({ embeds: [attachments] })
return
}
if (answer2.first().content.size > 8) {
@@ -199,17 +199,17 @@ module.exports = {
filter: m => m.author.id === user.id,
max: 1,
time: 1000 * 60 * 15
});
})
if (answer3.size === 0) {
await user.send({ embeds: [tooLong] })
return
}
if (answer3.first().content.toLowerCase() === 'cancel') {
if (answer3.first().content.toLowerCase() === "cancel") {
await user.send({ embeds: [cancelled] })
return
}
if (answer3.first().attachments.size > 0) {
await user.send({ embeds: [attachments] });
await user.send({ embeds: [attachments] })
return
}
if (answer3.first().content > 128) {
@@ -238,17 +238,17 @@ module.exports = {
filter: m => m.author.id === user.id,
max: 1,
time: 1000 * 60 * 15
});
})
if (answer4.size === 0) {
await user.send({ embeds: [tooLong] })
return
}
if (answer4.first().content.toLowerCase() === 'cancel') {
if (answer4.first().content.toLowerCase() === "cancel") {
await user.send({ embeds: [cancelled] })
return
}
if (answer4.first().attachments.size > 0) {
await user.send({ embeds: [attachments] });
await user.send({ embeds: [attachments] })
return
}
if (answer4.first().content > 256) {
@@ -276,17 +276,17 @@ module.exports = {
filter: m => m.author.id === user.id,
max: 1,
time: 1000 * 60 * 15
});
})
if (answer5.size === 0) {
await user.send({ embeds: [tooLong] })
return
}
if (answer5.first().content.toLowerCase() === 'cancel') {
if (answer5.first().content.toLowerCase() === "cancel") {
await user.send({ embeds: [cancelled] })
return
}
if (answer5.first().attachments.size > 0) {
await user.send({ embeds: [attachments] });
await user.send({ embeds: [attachments] })
return
}
if (answer5.first().content > 128) {
@@ -314,17 +314,17 @@ module.exports = {
filter: m => m.author.id === user.id,
max: 1,
time: 1000 * 60 * 15
});
})
if (answer6.size === 0) {
await user.send({ embeds: [tooLong] })
return
}
if (answer6.first().content.toLowerCase() === 'cancel') {
if (answer6.first().content.toLowerCase() === "cancel") {
await user.send({ embeds: [cancelled] })
return
}
if (answer6.first().attachments.size > 0) {
await user.send({ embeds: [attachments] });
await user.send({ embeds: [attachments] })
return
}
if (answer6.first().content > 256) {
@@ -352,17 +352,17 @@ module.exports = {
filter: m => m.author.id === user.id,
max: 1,
time: 1000 * 60 * 15
});
})
if (answer7.size === 0) {
await user.send({ embeds: [tooLong] })
return
}
if (answer7.first().content.toLowerCase() === 'cancel') {
if (answer7.first().content.toLowerCase() === "cancel") {
await user.send({ embeds: [cancelled] })
return
}
if (answer7.first().attachments.size > 0) {
await user.send({ embeds: [attachments] });
await user.send({ embeds: [attachments] })
return
}
if (answer7.first().content > 128) {
@@ -390,17 +390,17 @@ module.exports = {
filter: m => m.author.id === user.id,
max: 1,
time: 1000 * 60 * 15
});
})
if (answer8.size === 0) {
await user.send({ embeds: [tooLong] })
return
}
if (answer8.first().content.toLowerCase() === 'cancel') {
if (answer8.first().content.toLowerCase() === "cancel") {
await user.send({ embeds: [cancelled] })
return
}
if (answer8.first().attachments.size > 0) {
await user.send({ embeds: [attachments] });
await user.send({ embeds: [attachments] })
return
}
if (answer8.first().content > 64) {
@@ -424,17 +424,17 @@ module.exports = {
filter: m => m.author.id === user.id,
max: 1,
time: 1000 * 60 * 5
});
})
if (final.size === 0) {
await user.send({ embeds: [tooLong] });
await user.send({ embeds: [tooLong] })
return
}
if (final.first().content.toLowerCase() !== 'yes') {
await user.send({ embeds: [cancelled] });
if (final.first().content.toLowerCase() !== "yes") {
await user.send({ embeds: [cancelled] })
return
}
if (final.first().attachments.size > 0) {
await user.send({ embeds: [attachments] });
await user.send({ embeds: [attachments] })
return
}
@@ -453,7 +453,7 @@ module.exports = {
await newGuildApp.save()
const channel = guild.channels.cache.get(applicationsChannel);
const channel = guild.channels.cache.get(applicationsChannel)
await channel.send({
embeds: [{
title: user.username + "#" + user.discriminator + " - Guild Application",
@@ -516,7 +516,7 @@ module.exports = {
.setStyle(ButtonStyle.Secondary)
)
]
});
})
}
}