Beautifying
This commit is contained in:
@@ -1,147 +1,203 @@
|
||||
const { SlashCommandBuilder, EmbedBuilder, PermissionFlagsBits } = require('discord.js');
|
||||
const { bwfdkr, bwstars, bwwins, duelswins, swstars } = require('../config/reqs.json')
|
||||
const getuuid = require('../utils/functions');
|
||||
const env = require('dotenv').config();
|
||||
const {
|
||||
SlashCommandBuilder,
|
||||
EmbedBuilder,
|
||||
PermissionFlagsBits
|
||||
} = require("discord.js");
|
||||
const {
|
||||
bwfdkr,
|
||||
bwstars,
|
||||
bwwins,
|
||||
duelswins,
|
||||
swstars
|
||||
} = require("../config/reqs.json");
|
||||
const getuuid = require("../utils/functions");
|
||||
const env = require("dotenv").config();
|
||||
const hypixelApiKey = process.env.HYPIXELAPI;
|
||||
const { color } = require('../config/options.json');
|
||||
const fetch = require('axios');
|
||||
const { color } = require("../config/options.json");
|
||||
const fetch = require("axios");
|
||||
|
||||
module.exports = {
|
||||
name: 'check',
|
||||
description: 'Check a player\'s stats.',
|
||||
type: 'slash',
|
||||
name: "check",
|
||||
description: "Check a player's stats.",
|
||||
type: "slash",
|
||||
|
||||
data: new SlashCommandBuilder()
|
||||
.setName('check')
|
||||
.setDescription('Check a player\'s stats.')
|
||||
.addStringOption(option =>
|
||||
option
|
||||
.setName('ign')
|
||||
.setDescription('The player\'s IGN.')
|
||||
.setRequired(true))
|
||||
.setDMPermission(false),
|
||||
data: new SlashCommandBuilder()
|
||||
.setName("check")
|
||||
.setDescription("Check a player's stats.")
|
||||
.addStringOption((option) =>
|
||||
option
|
||||
.setName("ign")
|
||||
.setDescription("The player's IGN.")
|
||||
.setRequired(true)
|
||||
)
|
||||
.setDMPermission(false),
|
||||
|
||||
async execute(interaction) {
|
||||
async execute(interaction) {
|
||||
await interaction.deferReply({});
|
||||
|
||||
await interaction.deferReply({})
|
||||
const ign = interaction.options.getString("ign");
|
||||
const mojang = "https://api.mojang.com/users/profiles/minecraft/";
|
||||
const slothPixel = "https://api.slothpixel.me/api/players/";
|
||||
const guildAPI = "https://api.slothpixel.me/api/guilds/";
|
||||
const minotar = "https://minotar.net/helm/";
|
||||
const embedColor = Number(color.replace("#", "0x"));
|
||||
|
||||
const ign = interaction.options.getString('ign');
|
||||
const mojang = "https://api.mojang.com/users/profiles/minecraft/"
|
||||
const slothPixel = "https://api.slothpixel.me/api/players/";
|
||||
const guildAPI = "https://api.slothpixel.me/api/guilds/"
|
||||
const minotar = "https://minotar.net/helm/";
|
||||
const embedColor = Number(color.replace("#", "0x"));
|
||||
|
||||
if (!ign) {
|
||||
await interaction.editReply('Please provide a player\'s IGN.')
|
||||
return
|
||||
}
|
||||
|
||||
if (await getuuid(ign) === null) {
|
||||
await interaction.editReply('That player doesn\'t exist. [Mojang]')
|
||||
return
|
||||
}
|
||||
|
||||
const userUUID = await getuuid(ign);
|
||||
|
||||
try {
|
||||
await fetch(slothPixel + userUUID);
|
||||
} catch (error) {
|
||||
interaction.editReply('That player doesn\'t exist. [Hypixel]')
|
||||
return
|
||||
}
|
||||
|
||||
const stats = await fetch(slothPixel + userUUID);
|
||||
const head = minotar + ign;
|
||||
|
||||
if (!stats.data.uuid) {
|
||||
interaction.editReply('That player doesn\'t exist. [Hypixel]')
|
||||
return
|
||||
}
|
||||
|
||||
const rank_formatted = stats.data.rank_formatted
|
||||
const rank2 = rank_formatted.replace(/&[0-9a-fk-or]/g, "")
|
||||
|
||||
if (rank2 === "") {
|
||||
var rank = ""
|
||||
} else {
|
||||
var rank = rank2 + " "
|
||||
}
|
||||
|
||||
try {
|
||||
const guildCheck = await fetch(guildAPI + userUUID);
|
||||
var guildName = guildCheck.data.name
|
||||
} catch (error) {
|
||||
var guildName = "None"
|
||||
}
|
||||
|
||||
const hsbwstars = stats.data.stats.BedWars.level
|
||||
const hsbwfkdr = stats.data.stats.BedWars.final_k_d
|
||||
const hsbwwins = stats.data.stats.BedWars.wins
|
||||
const hsswstars = stats.data.stats.SkyWars.level
|
||||
const hsduelswins = stats.data.stats.Duels.general.wins
|
||||
|
||||
if (hsbwstars < bwstars && hsbwfkdr < bwfdkr && hsbwwins < bwwins) {
|
||||
var bwtitle = "<a:cross_a:1087808606897983539> This player does not meet the BedWars requirements."
|
||||
} else {
|
||||
var bwtitle = "<a:check_a:1087808632172847134> This player meets the BedWars requirements."
|
||||
}
|
||||
|
||||
if (hsswstars < swstars) {
|
||||
var swtitle = "<a:cross_a:1087808606897983539> This player does not meet the SkyWars requirements."
|
||||
} else {
|
||||
var swtitle = "<a:check_a:1087808632172847134> This player meets the SkyWars requirements."
|
||||
}
|
||||
|
||||
if (hsduelswins < duelswins) {
|
||||
var duelstitle = "<a:cross_a:1087808606897983539> This player does not meet the Duels requirements."
|
||||
} else {
|
||||
var duelstitle = "<a:check_a:1087808632172847134> This player meets the Duels requirements."
|
||||
}
|
||||
|
||||
try {
|
||||
const guildCheck = await fetch(guildAPI + userUUID);
|
||||
const tag_formatted = guildCheck.data.tag_formatted
|
||||
const guildTag2 = tag_formatted.replace(/&[0-9a-fk-or]/g, "")
|
||||
var guildTag = " " + guildTag2
|
||||
} catch (error) {
|
||||
var guildTag = ""
|
||||
}
|
||||
|
||||
await interaction.editReply({
|
||||
embeds: [{
|
||||
title: rank + stats.data.username + guildTag,
|
||||
description: "**Network Level:** `" + stats.data.level.toString() + "`\n" +
|
||||
"**Current Guild:** `" + guildName + "`",
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: head
|
||||
},
|
||||
footer: {
|
||||
text: interaction.guild.name + " | Developed by @Taken#0002",
|
||||
icon_url: interaction.guild.iconURL()
|
||||
},
|
||||
fields: [
|
||||
{
|
||||
name: bwtitle,
|
||||
value: "**➺ Stars:** `" + stats.data.stats.BedWars.level.toString() + " / " + bwstars.toString() + "`\n" +
|
||||
"**➺ FKDR:** `" + stats.data.stats.BedWars.final_k_d.toString() + " / " + bwfdkr.toString() + "`\n" +
|
||||
"**➺ Wins:** `" + stats.data.stats.BedWars.wins.toString() + " / " + bwwins.toString() + "`"
|
||||
},
|
||||
{
|
||||
name: swtitle,
|
||||
value: "**➺ Stars:** `" + stats.data.stats.SkyWars.level.toFixed(2).toString() + " / " + swstars.toString() + "`\n" +
|
||||
"**➺ KDR:** `" + stats.data.stats.SkyWars.kill_death_ratio.toString() + "`\n" +
|
||||
"**➺ Wins:** `" + stats.data.stats.SkyWars.wins.toString() + "`"
|
||||
},
|
||||
{
|
||||
name: duelstitle,
|
||||
value: "**➺ Wins:** `" + stats.data.stats.Duels.general.wins.toString() + " / " + duelswins.toString() + "`\n" +
|
||||
"**➺ KDR:** `" + stats.data.stats.Duels.general.kd_ratio.toFixed(2).toString() + "`\n" +
|
||||
"**➺ WLR:** `" + stats.data.stats.Duels.general.win_loss_ratio.toFixed(2).toString() + "`"
|
||||
}
|
||||
]
|
||||
}]
|
||||
})
|
||||
if (!ign) {
|
||||
await interaction.editReply("Please provide a player's IGN.");
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
||||
if ((await getuuid(ign)) === null) {
|
||||
await interaction.editReply("That player doesn't exist. [Mojang]");
|
||||
return;
|
||||
}
|
||||
|
||||
const userUUID = await getuuid(ign);
|
||||
|
||||
try {
|
||||
await fetch(slothPixel + userUUID);
|
||||
} catch (error) {
|
||||
interaction.editReply("That player doesn't exist. [Hypixel]");
|
||||
return;
|
||||
}
|
||||
|
||||
const stats = await fetch(slothPixel + userUUID);
|
||||
const head = minotar + ign;
|
||||
|
||||
if (!stats.data.uuid) {
|
||||
interaction.editReply("That player doesn't exist. [Hypixel]");
|
||||
return;
|
||||
}
|
||||
|
||||
const rank_formatted = stats.data.rank_formatted;
|
||||
const rank2 = rank_formatted.replace(/&[0-9a-fk-or]/g, "");
|
||||
|
||||
if (rank2 === "") {
|
||||
var rank = "";
|
||||
} else {
|
||||
var rank = rank2 + " ";
|
||||
}
|
||||
|
||||
try {
|
||||
const guildCheck = await fetch(guildAPI + userUUID);
|
||||
var guildName = guildCheck.data.name;
|
||||
} catch (error) {
|
||||
var guildName = "None";
|
||||
}
|
||||
|
||||
const hsbwstars = stats.data.stats.BedWars.level;
|
||||
const hsbwfkdr = stats.data.stats.BedWars.final_k_d;
|
||||
const hsbwwins = stats.data.stats.BedWars.wins;
|
||||
const hsswstars = stats.data.stats.SkyWars.level;
|
||||
const hsduelswins = stats.data.stats.Duels.general.wins;
|
||||
|
||||
if (hsbwstars < bwstars && hsbwfkdr < bwfdkr && hsbwwins < bwwins) {
|
||||
var bwtitle =
|
||||
"<a:cross_a:1087808606897983539> This player does not meet the BedWars requirements.";
|
||||
} else {
|
||||
var bwtitle =
|
||||
"<a:check_a:1087808632172847134> This player meets the BedWars requirements.";
|
||||
}
|
||||
|
||||
if (hsswstars < swstars) {
|
||||
var swtitle =
|
||||
"<a:cross_a:1087808606897983539> This player does not meet the SkyWars requirements.";
|
||||
} else {
|
||||
var swtitle =
|
||||
"<a:check_a:1087808632172847134> This player meets the SkyWars requirements.";
|
||||
}
|
||||
|
||||
if (hsduelswins < duelswins) {
|
||||
var duelstitle =
|
||||
"<a:cross_a:1087808606897983539> This player does not meet the Duels requirements.";
|
||||
} else {
|
||||
var duelstitle =
|
||||
"<a:check_a:1087808632172847134> This player meets the Duels requirements.";
|
||||
}
|
||||
|
||||
try {
|
||||
const guildCheck = await fetch(guildAPI + userUUID);
|
||||
const tag_formatted = guildCheck.data.tag_formatted;
|
||||
const guildTag2 = tag_formatted.replace(/&[0-9a-fk-or]/g, "");
|
||||
var guildTag = " " + guildTag2;
|
||||
} catch (error) {
|
||||
var guildTag = "";
|
||||
}
|
||||
|
||||
await interaction.editReply({
|
||||
embeds: [
|
||||
{
|
||||
title: rank + stats.data.username + guildTag,
|
||||
description:
|
||||
"**Network Level:** `" +
|
||||
stats.data.level.toString() +
|
||||
"`\n" +
|
||||
"**Current Guild:** `" +
|
||||
guildName +
|
||||
"`",
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: head
|
||||
},
|
||||
footer: {
|
||||
text: interaction.guild.name + " | Developed by @Taken#0002",
|
||||
icon_url: interaction.guild.iconURL()
|
||||
},
|
||||
fields: [
|
||||
{
|
||||
name: bwtitle,
|
||||
value:
|
||||
"**➺ Stars:** `" +
|
||||
stats.data.stats.BedWars.level.toString() +
|
||||
" / " +
|
||||
bwstars.toString() +
|
||||
"`\n" +
|
||||
"**➺ FKDR:** `" +
|
||||
stats.data.stats.BedWars.final_k_d.toString() +
|
||||
" / " +
|
||||
bwfdkr.toString() +
|
||||
"`\n" +
|
||||
"**➺ Wins:** `" +
|
||||
stats.data.stats.BedWars.wins.toString() +
|
||||
" / " +
|
||||
bwwins.toString() +
|
||||
"`"
|
||||
},
|
||||
{
|
||||
name: swtitle,
|
||||
value:
|
||||
"**➺ Stars:** `" +
|
||||
stats.data.stats.SkyWars.level.toFixed(2).toString() +
|
||||
" / " +
|
||||
swstars.toString() +
|
||||
"`\n" +
|
||||
"**➺ KDR:** `" +
|
||||
stats.data.stats.SkyWars.kill_death_ratio.toString() +
|
||||
"`\n" +
|
||||
"**➺ Wins:** `" +
|
||||
stats.data.stats.SkyWars.wins.toString() +
|
||||
"`"
|
||||
},
|
||||
{
|
||||
name: duelstitle,
|
||||
value:
|
||||
"**➺ Wins:** `" +
|
||||
stats.data.stats.Duels.general.wins.toString() +
|
||||
" / " +
|
||||
duelswins.toString() +
|
||||
"`\n" +
|
||||
"**➺ KDR:** `" +
|
||||
stats.data.stats.Duels.general.kd_ratio.toFixed(2).toString() +
|
||||
"`\n" +
|
||||
"**➺ WLR:** `" +
|
||||
stats.data.stats.Duels.general.win_loss_ratio
|
||||
.toFixed(2)
|
||||
.toString() +
|
||||
"`"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,125 +1,145 @@
|
||||
const { SlashCommandBuilder, PermissionFlagsBits, ButtonBuilder, ActionRowBuilder, ButtonStyle, EmbedBuilder, WebhookClient } = require('discord.js');
|
||||
const { title } = require('process');
|
||||
const { color } = require('../config/options.json');
|
||||
const {
|
||||
SlashCommandBuilder,
|
||||
PermissionFlagsBits,
|
||||
ButtonBuilder,
|
||||
ActionRowBuilder,
|
||||
ButtonStyle,
|
||||
EmbedBuilder,
|
||||
WebhookClient
|
||||
} = require("discord.js");
|
||||
const { title } = require("process");
|
||||
const { color } = require("../config/options.json");
|
||||
|
||||
module.exports = {
|
||||
name: 'config',
|
||||
description: 'Configure the bot.',
|
||||
type: 'slash',
|
||||
name: "config",
|
||||
description: "Configure the bot.",
|
||||
type: "slash",
|
||||
|
||||
data: new SlashCommandBuilder()
|
||||
.setName('config')
|
||||
.setDescription('Configure the bot.')
|
||||
.addSubcommand(subcommand =>
|
||||
subcommand
|
||||
.setName('sendguildapplication')
|
||||
.setDescription('Send the application message to a channel.')
|
||||
.addChannelOption(option =>
|
||||
option
|
||||
.setName('channel')
|
||||
.setDescription('The channel to send the application to.')
|
||||
.setRequired(true)))
|
||||
.addSubcommand(subcommand =>
|
||||
subcommand
|
||||
.setName('sendstaffapplication')
|
||||
.setDescription('Send the application message to a channel.')
|
||||
.addChannelOption(option =>
|
||||
option
|
||||
.setName('channel')
|
||||
.setDescription('The channel to send the application to.')
|
||||
.setRequired(true)))
|
||||
.addSubcommand(subcommand =>
|
||||
subcommand
|
||||
.setName('sendguildinfo')
|
||||
.setDescription('Send the guild info message to a channel.'))
|
||||
.addSubcommand(subcommand =>
|
||||
subcommand
|
||||
.setName('sendrequirements')
|
||||
.setDescription('Send the guild requirements message to a channel.'))
|
||||
.addSubcommand(subcommand =>
|
||||
subcommand
|
||||
.setName('sendrules-info')
|
||||
.setDescription('Send the rules and info message to a channel.'))
|
||||
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
|
||||
.setDMPermission(false),
|
||||
data: new SlashCommandBuilder()
|
||||
.setName("config")
|
||||
.setDescription("Configure the bot.")
|
||||
.addSubcommand((subcommand) =>
|
||||
subcommand
|
||||
.setName("sendguildapplication")
|
||||
.setDescription("Send the application message to a channel.")
|
||||
.addChannelOption((option) =>
|
||||
option
|
||||
.setName("channel")
|
||||
.setDescription("The channel to send the application to.")
|
||||
.setRequired(true)
|
||||
)
|
||||
)
|
||||
.addSubcommand((subcommand) =>
|
||||
subcommand
|
||||
.setName("sendstaffapplication")
|
||||
.setDescription("Send the application message to a channel.")
|
||||
.addChannelOption((option) =>
|
||||
option
|
||||
.setName("channel")
|
||||
.setDescription("The channel to send the application to.")
|
||||
.setRequired(true)
|
||||
)
|
||||
)
|
||||
.addSubcommand((subcommand) =>
|
||||
subcommand
|
||||
.setName("sendguildinfo")
|
||||
.setDescription("Send the guild info message to a channel.")
|
||||
)
|
||||
.addSubcommand((subcommand) =>
|
||||
subcommand
|
||||
.setName("sendrequirements")
|
||||
.setDescription("Send the guild requirements message to a channel.")
|
||||
)
|
||||
.addSubcommand((subcommand) =>
|
||||
subcommand
|
||||
.setName("sendrules-info")
|
||||
.setDescription("Send the rules and info message to a channel.")
|
||||
)
|
||||
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
|
||||
.setDMPermission(false),
|
||||
|
||||
async execute(interaction) {
|
||||
async execute(interaction) {
|
||||
const user = interaction.user;
|
||||
const guild = interaction.guild;
|
||||
const subcommand = interaction.options.getSubcommand();
|
||||
const embedColor = Number(color.replace("#", "0x"));
|
||||
|
||||
const user = interaction.user;
|
||||
const guild = interaction.guild;
|
||||
const subcommand = interaction.options.getSubcommand();
|
||||
const embedColor = Number(color.replace("#", "0x"));
|
||||
if (subcommand === "reload") {
|
||||
await interaction.reply({ content: "In development", ephemeral: true });
|
||||
return;
|
||||
}
|
||||
|
||||
if (subcommand === 'reload') {
|
||||
if (subcommand === "sendguildapplication") {
|
||||
const channel = interaction.options.getChannel("channel");
|
||||
|
||||
await interaction.reply({ content: 'In development', ephemeral: true })
|
||||
return
|
||||
await channel.send({
|
||||
embeds: [
|
||||
{
|
||||
title: "Guild Application",
|
||||
description:
|
||||
"You can apply for the guild by clicking the button below.",
|
||||
color: embedColor,
|
||||
footer: {
|
||||
text: interaction.guild.name + " | Developed by @Taken#0002",
|
||||
iconURL: interaction.guild.iconURL({ dynamic: true })
|
||||
},
|
||||
thumbnail: {
|
||||
url: interaction.guild.iconURL({ dynamic: true })
|
||||
}
|
||||
}
|
||||
],
|
||||
components: [
|
||||
new ActionRowBuilder().addComponents(
|
||||
new ButtonBuilder()
|
||||
.setCustomId("guildapply")
|
||||
.setLabel("Apply")
|
||||
.setStyle(ButtonStyle.Primary)
|
||||
.setEmoji({ name: "✅" })
|
||||
)
|
||||
]
|
||||
});
|
||||
await interaction.reply({ content: "Message sent", ephemeral: true });
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (subcommand === 'sendguildapplication') {
|
||||
if (subcommand === "sendstaffapplication") {
|
||||
const channel = interaction.options.getChannel("channel");
|
||||
|
||||
const channel = interaction.options.getChannel('channel');
|
||||
await channel.send({
|
||||
embeds: [
|
||||
{
|
||||
title: "Staff Application",
|
||||
description:
|
||||
"You can apply for the staff team by clicking the button below.",
|
||||
color: embedColor,
|
||||
footer: {
|
||||
text: interaction.guild.name + " | Developed by @Taken#0002",
|
||||
iconURL: interaction.guild.iconURL({ dynamic: true })
|
||||
},
|
||||
thumbnail: {
|
||||
url: interaction.guild.iconURL({ dynamic: true })
|
||||
}
|
||||
}
|
||||
],
|
||||
components: [
|
||||
new ActionRowBuilder().addComponents(
|
||||
new ButtonBuilder()
|
||||
.setCustomId("staffapply")
|
||||
.setLabel("Apply")
|
||||
.setStyle(ButtonStyle.Primary)
|
||||
.setEmoji({ name: "✅" })
|
||||
)
|
||||
]
|
||||
});
|
||||
|
||||
await channel.send({
|
||||
embeds: [{
|
||||
title: 'Guild Application',
|
||||
description: "You can apply for the guild by clicking the button below.",
|
||||
color: embedColor,
|
||||
footer: {
|
||||
text: interaction.guild.name + " | Developed by @Taken#0002",
|
||||
iconURL: interaction.guild.iconURL({ dynamic: true })
|
||||
},
|
||||
thumbnail: {
|
||||
url: interaction.guild.iconURL({ dynamic: true })
|
||||
}
|
||||
}],
|
||||
components: [
|
||||
new ActionRowBuilder().addComponents(
|
||||
new ButtonBuilder()
|
||||
.setCustomId('guildapply')
|
||||
.setLabel('Apply')
|
||||
.setStyle(ButtonStyle.Primary)
|
||||
.setEmoji({ name: '✅' })
|
||||
)
|
||||
]
|
||||
})
|
||||
await interaction.reply({ content: 'Message sent', ephemeral: true })
|
||||
}
|
||||
await interaction.reply({ content: "Message sent", ephemeral: true });
|
||||
}
|
||||
|
||||
if (subcommand === 'sendstaffapplication') {
|
||||
|
||||
const channel = interaction.options.getChannel('channel');
|
||||
|
||||
await channel.send({
|
||||
embeds: [{
|
||||
title: 'Staff Application',
|
||||
description: "You can apply for the staff team by clicking the button below.",
|
||||
color: embedColor,
|
||||
footer: {
|
||||
text: interaction.guild.name + " | Developed by @Taken#0002",
|
||||
iconURL: interaction.guild.iconURL({ dynamic: true })
|
||||
},
|
||||
thumbnail: {
|
||||
url: interaction.guild.iconURL({ dynamic: true })
|
||||
}
|
||||
}],
|
||||
components: [
|
||||
new ActionRowBuilder().addComponents(
|
||||
new ButtonBuilder()
|
||||
.setCustomId('staffapply')
|
||||
.setLabel('Apply')
|
||||
.setStyle(ButtonStyle.Primary)
|
||||
.setEmoji({ name: '✅' })
|
||||
)
|
||||
]
|
||||
})
|
||||
|
||||
await interaction.reply({ content: 'Message sent', ephemeral: true })
|
||||
}
|
||||
|
||||
if (subcommand !== "sendguildinfo" || "sendrequirements" || "sendrules-info") {
|
||||
await interaction.reply({ content: 'In development.', ephemeral: true });
|
||||
}
|
||||
}
|
||||
};
|
||||
if (
|
||||
subcommand !== "sendguildinfo" ||
|
||||
"sendrequirements" ||
|
||||
"sendrules-info"
|
||||
) {
|
||||
await interaction.reply({ content: "In development.", ephemeral: true });
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,105 +1,104 @@
|
||||
const { SlashCommandBuilder, PermissionFlagsBits, userMention, EmbedBuilder } = require('discord.js');
|
||||
const { hypixelGuildID, color } = require('../config/options.json');
|
||||
const verify = require('../schemas/verifySchema.js');
|
||||
const env = require('dotenv').config();
|
||||
const {
|
||||
SlashCommandBuilder,
|
||||
PermissionFlagsBits,
|
||||
userMention,
|
||||
EmbedBuilder
|
||||
} = require("discord.js");
|
||||
const { hypixelGuildID, color } = require("../config/options.json");
|
||||
const verify = require("../schemas/verifySchema.js");
|
||||
const env = require("dotenv").config();
|
||||
const dev = process.env.DEV;
|
||||
const fetch = require('axios');
|
||||
const fetch = require("axios");
|
||||
|
||||
module.exports = {
|
||||
name: 'admin',
|
||||
description: 'Admin command.',
|
||||
type: 'slash',
|
||||
name: "admin",
|
||||
description: "Admin command.",
|
||||
type: "slash",
|
||||
|
||||
data: new SlashCommandBuilder()
|
||||
.setName('devel')
|
||||
.setDescription('Admin command.')
|
||||
.addSubcommand(subcommand =>
|
||||
subcommand
|
||||
.setName('dbclearnonguildmembers')
|
||||
.setDescription('Clears the database of non-guild members.'))
|
||||
.addSubcommand(subcommand =>
|
||||
subcommand
|
||||
.setName('reload')
|
||||
.setDescription('Reload the bot.'))
|
||||
.addSubcommand(subcommand =>
|
||||
subcommand
|
||||
.setName('listallverified')
|
||||
.setDescription('List all verified users.'))
|
||||
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
|
||||
.setDMPermission(false),
|
||||
data: new SlashCommandBuilder()
|
||||
.setName("devel")
|
||||
.setDescription("Admin command.")
|
||||
.addSubcommand((subcommand) =>
|
||||
subcommand
|
||||
.setName("dbclearnonguildmembers")
|
||||
.setDescription("Clears the database of non-guild members.")
|
||||
)
|
||||
.addSubcommand((subcommand) =>
|
||||
subcommand.setName("reload").setDescription("Reload the bot.")
|
||||
)
|
||||
.addSubcommand((subcommand) =>
|
||||
subcommand
|
||||
.setName("listallverified")
|
||||
.setDescription("List all verified users.")
|
||||
)
|
||||
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
|
||||
.setDMPermission(false),
|
||||
|
||||
async execute(interaction) {
|
||||
async execute(interaction) {
|
||||
const subcommand = interaction.options.getSubcommand();
|
||||
const user = interaction.user;
|
||||
const userMentioned = userMention(user.id);
|
||||
const guild = interaction.guild;
|
||||
const embedColor = Number(color.replace("#", "0x"));
|
||||
|
||||
const subcommand = interaction.options.getSubcommand();
|
||||
const user = interaction.user;
|
||||
const userMentioned = userMention(user.id);
|
||||
const guild = interaction.guild;
|
||||
const embedColor = Number(color.replace("#", "0x"));
|
||||
if (subcommand === "dbclearnonguildmembers") {
|
||||
await interaction.deferReply({ ephemeral: true });
|
||||
|
||||
if (subcommand === 'dbclearnonguildmembers') {
|
||||
if (user.id !== dev) {
|
||||
interaction.editReply({
|
||||
content:
|
||||
"Due to you not screwing something up this command is restricted to only " +
|
||||
userMentioned,
|
||||
ephemeral: true
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
await interaction.deferReply({ ephemeral: true })
|
||||
const slothPixel = "https://api.slothpixel.me/api/guilds/";
|
||||
const verifiedUsers = await verify.find();
|
||||
|
||||
if (user.id !== dev) {
|
||||
interaction.editReply({ content: 'Due to you not screwing something up this command is restricted to only ' + userMentioned, ephemeral: true })
|
||||
return
|
||||
}
|
||||
|
||||
const slothPixel = "https://api.slothpixel.me/api/guilds/"
|
||||
const verifiedUsers = await verify.find()
|
||||
|
||||
verifiedUsers.forEach(async (user) => {
|
||||
|
||||
const userGuild = await fetch(slothPixel + user.uuid);
|
||||
|
||||
if (userGuild.data.id !== hypixelGuildID) {
|
||||
await verify.deleteOne({ uuid: user.uuid })
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
interaction.editReply({ content: 'Done!', ephemeral: true })
|
||||
|
||||
}
|
||||
|
||||
if (subcommand === 'reload') {
|
||||
|
||||
await interaction.reply({ content: 'In development', ephemeral: true })
|
||||
return
|
||||
|
||||
}
|
||||
|
||||
if (subcommand === 'listallverified') {
|
||||
|
||||
const verifiedUsers = await verify.find()
|
||||
const mojang = "https://api.mojang.com/user/profile/"
|
||||
|
||||
let embed = new EmbedBuilder()
|
||||
.setTitle(guild.name)
|
||||
.setColor(embedColor)
|
||||
.setDescription('List of all verified users')
|
||||
|
||||
for (let i = 0; i < verifiedUsers.length; i++) {
|
||||
|
||||
const user = verifiedUsers[i];
|
||||
|
||||
const userCheck = await fetch(mojang + user.uuid);
|
||||
const ign = userCheck.data.name;
|
||||
|
||||
const mentionedUser = userMention(user.userID);
|
||||
|
||||
embed.addFields({
|
||||
name: "**IGN:** " + ign,
|
||||
value: "**Discord:** " + mentionedUser
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
await interaction.reply({
|
||||
embeds: [embed]
|
||||
})
|
||||
verifiedUsers.forEach(async (user) => {
|
||||
const userGuild = await fetch(slothPixel + user.uuid);
|
||||
|
||||
if (userGuild.data.id !== hypixelGuildID) {
|
||||
await verify.deleteOne({ uuid: user.uuid });
|
||||
}
|
||||
});
|
||||
|
||||
interaction.editReply({ content: "Done!", ephemeral: true });
|
||||
}
|
||||
};
|
||||
|
||||
if (subcommand === "reload") {
|
||||
await interaction.reply({ content: "In development", ephemeral: true });
|
||||
return;
|
||||
}
|
||||
|
||||
if (subcommand === "listallverified") {
|
||||
const verifiedUsers = await verify.find();
|
||||
const mojang = "https://api.mojang.com/user/profile/";
|
||||
|
||||
let embed = new EmbedBuilder()
|
||||
.setTitle(guild.name)
|
||||
.setColor(embedColor)
|
||||
.setDescription("List of all verified users");
|
||||
|
||||
for (let i = 0; i < verifiedUsers.length; i++) {
|
||||
const user = verifiedUsers[i];
|
||||
|
||||
const userCheck = await fetch(mojang + user.uuid);
|
||||
const ign = userCheck.data.name;
|
||||
|
||||
const mentionedUser = userMention(user.userID);
|
||||
|
||||
embed.addFields({
|
||||
name: "**IGN:** " + ign,
|
||||
value: "**Discord:** " + mentionedUser
|
||||
});
|
||||
}
|
||||
|
||||
await interaction.reply({
|
||||
embeds: [embed]
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,266 +1,323 @@
|
||||
const { SlashCommandBuilder, PermissionFlagsBits, userMention } = require('discord.js');
|
||||
const { hypixelGuildID, color } = require('../config/options.json');
|
||||
const { gm, manager, moderator, beast, member, trialmember, guildRole, guildStaff, defaultMember } = require('../config/roles.json');
|
||||
const verify = require('../schemas/verifySchema.js')
|
||||
const fetch = require('axios');
|
||||
const removeThese = [gm, manager, moderator, beast, member, trialmember, guildRole, guildStaff]
|
||||
const {
|
||||
SlashCommandBuilder,
|
||||
PermissionFlagsBits,
|
||||
userMention
|
||||
} = require("discord.js");
|
||||
const { hypixelGuildID, color } = require("../config/options.json");
|
||||
const {
|
||||
gm,
|
||||
manager,
|
||||
moderator,
|
||||
beast,
|
||||
member,
|
||||
trialmember,
|
||||
guildRole,
|
||||
guildStaff,
|
||||
defaultMember
|
||||
} = require("../config/roles.json");
|
||||
const verify = require("../schemas/verifySchema.js");
|
||||
const fetch = require("axios");
|
||||
const removeThese = [
|
||||
gm,
|
||||
manager,
|
||||
moderator,
|
||||
beast,
|
||||
member,
|
||||
trialmember,
|
||||
guildRole,
|
||||
guildStaff
|
||||
];
|
||||
|
||||
module.exports = {
|
||||
name: 'forceupdate',
|
||||
description: 'Force update the user',
|
||||
type: 'slash',
|
||||
name: "forceupdate",
|
||||
description: "Force update the user",
|
||||
type: "slash",
|
||||
|
||||
data: new SlashCommandBuilder()
|
||||
.setName('forceupdate')
|
||||
.setDescription('Force update the user')
|
||||
.addUserOption(option =>
|
||||
option
|
||||
.setName('user')
|
||||
.setDescription('The user to force update')
|
||||
.setRequired(true))
|
||||
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
|
||||
.setDMPermission(false),
|
||||
data: new SlashCommandBuilder()
|
||||
.setName("forceupdate")
|
||||
.setDescription("Force update the user")
|
||||
.addUserOption((option) =>
|
||||
option
|
||||
.setName("user")
|
||||
.setDescription("The user to force update")
|
||||
.setRequired(true)
|
||||
)
|
||||
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
|
||||
.setDMPermission(false),
|
||||
|
||||
async execute(interaction) {
|
||||
async execute(interaction) {
|
||||
await interaction.deferReply();
|
||||
|
||||
await interaction.deferReply();
|
||||
const user = interaction.options.getUser("user");
|
||||
const usermentioned = userMention(user.id);
|
||||
const guild = interaction.guild;
|
||||
const verifyData = await verify.findOne({ userID: user.id });
|
||||
|
||||
const user = interaction.options.getUser('user');
|
||||
const usermentioned = userMention(user.id);
|
||||
const guild = interaction.guild;
|
||||
const verifyData = await verify.findOne({ userID: user.id })
|
||||
const user1 = guild.members.cache.get(user.id);
|
||||
const roleManage = user1.roles;
|
||||
|
||||
const user1 = guild.members.cache.get(user.id);
|
||||
const roleManage = user1.roles;
|
||||
if (!verifyData) {
|
||||
for (let i = 0; i < removeThese.length; i++) {
|
||||
await roleManage.remove(
|
||||
removeThese[i],
|
||||
"Auto role removal. (Force Update)"
|
||||
);
|
||||
}
|
||||
|
||||
if (!verifyData) {
|
||||
|
||||
for (let i = 0; i < removeThese.length; i++) {
|
||||
await roleManage.remove(removeThese[i], "Auto role removal. (Force Update)")
|
||||
await interaction.editReply({
|
||||
embeds: [
|
||||
{
|
||||
description:
|
||||
usermentioned + " was given the the Default Member role.",
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: head
|
||||
},
|
||||
footer: {
|
||||
text: interaction.guild.name + " | Developed by @Taken#0002",
|
||||
icon_url: interaction.guild.iconURL({ dynamic: true })
|
||||
}
|
||||
|
||||
await interaction.editReply({
|
||||
embeds: [{
|
||||
description: usermentioned + " was given the the Default Member role.",
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: head
|
||||
},
|
||||
footer: {
|
||||
text: interaction.guild.name + " | Developed by @Taken#0002",
|
||||
icon_url: interaction.guild.iconURL({ dynamic: true })
|
||||
}
|
||||
}]
|
||||
})
|
||||
await roleManage.add(defaultMember, "User was force updated.")
|
||||
return
|
||||
}
|
||||
|
||||
const slothPixel = "https://api.slothpixel.me/api/players/";
|
||||
const guildAPI = "https://api.slothpixel.me/api/guilds/"
|
||||
const mojangAPI = "https://api.mojang.com/user/profile/"
|
||||
const minotar = "https://minotar.net/helm/";
|
||||
|
||||
const userCheck = await fetch(mojangAPI + verifyData.uuid);
|
||||
const hypixelCheck = await fetch(slothPixel + verifyData.uuid);
|
||||
const head = minotar + userCheck.data.name;
|
||||
|
||||
try {
|
||||
const guildCheck = await fetch(guildAPI + verifyData.uuid);
|
||||
var responseGuildID = guildCheck.data.id;
|
||||
} catch (err) {
|
||||
var responseGuildID = null;
|
||||
}
|
||||
|
||||
if (responseGuildID !== hypixelGuildID) {
|
||||
|
||||
for (let i = 0; i < removeThese.length; i++) {
|
||||
await roleManage.remove(removeThese[i], "Auto role removal. (Force Update)")
|
||||
}
|
||||
|
||||
await interaction.editReply({
|
||||
embeds: [{
|
||||
description: usermentioned + " was given the the Default Member role.",
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: head
|
||||
},
|
||||
footer: {
|
||||
text: interaction.guild.name + " | Developed by @Taken#0002",
|
||||
icon_url: interaction.guild.iconURL({ dynamic: true })
|
||||
}
|
||||
}]
|
||||
})
|
||||
await roleManage.add(defaultMember)
|
||||
return
|
||||
}
|
||||
|
||||
const guildCheck = await fetch(guildAPI + verifyData.uuid);
|
||||
const embedColor = Number(color.replace("#", "0x"));
|
||||
const GuildMembers = await guildCheck.data.members;
|
||||
const guildRank = GuildMembers.find(member => member.uuid === verifyData.uuid).rank;
|
||||
|
||||
if (guildRank === 'Guild Master' && responseGuildID === hypixelGuildID) {
|
||||
|
||||
for (let i = 0; i < removeThese.length; i++) {
|
||||
await roleManage.remove(removeThese[i], "Auto role removal. (Force Update)")
|
||||
}
|
||||
|
||||
await roleManage.add(guildRole, "User was force updated.")
|
||||
await roleManage.add(guildStaff, "User was force updated.")
|
||||
await roleManage.add(gm, "User was force updated.")
|
||||
await roleManage.add(defaultMember, "User was force updated.")
|
||||
|
||||
|
||||
await interaction.editReply({
|
||||
embeds: [{
|
||||
description: usermentioned + "'s rank has been updated to `Guild Master`",
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: head
|
||||
},
|
||||
footer: {
|
||||
text: interaction.guild.name + " | Developed by @Taken#0002",
|
||||
icon_url: interaction.guild.iconURL({ dynamic: true })
|
||||
}
|
||||
}]
|
||||
})
|
||||
}
|
||||
|
||||
if (guildRank === 'Manager' && responseGuildID === hypixelGuildID) {
|
||||
|
||||
for (let i = 0; i < removeThese.length; i++) {
|
||||
await roleManage.remove(removeThese[i], "Auto role removal. (Force Update)")
|
||||
}
|
||||
|
||||
await roleManage.add(guildRole, "User was force updated.")
|
||||
await roleManage.add(guildStaff, "User was force updated.")
|
||||
await roleManage.add(manager, "User was force updated.")
|
||||
await roleManage.add(defaultMember, "User was force updated.")
|
||||
|
||||
|
||||
await interaction.editReply({
|
||||
embeds: [{
|
||||
description: usermentioned + "'s rank has been updated to `Manager`",
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: head
|
||||
},
|
||||
footer: {
|
||||
text: interaction.guild.name + " | Developed by @Taken#0002",
|
||||
icon_url: interaction.guild.iconURL({ dynamic: true })
|
||||
}
|
||||
}]
|
||||
})
|
||||
}
|
||||
|
||||
if (guildRank === 'Moderator' && responseGuildID === hypixelGuildID) {
|
||||
|
||||
for (let i = 0; i < removeThese.length; i++) {
|
||||
await roleManage.remove(removeThese[i], "Auto role removal. (Force Update)")
|
||||
}
|
||||
|
||||
await roleManage.add(guildRole, "User was force updated.")
|
||||
await roleManage.add(guildStaff, "User was force updated.")
|
||||
await roleManage.add(moderator, "User was force updated.")
|
||||
await roleManage.add(defaultMember, "User was force updated.")
|
||||
|
||||
|
||||
await interaction.editReply({
|
||||
embeds: [{
|
||||
description: usermentioned + "'s rank has been updated to `Moderator`",
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: head
|
||||
},
|
||||
footer: {
|
||||
text: interaction.guild.name + " | Developed by @Taken#0002",
|
||||
icon_url: interaction.guild.iconURL({ dynamic: true })
|
||||
}
|
||||
}]
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
if (guildRank === 'Beast' && responseGuildID === hypixelGuildID) {
|
||||
|
||||
for (let i = 0; i < removeThese.length; i++) {
|
||||
await roleManage.remove(removeThese[i], "Auto role removal. (Force Update)")
|
||||
}
|
||||
|
||||
await roleManage.add(guildRole, "User was force updated.")
|
||||
await roleManage.add(beast, "User was force updated.")
|
||||
await roleManage.add(defaultMember, "User was force updated.")
|
||||
|
||||
|
||||
await interaction.editReply({
|
||||
embeds: [{
|
||||
description: usermentioned + "'s rank has been updated to `Beast`.",
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: head
|
||||
},
|
||||
footer: {
|
||||
text: interaction.guild.name + " | Developed by @Taken#0002",
|
||||
icon_url: interaction.guild.iconURL({ dynamic: true })
|
||||
}
|
||||
}]
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
if (guildRank === 'Member' && responseGuildID === hypixelGuildID) {
|
||||
|
||||
for (let i = 0; i < removeThese.length; i++) {
|
||||
await roleManage.remove(removeThese[i], "Auto role removal. (Force Update)")
|
||||
}
|
||||
|
||||
await roleManage.add(guildRole, "User was force updated.")
|
||||
await roleManage.add(member, "User was force updated.")
|
||||
await roleManage.add(defaultMember, "User was force updated.")
|
||||
|
||||
|
||||
await interaction.editReply({
|
||||
embeds: [{
|
||||
description: usermentioned + "'s rank has been updated to `Member`.",
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: head
|
||||
},
|
||||
footer: {
|
||||
text: interaction.guild.name + " | Developed by @Taken#0002",
|
||||
icon_url: interaction.guild.iconURL({ dynamic: true })
|
||||
}
|
||||
}]
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
if (guildRank === 'Trial Member' && responseGuildID === hypixelGuildID) {
|
||||
|
||||
for (let i = 0; i < removeThese.length; i++) {
|
||||
await roleManage.remove(removeThese[i], "Auto role removal. (Force Update)")
|
||||
}
|
||||
|
||||
await roleManage.add(guildRole, "User was force updated.")
|
||||
await roleManage.add(trialmember, "User was force updated.")
|
||||
await roleManage.add(defaultMember, "User was force updated.")
|
||||
|
||||
|
||||
await interaction.editReply({
|
||||
embeds: [{
|
||||
description: usermentioned + "'s rank has been updated to `Trial Member`.",
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: head
|
||||
},
|
||||
footer: {
|
||||
text: interaction.guild.name + " | Developed by @Taken#0002",
|
||||
icon_url: interaction.guild.iconURL({ dynamic: true })
|
||||
}
|
||||
}]
|
||||
})
|
||||
return
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
await roleManage.add(defaultMember, "User was force updated.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
const slothPixel = "https://api.slothpixel.me/api/players/";
|
||||
const guildAPI = "https://api.slothpixel.me/api/guilds/";
|
||||
const mojangAPI = "https://api.mojang.com/user/profile/";
|
||||
const minotar = "https://minotar.net/helm/";
|
||||
|
||||
const userCheck = await fetch(mojangAPI + verifyData.uuid);
|
||||
const hypixelCheck = await fetch(slothPixel + verifyData.uuid);
|
||||
const head = minotar + userCheck.data.name;
|
||||
|
||||
try {
|
||||
const guildCheck = await fetch(guildAPI + verifyData.uuid);
|
||||
var responseGuildID = guildCheck.data.id;
|
||||
} catch (err) {
|
||||
var responseGuildID = null;
|
||||
}
|
||||
|
||||
if (responseGuildID !== hypixelGuildID) {
|
||||
for (let i = 0; i < removeThese.length; i++) {
|
||||
await roleManage.remove(
|
||||
removeThese[i],
|
||||
"Auto role removal. (Force Update)"
|
||||
);
|
||||
}
|
||||
|
||||
await interaction.editReply({
|
||||
embeds: [
|
||||
{
|
||||
description:
|
||||
usermentioned + " was given the the Default Member role.",
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: head
|
||||
},
|
||||
footer: {
|
||||
text: interaction.guild.name + " | Developed by @Taken#0002",
|
||||
icon_url: interaction.guild.iconURL({ dynamic: true })
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
await roleManage.add(defaultMember);
|
||||
return;
|
||||
}
|
||||
|
||||
const guildCheck = await fetch(guildAPI + verifyData.uuid);
|
||||
const embedColor = Number(color.replace("#", "0x"));
|
||||
const GuildMembers = await guildCheck.data.members;
|
||||
const guildRank = GuildMembers.find(
|
||||
(member) => member.uuid === verifyData.uuid
|
||||
).rank;
|
||||
|
||||
if (guildRank === "Guild Master" && responseGuildID === hypixelGuildID) {
|
||||
for (let i = 0; i < removeThese.length; i++) {
|
||||
await roleManage.remove(
|
||||
removeThese[i],
|
||||
"Auto role removal. (Force Update)"
|
||||
);
|
||||
}
|
||||
|
||||
await roleManage.add(guildRole, "User was force updated.");
|
||||
await roleManage.add(guildStaff, "User was force updated.");
|
||||
await roleManage.add(gm, "User was force updated.");
|
||||
await roleManage.add(defaultMember, "User was force updated.");
|
||||
|
||||
await interaction.editReply({
|
||||
embeds: [
|
||||
{
|
||||
description:
|
||||
usermentioned + "'s rank has been updated to `Guild Master`",
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: head
|
||||
},
|
||||
footer: {
|
||||
text: interaction.guild.name + " | Developed by @Taken#0002",
|
||||
icon_url: interaction.guild.iconURL({ dynamic: true })
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
if (guildRank === "Manager" && responseGuildID === hypixelGuildID) {
|
||||
for (let i = 0; i < removeThese.length; i++) {
|
||||
await roleManage.remove(
|
||||
removeThese[i],
|
||||
"Auto role removal. (Force Update)"
|
||||
);
|
||||
}
|
||||
|
||||
await roleManage.add(guildRole, "User was force updated.");
|
||||
await roleManage.add(guildStaff, "User was force updated.");
|
||||
await roleManage.add(manager, "User was force updated.");
|
||||
await roleManage.add(defaultMember, "User was force updated.");
|
||||
|
||||
await interaction.editReply({
|
||||
embeds: [
|
||||
{
|
||||
description:
|
||||
usermentioned + "'s rank has been updated to `Manager`",
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: head
|
||||
},
|
||||
footer: {
|
||||
text: interaction.guild.name + " | Developed by @Taken#0002",
|
||||
icon_url: interaction.guild.iconURL({ dynamic: true })
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
if (guildRank === "Moderator" && responseGuildID === hypixelGuildID) {
|
||||
for (let i = 0; i < removeThese.length; i++) {
|
||||
await roleManage.remove(
|
||||
removeThese[i],
|
||||
"Auto role removal. (Force Update)"
|
||||
);
|
||||
}
|
||||
|
||||
await roleManage.add(guildRole, "User was force updated.");
|
||||
await roleManage.add(guildStaff, "User was force updated.");
|
||||
await roleManage.add(moderator, "User was force updated.");
|
||||
await roleManage.add(defaultMember, "User was force updated.");
|
||||
|
||||
await interaction.editReply({
|
||||
embeds: [
|
||||
{
|
||||
description:
|
||||
usermentioned + "'s rank has been updated to `Moderator`",
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: head
|
||||
},
|
||||
footer: {
|
||||
text: interaction.guild.name + " | Developed by @Taken#0002",
|
||||
icon_url: interaction.guild.iconURL({ dynamic: true })
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
if (guildRank === "Beast" && responseGuildID === hypixelGuildID) {
|
||||
for (let i = 0; i < removeThese.length; i++) {
|
||||
await roleManage.remove(
|
||||
removeThese[i],
|
||||
"Auto role removal. (Force Update)"
|
||||
);
|
||||
}
|
||||
|
||||
await roleManage.add(guildRole, "User was force updated.");
|
||||
await roleManage.add(beast, "User was force updated.");
|
||||
await roleManage.add(defaultMember, "User was force updated.");
|
||||
|
||||
await interaction.editReply({
|
||||
embeds: [
|
||||
{
|
||||
description: usermentioned + "'s rank has been updated to `Beast`.",
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: head
|
||||
},
|
||||
footer: {
|
||||
text: interaction.guild.name + " | Developed by @Taken#0002",
|
||||
icon_url: interaction.guild.iconURL({ dynamic: true })
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
if (guildRank === "Member" && responseGuildID === hypixelGuildID) {
|
||||
for (let i = 0; i < removeThese.length; i++) {
|
||||
await roleManage.remove(
|
||||
removeThese[i],
|
||||
"Auto role removal. (Force Update)"
|
||||
);
|
||||
}
|
||||
|
||||
await roleManage.add(guildRole, "User was force updated.");
|
||||
await roleManage.add(member, "User was force updated.");
|
||||
await roleManage.add(defaultMember, "User was force updated.");
|
||||
|
||||
await interaction.editReply({
|
||||
embeds: [
|
||||
{
|
||||
description:
|
||||
usermentioned + "'s rank has been updated to `Member`.",
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: head
|
||||
},
|
||||
footer: {
|
||||
text: interaction.guild.name + " | Developed by @Taken#0002",
|
||||
icon_url: interaction.guild.iconURL({ dynamic: true })
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
if (guildRank === "Trial Member" && responseGuildID === hypixelGuildID) {
|
||||
for (let i = 0; i < removeThese.length; i++) {
|
||||
await roleManage.remove(
|
||||
removeThese[i],
|
||||
"Auto role removal. (Force Update)"
|
||||
);
|
||||
}
|
||||
|
||||
await roleManage.add(guildRole, "User was force updated.");
|
||||
await roleManage.add(trialmember, "User was force updated.");
|
||||
await roleManage.add(defaultMember, "User was force updated.");
|
||||
|
||||
await interaction.editReply({
|
||||
embeds: [
|
||||
{
|
||||
description:
|
||||
usermentioned + "'s rank has been updated to `Trial Member`.",
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: head
|
||||
},
|
||||
footer: {
|
||||
text: interaction.guild.name + " | Developed by @Taken#0002",
|
||||
icon_url: interaction.guild.iconURL({ dynamic: true })
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
return;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,174 +1,195 @@
|
||||
const { SlashCommandBuilder, PermissionFlagsBits } = require('discord.js');
|
||||
const env = require('dotenv').config();
|
||||
const { SlashCommandBuilder, PermissionFlagsBits } = require("discord.js");
|
||||
const env = require("dotenv").config();
|
||||
const hypixelApiKey = process.env.HYPIXELAPIKEY;
|
||||
const fetch = require('axios');
|
||||
const { color, hypixelGuildID } = require('../config/options.json');
|
||||
const verify = require('../schemas/verifySchema.js')
|
||||
const {mongoose} = require('mongoose');
|
||||
const { gm, manager, moderator, beast, member, trialmember, guildRole, guildStaff, defaultMember } = require('../config/roles.json');
|
||||
|
||||
const fetch = require("axios");
|
||||
const { color, hypixelGuildID } = require("../config/options.json");
|
||||
const verify = require("../schemas/verifySchema.js");
|
||||
const { mongoose } = require("mongoose");
|
||||
const {
|
||||
gm,
|
||||
manager,
|
||||
moderator,
|
||||
beast,
|
||||
member,
|
||||
trialmember,
|
||||
guildRole,
|
||||
guildStaff,
|
||||
defaultMember
|
||||
} = require("../config/roles.json");
|
||||
|
||||
module.exports = {
|
||||
name: 'forceverify',
|
||||
description: 'Force verify a user.',
|
||||
type: 'slash',
|
||||
name: "forceverify",
|
||||
description: "Force verify a user.",
|
||||
type: "slash",
|
||||
|
||||
data: new SlashCommandBuilder()
|
||||
.setName('forceverify')
|
||||
.setDescription('Force verify a user.')
|
||||
.addUserOption(option =>
|
||||
option
|
||||
.setName('user')
|
||||
.setDescription('The user to force verify.'))
|
||||
.addStringOption(option =>
|
||||
option
|
||||
.setName('ign')
|
||||
.setDescription('The user\'s in-game name.'))
|
||||
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
|
||||
.setDMPermission(false),
|
||||
|
||||
async execute(interaction) {
|
||||
data: new SlashCommandBuilder()
|
||||
.setName("forceverify")
|
||||
.setDescription("Force verify a user.")
|
||||
.addUserOption((option) =>
|
||||
option.setName("user").setDescription("The user to force verify.")
|
||||
)
|
||||
.addStringOption((option) =>
|
||||
option.setName("ign").setDescription("The user's in-game name.")
|
||||
)
|
||||
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
|
||||
.setDMPermission(false),
|
||||
|
||||
await interaction.deferReply();
|
||||
async execute(interaction) {
|
||||
await interaction.deferReply();
|
||||
|
||||
const user1 = interaction.options.getUser('user');
|
||||
const user = interaction.guild.members.cache.get(user1.id);
|
||||
const fullUsername = user1.username + "#" + user1.discriminator
|
||||
const ign = interaction.options.getString('ign');
|
||||
const mod = interaction.user.username + "#" + interaction.user.discriminator
|
||||
const user1 = interaction.options.getUser("user");
|
||||
const user = interaction.guild.members.cache.get(user1.id);
|
||||
const fullUsername = user1.username + "#" + user1.discriminator;
|
||||
const ign = interaction.options.getString("ign");
|
||||
const mod =
|
||||
interaction.user.username + "#" + interaction.user.discriminator;
|
||||
|
||||
const mojang = "https://api.mojang.com/users/profiles/minecraft/"
|
||||
const slothPixel = "https://api.slothpixel.me/api/players/";
|
||||
const guildAPI = "https://api.slothpixel.me/api/guilds/"
|
||||
const minotar = "https://minotar.net/helm/";
|
||||
const embedColor = Number(color.replace("#", "0x"));
|
||||
|
||||
if (!user) {
|
||||
interaction.editReply('Please provide a user to force verify.')
|
||||
return
|
||||
}
|
||||
|
||||
if (!ign) {
|
||||
interaction.editReply('Please provide a player\'s IGN.')
|
||||
return
|
||||
}
|
||||
|
||||
const verifyData = await verify.findOne({ userID: user.id })
|
||||
|
||||
if (verifyData) {
|
||||
interaction.editReply('That user is already verified.')
|
||||
return
|
||||
}
|
||||
|
||||
try {
|
||||
await fetch(mojang + ign);
|
||||
} catch (err) {
|
||||
interaction.editReply('That player doesn\'t exist. [Mojang]')
|
||||
return
|
||||
}
|
||||
|
||||
try {
|
||||
await fetch(slothPixel + ign);
|
||||
} catch (err) {
|
||||
interaction.editReply('That player doesn\'t exist. [Hypixel]')
|
||||
return
|
||||
}
|
||||
|
||||
const userCheck = await fetch(mojang + ign);
|
||||
const userUUID = userCheck.data.id;
|
||||
|
||||
const hypixelCheck = await fetch(slothPixel + userUUID);
|
||||
const head = minotar + ign;
|
||||
|
||||
try {
|
||||
const guildCheck = await fetch(guildAPI + userUUID);
|
||||
var responseGuildID = guildCheck.data.id;
|
||||
} catch (err) {
|
||||
var responseGuildID = null;
|
||||
}
|
||||
|
||||
if (responseGuildID !== hypixelGuildID) {
|
||||
|
||||
await user.roles.add(defaultMember, "User was force verified by " + mod);
|
||||
|
||||
await interaction.editReply({
|
||||
embeds: [{
|
||||
title: interaction.guild.name,
|
||||
description: "You have successfully force verified `" + fullUsername + "` with the account `" + hypixelCheck.data.username + "`.",
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: head
|
||||
},
|
||||
footer: {
|
||||
icon_url: interaction.guild.iconURL(),
|
||||
text: interaction.guild.name + " | Developed by Taken#0002"
|
||||
}
|
||||
}]
|
||||
});
|
||||
return
|
||||
}
|
||||
|
||||
const guildCheck = await fetch(guildAPI + userUUID);
|
||||
const GuildMembers = await guildCheck.data.members;
|
||||
const guildRank = GuildMembers.find(member => member.uuid === hypixelCheck.data.uuid).rank;
|
||||
|
||||
if (guildRank === "Guild Master" && guildCheck.data.id === hypixelGuildID) {
|
||||
await user.roles.add(gm, "User was force verified by " + mod);
|
||||
await user.roles.add(guildRole, "User was force verified by " + mod)
|
||||
await user.roles.add(guildStaff, "User was force verified by " + mod)
|
||||
}
|
||||
|
||||
if (guildRank === "Manager" && guildCheck.data.id === hypixelGuildID) {
|
||||
await user.roles.add(manager, "User was force verified by " + mod);
|
||||
await user.roles.add(guildRole, "User was force verified by " + mod)
|
||||
await user.roles.add(guildStaff, "User was force verified by " + mod)
|
||||
}
|
||||
|
||||
if (guildRank === "Moderator" && guildCheck.data.id === hypixelGuildID) {
|
||||
await user.roles.add(moderator, "User was force verified by " + mod);
|
||||
await user.roles.add(guildRole, "User was force verified by " + mod)
|
||||
await user.roles.add(guildStaff, "User was force verified by " + mod)
|
||||
}
|
||||
|
||||
if (guildRank === "Beast" && guildCheck.data.id === hypixelGuildID) {
|
||||
await user.roles.add(beast, "User was force verified by " + mod);
|
||||
await user.roles.add(guildRole, "User was force verified by " + mod)
|
||||
}
|
||||
|
||||
if (guildRank === "Member" && guildCheck.data.id === hypixelGuildID) {
|
||||
await user.roles.add(member, "User was force verified by " + mod);
|
||||
await user.roles.add(guildRole, "User was force verified by " + mod)
|
||||
}
|
||||
|
||||
if (guildRank === "Trial Member" && guildCheck.data.id === hypixelGuildID) {
|
||||
await user.roles.add(trialmember, "User was force verified by " + mod);
|
||||
await user.roles.add(guildRole, "User was force verified by " + mod)
|
||||
}
|
||||
|
||||
await user.roles.add(defaultMember, "User was force verified by " + mod);
|
||||
|
||||
const newVerify = new verify({
|
||||
_id: new mongoose.Types.ObjectId(),
|
||||
userID: user.id,
|
||||
uuid: userUUID
|
||||
})
|
||||
|
||||
await newVerify.save();
|
||||
|
||||
await interaction.editReply({
|
||||
embeds: [{
|
||||
title: interaction.guild.name,
|
||||
description: "You have successfully force verified `" + fullUsername + "` with the account `" + hypixelCheck.data.username + "`.",
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: head
|
||||
},
|
||||
footer: {
|
||||
icon_url: interaction.guild.iconURL(),
|
||||
text: interaction.guild.name + " | Developed by Taken#0002"
|
||||
}
|
||||
}]
|
||||
});
|
||||
const mojang = "https://api.mojang.com/users/profiles/minecraft/";
|
||||
const slothPixel = "https://api.slothpixel.me/api/players/";
|
||||
const guildAPI = "https://api.slothpixel.me/api/guilds/";
|
||||
const minotar = "https://minotar.net/helm/";
|
||||
const embedColor = Number(color.replace("#", "0x"));
|
||||
|
||||
if (!user) {
|
||||
interaction.editReply("Please provide a user to force verify.");
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
||||
if (!ign) {
|
||||
interaction.editReply("Please provide a player's IGN.");
|
||||
return;
|
||||
}
|
||||
|
||||
const verifyData = await verify.findOne({ userID: user.id });
|
||||
|
||||
if (verifyData) {
|
||||
interaction.editReply("That user is already verified.");
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
await fetch(mojang + ign);
|
||||
} catch (err) {
|
||||
interaction.editReply("That player doesn't exist. [Mojang]");
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
await fetch(slothPixel + ign);
|
||||
} catch (err) {
|
||||
interaction.editReply("That player doesn't exist. [Hypixel]");
|
||||
return;
|
||||
}
|
||||
|
||||
const userCheck = await fetch(mojang + ign);
|
||||
const userUUID = userCheck.data.id;
|
||||
|
||||
const hypixelCheck = await fetch(slothPixel + userUUID);
|
||||
const head = minotar + ign;
|
||||
|
||||
try {
|
||||
const guildCheck = await fetch(guildAPI + userUUID);
|
||||
var responseGuildID = guildCheck.data.id;
|
||||
} catch (err) {
|
||||
var responseGuildID = null;
|
||||
}
|
||||
|
||||
if (responseGuildID !== hypixelGuildID) {
|
||||
await user.roles.add(defaultMember, "User was force verified by " + mod);
|
||||
|
||||
await interaction.editReply({
|
||||
embeds: [
|
||||
{
|
||||
title: interaction.guild.name,
|
||||
description:
|
||||
"You have successfully force verified `" +
|
||||
fullUsername +
|
||||
"` with the account `" +
|
||||
hypixelCheck.data.username +
|
||||
"`.",
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: head
|
||||
},
|
||||
footer: {
|
||||
icon_url: interaction.guild.iconURL(),
|
||||
text: interaction.guild.name + " | Developed by Taken#0002"
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
const guildCheck = await fetch(guildAPI + userUUID);
|
||||
const GuildMembers = await guildCheck.data.members;
|
||||
const guildRank = GuildMembers.find(
|
||||
(member) => member.uuid === hypixelCheck.data.uuid
|
||||
).rank;
|
||||
|
||||
if (guildRank === "Guild Master" && guildCheck.data.id === hypixelGuildID) {
|
||||
await user.roles.add(gm, "User was force verified by " + mod);
|
||||
await user.roles.add(guildRole, "User was force verified by " + mod);
|
||||
await user.roles.add(guildStaff, "User was force verified by " + mod);
|
||||
}
|
||||
|
||||
if (guildRank === "Manager" && guildCheck.data.id === hypixelGuildID) {
|
||||
await user.roles.add(manager, "User was force verified by " + mod);
|
||||
await user.roles.add(guildRole, "User was force verified by " + mod);
|
||||
await user.roles.add(guildStaff, "User was force verified by " + mod);
|
||||
}
|
||||
|
||||
if (guildRank === "Moderator" && guildCheck.data.id === hypixelGuildID) {
|
||||
await user.roles.add(moderator, "User was force verified by " + mod);
|
||||
await user.roles.add(guildRole, "User was force verified by " + mod);
|
||||
await user.roles.add(guildStaff, "User was force verified by " + mod);
|
||||
}
|
||||
|
||||
if (guildRank === "Beast" && guildCheck.data.id === hypixelGuildID) {
|
||||
await user.roles.add(beast, "User was force verified by " + mod);
|
||||
await user.roles.add(guildRole, "User was force verified by " + mod);
|
||||
}
|
||||
|
||||
if (guildRank === "Member" && guildCheck.data.id === hypixelGuildID) {
|
||||
await user.roles.add(member, "User was force verified by " + mod);
|
||||
await user.roles.add(guildRole, "User was force verified by " + mod);
|
||||
}
|
||||
|
||||
if (guildRank === "Trial Member" && guildCheck.data.id === hypixelGuildID) {
|
||||
await user.roles.add(trialmember, "User was force verified by " + mod);
|
||||
await user.roles.add(guildRole, "User was force verified by " + mod);
|
||||
}
|
||||
|
||||
await user.roles.add(defaultMember, "User was force verified by " + mod);
|
||||
|
||||
const newVerify = new verify({
|
||||
_id: new mongoose.Types.ObjectId(),
|
||||
userID: user.id,
|
||||
uuid: userUUID
|
||||
});
|
||||
|
||||
await newVerify.save();
|
||||
|
||||
await interaction.editReply({
|
||||
embeds: [
|
||||
{
|
||||
title: interaction.guild.name,
|
||||
description:
|
||||
"You have successfully force verified `" +
|
||||
fullUsername +
|
||||
"` with the account `" +
|
||||
hypixelCheck.data.username +
|
||||
"`.",
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: head
|
||||
},
|
||||
footer: {
|
||||
icon_url: interaction.guild.iconURL(),
|
||||
text: interaction.guild.name + " | Developed by Taken#0002"
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,54 +1,54 @@
|
||||
const { SlashCommandBuilder, ChannelType } = require('discord.js');
|
||||
const { color } = require('../config/options.json');
|
||||
const { SlashCommandBuilder, ChannelType } = require("discord.js");
|
||||
const { color } = require("../config/options.json");
|
||||
|
||||
module.exports = {
|
||||
name: 'help',
|
||||
description: 'Help command',
|
||||
type: 'slash',
|
||||
|
||||
data: new SlashCommandBuilder()
|
||||
.setName('help')
|
||||
.setDescription('Help command')
|
||||
.setDMPermission(true),
|
||||
name: "help",
|
||||
description: "Help command",
|
||||
type: "slash",
|
||||
|
||||
async execute(interaction) {
|
||||
data: new SlashCommandBuilder()
|
||||
.setName("help")
|
||||
.setDescription("Help command")
|
||||
.setDMPermission(true),
|
||||
|
||||
await interaction.deferReply({ ephemeral: true });
|
||||
async execute(interaction) {
|
||||
await interaction.deferReply({ ephemeral: true });
|
||||
|
||||
const embedColor = Number(color.replace('#', '0x'));
|
||||
const embedColor = Number(color.replace("#", "0x"));
|
||||
|
||||
await interaction.editReply({
|
||||
embeds: [{
|
||||
title: 'Commands',
|
||||
description: "List of commands",
|
||||
fields: [
|
||||
{
|
||||
name: '/check',
|
||||
value: 'Check the stats of a player'
|
||||
},
|
||||
{
|
||||
name: '/reqs',
|
||||
value: 'Check the requirements of the guild'
|
||||
},
|
||||
{
|
||||
name: '/update',
|
||||
value: 'Update\'s your roles'
|
||||
},
|
||||
{
|
||||
name: '/help',
|
||||
value: 'Shows this message'
|
||||
}
|
||||
],
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: interaction.guild.iconURL({ dynamic: true })
|
||||
},
|
||||
footer: {
|
||||
icon_url: interaction.guild.iconURL({ dynamic: true }),
|
||||
text: interaction.guild.name + ' | Developed by: @Taken#0001'
|
||||
}
|
||||
}]
|
||||
});
|
||||
|
||||
}
|
||||
};
|
||||
await interaction.editReply({
|
||||
embeds: [
|
||||
{
|
||||
title: "Commands",
|
||||
description: "List of commands",
|
||||
fields: [
|
||||
{
|
||||
name: "/check",
|
||||
value: "Check the stats of a player"
|
||||
},
|
||||
{
|
||||
name: "/reqs",
|
||||
value: "Check the requirements of the guild"
|
||||
},
|
||||
{
|
||||
name: "/update",
|
||||
value: "Update's your roles"
|
||||
},
|
||||
{
|
||||
name: "/help",
|
||||
value: "Shows this message"
|
||||
}
|
||||
],
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: interaction.guild.iconURL({ dynamic: true })
|
||||
},
|
||||
footer: {
|
||||
icon_url: interaction.guild.iconURL({ dynamic: true }),
|
||||
text: interaction.guild.name + " | Developed by: @Taken#0001"
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
103
commands/reqs.js
103
commands/reqs.js
@@ -1,50 +1,63 @@
|
||||
const { SlashCommandBuilder } = require('discord.js');
|
||||
const { color } = require('../config/options.json');
|
||||
const { bwfdkr, bwstars, bwwins, duelswins, swstars } = require('../config/reqs.json');
|
||||
const { SlashCommandBuilder } = require("discord.js");
|
||||
const { color } = require("../config/options.json");
|
||||
const {
|
||||
bwfdkr,
|
||||
bwstars,
|
||||
bwwins,
|
||||
duelswins,
|
||||
swstars
|
||||
} = require("../config/reqs.json");
|
||||
|
||||
module.exports = {
|
||||
name: 'reqs',
|
||||
description: 'Displays the requirements for the guild.',
|
||||
type: 'slash',
|
||||
data: new SlashCommandBuilder()
|
||||
.setName('reqs')
|
||||
.setDescription('Displays the requirements for the guild.'),
|
||||
name: "reqs",
|
||||
description: "Displays the requirements for the guild.",
|
||||
type: "slash",
|
||||
data: new SlashCommandBuilder()
|
||||
.setName("reqs")
|
||||
.setDescription("Displays the requirements for the guild."),
|
||||
|
||||
async execute(interaction) {
|
||||
async execute(interaction) {
|
||||
await interaction.deferReply({ ephemeral: true });
|
||||
|
||||
await interaction.deferReply({ ephemeral: true });
|
||||
const embedColor = Number(color.replace("#", "0x"));
|
||||
|
||||
const embedColor = Number(color.replace("#", "0x"));
|
||||
|
||||
await interaction.editReply({
|
||||
embeds: [{
|
||||
title: 'Requirements',
|
||||
description: '**You must make 100k-150k weekly GEXP.\nAs well as onne of the game stats below**',
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: interaction.guild.iconURL()
|
||||
},
|
||||
fields: [
|
||||
{
|
||||
name: '**Bedwars**',
|
||||
value: '**Stars:** `' + bwstars.toString() +
|
||||
'`\n**Wins:** `' + bwwins.toString() +
|
||||
'`\n**FKDR:** `' + bwfdkr.toString() + '`'
|
||||
},
|
||||
{
|
||||
name: '**Skywars**',
|
||||
value: '**Stars:** `' + swstars.toString() + '`'
|
||||
},
|
||||
{
|
||||
name: '**Duels**',
|
||||
value: '**Wins:** `' + duelswins.toString() + '`'
|
||||
}
|
||||
],
|
||||
footer: {
|
||||
text: interaction.guild.name + ' | Developed by: @Taken#0002',
|
||||
icon_url: interaction.guild.iconURL()
|
||||
}
|
||||
}]
|
||||
})
|
||||
}
|
||||
}
|
||||
await interaction.editReply({
|
||||
embeds: [
|
||||
{
|
||||
title: "Requirements",
|
||||
description:
|
||||
"**You must make 100k-150k weekly GEXP.\nAs well as onne of the game stats below**",
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: interaction.guild.iconURL()
|
||||
},
|
||||
fields: [
|
||||
{
|
||||
name: "**Bedwars**",
|
||||
value:
|
||||
"**Stars:** `" +
|
||||
bwstars.toString() +
|
||||
"`\n**Wins:** `" +
|
||||
bwwins.toString() +
|
||||
"`\n**FKDR:** `" +
|
||||
bwfdkr.toString() +
|
||||
"`"
|
||||
},
|
||||
{
|
||||
name: "**Skywars**",
|
||||
value: "**Stars:** `" + swstars.toString() + "`"
|
||||
},
|
||||
{
|
||||
name: "**Duels**",
|
||||
value: "**Wins:** `" + duelswins.toString() + "`"
|
||||
}
|
||||
],
|
||||
footer: {
|
||||
text: interaction.guild.name + " | Developed by: @Taken#0002",
|
||||
icon_url: interaction.guild.iconURL()
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
105
commands/send.js
105
commands/send.js
@@ -1,57 +1,62 @@
|
||||
const { SlashCommandBuilder, PermissionFlagsBits } = require('discord.js');
|
||||
const { color } = require('../config/options.json');
|
||||
const { SlashCommandBuilder, PermissionFlagsBits } = require("discord.js");
|
||||
const { color } = require("../config/options.json");
|
||||
|
||||
module.exports = {
|
||||
name: 'send',
|
||||
description: 'Send a message to a channel.',
|
||||
type: 'slash',
|
||||
name: "send",
|
||||
description: "Send a message to a channel.",
|
||||
type: "slash",
|
||||
|
||||
data: new SlashCommandBuilder()
|
||||
.setName('send')
|
||||
.setDescription('Send a message to a channel.')
|
||||
.addStringOption(option =>
|
||||
option
|
||||
.setName('message')
|
||||
.setDescription('The message to send.'))
|
||||
.addChannelOption(option =>
|
||||
option
|
||||
.setName('channel')
|
||||
.setDescription('The channel to send the message to.'))
|
||||
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
|
||||
.setDMPermission(false),
|
||||
|
||||
async execute(interaction) {
|
||||
data: new SlashCommandBuilder()
|
||||
.setName("send")
|
||||
.setDescription("Send a message to a channel.")
|
||||
.addStringOption((option) =>
|
||||
option.setName("message").setDescription("The message to send.")
|
||||
)
|
||||
.addChannelOption((option) =>
|
||||
option
|
||||
.setName("channel")
|
||||
.setDescription("The channel to send the message to.")
|
||||
)
|
||||
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
|
||||
.setDMPermission(false),
|
||||
|
||||
await interaction.deferReply({ ephemeral: true });
|
||||
async execute(interaction) {
|
||||
await interaction.deferReply({ ephemeral: true });
|
||||
|
||||
const message = interaction.options.getString('message');
|
||||
const channel = interaction.options.getChannel('channel');
|
||||
const embedColor = Number(color.replace("#", "0x"));
|
||||
const message = interaction.options.getString("message");
|
||||
const channel = interaction.options.getChannel("channel");
|
||||
const embedColor = Number(color.replace("#", "0x"));
|
||||
|
||||
if (!message) {
|
||||
interaction.editReply({ content: 'Please provide a message to send.', ephemeral: true })
|
||||
return
|
||||
}
|
||||
|
||||
if (!channel) {
|
||||
interaction.editReply({ content: 'Please provide a channel to send the message to.', ephemeral: true })
|
||||
return
|
||||
}
|
||||
|
||||
channel.send({
|
||||
embeds: [
|
||||
{
|
||||
title: interaction.guild.name,
|
||||
description: message,
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: interaction.guild.iconURL({ dynamic: true })
|
||||
},
|
||||
footer: {
|
||||
text: "Developed by @Taken#0002"
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
if (!message) {
|
||||
interaction.editReply({
|
||||
content: "Please provide a message to send.",
|
||||
ephemeral: true
|
||||
});
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
||||
if (!channel) {
|
||||
interaction.editReply({
|
||||
content: "Please provide a channel to send the message to.",
|
||||
ephemeral: true
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
channel.send({
|
||||
embeds: [
|
||||
{
|
||||
title: interaction.guild.name,
|
||||
description: message,
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: interaction.guild.iconURL({ dynamic: true })
|
||||
},
|
||||
footer: {
|
||||
text: "Developed by @Taken#0002"
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,39 +1,50 @@
|
||||
const { SlashCommandBuilder, PermissionFlagsBits, userMention } = require('discord.js')
|
||||
const {
|
||||
SlashCommandBuilder,
|
||||
PermissionFlagsBits,
|
||||
userMention
|
||||
} = require("discord.js");
|
||||
|
||||
module.exports = {
|
||||
name: 'setnick',
|
||||
description: 'Set your nickname',
|
||||
type: 'slash',
|
||||
name: "setnick",
|
||||
description: "Set your nickname",
|
||||
type: "slash",
|
||||
|
||||
data: new SlashCommandBuilder()
|
||||
.setName('setnick')
|
||||
.setDescription('Set your nickname')
|
||||
.addUserOption(option =>
|
||||
option
|
||||
.setName('user')
|
||||
.setDescription('The user to set the nickname for')
|
||||
.setRequired(true))
|
||||
.addStringOption(option =>
|
||||
option
|
||||
.setName('nickname')
|
||||
.setDescription('The nickname to set')
|
||||
.setRequired(true))
|
||||
.setDefaultMemberPermissions(PermissionFlagsBits.ManageNicknames)
|
||||
.setDMPermission(false),
|
||||
data: new SlashCommandBuilder()
|
||||
.setName("setnick")
|
||||
.setDescription("Set your nickname")
|
||||
.addUserOption((option) =>
|
||||
option
|
||||
.setName("user")
|
||||
.setDescription("The user to set the nickname for")
|
||||
.setRequired(true)
|
||||
)
|
||||
.addStringOption((option) =>
|
||||
option
|
||||
.setName("nickname")
|
||||
.setDescription("The nickname to set")
|
||||
.setRequired(true)
|
||||
)
|
||||
.setDefaultMemberPermissions(PermissionFlagsBits.ManageNicknames)
|
||||
.setDMPermission(false),
|
||||
|
||||
async execute(interaction) {
|
||||
|
||||
const user = interaction.options.getUser('user');
|
||||
const nickname = interaction.options.getString('nickname');
|
||||
const member = await interaction.guild.members.fetch(user.id);
|
||||
|
||||
if (!member.manageable) {
|
||||
return interaction.reply({ content: 'I cannot set the nickname for this user!', ephemeral: true });
|
||||
}
|
||||
|
||||
await member.setNickname(nickname, `Set by ${interaction.user.tag}`);
|
||||
|
||||
await interaction.reply({ content: "Set the nickname of " + userMention(member.id) + " to " + nickname, ephemeral: true });
|
||||
async execute(interaction) {
|
||||
const user = interaction.options.getUser("user");
|
||||
const nickname = interaction.options.getString("nickname");
|
||||
const member = await interaction.guild.members.fetch(user.id);
|
||||
|
||||
if (!member.manageable) {
|
||||
return interaction.reply({
|
||||
content: "I cannot set the nickname for this user!",
|
||||
ephemeral: true
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
await member.setNickname(nickname, `Set by ${interaction.user.tag}`);
|
||||
|
||||
await interaction.reply({
|
||||
content:
|
||||
"Set the nickname of " + userMention(member.id) + " to " + nickname,
|
||||
ephemeral: true
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,59 +1,64 @@
|
||||
const { SlashCommandBuilder, PermissionFlagsBits } = require('discord.js');
|
||||
const { color } = require('../config/options.json');
|
||||
const { SlashCommandBuilder, PermissionFlagsBits } = require("discord.js");
|
||||
const { color } = require("../config/options.json");
|
||||
|
||||
module.exports = {
|
||||
name: 'slowmode',
|
||||
description: 'Set the slowmode of a channel.',
|
||||
type: 'slash',
|
||||
name: "slowmode",
|
||||
description: "Set the slowmode of a channel.",
|
||||
type: "slash",
|
||||
|
||||
data: new SlashCommandBuilder()
|
||||
.setName('slowmode')
|
||||
.setDescription('Set the slowmode of a channel.')
|
||||
.addIntegerOption(option =>
|
||||
option
|
||||
.setName('seconds')
|
||||
.setDescription('The amount of seconds to set the slowmode to.'))
|
||||
.addChannelOption(option =>
|
||||
option
|
||||
.setName('channel')
|
||||
.setDescription('The channel to set the slowmode of.'))
|
||||
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
|
||||
.setDMPermission(false),
|
||||
data: new SlashCommandBuilder()
|
||||
.setName("slowmode")
|
||||
.setDescription("Set the slowmode of a channel.")
|
||||
.addIntegerOption((option) =>
|
||||
option
|
||||
.setName("seconds")
|
||||
.setDescription("The amount of seconds to set the slowmode to.")
|
||||
)
|
||||
.addChannelOption((option) =>
|
||||
option
|
||||
.setName("channel")
|
||||
.setDescription("The channel to set the slowmode of.")
|
||||
)
|
||||
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
|
||||
.setDMPermission(false),
|
||||
|
||||
async execute(interaction) {
|
||||
async execute(interaction) {
|
||||
await interaction.deferReply({ ephermeral: true });
|
||||
|
||||
await interaction.deferReply({ ephermeral: true });
|
||||
|
||||
const seconds = interaction.options.getInteger('seconds') ?? 5
|
||||
const channel = interaction.options.getChannel('channel') ?? interaction.channel
|
||||
const embedColor = Number(color.replace("#", "0x"));
|
||||
|
||||
if (seconds > 21600) {
|
||||
await channel.setRateLimitPerUser(21600)
|
||||
await interaction.editReply({
|
||||
embeds: [{
|
||||
description: `Set the slowmode of ${channel} to 21600 seconds.`,
|
||||
color: embedColor,
|
||||
footer: {
|
||||
text: interaction.guild.name + " | Developed by: @Taken#0001",
|
||||
icon_url: interaction.guild.iconURL({ dynamic: true })
|
||||
}
|
||||
}]
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
await interaction.editReply({
|
||||
embeds: [{
|
||||
description: `Set the slowmode of ${channel} to ${seconds} seconds.`,
|
||||
color: embedColor,
|
||||
footer: {
|
||||
text: interaction.guild.name + " | Developed by: @Taken#0001",
|
||||
icon_url: interaction.guild.iconURL({ dynamic: true })
|
||||
}
|
||||
}]
|
||||
})
|
||||
await channel.setRateLimitPerUser(seconds)
|
||||
const seconds = interaction.options.getInteger("seconds") ?? 5;
|
||||
const channel =
|
||||
interaction.options.getChannel("channel") ?? interaction.channel;
|
||||
const embedColor = Number(color.replace("#", "0x"));
|
||||
|
||||
if (seconds > 21600) {
|
||||
await channel.setRateLimitPerUser(21600);
|
||||
await interaction.editReply({
|
||||
embeds: [
|
||||
{
|
||||
description: `Set the slowmode of ${channel} to 21600 seconds.`,
|
||||
color: embedColor,
|
||||
footer: {
|
||||
text: interaction.guild.name + " | Developed by: @Taken#0001",
|
||||
icon_url: interaction.guild.iconURL({ dynamic: true })
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
await interaction.editReply({
|
||||
embeds: [
|
||||
{
|
||||
description: `Set the slowmode of ${channel} to ${seconds} seconds.`,
|
||||
color: embedColor,
|
||||
footer: {
|
||||
text: interaction.guild.name + " | Developed by: @Taken#0001",
|
||||
icon_url: interaction.guild.iconURL({ dynamic: true })
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
await channel.setRateLimitPerUser(seconds);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,262 +1,282 @@
|
||||
const { SlashCommandBuilder } = require('discord.js');
|
||||
const env = require('dotenv').config();
|
||||
const { SlashCommandBuilder } = require("discord.js");
|
||||
const env = require("dotenv").config();
|
||||
const hypixelApiKey = process.env.HYPIXELAPIKEY;
|
||||
const fetch = require('axios');
|
||||
const verify = require('../schemas/verifySchema.js')
|
||||
const { color, hypixelGuildID } = require('../config/options.json');
|
||||
const { gm, manager, moderator, beast, member, trialmember, guildRole, guildStaff, defaultMember } = require('../config/roles.json');
|
||||
const fetch = require("axios");
|
||||
const verify = require("../schemas/verifySchema.js");
|
||||
const { color, hypixelGuildID } = require("../config/options.json");
|
||||
const {
|
||||
gm,
|
||||
manager,
|
||||
moderator,
|
||||
beast,
|
||||
member,
|
||||
trialmember,
|
||||
guildRole,
|
||||
guildStaff,
|
||||
defaultMember
|
||||
} = require("../config/roles.json");
|
||||
|
||||
const removeThese = [gm, manager, moderator, beast, member, trialmember, guildRole, guildStaff];
|
||||
const removeThese = [
|
||||
gm,
|
||||
manager,
|
||||
moderator,
|
||||
beast,
|
||||
member,
|
||||
trialmember,
|
||||
guildRole,
|
||||
guildStaff
|
||||
];
|
||||
|
||||
module.exports = {
|
||||
name: 'update',
|
||||
description: 'Update your guild rank.',
|
||||
type: 'slash',
|
||||
name: "update",
|
||||
description: "Update your guild rank.",
|
||||
type: "slash",
|
||||
|
||||
data: new SlashCommandBuilder()
|
||||
.setName('update')
|
||||
.setDescription('Update your guild rank.')
|
||||
.setDMPermission(false),
|
||||
data: new SlashCommandBuilder()
|
||||
.setName("update")
|
||||
.setDescription("Update your guild rank.")
|
||||
.setDMPermission(false),
|
||||
|
||||
async execute(interaction) {
|
||||
async execute(interaction) {
|
||||
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 roleManage = user.roles;
|
||||
|
||||
if (!verifyData) {
|
||||
|
||||
for (let i = 0; i < removeThese.length; i++) {
|
||||
await roleManage.remove(removeThese[i], "Auto role removal. (Update)")
|
||||
const user1 = interaction.user;
|
||||
const user = interaction.guild.members.cache.get(user1.id);
|
||||
const verifyData = await verify.findOne({ userID: user.id });
|
||||
const roleManage = user.roles;
|
||||
|
||||
if (!verifyData) {
|
||||
for (let i = 0; i < removeThese.length; i++) {
|
||||
await roleManage.remove(removeThese[i], "Auto role removal. (Update)");
|
||||
}
|
||||
|
||||
await interaction.editReply({
|
||||
embeds: [
|
||||
{
|
||||
description: "Updated your roles to `Default Member`",
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: head
|
||||
},
|
||||
footer: {
|
||||
text: interaction.guild.name + " | Developed by @Taken#0002",
|
||||
icon_url: interaction.guild.iconURL({ dynamic: true })
|
||||
}
|
||||
|
||||
await interaction.editReply({
|
||||
embeds: [{
|
||||
description: "Updated your roles to `Default Member`",
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: head
|
||||
},
|
||||
footer: {
|
||||
text: interaction.guild.name + " | Developed by @Taken#0002",
|
||||
icon_url: interaction.guild.iconURL({ dynamic: true })
|
||||
}
|
||||
}]
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
const slothPixel = "https://api.slothpixel.me/api/players/";
|
||||
const guildAPI = "https://api.slothpixel.me/api/guilds/"
|
||||
const mojangAPI = "https://api.mojang.com/user/profile/"
|
||||
const minotar = "https://minotar.net/helm/";
|
||||
|
||||
const userCheck = await fetch(mojangAPI + verifyData.uuid);
|
||||
const hypixelCheck = await fetch(slothPixel + verifyData.uuid);
|
||||
|
||||
try {
|
||||
const guildCheck = await fetch(guildAPI + verifyData.uuid);
|
||||
var responseGuildID = guildCheck.data.id;
|
||||
} catch (err) {
|
||||
var responseGuildID = null;
|
||||
}
|
||||
|
||||
if (responseGuildID !== hypixelGuildID) {
|
||||
|
||||
for (let i = 0; i < removeThese.length; i++) {
|
||||
await roleManage.remove(removeThese[i], "Auto role removal. (Update)")
|
||||
}
|
||||
|
||||
await roleManage.add(defaultMember, "User used the update command")
|
||||
|
||||
await interaction.editReply({
|
||||
embeds: [{
|
||||
description: "Updated your roles to `Default Member`",
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: head
|
||||
},
|
||||
footer: {
|
||||
text: interaction.guild.name + " | Developed by @Taken#0002",
|
||||
icon_url: interaction.guild.iconURL({ dynamic: true })
|
||||
}
|
||||
}]
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
const guildCheck = await fetch(guildAPI + verifyData.uuid);
|
||||
const head = minotar + userCheck.data.name;
|
||||
|
||||
const embedColor = Number(color.replace("#", "0x"));
|
||||
const GuildMembers = guildCheck.data.members;
|
||||
const guildRank = GuildMembers.find(member => member.uuid === verifyData.uuid).rank;
|
||||
|
||||
if (guildRank === 'Guild Master' && responseGuildID === hypixelGuildID) {
|
||||
|
||||
for (let i = 0; i < removeThese.length; i++) {
|
||||
await roleManage.remove(removeThese[i], "Auto role removal. (Update)")
|
||||
}
|
||||
|
||||
await roleManage.add(guildRole, "User used the update command")
|
||||
await roleManage.add(guildStaff, "User used the update command")
|
||||
await roleManage.add(gm, "User used the update command")
|
||||
await roleManage.add(defaultMember, "User used the update command")
|
||||
|
||||
|
||||
await interaction.editReply({
|
||||
embeds: [{
|
||||
description: "Your rank has been updated to `Guild Master`",
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: head
|
||||
},
|
||||
footer: {
|
||||
text: interaction.guild.name + " | Developed by @Taken#0002",
|
||||
icon_url: interaction.guild.iconURL({ dynamic: true })
|
||||
}
|
||||
}]
|
||||
})
|
||||
}
|
||||
|
||||
if (guildRank === 'Manager' && responseGuildID === hypixelGuildID) {
|
||||
|
||||
for (let i = 0; i < removeThese.length; i++) {
|
||||
await roleManage.remove(removeThese[i], "Auto role removal. (Update)")
|
||||
}
|
||||
|
||||
await roleManage.add(guildRole, "User used the update command")
|
||||
await roleManage.add(guildStaff, "User used the update command")
|
||||
await roleManage.add(manager, "User used the update command")
|
||||
await roleManage.add(defaultMember, "User used the update command")
|
||||
|
||||
|
||||
await interaction.editReply({
|
||||
embeds: [{
|
||||
description: "Your rank has been updated to `Manager`",
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: head
|
||||
},
|
||||
footer: {
|
||||
text: interaction.guild.name + " | Developed by @Taken#0002",
|
||||
icon_url: interaction.guild.iconURL({ dynamic: true })
|
||||
}
|
||||
}]
|
||||
})
|
||||
}
|
||||
|
||||
if (guildRank === 'Moderator' && responseGuildID === hypixelGuildID) {
|
||||
|
||||
for (let i = 0; i < removeThese.length; i++) {
|
||||
await roleManage.remove(removeThese[i], "Auto role removal. (Update)")
|
||||
}
|
||||
|
||||
await roleManage.add(guildRole, "User used the update command")
|
||||
await roleManage.add(guildStaff, "User used the update command")
|
||||
await roleManage.add(moderator, "User used the update command")
|
||||
await roleManage.add(defaultMember, "User used the update command")
|
||||
|
||||
|
||||
await interaction.editReply({
|
||||
embeds: [{
|
||||
description: "Your rank has been updated to `Moderator`",
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: head
|
||||
},
|
||||
footer: {
|
||||
text: interaction.guild.name + " | Developed by @Taken#0002",
|
||||
icon_url: interaction.guild.iconURL({ dynamic: true })
|
||||
}
|
||||
}]
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
if (guildRank === 'Beast' && responseGuildID === hypixelGuildID) {
|
||||
|
||||
for (let i = 0; i < removeThese.length; i++) {
|
||||
await roleManage.remove(removeThese[i], "Auto role removal. (Update)")
|
||||
}
|
||||
|
||||
await roleManage.add(guildRole, "User used the update command")
|
||||
await roleManage.add(beast, "User used the update command")
|
||||
await roleManage.add(defaultMember, "User used the update command")
|
||||
|
||||
|
||||
await interaction.editReply({
|
||||
embeds: [{
|
||||
description: "Your rank has been updated to `Beast`.",
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: head
|
||||
},
|
||||
footer: {
|
||||
text: interaction.guild.name + " | Developed by @Taken#0002",
|
||||
icon_url: interaction.guild.iconURL({ dynamic: true })
|
||||
}
|
||||
}]
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
if (guildRank === 'Member' && responseGuildID === hypixelGuildID) {
|
||||
|
||||
for (let i = 0; i < removeThese.length; i++) {
|
||||
await roleManage.remove(removeThese[i], "Auto role removal. (Update)")
|
||||
}
|
||||
|
||||
await roleManage.add(guildRole, "User used the update command")
|
||||
await roleManage.add(member, "User used the update command")
|
||||
await roleManage.add(defaultMember, "User used the update command")
|
||||
|
||||
|
||||
await interaction.editReply({
|
||||
embeds: [{
|
||||
description: "Your rank has been updated to `Member`.",
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: head
|
||||
},
|
||||
footer: {
|
||||
text: interaction.guild.name + " | Developed by @Taken#0002",
|
||||
icon_url: interaction.guild.iconURL({ dynamic: true })
|
||||
}
|
||||
}]
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
if (guildRank === 'Trial Member' && responseGuildID === hypixelGuildID) {
|
||||
|
||||
for (let i = 0; i < removeThese.length; i++) {
|
||||
await roleManage.remove(removeThese[i], "Auto role removal. (Update)")
|
||||
}
|
||||
|
||||
await roleManage.add(guildRole, "User used the update command")
|
||||
await roleManage.add(trialmember, "User used the update command")
|
||||
await roleManage.add(defaultMember, "User used the update command")
|
||||
|
||||
|
||||
await interaction.editReply({
|
||||
embeds: [{
|
||||
description: "Your rank has been updated to `Trial Member`.",
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: head
|
||||
},
|
||||
footer: {
|
||||
text: interaction.guild.name + " | Developed by @Taken#0002",
|
||||
icon_url: interaction.guild.iconURL({ dynamic: true })
|
||||
}
|
||||
}]
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
}
|
||||
]
|
||||
});
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
||||
const slothPixel = "https://api.slothpixel.me/api/players/";
|
||||
const guildAPI = "https://api.slothpixel.me/api/guilds/";
|
||||
const mojangAPI = "https://api.mojang.com/user/profile/";
|
||||
const minotar = "https://minotar.net/helm/";
|
||||
|
||||
const userCheck = await fetch(mojangAPI + verifyData.uuid);
|
||||
const hypixelCheck = await fetch(slothPixel + verifyData.uuid);
|
||||
|
||||
try {
|
||||
const guildCheck = await fetch(guildAPI + verifyData.uuid);
|
||||
var responseGuildID = guildCheck.data.id;
|
||||
} catch (err) {
|
||||
var responseGuildID = null;
|
||||
}
|
||||
|
||||
if (responseGuildID !== hypixelGuildID) {
|
||||
for (let i = 0; i < removeThese.length; i++) {
|
||||
await roleManage.remove(removeThese[i], "Auto role removal. (Update)");
|
||||
}
|
||||
|
||||
await roleManage.add(defaultMember, "User used the update command");
|
||||
|
||||
await interaction.editReply({
|
||||
embeds: [
|
||||
{
|
||||
description: "Updated your roles to `Default Member`",
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: head
|
||||
},
|
||||
footer: {
|
||||
text: interaction.guild.name + " | Developed by @Taken#0002",
|
||||
icon_url: interaction.guild.iconURL({ dynamic: true })
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
const guildCheck = await fetch(guildAPI + verifyData.uuid);
|
||||
const head = minotar + userCheck.data.name;
|
||||
|
||||
const embedColor = Number(color.replace("#", "0x"));
|
||||
const GuildMembers = guildCheck.data.members;
|
||||
const guildRank = GuildMembers.find(
|
||||
(member) => member.uuid === verifyData.uuid
|
||||
).rank;
|
||||
|
||||
if (guildRank === "Guild Master" && responseGuildID === hypixelGuildID) {
|
||||
for (let i = 0; i < removeThese.length; i++) {
|
||||
await roleManage.remove(removeThese[i], "Auto role removal. (Update)");
|
||||
}
|
||||
|
||||
await roleManage.add(guildRole, "User used the update command");
|
||||
await roleManage.add(guildStaff, "User used the update command");
|
||||
await roleManage.add(gm, "User used the update command");
|
||||
await roleManage.add(defaultMember, "User used the update command");
|
||||
|
||||
await interaction.editReply({
|
||||
embeds: [
|
||||
{
|
||||
description: "Your rank has been updated to `Guild Master`",
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: head
|
||||
},
|
||||
footer: {
|
||||
text: interaction.guild.name + " | Developed by @Taken#0002",
|
||||
icon_url: interaction.guild.iconURL({ dynamic: true })
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
if (guildRank === "Manager" && responseGuildID === hypixelGuildID) {
|
||||
for (let i = 0; i < removeThese.length; i++) {
|
||||
await roleManage.remove(removeThese[i], "Auto role removal. (Update)");
|
||||
}
|
||||
|
||||
await roleManage.add(guildRole, "User used the update command");
|
||||
await roleManage.add(guildStaff, "User used the update command");
|
||||
await roleManage.add(manager, "User used the update command");
|
||||
await roleManage.add(defaultMember, "User used the update command");
|
||||
|
||||
await interaction.editReply({
|
||||
embeds: [
|
||||
{
|
||||
description: "Your rank has been updated to `Manager`",
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: head
|
||||
},
|
||||
footer: {
|
||||
text: interaction.guild.name + " | Developed by @Taken#0002",
|
||||
icon_url: interaction.guild.iconURL({ dynamic: true })
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
if (guildRank === "Moderator" && responseGuildID === hypixelGuildID) {
|
||||
for (let i = 0; i < removeThese.length; i++) {
|
||||
await roleManage.remove(removeThese[i], "Auto role removal. (Update)");
|
||||
}
|
||||
|
||||
await roleManage.add(guildRole, "User used the update command");
|
||||
await roleManage.add(guildStaff, "User used the update command");
|
||||
await roleManage.add(moderator, "User used the update command");
|
||||
await roleManage.add(defaultMember, "User used the update command");
|
||||
|
||||
await interaction.editReply({
|
||||
embeds: [
|
||||
{
|
||||
description: "Your rank has been updated to `Moderator`",
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: head
|
||||
},
|
||||
footer: {
|
||||
text: interaction.guild.name + " | Developed by @Taken#0002",
|
||||
icon_url: interaction.guild.iconURL({ dynamic: true })
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
if (guildRank === "Beast" && responseGuildID === hypixelGuildID) {
|
||||
for (let i = 0; i < removeThese.length; i++) {
|
||||
await roleManage.remove(removeThese[i], "Auto role removal. (Update)");
|
||||
}
|
||||
|
||||
await roleManage.add(guildRole, "User used the update command");
|
||||
await roleManage.add(beast, "User used the update command");
|
||||
await roleManage.add(defaultMember, "User used the update command");
|
||||
|
||||
await interaction.editReply({
|
||||
embeds: [
|
||||
{
|
||||
description: "Your rank has been updated to `Beast`.",
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: head
|
||||
},
|
||||
footer: {
|
||||
text: interaction.guild.name + " | Developed by @Taken#0002",
|
||||
icon_url: interaction.guild.iconURL({ dynamic: true })
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
if (guildRank === "Member" && responseGuildID === hypixelGuildID) {
|
||||
for (let i = 0; i < removeThese.length; i++) {
|
||||
await roleManage.remove(removeThese[i], "Auto role removal. (Update)");
|
||||
}
|
||||
|
||||
await roleManage.add(guildRole, "User used the update command");
|
||||
await roleManage.add(member, "User used the update command");
|
||||
await roleManage.add(defaultMember, "User used the update command");
|
||||
|
||||
await interaction.editReply({
|
||||
embeds: [
|
||||
{
|
||||
description: "Your rank has been updated to `Member`.",
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: head
|
||||
},
|
||||
footer: {
|
||||
text: interaction.guild.name + " | Developed by @Taken#0002",
|
||||
icon_url: interaction.guild.iconURL({ dynamic: true })
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
if (guildRank === "Trial Member" && responseGuildID === hypixelGuildID) {
|
||||
for (let i = 0; i < removeThese.length; i++) {
|
||||
await roleManage.remove(removeThese[i], "Auto role removal. (Update)");
|
||||
}
|
||||
|
||||
await roleManage.add(guildRole, "User used the update command");
|
||||
await roleManage.add(trialmember, "User used the update command");
|
||||
await roleManage.add(defaultMember, "User used the update command");
|
||||
|
||||
await interaction.editReply({
|
||||
embeds: [
|
||||
{
|
||||
description: "Your rank has been updated to `Trial Member`.",
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: head
|
||||
},
|
||||
footer: {
|
||||
text: interaction.guild.name + " | Developed by @Taken#0002",
|
||||
icon_url: interaction.guild.iconURL({ dynamic: true })
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
return;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,168 +1,191 @@
|
||||
const { SlashCommandBuilder } = require('discord.js');
|
||||
const env = require('dotenv').config();
|
||||
const { SlashCommandBuilder } = require("discord.js");
|
||||
const env = require("dotenv").config();
|
||||
const hypixelApiKey = process.env.HYPIXELAPIKEY;
|
||||
const fetch = require('axios');
|
||||
const { color, hypixelGuildID } = require('../config/options.json');
|
||||
const verify = require('../schemas/verifySchema.js')
|
||||
const mongoose = require('mongoose');
|
||||
const { gm, manager, moderator, beast, member, trialmember, guildRole, guildStaff, defaultMember } = require('../config/roles.json');
|
||||
|
||||
const fetch = require("axios");
|
||||
const { color, hypixelGuildID } = require("../config/options.json");
|
||||
const verify = require("../schemas/verifySchema.js");
|
||||
const mongoose = require("mongoose");
|
||||
const {
|
||||
gm,
|
||||
manager,
|
||||
moderator,
|
||||
beast,
|
||||
member,
|
||||
trialmember,
|
||||
guildRole,
|
||||
guildStaff,
|
||||
defaultMember
|
||||
} = require("../config/roles.json");
|
||||
|
||||
module.exports = {
|
||||
name: 'verify',
|
||||
description: 'Verify yourself as a member of the server.',
|
||||
type: 'slash',
|
||||
name: "verify",
|
||||
description: "Verify yourself as a member of the server.",
|
||||
type: "slash",
|
||||
|
||||
data: new SlashCommandBuilder()
|
||||
.setName('verify')
|
||||
.setDescription('Verify yourself as a member of the server.')
|
||||
.addStringOption(option =>
|
||||
option
|
||||
.setName('ign')
|
||||
.setDescription('Your in-game name.'))
|
||||
.setDMPermission(false),
|
||||
data: new SlashCommandBuilder()
|
||||
.setName("verify")
|
||||
.setDescription("Verify yourself as a member of the server.")
|
||||
.addStringOption((option) =>
|
||||
option.setName("ign").setDescription("Your in-game name.")
|
||||
)
|
||||
.setDMPermission(false),
|
||||
|
||||
async execute(interaction) {
|
||||
async execute(interaction) {
|
||||
await interaction.deferReply();
|
||||
|
||||
await interaction.deferReply();
|
||||
const user1 = interaction.user;
|
||||
const user = await interaction.guild.members.fetch(user1.id);
|
||||
|
||||
const user1 = interaction.user;
|
||||
const user = await interaction.guild.members.fetch(user1.id);
|
||||
const fullUsername = user.user.username + "#" + user.user.discriminator;
|
||||
const ign = interaction.options.getString("ign");
|
||||
const mojang = "https://api.mojang.com/users/profiles/minecraft/";
|
||||
const slothPixel = "https://api.slothpixel.me/api/players/";
|
||||
const guildAPI = "https://api.slothpixel.me/api/guilds/";
|
||||
const minotar = "https://minotar.net/helm/";
|
||||
const embedColor = Number(color.replace("#", "0x"));
|
||||
|
||||
const fullUsername = user.user.username + "#" + user.user.discriminator
|
||||
const ign = interaction.options.getString('ign');
|
||||
const mojang = "https://api.mojang.com/users/profiles/minecraft/"
|
||||
const slothPixel = "https://api.slothpixel.me/api/players/";
|
||||
const guildAPI = "https://api.slothpixel.me/api/guilds/"
|
||||
const minotar = "https://minotar.net/helm/";
|
||||
const embedColor = Number(color.replace("#", "0x"));
|
||||
|
||||
const verifyData = await verify.findOne({ userID: user.id })
|
||||
|
||||
if (verifyData) {
|
||||
interaction.editReply('You are already verified.')
|
||||
return
|
||||
}
|
||||
|
||||
if (!ign) {
|
||||
interaction.editReply('Please provide a player\'s IGN.')
|
||||
return
|
||||
}
|
||||
|
||||
try {
|
||||
await fetch(mojang + ign);
|
||||
} catch (err) {
|
||||
interaction.editReply('That player doesn\'t exist. [Mojang]')
|
||||
return
|
||||
}
|
||||
|
||||
try {
|
||||
await fetch(slothPixel + ign);
|
||||
} catch (err) {
|
||||
interaction.editReply('That player doesn\'t exist. [Hypixel]')
|
||||
return
|
||||
}
|
||||
|
||||
const userCheck = await fetch(mojang + ign);
|
||||
const userUUID = userCheck.data.id;
|
||||
|
||||
const hypixelCheck = await fetch(slothPixel + userUUID);
|
||||
const head = minotar + ign;
|
||||
|
||||
if (hypixelCheck.data.links.DISCORD !== fullUsername) {
|
||||
interaction.editReply('Your Discord tag does not match your in-game tag.')
|
||||
return
|
||||
}
|
||||
|
||||
try {
|
||||
const guildCheck = await fetch(guildAPI + userUUID);
|
||||
var responseGuildID = guildCheck.data.id;
|
||||
} catch (err) {
|
||||
var responseGuildID = null;
|
||||
}
|
||||
|
||||
if (responseGuildID !== hypixelGuildID) {
|
||||
|
||||
await user.roles.add(defaultMember, "Verification")
|
||||
|
||||
await interaction.editReply({
|
||||
embeds: [{
|
||||
title: interaction.guild.name,
|
||||
description: "You have successfully verified `" + fullUsername + "` with the account `" + hypixelCheck.data.username + "`.",
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: head
|
||||
},
|
||||
footer: {
|
||||
icon_url: interaction.guild.iconURL(),
|
||||
text: interaction.guild.name + " | Developed by Taken#0002"
|
||||
}
|
||||
}]
|
||||
});
|
||||
return
|
||||
}
|
||||
|
||||
const guildCheck = await fetch(guildAPI + userUUID);
|
||||
const GuildMembers = await guildCheck.data.members;
|
||||
const guildRank = GuildMembers.find(member => member.uuid === hypixelCheck.data.uuid).rank;
|
||||
|
||||
if (guildRank === "Guild Master" && responseGuildID === hypixelGuildID) {
|
||||
await user.roles.add(gm, "Verification");
|
||||
await user.roles.add(guildRole, "Verification")
|
||||
await user.roles.add(guildStaff, "Verification")
|
||||
}
|
||||
|
||||
if (guildRank === "Manager" && responseGuildID === hypixelGuildID) {
|
||||
await user.roles.add(manager, "Verification");
|
||||
await user.roles.add(guildRole, "Verification")
|
||||
await user.roles.add(guildStaff, "Verification")
|
||||
}
|
||||
|
||||
if (guildRank === "Moderator" && responseGuildID === hypixelGuildID) {
|
||||
await user.roles.add(moderator, "Verification");
|
||||
await user.roles.add(guildRole, "Verification")
|
||||
await user.roles.add(guildStaff, "Verification")
|
||||
}
|
||||
|
||||
if (guildRank === "Beast" && responseGuildID === hypixelGuildID) {
|
||||
await user.roles.add(beast, "Verification");
|
||||
await user.roles.add(guildRole, "Verification")
|
||||
}
|
||||
|
||||
if (guildRank === "Member" && responseGuildID === hypixelGuildID) {
|
||||
await user.roles.add(member, "Verification");
|
||||
await user.roles.add(guildRole, "Verification")
|
||||
}
|
||||
|
||||
if (guildRank === "Trial Member" && responseGuildID === hypixelGuildID) {
|
||||
await user.roles.add(trialmember, "Verification");
|
||||
await user.roles.add(guildRole, "Verification")
|
||||
}
|
||||
|
||||
await user.roles.add(defaultMember, "Verification")
|
||||
|
||||
const newVerify = new verify({
|
||||
_id: new mongoose.Types.ObjectId(),
|
||||
userID: user.id,
|
||||
uuid: userUUID
|
||||
})
|
||||
|
||||
await newVerify.save()
|
||||
|
||||
await interaction.editReply({
|
||||
embeds: [{
|
||||
title: interaction.guild.name,
|
||||
description: "You have successfully verified `" + fullUsername + "` with the account `" + hypixelCheck.data.username + "`.",
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: head
|
||||
},
|
||||
footer: {
|
||||
icon_url: interaction.guild.iconURL(),
|
||||
text: interaction.guild.name + " | Developed by Taken#0002"
|
||||
}
|
||||
}]
|
||||
});
|
||||
const verifyData = await verify.findOne({ userID: user.id });
|
||||
|
||||
if (verifyData) {
|
||||
interaction.editReply("You are already verified.");
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
||||
if (!ign) {
|
||||
interaction.editReply("Please provide a player's IGN.");
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
await fetch(mojang + ign);
|
||||
} catch (err) {
|
||||
interaction.editReply("That player doesn't exist. [Mojang]");
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
await fetch(slothPixel + ign);
|
||||
} catch (err) {
|
||||
interaction.editReply("That player doesn't exist. [Hypixel]");
|
||||
return;
|
||||
}
|
||||
|
||||
const userCheck = await fetch(mojang + ign);
|
||||
const userUUID = userCheck.data.id;
|
||||
|
||||
const hypixelCheck = await fetch(slothPixel + userUUID);
|
||||
const head = minotar + ign;
|
||||
|
||||
if (hypixelCheck.data.links.DISCORD !== fullUsername) {
|
||||
interaction.editReply(
|
||||
"Your Discord tag does not match your in-game tag."
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
const guildCheck = await fetch(guildAPI + userUUID);
|
||||
var responseGuildID = guildCheck.data.id;
|
||||
} catch (err) {
|
||||
var responseGuildID = null;
|
||||
}
|
||||
|
||||
if (responseGuildID !== hypixelGuildID) {
|
||||
await user.roles.add(defaultMember, "Verification");
|
||||
|
||||
await interaction.editReply({
|
||||
embeds: [
|
||||
{
|
||||
title: interaction.guild.name,
|
||||
description:
|
||||
"You have successfully verified `" +
|
||||
fullUsername +
|
||||
"` with the account `" +
|
||||
hypixelCheck.data.username +
|
||||
"`.",
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: head
|
||||
},
|
||||
footer: {
|
||||
icon_url: interaction.guild.iconURL(),
|
||||
text: interaction.guild.name + " | Developed by Taken#0002"
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
const guildCheck = await fetch(guildAPI + userUUID);
|
||||
const GuildMembers = await guildCheck.data.members;
|
||||
const guildRank = GuildMembers.find(
|
||||
(member) => member.uuid === hypixelCheck.data.uuid
|
||||
).rank;
|
||||
|
||||
if (guildRank === "Guild Master" && responseGuildID === hypixelGuildID) {
|
||||
await user.roles.add(gm, "Verification");
|
||||
await user.roles.add(guildRole, "Verification");
|
||||
await user.roles.add(guildStaff, "Verification");
|
||||
}
|
||||
|
||||
if (guildRank === "Manager" && responseGuildID === hypixelGuildID) {
|
||||
await user.roles.add(manager, "Verification");
|
||||
await user.roles.add(guildRole, "Verification");
|
||||
await user.roles.add(guildStaff, "Verification");
|
||||
}
|
||||
|
||||
if (guildRank === "Moderator" && responseGuildID === hypixelGuildID) {
|
||||
await user.roles.add(moderator, "Verification");
|
||||
await user.roles.add(guildRole, "Verification");
|
||||
await user.roles.add(guildStaff, "Verification");
|
||||
}
|
||||
|
||||
if (guildRank === "Beast" && responseGuildID === hypixelGuildID) {
|
||||
await user.roles.add(beast, "Verification");
|
||||
await user.roles.add(guildRole, "Verification");
|
||||
}
|
||||
|
||||
if (guildRank === "Member" && responseGuildID === hypixelGuildID) {
|
||||
await user.roles.add(member, "Verification");
|
||||
await user.roles.add(guildRole, "Verification");
|
||||
}
|
||||
|
||||
if (guildRank === "Trial Member" && responseGuildID === hypixelGuildID) {
|
||||
await user.roles.add(trialmember, "Verification");
|
||||
await user.roles.add(guildRole, "Verification");
|
||||
}
|
||||
|
||||
await user.roles.add(defaultMember, "Verification");
|
||||
|
||||
const newVerify = new verify({
|
||||
_id: new mongoose.Types.ObjectId(),
|
||||
userID: user.id,
|
||||
uuid: userUUID
|
||||
});
|
||||
|
||||
await newVerify.save();
|
||||
|
||||
await interaction.editReply({
|
||||
embeds: [
|
||||
{
|
||||
title: interaction.guild.name,
|
||||
description:
|
||||
"You have successfully verified `" +
|
||||
fullUsername +
|
||||
"` with the account `" +
|
||||
hypixelCheck.data.username +
|
||||
"`.",
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: head
|
||||
},
|
||||
footer: {
|
||||
icon_url: interaction.guild.iconURL(),
|
||||
text: interaction.guild.name + " | Developed by Taken#0002"
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,58 +1,66 @@
|
||||
const { SlashCommandBuilder, PermissionFlagsBits, userMention } = require('discord.js');
|
||||
const { color } = require('../config/options.json');
|
||||
const verify = require('../schemas/verifySchema.js');
|
||||
const fetch = require('axios');
|
||||
const {
|
||||
SlashCommandBuilder,
|
||||
PermissionFlagsBits,
|
||||
userMention
|
||||
} = require("discord.js");
|
||||
const { color } = require("../config/options.json");
|
||||
const verify = require("../schemas/verifySchema.js");
|
||||
const fetch = require("axios");
|
||||
|
||||
module.exports = {
|
||||
name: 'whois',
|
||||
description: 'Get\'s the ign of a user.',
|
||||
type: 'slash',
|
||||
name: "whois",
|
||||
description: "Get's the ign of a user.",
|
||||
type: "slash",
|
||||
|
||||
data: new SlashCommandBuilder()
|
||||
.setName('whois')
|
||||
.setDescription('Get\'s the ign of a user.')
|
||||
.addUserOption(option =>
|
||||
option
|
||||
.setName('user')
|
||||
.setDescription('The user to get the ign of.')
|
||||
.setRequired(true))
|
||||
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
|
||||
.setDMPermission(false),
|
||||
data: new SlashCommandBuilder()
|
||||
.setName("whois")
|
||||
.setDescription("Get's the ign of a user.")
|
||||
.addUserOption((option) =>
|
||||
option
|
||||
.setName("user")
|
||||
.setDescription("The user to get the ign of.")
|
||||
.setRequired(true)
|
||||
)
|
||||
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
|
||||
.setDMPermission(false),
|
||||
|
||||
async execute(interaction) {
|
||||
async execute(interaction) {
|
||||
await interaction.deferReply();
|
||||
|
||||
await interaction.deferReply();
|
||||
const user = interaction.options.getUser("user");
|
||||
const embedColor = Number(color.replace("#", "0x"));
|
||||
const mojang = "https://api.mojang.com/user/profile/";
|
||||
const minotar = "https://minotar.net/helm/";
|
||||
|
||||
const user = interaction.options.getUser('user');
|
||||
const embedColor = Number(color.replace("#", "0x"));
|
||||
const mojang = "https://api.mojang.com/user/profile/"
|
||||
const minotar = "https://minotar.net/helm/";
|
||||
|
||||
const verifiedUser = await verify.findOne({ userID: user.id });
|
||||
|
||||
if (!verifiedUser) {
|
||||
interaction.editReply({ content: 'This user has not verified their account.' });
|
||||
return
|
||||
}
|
||||
|
||||
const userCheck = await fetch(mojang + verifiedUser.uuid);
|
||||
const ign = userCheck.data.name;
|
||||
const head = minotar + ign;
|
||||
|
||||
await interaction.editReply({
|
||||
embeds: [{
|
||||
title: interaction.guild.name,
|
||||
description: "**User:** " + userMention(user.id) + "\n**IGN:** " + ign,
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: head
|
||||
},
|
||||
footer: {
|
||||
text: interaction.guild.name + " | Developed by: @Taken#0002",
|
||||
icon_url: interaction.guild.iconURL({ dynamic: true })
|
||||
}
|
||||
}]
|
||||
})
|
||||
const verifiedUser = await verify.findOne({ userID: user.id });
|
||||
|
||||
if (!verifiedUser) {
|
||||
interaction.editReply({
|
||||
content: "This user has not verified their account."
|
||||
});
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
||||
const userCheck = await fetch(mojang + verifiedUser.uuid);
|
||||
const ign = userCheck.data.name;
|
||||
const head = minotar + ign;
|
||||
|
||||
await interaction.editReply({
|
||||
embeds: [
|
||||
{
|
||||
title: interaction.guild.name,
|
||||
description:
|
||||
"**User:** " + userMention(user.id) + "\n**IGN:** " + ign,
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: head
|
||||
},
|
||||
footer: {
|
||||
text: interaction.guild.name + " | Developed by: @Taken#0002",
|
||||
icon_url: interaction.guild.iconURL({ dynamic: true })
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user