Added small patches
This commit is contained in:
@@ -56,7 +56,7 @@ module.exports = {
|
|||||||
await channel.send({
|
await channel.send({
|
||||||
embeds: [{
|
embeds: [{
|
||||||
title: 'Guild Application',
|
title: 'Guild Application',
|
||||||
description: "You can apply for the staff team by clicking the button below.",
|
description: "You can apply for guild by clicking the button below.",
|
||||||
color: embedColor,
|
color: embedColor,
|
||||||
footer: {
|
footer: {
|
||||||
text: interaction.guild.name + " | Developed by @Taken#0002",
|
text: interaction.guild.name + " | Developed by @Taken#0002",
|
||||||
@@ -86,7 +86,7 @@ module.exports = {
|
|||||||
await channel.send({
|
await channel.send({
|
||||||
embeds: [{
|
embeds: [{
|
||||||
title: 'Staff Application',
|
title: 'Staff Application',
|
||||||
description: "You can apply for the guild by clicking the button below.",
|
description: "You can apply for the staff team by clicking the button below.",
|
||||||
color: embedColor,
|
color: embedColor,
|
||||||
footer: {
|
footer: {
|
||||||
text: interaction.guild.name + " | Developed by @Taken#0002",
|
text: interaction.guild.name + " | Developed by @Taken#0002",
|
||||||
|
|||||||
@@ -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, hypixelGuildID } = require('../config/options.json');
|
const { color, hypixelGuildID } = require('../config/options.json');
|
||||||
const { gm, manager, moderator, beast, member, trialmember, guildRole, guildStaff } = require('../config/roles.json');
|
const { gm, manager, moderator, beast, member, trialmember, guildRole, guildStaff, defaultMember } = require('../config/roles.json');
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: 'update',
|
name: 'update',
|
||||||
@@ -20,6 +20,8 @@ module.exports = {
|
|||||||
|
|
||||||
await interaction.deferReply();
|
await interaction.deferReply();
|
||||||
|
|
||||||
|
const user1 = interaction.user;
|
||||||
|
const user = interaction.guild.members.cache.get(user1.id);
|
||||||
const verifyData = await verify.findOne({ userID: user.id })
|
const verifyData = await verify.findOne({ userID: user.id })
|
||||||
const memberRoles = interaction.member.roles.cache;
|
const memberRoles = interaction.member.roles.cache;
|
||||||
const roleManage = interaction.member.roles;
|
const roleManage = interaction.member.roles;
|
||||||
@@ -29,8 +31,6 @@ module.exports = {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
const user1 = interaction.options.getUser('user');
|
|
||||||
const user = interaction.guild.members.cache.get(user1.id);
|
|
||||||
const slothPixel = "https://api.slothpixel.me/api/players/";
|
const slothPixel = "https://api.slothpixel.me/api/players/";
|
||||||
const guildAPI = "https://api.slothpixel.me/api/guilds/"
|
const guildAPI = "https://api.slothpixel.me/api/guilds/"
|
||||||
const mojangAPI = "https://api.mojang.com/user/profile/"
|
const mojangAPI = "https://api.mojang.com/user/profile/"
|
||||||
@@ -46,7 +46,7 @@ module.exports = {
|
|||||||
const guildRank = GuildMembers.find(member => member.uuid === verifyData.uuid).rank;
|
const guildRank = GuildMembers.find(member => member.uuid === verifyData.uuid).rank;
|
||||||
|
|
||||||
if (guildCheck.data.id !== hypixelGuildID) {
|
if (guildCheck.data.id !== hypixelGuildID) {
|
||||||
interaction.reply({
|
interaction.editReply({
|
||||||
embeds: [{
|
embeds: [{
|
||||||
description: "Updating is only available for members of the guild.",
|
description: "Updating is only available for members of the guild.",
|
||||||
color: embedColor,
|
color: embedColor,
|
||||||
@@ -63,13 +63,14 @@ module.exports = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (guildRank === 'Guild Master') {
|
if (guildRank === 'Guild Master') {
|
||||||
await roleManage.remove(gm || manager || moderator || beast || member || trialmember || guildRole || guildStaff)
|
await roleManage.remove(gm || manager || moderator || beast || member || trialmember || guildRole || guildStaff || defaultMember)
|
||||||
await roleManage.add(guildRole)
|
await roleManage.add(guildRole)
|
||||||
await roleManage.add(guildStaff)
|
await roleManage.add(guildStaff)
|
||||||
await roleManage.add(gm)
|
await roleManage.add(gm)
|
||||||
|
await roleManage.add(defaultMember)
|
||||||
|
|
||||||
await verify.findOneAndUpdate({ userID: user.id })
|
await verify.findOneAndUpdate({ userID: user.id })
|
||||||
interaction.reply({
|
interaction.editReply({
|
||||||
embeds: [{
|
embeds: [{
|
||||||
description: "Your rank has been updated to `Guild Master`",
|
description: "Your rank has been updated to `Guild Master`",
|
||||||
color: embedColor,
|
color: embedColor,
|
||||||
@@ -89,9 +90,10 @@ module.exports = {
|
|||||||
await roleManage.add(guildRole)
|
await roleManage.add(guildRole)
|
||||||
await roleManage.add(guildStaff)
|
await roleManage.add(guildStaff)
|
||||||
await roleManage.add(manager)
|
await roleManage.add(manager)
|
||||||
|
await roleManage.add(defaultMember)
|
||||||
|
|
||||||
await verify.findOneAndUpdate({ userID: user.id })
|
await verify.findOneAndUpdate({ userID: user.id })
|
||||||
interaction.reply({
|
interaction.editReply({
|
||||||
embeds: [{
|
embeds: [{
|
||||||
description: "Your rank has been updated to `Manager`",
|
description: "Your rank has been updated to `Manager`",
|
||||||
color: embedColor,
|
color: embedColor,
|
||||||
@@ -111,9 +113,10 @@ module.exports = {
|
|||||||
await roleManage.add(guildRole)
|
await roleManage.add(guildRole)
|
||||||
await roleManage.add(guildStaff)
|
await roleManage.add(guildStaff)
|
||||||
await roleManage.add(moderator)
|
await roleManage.add(moderator)
|
||||||
|
await roleManage.add(defaultMember)
|
||||||
|
|
||||||
await verify.findOneAndUpdate({ userID: user.id })
|
await verify.findOneAndUpdate({ userID: user.id })
|
||||||
interaction.reply({
|
interaction.editReply({
|
||||||
embeds: [{
|
embeds: [{
|
||||||
description: "Your rank has been updated to `Moderator`",
|
description: "Your rank has been updated to `Moderator`",
|
||||||
color: embedColor,
|
color: embedColor,
|
||||||
@@ -133,9 +136,10 @@ module.exports = {
|
|||||||
await roleManage.remove(gm || manager || moderator || beast || member || trialmember || guildRole)
|
await roleManage.remove(gm || manager || moderator || beast || member || trialmember || guildRole)
|
||||||
await roleManage.add(guildRole)
|
await roleManage.add(guildRole)
|
||||||
await roleManage.add(beast)
|
await roleManage.add(beast)
|
||||||
|
await roleManage.add(defaultMember)
|
||||||
|
|
||||||
await verify.findOneAndUpdate({ userID: user.id })
|
await verify.findOneAndUpdate({ userID: user.id })
|
||||||
interaction.reply({
|
interaction.editReply({
|
||||||
embeds: [{
|
embeds: [{
|
||||||
description: "Your rank has been updated to `Beast`.",
|
description: "Your rank has been updated to `Beast`.",
|
||||||
color: embedColor,
|
color: embedColor,
|
||||||
@@ -155,9 +159,10 @@ module.exports = {
|
|||||||
await roleManage.remove(gm || manager || moderator || beast || member || trialmember || guildRole)
|
await roleManage.remove(gm || manager || moderator || beast || member || trialmember || guildRole)
|
||||||
await roleManage.add(guildRole)
|
await roleManage.add(guildRole)
|
||||||
await roleManage.add(member)
|
await roleManage.add(member)
|
||||||
|
await roleManage.add(defaultMember)
|
||||||
|
|
||||||
await verify.findOneAndUpdate({ userID: user.id })
|
await verify.findOneAndUpdate({ userID: user.id })
|
||||||
interaction.reply({
|
interaction.editReply({
|
||||||
embeds: [{
|
embeds: [{
|
||||||
description: "Your rank has been updated to `Member`.",
|
description: "Your rank has been updated to `Member`.",
|
||||||
color: embedColor,
|
color: embedColor,
|
||||||
@@ -177,9 +182,10 @@ module.exports = {
|
|||||||
await roleManage.remove(gm || manager || moderator || beast || member || trialmember || guildRole)
|
await roleManage.remove(gm || manager || moderator || beast || member || trialmember || guildRole)
|
||||||
await roleManage.add(guildRole)
|
await roleManage.add(guildRole)
|
||||||
await roleManage.add(trialmember)
|
await roleManage.add(trialmember)
|
||||||
|
await roleManage.add(defaultMember)
|
||||||
|
|
||||||
await verify.findOneAndUpdate({ userID: user.id })
|
await verify.findOneAndUpdate({ userID: user.id })
|
||||||
interaction.reply({
|
interaction.editReply({
|
||||||
embeds: [{
|
embeds: [{
|
||||||
description: "Your rank has been updated to `Trial Member`.",
|
description: "Your rank has been updated to `Trial Member`.",
|
||||||
color: embedColor,
|
color: embedColor,
|
||||||
|
|||||||
@@ -25,9 +25,10 @@ module.exports = {
|
|||||||
|
|
||||||
await interaction.deferReply();
|
await interaction.deferReply();
|
||||||
|
|
||||||
const user1 = interaction.options.getUser('user');
|
const user1 = interaction.user;
|
||||||
const user = interaction.guild.members.cache.get(user1.id);
|
const user = await interaction.guild.members.fetch(user1.id);
|
||||||
const fullUsername = user1.username + "#" + user1.discriminator
|
|
||||||
|
const fullUsername = user.user.username + "#" + user.user.discriminator
|
||||||
const ign = interaction.options.getString('ign');
|
const ign = interaction.options.getString('ign');
|
||||||
const mojang = "https://api.mojang.com/users/profiles/minecraft/"
|
const mojang = "https://api.mojang.com/users/profiles/minecraft/"
|
||||||
const slothPixel = "https://api.slothpixel.me/api/players/";
|
const slothPixel = "https://api.slothpixel.me/api/players/";
|
||||||
@@ -46,29 +47,29 @@ module.exports = {
|
|||||||
const guildRank = GuildMembers.find(member => member.uuid === hypixelCheck.data.uuid).rank;
|
const guildRank = GuildMembers.find(member => member.uuid === hypixelCheck.data.uuid).rank;
|
||||||
|
|
||||||
if (!ign) {
|
if (!ign) {
|
||||||
interaction.reply('Please provide a player\'s IGN.')
|
interaction.editReply('Please provide a player\'s IGN.')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!userUUID) {
|
if (!userUUID) {
|
||||||
interaction.reply('That player doesn\'t exist. [Mojang]')
|
interaction.editReply('That player doesn\'t exist. [Mojang]')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!hypixelCheck.data.uuid) {
|
if (!hypixelCheck.data.uuid) {
|
||||||
interaction.reply('That player doesn\'t exist. [Hypixel]')
|
interaction.editReply('That player doesn\'t exist. [Hypixel]')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hypixelCheck.data.links.DISCORD !== fullUsername) {
|
if (hypixelCheck.data.links.DISCORD !== fullUsername) {
|
||||||
interaction.reply('Your Discord tag does not match your in-game tag.')
|
interaction.editReply('Your Discord tag does not match your in-game tag.')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
const verifyData = await verify.findOne({ userID: user.id })
|
const verifyData = await verify.findOne({ userID: user.id })
|
||||||
|
|
||||||
if (verifyData) {
|
if (verifyData) {
|
||||||
interaction.reply('You are already verified.')
|
interaction.editReply('You are already verified.')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -115,7 +116,7 @@ module.exports = {
|
|||||||
|
|
||||||
await newVerify.save()
|
await newVerify.save()
|
||||||
|
|
||||||
await interaction.reply({
|
await interaction.editReply({
|
||||||
embeds: [{
|
embeds: [{
|
||||||
title: interaction.guild.name,
|
title: interaction.guild.name,
|
||||||
description: "You have successfully verified `" + fullUsername + "` with the account `" + hypixelCheck.data.username + "`.",
|
description: "You have successfully verified `" + fullUsername + "` with the account `" + hypixelCheck.data.username + "`.",
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"color": "#eeaadb",
|
"color": "#eeaadb",
|
||||||
"applicationsCategory": "568796159997509653",
|
"applicationsChannel": "776705352456470550",
|
||||||
"hypixelGuildID": "5a353a170cf2e529044f2935"
|
"hypixelGuildID": "5a353a170cf2e529044f2935"
|
||||||
}
|
}
|
||||||
@@ -2,7 +2,7 @@ const { REST, Routes } = require('discord.js');
|
|||||||
const { clientId, realguildId, testguildId, token } = require('./config.json');
|
const { clientId, realguildId, testguildId, token } = require('./config.json');
|
||||||
const fs = require('node:fs');
|
const fs = require('node:fs');
|
||||||
|
|
||||||
const guildId = testguildId;
|
const guildId = realguildId;
|
||||||
|
|
||||||
const commands = [];
|
const commands = [];
|
||||||
// Grab all the command files from the commands directory you created earlier
|
// Grab all the command files from the commands directory you created earlier
|
||||||
|
|||||||
Reference in New Issue
Block a user