Doing small tweaks
This commit is contained in:
@@ -4,7 +4,7 @@ const fetch = require('axios');
|
|||||||
const verify = require('../schemas/verifySchema.js')
|
const verify = require('../schemas/verifySchema.js')
|
||||||
const mongoose = require('mongoose');
|
const mongoose = require('mongoose');
|
||||||
const { color } = require('../config/options.json');
|
const { color } = require('../config/options.json');
|
||||||
const { gm, manager, moderator, beast, member, trialmember } = require('../config/roles.json');
|
const { gm, manager, moderator, beast, member, trialmember, guildRole } = require('../config/roles.json');
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: 'update',
|
name: 'update',
|
||||||
@@ -54,50 +54,73 @@ module.exports = {
|
|||||||
const guildRank = GuildMembers.find(member => member.uuid === verifyData.uuid).rank;
|
const guildRank = GuildMembers.find(member => member.uuid === verifyData.uuid).rank;
|
||||||
|
|
||||||
if (guildRank === 'Guild Master') {
|
if (guildRank === 'Guild Master') {
|
||||||
await interaction.reply({
|
await roleManage.remove(gm || manager || moderator || beast || member || trialmember || guildRole)
|
||||||
|
await roleManage.add(guildRole)
|
||||||
|
await roleManage.add(gm)
|
||||||
|
|
||||||
|
await verify.findOneAndUpdate({ userID: user.id }, { rank: guildRank })
|
||||||
|
interaction.reply({
|
||||||
embeds: [{
|
embeds: [{
|
||||||
description: "You are the Guild Master. Due to security reasons, you cannot update your rank.",
|
description: "Your rank has been updated to `Guild Master`",
|
||||||
color: embedColor,
|
color: embedColor,
|
||||||
|
thumbnail: {
|
||||||
|
url: head
|
||||||
|
},
|
||||||
footer: {
|
footer: {
|
||||||
text: interaction.guild.name + " | Developed by @Taken#0002",
|
text: interaction.guild.name + " | Developed by @Taken#0002",
|
||||||
icon_url: interaction.guild.iconURL({ dynamic: true })
|
icon_url: interaction.guild.iconURL({ dynamic: true })
|
||||||
}
|
}
|
||||||
}]
|
}]
|
||||||
})
|
})
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (guildRank === 'Manager') {
|
if (guildRank === 'Manager') {
|
||||||
await interaction.reply({
|
await roleManage.remove(gm || manager || moderator || beast || member || trialmember || guildRole)
|
||||||
|
await roleManage.add(guildRole)
|
||||||
|
await roleManage.add(manager)
|
||||||
|
|
||||||
|
await verify.findOneAndUpdate({ userID: user.id }, { rank: guildRank })
|
||||||
|
interaction.reply({
|
||||||
embeds: [{
|
embeds: [{
|
||||||
description: "You are a Manager. Due to security reasons, you cannot update your rank.",
|
description: "Your rank has been updated to `Manager`",
|
||||||
color: embedColor,
|
color: embedColor,
|
||||||
|
thumbnail: {
|
||||||
|
url: head
|
||||||
|
},
|
||||||
footer: {
|
footer: {
|
||||||
text: interaction.guild.name + " | Developed by @Taken#0002",
|
text: interaction.guild.name + " | Developed by @Taken#0002",
|
||||||
icon_url: interaction.guild.iconURL({ dynamic: true })
|
icon_url: interaction.guild.iconURL({ dynamic: true })
|
||||||
}
|
}
|
||||||
}]
|
}]
|
||||||
})
|
})
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (guildRank === 'Moderator') {
|
if (guildRank === 'Moderator') {
|
||||||
await interaction.reply({
|
await roleManage.remove(gm || manager || moderator || beast || member || trialmember || guildRole)
|
||||||
|
await roleManage.add(guildRole)
|
||||||
|
await roleManage.add(moderator)
|
||||||
|
|
||||||
|
await verify.findOneAndUpdate({ userID: user.id }, { rank: guildRank })
|
||||||
|
interaction.reply({
|
||||||
embeds: [{
|
embeds: [{
|
||||||
description: "You are a Moderator. Due to security reasons, you cannot update your rank.",
|
description: "Your rank has been updated to `Moderator`",
|
||||||
color: embedColor,
|
color: embedColor,
|
||||||
|
thumbnail: {
|
||||||
|
url: head
|
||||||
|
},
|
||||||
footer: {
|
footer: {
|
||||||
text: interaction.guild.name + " | Developed by @Taken#0002",
|
text: interaction.guild.name + " | Developed by @Taken#0002",
|
||||||
icon_url: interaction.guild.iconURL({ dynamic: true })
|
icon_url: interaction.guild.iconURL({ dynamic: true })
|
||||||
}
|
}
|
||||||
}]
|
}]
|
||||||
})
|
})
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (guildRank === 'Beast') {
|
if (guildRank === 'Beast') {
|
||||||
|
await roleManage.remove(gm || manager || moderator || beast || member || trialmember || guildRole)
|
||||||
|
await roleManage.add(guildRole)
|
||||||
await roleManage.add(beast)
|
await roleManage.add(beast)
|
||||||
await roleManage.remove(gm || manager || moderator || member || trialmember)
|
|
||||||
|
|
||||||
await verify.findOneAndUpdate({ userID: user.id }, { rank: guildRank })
|
await verify.findOneAndUpdate({ userID: user.id }, { rank: guildRank })
|
||||||
interaction.reply({
|
interaction.reply({
|
||||||
@@ -117,8 +140,9 @@ module.exports = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (guildRank === 'Member') {
|
if (guildRank === 'Member') {
|
||||||
|
await roleManage.remove(gm || manager || moderator || beast || member || trialmember || guildRole)
|
||||||
|
await roleManage.add(guildRole)
|
||||||
await roleManage.add(member)
|
await roleManage.add(member)
|
||||||
await roleManage.remove(gm || manager || moderator || beast || trialmember)
|
|
||||||
|
|
||||||
await verify.findOneAndUpdate({ userID: user.id }, { rank: guildRank })
|
await verify.findOneAndUpdate({ userID: user.id }, { rank: guildRank })
|
||||||
interaction.reply({
|
interaction.reply({
|
||||||
@@ -138,8 +162,9 @@ module.exports = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (guildRank === 'Trial Member') {
|
if (guildRank === 'Trial Member') {
|
||||||
|
await roleManage.remove(gm || manager || moderator || beast || member || trialmember || guildRole)
|
||||||
|
await roleManage.add(guildRole)
|
||||||
await roleManage.add(trialmember)
|
await roleManage.add(trialmember)
|
||||||
await roleManage.remove(gm || manager || moderator || beast || member)
|
|
||||||
|
|
||||||
await verify.findOneAndUpdate({ userID: user.id }, { rank: guildRank })
|
await verify.findOneAndUpdate({ userID: user.id }, { rank: guildRank })
|
||||||
interaction.reply({
|
interaction.reply({
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ const fetch = require('axios');
|
|||||||
const { color } = require('../config/options.json');
|
const { color } = require('../config/options.json');
|
||||||
const verify = require('../schemas/verifySchema.js')
|
const verify = require('../schemas/verifySchema.js')
|
||||||
const mongoose = require('mongoose');
|
const mongoose = require('mongoose');
|
||||||
const { gm, manager, moderator, beast, member, trialmember } = require('../config/roles.json');
|
const { gm, manager, moderator, beast, member, trialmember, guildRole } = require('../config/roles.json');
|
||||||
|
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
@@ -77,26 +77,32 @@ module.exports = {
|
|||||||
|
|
||||||
if (guildRank === "Guild Master") {
|
if (guildRank === "Guild Master") {
|
||||||
await user.roles.add(gm);
|
await user.roles.add(gm);
|
||||||
|
await user.roles.add(guildRole)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (guildRank === "Manager") {
|
if (guildRank === "Manager") {
|
||||||
await user.roles.add(manager);
|
await user.roles.add(manager);
|
||||||
|
await user.roles.add(guildRole)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (guildRank === "Moderator") {
|
if (guildRank === "Moderator") {
|
||||||
await user.roles.add(moderator);
|
await user.roles.add(moderator);
|
||||||
|
await user.roles.add(guildRole)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (guildRank === "Beast") {
|
if (guildRank === "Beast") {
|
||||||
await user.roles.add(beast);
|
await user.roles.add(beast);
|
||||||
|
await user.roles.add(guildRole)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (guildRank === "Member") {
|
if (guildRank === "Member") {
|
||||||
await user.roles.add(member);
|
await user.roles.add(member);
|
||||||
|
await user.roles.add(guildRole)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (guildRank === "Trial Member") {
|
if (guildRank === "Trial Member") {
|
||||||
await user.roles.add(trialmember);
|
await user.roles.add(trialmember);
|
||||||
|
await user.roles.add(guildRole)
|
||||||
}
|
}
|
||||||
|
|
||||||
// write to database using verifySchema
|
// write to database using verifySchema
|
||||||
|
|||||||
@@ -108,8 +108,7 @@ module.exports = {
|
|||||||
if (answer1.first().content > 16) {
|
if (answer1.first().content > 16) {
|
||||||
await user.send({
|
await user.send({
|
||||||
embeds: [{
|
embeds: [{
|
||||||
description: "That is not a valid Minecraft username.\n" +
|
description: "¸Max character limit is 16.",
|
||||||
"Application cancelled.",
|
|
||||||
color: embedColor
|
color: embedColor
|
||||||
}]
|
}]
|
||||||
})
|
})
|
||||||
@@ -164,6 +163,7 @@ module.exports = {
|
|||||||
color: embedColor
|
color: embedColor
|
||||||
}]
|
}]
|
||||||
})
|
})
|
||||||
|
return
|
||||||
}
|
}
|
||||||
if (answer2.size === 0) {
|
if (answer2.size === 0) {
|
||||||
await user.send({ embeds: [tooLong] })
|
await user.send({ embeds: [tooLong] })
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ module.exports = {
|
|||||||
.setLabel('Deny Reason')
|
.setLabel('Deny Reason')
|
||||||
.setCustomId('denyreason')
|
.setCustomId('denyreason')
|
||||||
.setStyle(TextInputStyle.Paragraph)
|
.setStyle(TextInputStyle.Paragraph)
|
||||||
|
.setPlaceholder('Enter a reason for denying the application')
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ module.exports = {
|
|||||||
const applicantId = channel.topic;
|
const applicantId = channel.topic;
|
||||||
const guild = interaction.guild;
|
const guild = interaction.guild;
|
||||||
const applicant = await guild.members.fetch(applicantId);
|
const applicant = await guild.members.fetch(applicantId);
|
||||||
const reason = interaction.fields.fields.get('denyreason').value;
|
const reason = interaction.fields.fields.get('denyreason').value ?? "No reason provided";
|
||||||
const embedColor = Number(color.replace("#", "0x"));
|
const embedColor = Number(color.replace("#", "0x"));
|
||||||
const filePath = path.join(__dirname, `../../applications/${applicantId}`);
|
const filePath = path.join(__dirname, `../../applications/${applicantId}`);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user