Merge branch 'dev' into 'main'
Formatted all files using clang See merge request illegitimate/illegitimate-bot!20
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
const { ContextMenuCommandBuilder, ApplicationCommandType, PermissionFlagsBits, userMention} = require('discord.js');
|
||||
const { ContextMenuCommandBuilder, ApplicationCommandType, PermissionFlagsBits, userMention } = require('discord.js');
|
||||
|
||||
module.exports = {
|
||||
name: 'congratsmessage',
|
||||
@@ -22,7 +22,7 @@ module.exports = {
|
||||
const target = message.author;
|
||||
|
||||
await message.reply({
|
||||
embeds:[{
|
||||
embeds: [{
|
||||
title: 'Congratulations!',
|
||||
description: `GG to ${userMention(target.id)}!`,
|
||||
}]
|
||||
|
||||
@@ -7,63 +7,63 @@ const fetch = require("axios");
|
||||
const { getExactLevel, skywarsLevel, getLevelForExp } = require("../utils/functions.js");
|
||||
|
||||
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) {
|
||||
await interaction.deferReply({});
|
||||
async execute(interaction) {
|
||||
await interaction.deferReply({});
|
||||
|
||||
const ign = interaction.options.getString("ign");
|
||||
const mojang = "https://api.mojang.com/users/profiles/minecraft/";
|
||||
const hypixel = "https://api.hypixel.net/player"
|
||||
const guildAPI = "https://api.hypixel.net/guild"
|
||||
const minotar = "https://minotar.net/helm/";
|
||||
const embedColor = Number(color.replace("#", "0x"));
|
||||
const head = minotar + ign;
|
||||
const ign = interaction.options.getString("ign");
|
||||
const mojang = "https://api.mojang.com/users/profiles/minecraft/";
|
||||
const hypixel = "https://api.hypixel.net/player"
|
||||
const guildAPI = "https://api.hypixel.net/guild"
|
||||
const minotar = "https://minotar.net/helm/";
|
||||
const embedColor = Number(color.replace("#", "0x"));
|
||||
const head = minotar + ign;
|
||||
|
||||
if (!ign) {
|
||||
await interaction.editReply("Please provide a player's IGN.");
|
||||
return;
|
||||
}
|
||||
if (!ign) {
|
||||
await interaction.editReply("Please provide a player's IGN.");
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
await fetch(mojang + ign);
|
||||
} catch (error) {
|
||||
interaction.editReply({
|
||||
embeds: [
|
||||
{ description: "That player doesn't exist.", color: embedColor }
|
||||
]
|
||||
});
|
||||
return;
|
||||
}
|
||||
try {
|
||||
await fetch(mojang + ign);
|
||||
} catch (error) {
|
||||
interaction.editReply({
|
||||
embeds: [
|
||||
{ description: "That player doesn't exist.", color: embedColor }
|
||||
]
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
const userCheck = await fetch(mojang + ign);
|
||||
const uuid = userCheck.data.id;
|
||||
const userCheck = await fetch(mojang + ign);
|
||||
const uuid = userCheck.data.id;
|
||||
|
||||
const player = hypixel + "?key=" + hypixelApiKey + "&uuid=" + uuid
|
||||
const stats = await fetch(player);
|
||||
const player = hypixel + "?key=" + hypixelApiKey + "&uuid=" + uuid
|
||||
const stats = await fetch(player);
|
||||
|
||||
if (!stats.data.player) {
|
||||
interaction.editReply({
|
||||
embeds: [{
|
||||
description: "That player hasn't played Hypixel before.",
|
||||
color: embedColor
|
||||
}]
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (!stats.data.player) {
|
||||
interaction.editReply({
|
||||
embeds: [{
|
||||
description: "That player hasn't played Hypixel before.",
|
||||
color: embedColor
|
||||
}]
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
const rank2 = stats.data.player.newPackageRank;
|
||||
const monthlyRank = stats.data.player.monthlyPackageRank;
|
||||
const rank2 = stats.data.player.newPackageRank;
|
||||
const monthlyRank = stats.data.player.monthlyPackageRank;
|
||||
|
||||
if (rank2 === 'VIP') {
|
||||
var rank = "[VIP] "
|
||||
@@ -77,128 +77,128 @@ module.exports = {
|
||||
var rank = "[MVP++] "
|
||||
}
|
||||
|
||||
const guild = guildAPI + "?key=" + hypixelApiKey + "&player=" + uuid
|
||||
const guildCheck = await fetch(guild);
|
||||
const guild = guildAPI + "?key=" + hypixelApiKey + "&player=" + uuid
|
||||
const guildCheck = await fetch(guild);
|
||||
|
||||
if (!guildCheck.data.guild) {
|
||||
var guildName = "None";
|
||||
} else {
|
||||
var guildName = guildCheck.data.guild.name;
|
||||
}
|
||||
if (!guildCheck.data.guild) {
|
||||
var guildName = "None";
|
||||
} else {
|
||||
var guildName = guildCheck.data.guild.name;
|
||||
}
|
||||
|
||||
if (!guildCheck.data.guild) {
|
||||
var guildTag = ""
|
||||
} else if (!guildCheck.data.guild.tag) {
|
||||
var guildTag = ""
|
||||
} else {
|
||||
var guildTag = " [" + guildCheck.data.guild.tag + "]"
|
||||
}
|
||||
if (!guildCheck.data.guild) {
|
||||
var guildTag = ""
|
||||
} else if (!guildCheck.data.guild.tag) {
|
||||
var guildTag = ""
|
||||
} else {
|
||||
var guildTag = " [" + guildCheck.data.guild.tag + "]"
|
||||
}
|
||||
|
||||
//bedwars level
|
||||
const hsbwexp = stats.data.player.stats.Bedwars.Experience;
|
||||
const hsbwstars = getLevelForExp(hsbwexp);
|
||||
// bedwars fkdr
|
||||
const hsbwfk = stats.data.player.stats.Bedwars.final_kills_bedwars;
|
||||
const hsbwfd = stats.data.player.stats.Bedwars.final_deaths_bedwars;
|
||||
const hsbwfkdr = hsbwfk / hsbwfd;
|
||||
// bedwars wins
|
||||
const hsbwwins = stats.data.player.stats.Bedwars.wins_bedwars;
|
||||
// skywars level
|
||||
const hsswexp = stats.data.player.stats.SkyWars.skywars_experience;
|
||||
const hsswstars = skywarsLevel(hsswexp);
|
||||
// skywars kdr
|
||||
const hsswkills = stats.data.player.stats.SkyWars.kills;
|
||||
const hsswdeaths = stats.data.player.stats.SkyWars.deaths;
|
||||
const hsswkd = hsswkills / hsswdeaths;
|
||||
//skywars wins
|
||||
const hsswwins = stats.data.player.stats.SkyWars.wins;
|
||||
// dueks kdr
|
||||
const hsduelskills = stats.data.player.stats.Duels.kills
|
||||
const hsduelsdeaths = stats.data.player.stats.Duels.deaths
|
||||
const hsduelskd = hsduelskills / hsduelsdeaths
|
||||
// duels wins
|
||||
const hsduelswins = stats.data.player.stats.Duels.wins;
|
||||
// duels wlr
|
||||
const hsduelslosses = stats.data.player.stats.Duels.losses;
|
||||
const hsduelswlr = hsduelswins / hsduelslosses;
|
||||
// network level
|
||||
const hypixelExp = stats.data.player.networkExp;
|
||||
const level = getExactLevel(hypixelExp);
|
||||
//bedwars level
|
||||
const hsbwexp = stats.data.player.stats.Bedwars.Experience;
|
||||
const hsbwstars = getLevelForExp(hsbwexp);
|
||||
// bedwars fkdr
|
||||
const hsbwfk = stats.data.player.stats.Bedwars.final_kills_bedwars;
|
||||
const hsbwfd = stats.data.player.stats.Bedwars.final_deaths_bedwars;
|
||||
const hsbwfkdr = hsbwfk / hsbwfd;
|
||||
// bedwars wins
|
||||
const hsbwwins = stats.data.player.stats.Bedwars.wins_bedwars;
|
||||
// skywars level
|
||||
const hsswexp = stats.data.player.stats.SkyWars.skywars_experience;
|
||||
const hsswstars = skywarsLevel(hsswexp);
|
||||
// skywars kdr
|
||||
const hsswkills = stats.data.player.stats.SkyWars.kills;
|
||||
const hsswdeaths = stats.data.player.stats.SkyWars.deaths;
|
||||
const hsswkd = hsswkills / hsswdeaths;
|
||||
//skywars wins
|
||||
const hsswwins = stats.data.player.stats.SkyWars.wins;
|
||||
// dueks kdr
|
||||
const hsduelskills = stats.data.player.stats.Duels.kills
|
||||
const hsduelsdeaths = stats.data.player.stats.Duels.deaths
|
||||
const hsduelskd = hsduelskills / hsduelsdeaths
|
||||
// duels wins
|
||||
const hsduelswins = stats.data.player.stats.Duels.wins;
|
||||
// duels wlr
|
||||
const hsduelslosses = stats.data.player.stats.Duels.losses;
|
||||
const hsduelswlr = hsduelswins / hsduelslosses;
|
||||
// network level
|
||||
const hypixelExp = stats.data.player.networkExp;
|
||||
const level = getExactLevel(hypixelExp);
|
||||
|
||||
if (hsbwstars < bwstars || hsbwfkdr < bwfkdr || 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 (hsbwstars < bwstars || hsbwfkdr < bwfkdr || 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 (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 || hsduelswlr < duelswlr) {
|
||||
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.";
|
||||
}
|
||||
if (hsduelswins < duelswins || hsduelswlr < duelswlr) {
|
||||
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.";
|
||||
}
|
||||
|
||||
await interaction.editReply({
|
||||
embeds: [{
|
||||
title: rank + stats.data.player.displayname + guildTag,
|
||||
description: "**Network Level:** `" +
|
||||
level.toFixed(2).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:** `" +
|
||||
hsbwstars.toFixed(2).toString() + " / " +
|
||||
bwstars.toString() + "`\n" +
|
||||
"**➺ FKDR:** `" +
|
||||
hsbwfkdr.toFixed(2).toString() +
|
||||
" / " + bwfkdr.toString() + "`\n" +
|
||||
"**➺ Wins:** `" +
|
||||
hsbwwins.toString() + " / " +
|
||||
bwwins.toString() + "`"
|
||||
},
|
||||
{
|
||||
name: swtitle,
|
||||
value:
|
||||
"**➺ Stars:** `" +
|
||||
hsswstars.toFixed(2).toString() +
|
||||
" / " + swstars.toString() + "`\n" +
|
||||
"**➺ KDR:** `" +
|
||||
hsswkd.toFixed(2).toString() +
|
||||
"`\n" +
|
||||
"**➺ Wins:** `" +
|
||||
hsswwins.toString() + "`"
|
||||
},
|
||||
{
|
||||
name: duelstitle,
|
||||
value: "**➺ Wins:** `" +
|
||||
hsduelswins.toString() +
|
||||
" / " + duelswins.toString() + "`\n" +
|
||||
await interaction.editReply({
|
||||
embeds: [{
|
||||
title: rank + stats.data.player.displayname + guildTag,
|
||||
description: "**Network Level:** `" +
|
||||
level.toFixed(2).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:** `" +
|
||||
hsbwstars.toFixed(2).toString() + " / " +
|
||||
bwstars.toString() + "`\n" +
|
||||
"**➺ FKDR:** `" +
|
||||
hsbwfkdr.toFixed(2).toString() +
|
||||
" / " + bwfkdr.toString() + "`\n" +
|
||||
"**➺ Wins:** `" +
|
||||
hsbwwins.toString() + " / " +
|
||||
bwwins.toString() + "`"
|
||||
},
|
||||
{
|
||||
name: swtitle,
|
||||
value:
|
||||
"**➺ Stars:** `" +
|
||||
hsswstars.toFixed(2).toString() +
|
||||
" / " + swstars.toString() + "`\n" +
|
||||
"**➺ KDR:** `" +
|
||||
hsswkd.toFixed(2).toString() +
|
||||
"`\n" +
|
||||
"**➺ Wins:** `" +
|
||||
hsswwins.toString() + "`"
|
||||
},
|
||||
{
|
||||
name: duelstitle,
|
||||
value: "**➺ Wins:** `" +
|
||||
hsduelswins.toString() +
|
||||
" / " + duelswins.toString() + "`\n" +
|
||||
"**➺ WLR:** `" +
|
||||
hsduelswlr.toFixed(2).toString() +
|
||||
hsduelswlr.toFixed(2).toString() +
|
||||
" / " + duelswlr.toString() + "`\n" +
|
||||
"**➺ KDR:** `" +
|
||||
hsduelskd.toFixed(2).toString() + "`"
|
||||
}
|
||||
]
|
||||
}]
|
||||
});
|
||||
}
|
||||
hsduelskd.toFixed(2).toString() + "`"
|
||||
}
|
||||
]
|
||||
}]
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
@@ -2,218 +2,218 @@ const { SlashCommandBuilder, PermissionFlagsBits, ButtonBuilder, ActionRowBuilde
|
||||
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) =>
|
||||
data: new SlashCommandBuilder()
|
||||
.setName("config")
|
||||
.setDescription("Configure the bot.")
|
||||
.addSubcommand((subcommand) =>
|
||||
subcommand
|
||||
.setName("sendverfiymessage")
|
||||
.setDescription("Send the verfiy message to a channel.")
|
||||
.addChannelOption((option) =>
|
||||
.setName("sendguildapplication")
|
||||
.setDescription("Send the application message to a channel.")
|
||||
.addChannelOption((option) =>
|
||||
option
|
||||
.setName("channel")
|
||||
.setDescription("The channel to send the verfiy message to.")
|
||||
.setRequired(true)))
|
||||
.addSubcommand((subcommand) =>
|
||||
.setName("channel")
|
||||
.setDescription("The channel to send the application to.")
|
||||
.setRequired(true))
|
||||
)
|
||||
.addSubcommand((subcommand) =>
|
||||
subcommand
|
||||
.setName("sendwaitinglistmessage")
|
||||
.setDescription("Send the waiting list message to a channel.")
|
||||
.addChannelOption((option) =>
|
||||
.setName("sendstaffapplication")
|
||||
.setDescription("Send the application message to a channel.")
|
||||
.addChannelOption((option) =>
|
||||
option
|
||||
.setName("channel")
|
||||
.setDescription("The channel to send the waiting list message to.")
|
||||
.setRequired(true)))
|
||||
.addSubcommand((subcommand) =>
|
||||
subcommand
|
||||
.setName("sendinactivityapplication")
|
||||
.setDescription("Send the application message to a channel.")
|
||||
.addChannelOption((option) =>
|
||||
option
|
||||
.setName("channel")
|
||||
.setDescription("The channel to send the application to.")
|
||||
.setRequired(true)))
|
||||
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
|
||||
.setDMPermission(false),
|
||||
.setName("channel")
|
||||
.setDescription("The channel to send the application to.")
|
||||
.setRequired(true)))
|
||||
.addSubcommand((subcommand) =>
|
||||
subcommand
|
||||
.setName("sendverfiymessage")
|
||||
.setDescription("Send the verfiy message to a channel.")
|
||||
.addChannelOption((option) =>
|
||||
option
|
||||
.setName("channel")
|
||||
.setDescription("The channel to send the verfiy message to.")
|
||||
.setRequired(true)))
|
||||
.addSubcommand((subcommand) =>
|
||||
subcommand
|
||||
.setName("sendwaitinglistmessage")
|
||||
.setDescription("Send the waiting list message to a channel.")
|
||||
.addChannelOption((option) =>
|
||||
option
|
||||
.setName("channel")
|
||||
.setDescription("The channel to send the waiting list message to.")
|
||||
.setRequired(true)))
|
||||
.addSubcommand((subcommand) =>
|
||||
subcommand
|
||||
.setName("sendinactivityapplication")
|
||||
.setDescription("Send the application message to a channel.")
|
||||
.addChannelOption((option) =>
|
||||
option
|
||||
.setName("channel")
|
||||
.setDescription("The channel to send the application to.")
|
||||
.setRequired(true)))
|
||||
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
|
||||
.setDMPermission(false),
|
||||
|
||||
async execute(interaction) {
|
||||
const user = interaction.user;
|
||||
const guild = interaction.guild;
|
||||
const subcommand = interaction.options.getSubcommand();
|
||||
const embedColor = Number(color.replace("#", "0x"));
|
||||
async execute(interaction) {
|
||||
const user = interaction.user;
|
||||
const guild = interaction.guild;
|
||||
const subcommand = interaction.options.getSubcommand();
|
||||
const embedColor = Number(color.replace("#", "0x"));
|
||||
|
||||
|
||||
if (subcommand === "sendguildapplication") {
|
||||
const channel = interaction.options.getChannel("channel");
|
||||
if (subcommand === "sendguildapplication") {
|
||||
const channel = interaction.options.getChannel("channel");
|
||||
|
||||
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 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 === "sendstaffapplication") {
|
||||
const channel = interaction.options.getChannel("channel");
|
||||
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 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 });
|
||||
}
|
||||
await interaction.reply({ content: "Message sent", ephemeral: true });
|
||||
}
|
||||
|
||||
if (subcommand === "sendinactivityapplication") {
|
||||
const channel = interaction.options.getChannel("channel");
|
||||
if (subcommand === "sendinactivityapplication") {
|
||||
const channel = interaction.options.getChannel("channel");
|
||||
|
||||
await channel.send({
|
||||
embeds: [
|
||||
{
|
||||
title: "Inactivity Log",
|
||||
description: "You can send an inactivity log 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("guildinactivitylog")
|
||||
.setLabel("Submit")
|
||||
.setStyle(ButtonStyle.Primary)
|
||||
.setEmoji({ name: "✅" }))
|
||||
]
|
||||
});
|
||||
await channel.send({
|
||||
embeds: [
|
||||
{
|
||||
title: "Inactivity Log",
|
||||
description: "You can send an inactivity log 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("guildinactivitylog")
|
||||
.setLabel("Submit")
|
||||
.setStyle(ButtonStyle.Primary)
|
||||
.setEmoji({ name: "✅" }))
|
||||
]
|
||||
});
|
||||
|
||||
await interaction.reply({ content: "Message sent", ephemeral: true });
|
||||
}
|
||||
await interaction.reply({ content: "Message sent", ephemeral: true });
|
||||
}
|
||||
|
||||
if (subcommand === "sendverfiymessage") {
|
||||
const channel = interaction.options.getChannel("channel");
|
||||
|
||||
await channel.send({
|
||||
embeds: [{
|
||||
title: "Verification",
|
||||
description: "You can verify 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("verifybutton")
|
||||
.setLabel("Verify")
|
||||
.setStyle(ButtonStyle.Primary)
|
||||
.setEmoji({ name: "✅" }))
|
||||
]
|
||||
});
|
||||
await interaction.reply({ content: "Message sent", ephemeral: true });
|
||||
await channel.send({
|
||||
embeds: [{
|
||||
title: "Verification",
|
||||
description: "You can verify 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("verifybutton")
|
||||
.setLabel("Verify")
|
||||
.setStyle(ButtonStyle.Primary)
|
||||
.setEmoji({ name: "✅" }))
|
||||
]
|
||||
});
|
||||
await interaction.reply({ content: "Message sent", ephemeral: true });
|
||||
|
||||
}
|
||||
|
||||
if (subcommand === "sendwaitinglistmessage") {
|
||||
const channel = interaction.options.getChannel("channel");
|
||||
if (subcommand === "sendwaitinglistmessage") {
|
||||
const channel = interaction.options.getChannel("channel");
|
||||
|
||||
await channel.send({
|
||||
embeds: [{
|
||||
title: "Waiting List",
|
||||
description: "The people below were accepted into the guild\n" +
|
||||
"Try to invite them in order.",
|
||||
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("waitinglistupdate")
|
||||
.setLabel("Update")
|
||||
.setStyle(ButtonStyle.Primary)
|
||||
.setEmoji({ name: "🔄" }))
|
||||
]
|
||||
});
|
||||
await interaction.reply({ content: "Message sent", ephemeral: true });
|
||||
}
|
||||
await channel.send({
|
||||
embeds: [{
|
||||
title: "Waiting List",
|
||||
description: "The people below were accepted into the guild\n" +
|
||||
"Try to invite them in order.",
|
||||
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("waitinglistupdate")
|
||||
.setLabel("Update")
|
||||
.setStyle(ButtonStyle.Primary)
|
||||
.setEmoji({ name: "🔄" }))
|
||||
]
|
||||
});
|
||||
await interaction.reply({ content: "Message sent", ephemeral: true });
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -3,7 +3,7 @@ const { color } = 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 removeThese = [ gm, manager, moderator, beast, member, trialmember, guildRole, guildStaff, defaultMember ]
|
||||
const removeThese = [gm, manager, moderator, beast, member, trialmember, guildRole, guildStaff, defaultMember]
|
||||
|
||||
module.exports = {
|
||||
name: "forceunverify",
|
||||
|
||||
@@ -53,236 +53,236 @@ module.exports = {
|
||||
}
|
||||
|
||||
const mojangAPI = "https://api.mojang.com/user/profile/"
|
||||
const guildlAPI = "https://api.hypixel.net/guild"
|
||||
const guildlAPI = "https://api.hypixel.net/guild"
|
||||
const minotar = "https://minotar.net/helm/";
|
||||
const guild = guildlAPI + "?key=" + hypixelAPIKey + "&player=" + verifyData.uuid;
|
||||
const guild = guildlAPI + "?key=" + hypixelAPIKey + "&player=" + verifyData.uuid;
|
||||
const userCheck = await fetch(mojangAPI + verifyData.uuid);
|
||||
const guildCheck = await fetch(guild);
|
||||
const head = minotar + userCheck.data.name;
|
||||
|
||||
if (!guildCheck.data.guild) {
|
||||
var responseGuildID = null
|
||||
} else {
|
||||
var responseGuildID = guildCheck.data.guild._id
|
||||
}
|
||||
if (!guildCheck.data.guild) {
|
||||
var responseGuildID = null
|
||||
} else {
|
||||
var responseGuildID = guildCheck.data.guild._id
|
||||
}
|
||||
|
||||
if (responseGuildID !== hypixelGuildID) {
|
||||
|
||||
for (let i = 0; i < removeThese.length; i++) {
|
||||
await roleManage.remove(removeThese[i], "Auto role removal. (Force Update)")
|
||||
}
|
||||
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
|
||||
}
|
||||
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
|
||||
}
|
||||
|
||||
if (responseGuildID === hypixelGuildID) {
|
||||
if (responseGuildID === hypixelGuildID) {
|
||||
|
||||
const GuildMembers = guildCheck.data.guild.members;
|
||||
const guildRank = GuildMembers.find(member => member.uuid === verifyData.uuid).rank;
|
||||
const GuildMembers = guildCheck.data.guild.members;
|
||||
const guildRank = GuildMembers.find(member => member.uuid === verifyData.uuid).rank;
|
||||
|
||||
if (guildRank === 'Guild Master') {
|
||||
if (guildRank === 'Guild Master') {
|
||||
|
||||
for (let i = 0; i < removeThese.length; i++) {
|
||||
await roleManage.remove(removeThese[i], "Auto role removal. (Force Update)")
|
||||
}
|
||||
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 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 })
|
||||
}
|
||||
}]
|
||||
})
|
||||
}
|
||||
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') {
|
||||
if (guildRank === 'Manager') {
|
||||
|
||||
for (let i = 0; i < removeThese.length; i++) {
|
||||
await roleManage.remove(removeThese[i], "Auto role removal. (Force Update)")
|
||||
}
|
||||
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 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 })
|
||||
}
|
||||
}]
|
||||
})
|
||||
}
|
||||
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') {
|
||||
if (guildRank === 'Moderator') {
|
||||
|
||||
for (let i = 0; i < removeThese.length; i++) {
|
||||
await roleManage.remove(removeThese[i], "Auto role removal. (Force Update)")
|
||||
}
|
||||
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 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 })
|
||||
}
|
||||
}]
|
||||
})
|
||||
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') {
|
||||
if (guildRank === 'Beast') {
|
||||
|
||||
for (let i = 0; i < removeThese.length; i++) {
|
||||
await roleManage.remove(removeThese[i], "Auto role removal. (Force Update)")
|
||||
}
|
||||
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 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
|
||||
}
|
||||
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 === 'Elite') {
|
||||
if (guildRank === 'Elite') {
|
||||
|
||||
for (let i = 0; i < removeThese.length; i++) {
|
||||
await roleManage.remove(removeThese[i], "Auto role removal. (Force Update)")
|
||||
}
|
||||
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(elite, "User was force updated.")
|
||||
await roleManage.add(defaultMember, "User was force updated.")
|
||||
await roleManage.add(guildRole, "User was force updated.")
|
||||
await roleManage.add(elite, "User was force updated.")
|
||||
await roleManage.add(defaultMember, "User was force updated.")
|
||||
|
||||
|
||||
await interaction.editReply({
|
||||
embeds: [{
|
||||
description: usermentioned + "'s rank has been updated to `Elite`.",
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: head
|
||||
},
|
||||
footer: {
|
||||
text: interaction.guild.name + " | Developed by @Taken#0002",
|
||||
icon_url: interaction.guild.iconURL({ dynamic: true })
|
||||
}
|
||||
}]
|
||||
})
|
||||
return
|
||||
}
|
||||
await interaction.editReply({
|
||||
embeds: [{
|
||||
description: usermentioned + "'s rank has been updated to `Elite`.",
|
||||
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') {
|
||||
if (guildRank === 'Member') {
|
||||
|
||||
for (let i = 0; i < removeThese.length; i++) {
|
||||
await roleManage.remove(removeThese[i], "Auto role removal. (Force Update)")
|
||||
}
|
||||
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 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
|
||||
}
|
||||
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') {
|
||||
if (guildRank === 'Trial Member') {
|
||||
|
||||
for (let i = 0; i < removeThese.length; i++) {
|
||||
await roleManage.remove(removeThese[i], "Auto role removal. (Force Update)")
|
||||
}
|
||||
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 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 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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,7 +4,7 @@ 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 { mongoose } = require('mongoose');
|
||||
const { gm, manager, moderator, beast, elite, member, trialmember, guildRole, guildStaff, defaultMember } = require('../config/roles.json');
|
||||
|
||||
|
||||
@@ -90,7 +90,7 @@ module.exports = {
|
||||
|
||||
const hypixelCheck = await fetch(player);
|
||||
|
||||
if (!hypixelCheck.data.player) {
|
||||
if (!hypixelCheck.data.player) {
|
||||
interaction.editReply({
|
||||
embeds: [{
|
||||
description: "<a:questionmark_pink:1130206038008803488> That player hasn't played Hypixel before.",
|
||||
@@ -98,7 +98,7 @@ module.exports = {
|
||||
}]
|
||||
});
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
const guildCheck = await fetch(guild)
|
||||
|
||||
@@ -109,47 +109,47 @@ module.exports = {
|
||||
}
|
||||
|
||||
if (responseGuildID === hypixelGuildID) {
|
||||
const GuildMembers = guildCheck.data.guild.members;
|
||||
const guildRank = GuildMembers.find(member => member.uuid === hypixelCheck.data.player.uuid).rank;
|
||||
const GuildMembers = guildCheck.data.guild.members;
|
||||
const guildRank = GuildMembers.find(member => member.uuid === hypixelCheck.data.player.uuid).rank;
|
||||
|
||||
if (guildRank === "Guild Master") {
|
||||
await user.roles.add(gm, "User was force verified by " + modName);
|
||||
await user.roles.add(guildRole, "User was force verified by " + modName)
|
||||
await user.roles.add(guildStaff, "User was force verified by " + modName)
|
||||
}
|
||||
if (guildRank === "Guild Master") {
|
||||
await user.roles.add(gm, "User was force verified by " + modName);
|
||||
await user.roles.add(guildRole, "User was force verified by " + modName)
|
||||
await user.roles.add(guildStaff, "User was force verified by " + modName)
|
||||
}
|
||||
|
||||
if (guildRank === "Manager") {
|
||||
await user.roles.add(manager, "User was force verified by " + modName);
|
||||
await user.roles.add(guildRole, "User was force verified by " + modName)
|
||||
await user.roles.add(guildStaff, "User was force verified by " + modName)
|
||||
}
|
||||
if (guildRank === "Manager") {
|
||||
await user.roles.add(manager, "User was force verified by " + modName);
|
||||
await user.roles.add(guildRole, "User was force verified by " + modName)
|
||||
await user.roles.add(guildStaff, "User was force verified by " + modName)
|
||||
}
|
||||
|
||||
if (guildRank === "Moderator") {
|
||||
await user.roles.add(moderator, "User was force verified by " + modName);
|
||||
await user.roles.add(guildRole, "User was force verified by " + modName)
|
||||
await user.roles.add(guildStaff, "User was force verified by " + modName)
|
||||
}
|
||||
if (guildRank === "Moderator") {
|
||||
await user.roles.add(moderator, "User was force verified by " + modName);
|
||||
await user.roles.add(guildRole, "User was force verified by " + modName)
|
||||
await user.roles.add(guildStaff, "User was force verified by " + modName)
|
||||
}
|
||||
|
||||
if (guildRank === "Beast") {
|
||||
await user.roles.add(beast, "User was force verified by " + modName);
|
||||
await user.roles.add(guildRole, "User was force verified by " + modName)
|
||||
}
|
||||
if (guildRank === "Beast") {
|
||||
await user.roles.add(beast, "User was force verified by " + modName);
|
||||
await user.roles.add(guildRole, "User was force verified by " + modName)
|
||||
}
|
||||
|
||||
if (guildRank === "Elite") {
|
||||
await user.roles.add(elite, "User was force verified by " + modName);
|
||||
await user.roles.add(guildRole, "User was force verified by " + modName)
|
||||
}
|
||||
if (guildRank === "Elite") {
|
||||
await user.roles.add(elite, "User was force verified by " + modName);
|
||||
await user.roles.add(guildRole, "User was force verified by " + modName)
|
||||
}
|
||||
|
||||
if (guildRank === "Member") {
|
||||
await user.roles.add(member, "User was force verified by " + modName);
|
||||
await user.roles.add(guildRole, "User was force verified by " + modName)
|
||||
}
|
||||
if (guildRank === "Member") {
|
||||
await user.roles.add(member, "User was force verified by " + modName);
|
||||
await user.roles.add(guildRole, "User was force verified by " + modName)
|
||||
}
|
||||
|
||||
if (guildRank === "Trial Member") {
|
||||
await user.roles.add(trialmember, "User was force verified by " + modName);
|
||||
await user.roles.add(guildRole, "User was force verified by " + modName)
|
||||
}
|
||||
}
|
||||
if (guildRank === "Trial Member") {
|
||||
await user.roles.add(trialmember, "User was force verified by " + modName);
|
||||
await user.roles.add(guildRole, "User was force verified by " + modName)
|
||||
}
|
||||
}
|
||||
|
||||
await user.roles.add(defaultMember, "User was force verified by " + modName);
|
||||
|
||||
|
||||
@@ -28,8 +28,8 @@ module.exports = {
|
||||
{
|
||||
name: '**Bedwars**',
|
||||
value: '**Stars:** `' + bwstars.toString() +
|
||||
'`\n**Wins:** `' + bwwins.toString() +
|
||||
'`\n**FKDR:** `' + bwfkdr.toString() + '`'
|
||||
'`\n**Wins:** `' + bwwins.toString() +
|
||||
'`\n**FKDR:** `' + bwfkdr.toString() + '`'
|
||||
},
|
||||
{
|
||||
name: '**Skywars**',
|
||||
@@ -38,7 +38,7 @@ module.exports = {
|
||||
{
|
||||
name: '**Duels**',
|
||||
value: '**Wins:** `' + duelswins.toString() +
|
||||
'`\n**WLR:** `' + duelswlr.toString() + '`'
|
||||
'`\n**WLR:** `' + duelswlr.toString() + '`'
|
||||
}
|
||||
],
|
||||
footer: {
|
||||
|
||||
@@ -13,9 +13,9 @@ module.exports = {
|
||||
type: 'slash',
|
||||
|
||||
data: new SlashCommandBuilder()
|
||||
.setName('update')
|
||||
.setDescription('Update your guild rank.')
|
||||
.setDMPermission(false),
|
||||
.setName('update')
|
||||
.setDescription('Update your guild rank.')
|
||||
.setDMPermission(false),
|
||||
|
||||
async execute(interaction) {
|
||||
|
||||
@@ -82,200 +82,200 @@ module.exports = {
|
||||
return
|
||||
}
|
||||
|
||||
if (guildID === hypixelGuildID) {
|
||||
if (guildID === hypixelGuildID) {
|
||||
|
||||
const GuildMembers = guildCheck.data.guild.members;
|
||||
const guildRank = GuildMembers.find(member => member.uuid === verifyData.uuid).rank;
|
||||
const GuildMembers = guildCheck.data.guild.members;
|
||||
const guildRank = GuildMembers.find(member => member.uuid === verifyData.uuid).rank;
|
||||
|
||||
if (guildRank === 'Guild Master') {
|
||||
if (guildRank === 'Guild Master') {
|
||||
|
||||
for (let i = 0; i < removeThese.length; i++) {
|
||||
await roleManage.remove(removeThese[i], "Auto role removal. (Update)")
|
||||
}
|
||||
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 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 })
|
||||
}
|
||||
}]
|
||||
})
|
||||
}
|
||||
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') {
|
||||
if (guildRank === 'Manager') {
|
||||
|
||||
for (let i = 0; i < removeThese.length; i++) {
|
||||
await roleManage.remove(removeThese[i], "Auto role removal. (Update)")
|
||||
}
|
||||
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 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 })
|
||||
}
|
||||
}]
|
||||
})
|
||||
}
|
||||
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') {
|
||||
if (guildRank === 'Moderator') {
|
||||
|
||||
for (let i = 0; i < removeThese.length; i++) {
|
||||
await roleManage.remove(removeThese[i], "Auto role removal. (Update)")
|
||||
}
|
||||
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 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 })
|
||||
}
|
||||
}]
|
||||
})
|
||||
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') {
|
||||
if (guildRank === 'Beast') {
|
||||
|
||||
for (let i = 0; i < removeThese.length; i++) {
|
||||
await roleManage.remove(removeThese[i], "Auto role removal. (Update)")
|
||||
}
|
||||
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 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
|
||||
}
|
||||
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 === 'Elite') {
|
||||
if (guildRank === 'Elite') {
|
||||
|
||||
for (let i = 0; i < removeThese.length; i++) {
|
||||
await roleManage.remove(removeThese[i], "Auto role removal. (Update)")
|
||||
}
|
||||
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(elite, "User used the update command")
|
||||
await roleManage.add(defaultMember, "User used the update command")
|
||||
await roleManage.add(guildRole, "User used the update command")
|
||||
await roleManage.add(elite, "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 `Elite`.",
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: head
|
||||
},
|
||||
footer: {
|
||||
text: interaction.guild.name + " | Developed by @Taken#0002",
|
||||
icon_url: interaction.guild.iconURL({ dynamic: true })
|
||||
}
|
||||
}]
|
||||
})
|
||||
return
|
||||
}
|
||||
await interaction.editReply({
|
||||
embeds: [{
|
||||
description: "Your rank has been updated to `Elite`.",
|
||||
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') {
|
||||
if (guildRank === 'Member') {
|
||||
|
||||
for (let i = 0; i < removeThese.length; i++) {
|
||||
await roleManage.remove(removeThese[i], "Auto role removal. (Update)")
|
||||
}
|
||||
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 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
|
||||
}
|
||||
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') {
|
||||
if (guildRank === 'Trial Member') {
|
||||
|
||||
for (let i = 0; i < removeThese.length; i++) {
|
||||
await roleManage.remove(removeThese[i], "Auto role removal. (Update)")
|
||||
}
|
||||
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 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
|
||||
}
|
||||
}
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -98,7 +98,7 @@ module.exports = {
|
||||
return;
|
||||
}
|
||||
|
||||
const linkedDiscord = stats.data.player.socialMedia.links.DISCORD
|
||||
const linkedDiscord = stats.data.player.socialMedia.links.DISCORD
|
||||
|
||||
if (linkedDiscord !== username) {
|
||||
interaction.editReply({
|
||||
@@ -122,48 +122,48 @@ module.exports = {
|
||||
var guildID = guildCheck.data.guild._id
|
||||
}
|
||||
|
||||
if (guildID === hypixelGuildID) {
|
||||
const GuildMembers = guildCheck.data.guild.members
|
||||
const guildRank = GuildMembers.find((member) => member.uuid === stats.data.player.uuid).rank;
|
||||
if (guildID === hypixelGuildID) {
|
||||
const GuildMembers = guildCheck.data.guild.members
|
||||
const guildRank = GuildMembers.find((member) => member.uuid === stats.data.player.uuid).rank;
|
||||
|
||||
if (guildRank === "Guild Master" && guildID === hypixelGuildID) {
|
||||
await user.roles.add(gm, "Verification");
|
||||
await user.roles.add(guildRole, "Verification");
|
||||
await user.roles.add(guildStaff, "Verification");
|
||||
}
|
||||
if (guildRank === "Guild Master" && guildID === hypixelGuildID) {
|
||||
await user.roles.add(gm, "Verification");
|
||||
await user.roles.add(guildRole, "Verification");
|
||||
await user.roles.add(guildStaff, "Verification");
|
||||
}
|
||||
|
||||
if (guildRank === "Manager" && guildID === hypixelGuildID) {
|
||||
await user.roles.add(manager, "Verification");
|
||||
await user.roles.add(guildRole, "Verification");
|
||||
await user.roles.add(guildStaff, "Verification");
|
||||
}
|
||||
if (guildRank === "Manager" && guildID === hypixelGuildID) {
|
||||
await user.roles.add(manager, "Verification");
|
||||
await user.roles.add(guildRole, "Verification");
|
||||
await user.roles.add(guildStaff, "Verification");
|
||||
}
|
||||
|
||||
if (guildRank === "Moderator" && guildID === hypixelGuildID) {
|
||||
await user.roles.add(moderator, "Verification");
|
||||
await user.roles.add(guildRole, "Verification");
|
||||
await user.roles.add(guildStaff, "Verification");
|
||||
}
|
||||
if (guildRank === "Moderator" && guildID === hypixelGuildID) {
|
||||
await user.roles.add(moderator, "Verification");
|
||||
await user.roles.add(guildRole, "Verification");
|
||||
await user.roles.add(guildStaff, "Verification");
|
||||
}
|
||||
|
||||
if (guildRank === "Beast" && guildID === hypixelGuildID) {
|
||||
await user.roles.add(beast, "Verification");
|
||||
await user.roles.add(guildRole, "Verification");
|
||||
}
|
||||
if (guildRank === "Beast" && guildID === hypixelGuildID) {
|
||||
await user.roles.add(beast, "Verification");
|
||||
await user.roles.add(guildRole, "Verification");
|
||||
}
|
||||
|
||||
if (guildRank === "Elite" && guildID === hypixelGuildID) {
|
||||
await user.roles.add(elite, "Verification");
|
||||
await user.roles.add(guildRole, "Verification");
|
||||
}
|
||||
if (guildRank === "Elite" && guildID === hypixelGuildID) {
|
||||
await user.roles.add(elite, "Verification");
|
||||
await user.roles.add(guildRole, "Verification");
|
||||
}
|
||||
|
||||
if (guildRank === "Member" && guildID === hypixelGuildID) {
|
||||
await user.roles.add(member, "Verification");
|
||||
await user.roles.add(guildRole, "Verification");
|
||||
}
|
||||
if (guildRank === "Member" && guildID === hypixelGuildID) {
|
||||
await user.roles.add(member, "Verification");
|
||||
await user.roles.add(guildRole, "Verification");
|
||||
}
|
||||
|
||||
if (guildRank === "Trial Member" && guildID === hypixelGuildID) {
|
||||
await user.roles.add(trialmember, "Verification");
|
||||
await user.roles.add(guildRole, "Verification");
|
||||
}
|
||||
}
|
||||
if (guildRank === "Trial Member" && guildID === hypixelGuildID) {
|
||||
await user.roles.add(trialmember, "Verification");
|
||||
await user.roles.add(guildRole, "Verification");
|
||||
}
|
||||
}
|
||||
|
||||
await user.roles.add(defaultMember, "Verification");
|
||||
|
||||
|
||||
@@ -130,8 +130,8 @@ module.exports = {
|
||||
embeds: [{
|
||||
title: rank + stats.data.player.displayname + guildTag,
|
||||
description: "**Network Level:** `" +
|
||||
level.toFixed(2).toString() + "`\n" +
|
||||
"**Current Guild:** `" + guildName + "`",
|
||||
level.toFixed(2).toString() + "`\n" +
|
||||
"**Current Guild:** `" + guildName + "`",
|
||||
color: embedColor,
|
||||
thumbnail: { url: head },
|
||||
footer: {
|
||||
@@ -142,36 +142,36 @@ module.exports = {
|
||||
{
|
||||
name: bwtitle,
|
||||
value: "**➺ Stars:** `" +
|
||||
hsbwstars.toFixed(2).toString() + " / " +
|
||||
bwstars.toString() + "`\n" +
|
||||
"**➺ FKDR:** `" +
|
||||
hsbwfkdr.toFixed(2).toString() +
|
||||
" / " + bwfkdr.toString() + "`\n" +
|
||||
"**➺ Wins:** `" +
|
||||
hsbwwins.toString() + " / " +
|
||||
bwwins.toString() + "`"
|
||||
hsbwstars.toFixed(2).toString() + " / " +
|
||||
bwstars.toString() + "`\n" +
|
||||
"**➺ FKDR:** `" +
|
||||
hsbwfkdr.toFixed(2).toString() +
|
||||
" / " + bwfkdr.toString() + "`\n" +
|
||||
"**➺ Wins:** `" +
|
||||
hsbwwins.toString() + " / " +
|
||||
bwwins.toString() + "`"
|
||||
},
|
||||
{
|
||||
name: swtitle,
|
||||
value:
|
||||
"**➺ Stars:** `" +
|
||||
hsswstars.toFixed(2).toString() +
|
||||
" / " + swstars.toString() + "`\n" +
|
||||
"**➺ KDR:** `" +
|
||||
hsswkd.toFixed(2).toString() + "`\n" +
|
||||
"**➺ Wins:** `" +
|
||||
hsswwins.toString() + "`"
|
||||
"**➺ Stars:** `" +
|
||||
hsswstars.toFixed(2).toString() +
|
||||
" / " + swstars.toString() + "`\n" +
|
||||
"**➺ KDR:** `" +
|
||||
hsswkd.toFixed(2).toString() + "`\n" +
|
||||
"**➺ Wins:** `" +
|
||||
hsswwins.toString() + "`"
|
||||
},
|
||||
{
|
||||
name: duelstitle,
|
||||
value: "**➺ Wins:** `" +
|
||||
hsduelswins.toString() +
|
||||
" / " + duelswins.toString() + "`\n" +
|
||||
"**➺ WLR:** `" +
|
||||
hsduelswlr.toFixed(2).toString() +
|
||||
" / " + duelswlr.toString() + "`\n" +
|
||||
"**➺ KDR:** `" +
|
||||
hsduelskd.toFixed(2).toString() + "`"
|
||||
hsduelswins.toString() +
|
||||
" / " + duelswins.toString() + "`\n" +
|
||||
"**➺ WLR:** `" +
|
||||
hsduelswlr.toFixed(2).toString() +
|
||||
" / " + duelswlr.toString() + "`\n" +
|
||||
"**➺ KDR:** `" +
|
||||
hsduelskd.toFixed(2).toString() + "`"
|
||||
}
|
||||
]
|
||||
}]
|
||||
|
||||
@@ -55,10 +55,10 @@ module.exports = {
|
||||
embeds: [{
|
||||
title: 'Guild Application',
|
||||
description: "Please answer the following questions to apply for the guild.\n" +
|
||||
"If you wish to cancel your application, please press type `cancel` at any time.\n" +
|
||||
"If you wish to proceed with your application, please type `yes`.\n\n" +
|
||||
"**Do not upload images, videos, or GIFS.**\n" +
|
||||
"You have a minute to respond to this message.",
|
||||
"If you wish to cancel your application, please press type `cancel` at any time.\n" +
|
||||
"If you wish to proceed with your application, please type `yes`.\n\n" +
|
||||
"**Do not upload images, videos, or GIFS.**\n" +
|
||||
"You have a minute to respond to this message.",
|
||||
color: embedColor,
|
||||
}]
|
||||
})
|
||||
@@ -67,7 +67,7 @@ module.exports = {
|
||||
return
|
||||
}
|
||||
|
||||
await interaction.editReply({ content: "Please check your DMs.", ephemeral: true})
|
||||
await interaction.editReply({ content: "Please check your DMs.", ephemeral: true })
|
||||
|
||||
|
||||
const input = await user.dmChannel.awaitMessages({
|
||||
@@ -84,17 +84,17 @@ module.exports = {
|
||||
return
|
||||
}
|
||||
if (input.first().content.toLowerCase() !== 'yes') {
|
||||
await user.send({ embeds: [cancelled]} );
|
||||
await user.send({ embeds: [cancelled] });
|
||||
return
|
||||
}
|
||||
|
||||
// first question
|
||||
const question1 = await user.send({
|
||||
embeds: [{
|
||||
title : "**Question 1**",
|
||||
title: "**Question 1**",
|
||||
description: qu1 + "\n\nPlease type your answer below or type `cancel` to cancel your application.\n`" + ignM + "`",
|
||||
color: embedColor,
|
||||
footer:{
|
||||
footer: {
|
||||
text: "You have 5 minutes to respond to this message."
|
||||
}
|
||||
}]
|
||||
@@ -123,7 +123,7 @@ module.exports = {
|
||||
await user.send({
|
||||
embeds: [{
|
||||
description: "That is not a valid Minecraft username.\n" +
|
||||
"Application cancelled.",
|
||||
"Application cancelled.",
|
||||
color: embedColor
|
||||
}]
|
||||
})
|
||||
@@ -142,10 +142,10 @@ module.exports = {
|
||||
// second question
|
||||
const question2 = await user.send({
|
||||
embeds: [{
|
||||
title : "**Question 2**",
|
||||
title: "**Question 2**",
|
||||
description: qu2 + "\n\nPlease type your answer below or type `cancel` to cancel your application.\n" + "`(8 characters max)`",
|
||||
color: embedColor,
|
||||
footer:{
|
||||
footer: {
|
||||
text: "You have 15 minutes to respond to this message."
|
||||
}
|
||||
}]
|
||||
@@ -181,10 +181,10 @@ module.exports = {
|
||||
// third question
|
||||
const question3 = await user.send({
|
||||
embeds: [{
|
||||
title : "**Question 3**",
|
||||
title: "**Question 3**",
|
||||
description: qu3 + "\n\nPlease type your answer below or type `cancel` to cancel your application.\n`" + smallM + "`",
|
||||
color: embedColor,
|
||||
footer:{
|
||||
footer: {
|
||||
text: "You have 15 minutes to respond to this message."
|
||||
}
|
||||
}]
|
||||
@@ -219,11 +219,11 @@ module.exports = {
|
||||
// fourth question
|
||||
const question4 = await user.send({
|
||||
embeds: [{
|
||||
title : "**Question 4**",
|
||||
title: "**Question 4**",
|
||||
description: qu4 + "\n\nPlease type your answer below or type `cancel` to cancel your application." +
|
||||
" `(We expect a longer answer.)`\n`" + largeM + "`",
|
||||
" `(We expect a longer answer.)`\n`" + largeM + "`",
|
||||
color: embedColor,
|
||||
footer:{
|
||||
footer: {
|
||||
text: "You have 15 minutes to respond to this message."
|
||||
}
|
||||
}]
|
||||
@@ -258,10 +258,10 @@ module.exports = {
|
||||
// fifth question
|
||||
const question5 = await user.send({
|
||||
embeds: [{
|
||||
title : "**Question 5**",
|
||||
title: "**Question 5**",
|
||||
description: qu5 + "\n\nPlease type your answer below or type `cancel` to cancel your application.\n`" + smallM + "`",
|
||||
color: embedColor,
|
||||
footer:{
|
||||
footer: {
|
||||
text: "You have 15 minutes to respond to this message."
|
||||
}
|
||||
}]
|
||||
@@ -296,10 +296,10 @@ module.exports = {
|
||||
// sixth question
|
||||
const question6 = await user.send({
|
||||
embeds: [{
|
||||
title : "**Question 6**",
|
||||
title: "**Question 6**",
|
||||
description: qu6 + "\n\nPlease type your answer below or type `cancel` to cancel your application.\n`" + largeM + "`",
|
||||
color: embedColor,
|
||||
footer:{
|
||||
footer: {
|
||||
text: "You have 15 minutes to respond to this message."
|
||||
}
|
||||
}]
|
||||
@@ -334,10 +334,10 @@ module.exports = {
|
||||
// seventh question
|
||||
const question7 = await user.send({
|
||||
embeds: [{
|
||||
title : "**Question 7**",
|
||||
title: "**Question 7**",
|
||||
description: qu7 + "\n\nPlease type your answer below or type `cancel` to cancel your application.\n`" + smallM + "`",
|
||||
color: embedColor,
|
||||
footer:{
|
||||
footer: {
|
||||
text: "You have 15 minutes to respond to this message."
|
||||
}
|
||||
}]
|
||||
@@ -372,10 +372,10 @@ module.exports = {
|
||||
// eighth question
|
||||
const question8 = await user.send({
|
||||
embeds: [{
|
||||
title : "**Question 8**",
|
||||
title: "**Question 8**",
|
||||
description: qu8 + "\n\nPlease type your answer below or type `cancel` to cancel your application.\n" + "`(64 characters max)`",
|
||||
color: embedColor,
|
||||
footer:{
|
||||
footer: {
|
||||
text: "You have 15 minutes to respond to this message."
|
||||
}
|
||||
}]
|
||||
@@ -428,7 +428,7 @@ module.exports = {
|
||||
return
|
||||
}
|
||||
if (final.first().content.toLowerCase() !== 'yes') {
|
||||
await user.send({ embeds: [cancelled]} );
|
||||
await user.send({ embeds: [cancelled] });
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ module.exports = {
|
||||
|
||||
await applicant.send({
|
||||
embeds: [{
|
||||
description: `Your application for the Illegitimate guild has been accepted.`,
|
||||
description: `Your application for the Illegitimate guild has been accepted.`,
|
||||
color: embedColor
|
||||
}]
|
||||
});
|
||||
|
||||
@@ -6,278 +6,266 @@ const { color, inactivityLogChannel } = require("../../config/options.json");
|
||||
const guildRoles = [gm, manager, moderator, beast, member, trialmember, guildStaff, guildRole];
|
||||
|
||||
module.exports = {
|
||||
name: "guildinactivitylog",
|
||||
description: "Configure the bot.",
|
||||
type: "button",
|
||||
name: "guildinactivitylog",
|
||||
description: "Configure the bot.",
|
||||
type: "button",
|
||||
|
||||
async execute(interaction) {
|
||||
const guild = interaction.guild;
|
||||
const user = interaction.user;
|
||||
const embedColor = Number(color.replace("#", "0x"));
|
||||
const userRoles = guild.members.cache.get(user.id).roles.cache;
|
||||
const mojangAPI = "https://api.mojang.com/users/profiles/minecraft/";
|
||||
async execute(interaction) {
|
||||
const guild = interaction.guild;
|
||||
const user = interaction.user;
|
||||
const embedColor = Number(color.replace("#", "0x"));
|
||||
const userRoles = guild.members.cache.get(user.id).roles.cache;
|
||||
const mojangAPI = "https://api.mojang.com/users/profiles/minecraft/";
|
||||
|
||||
if (!userRoles.some((role) => guildRoles.includes(role.id))) {
|
||||
return await interaction.reply({
|
||||
content: "Only guild members can use this button.",
|
||||
ephemeral: true
|
||||
});
|
||||
}
|
||||
if (!userRoles.some((role) => guildRoles.includes(role.id))) {
|
||||
return await interaction.reply({
|
||||
content: "Only guild members can use this button.",
|
||||
ephemeral: true
|
||||
});
|
||||
}
|
||||
|
||||
const tooLong = new EmbedBuilder()
|
||||
.setDescription("You took too long to respond.")
|
||||
.setColor(embedColor);
|
||||
const cancelled = new EmbedBuilder()
|
||||
.setDescription("You have cancelled your application.")
|
||||
.setColor(embedColor);
|
||||
const attachments = new EmbedBuilder()
|
||||
.setDescription("You have uploaded an attachment. Please do not upload images, videos, or GIFS.")
|
||||
.setColor(embedColor);
|
||||
const tooLong = new EmbedBuilder()
|
||||
.setDescription("You took too long to respond.")
|
||||
.setColor(embedColor);
|
||||
const cancelled = new EmbedBuilder()
|
||||
.setDescription("You have cancelled your application.")
|
||||
.setColor(embedColor);
|
||||
const attachments = new EmbedBuilder()
|
||||
.setDescription("You have uploaded an attachment. Please do not upload images, videos, or GIFS.")
|
||||
.setColor(embedColor);
|
||||
|
||||
try {
|
||||
await user.send({
|
||||
embeds: [
|
||||
{
|
||||
title: "Guild Inactivity Log",
|
||||
description: "Please answer the following questions to submit an inactivity log for the guild.\n" +
|
||||
"If you wish to cancel your form, please press type `cancel` at any time.\n" +
|
||||
"If you wish to proceed with your form, please type `yes`.\n\n" + "**Do not upload images, videos, or GIFS.**\n" +
|
||||
"You have a minute to respond to this message.",
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
});
|
||||
} catch (error) {
|
||||
return await interaction.reply({ content: "Please enable your DMs.", ephemeral: true });
|
||||
}
|
||||
try {
|
||||
await user.send({
|
||||
embeds: [{
|
||||
title: "Guild Inactivity Log",
|
||||
description: "Please answer the following questions to submit an inactivity log for the guild.\n" +
|
||||
"If you wish to cancel your form, please press type `cancel` at any time.\n" +
|
||||
"If you wish to proceed with your form, please type `yes`.\n\n" + "**Do not upload images, videos, or GIFS.**\n" +
|
||||
"You have a minute to respond to this message.",
|
||||
color: embedColor
|
||||
}]
|
||||
});
|
||||
} catch (error) {
|
||||
return await interaction.reply({ content: "Please enable your DMs.", ephemeral: true });
|
||||
}
|
||||
|
||||
await interaction.reply({ content: "Please check your DMs.", ephemeral: true });
|
||||
await interaction.reply({ content: "Please check your DMs.", ephemeral: true });
|
||||
|
||||
const input = await user.dmChannel.awaitMessages({
|
||||
filter: (m) => m.author.id === user.id,
|
||||
max: 1,
|
||||
time: 1000 * 60
|
||||
});
|
||||
if (input.first().attachments.size > 0) {
|
||||
await user.send({ embeds: [attachments] });
|
||||
return;
|
||||
}
|
||||
if (input.size === 0) {
|
||||
await user.send({ embeds: [tooLong] });
|
||||
return;
|
||||
}
|
||||
if (input.first().content.toLowerCase() !== "yes") {
|
||||
await user.send({ embeds: [cancelled] });
|
||||
return;
|
||||
}
|
||||
const input = await user.dmChannel.awaitMessages({
|
||||
filter: (m) => m.author.id === user.id,
|
||||
max: 1,
|
||||
time: 1000 * 60
|
||||
});
|
||||
if (input.first().attachments.size > 0) {
|
||||
await user.send({ embeds: [attachments] });
|
||||
return;
|
||||
}
|
||||
if (input.size === 0) {
|
||||
await user.send({ embeds: [tooLong] });
|
||||
return;
|
||||
}
|
||||
if (input.first().content.toLowerCase() !== "yes") {
|
||||
await user.send({ embeds: [cancelled] });
|
||||
return;
|
||||
}
|
||||
|
||||
await user.send({
|
||||
embeds: [
|
||||
{
|
||||
title: "**Question 1**",
|
||||
description: ia1 + "\n\nPlease type your answer below or type `cancel` to cancel your application.\n`" + ignM + "`",
|
||||
color: embedColor,
|
||||
footer: {
|
||||
text: "You have 5 minutes to respond to this message."
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
await user.send({
|
||||
embeds: [{
|
||||
title: "**Question 1**",
|
||||
description: ia1 + "\n\nPlease type your answer below or type `cancel` to cancel your application.\n`" + ignM + "`",
|
||||
color: embedColor,
|
||||
footer: {
|
||||
text: "You have 5 minutes to respond to this message."
|
||||
}
|
||||
}]
|
||||
});
|
||||
|
||||
const answer1 = await user.dmChannel.awaitMessages({
|
||||
filter: (m) => m.author.id === user.id,
|
||||
max: 1,
|
||||
time: 1000 * 60 * 5
|
||||
});
|
||||
if (answer1.first().attachments.size > 0) {
|
||||
await user.send({ embeds: [attachments] });
|
||||
return;
|
||||
}
|
||||
if (answer1.first().content > 16) {
|
||||
await user.send({
|
||||
embeds: [
|
||||
{
|
||||
description: "Max character limit is 16.",
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
});
|
||||
return;
|
||||
}
|
||||
try {
|
||||
await fetch(mojangAPI + answer1.first().content);
|
||||
} catch (error) {
|
||||
await user.send({
|
||||
embeds: [
|
||||
{
|
||||
description: "That is not a valid Minecraft username.\n" + "Application cancelled.",
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (answer1.size === 0) {
|
||||
await user.send({ embeds: [tooLong] });
|
||||
return;
|
||||
}
|
||||
if (answer1.first().content.toLowerCase() === "cancel") {
|
||||
await user.send({ embeds: [cancelled] });
|
||||
return;
|
||||
}
|
||||
const answer1_1 = answer1.first().content;
|
||||
const answer1 = await user.dmChannel.awaitMessages({
|
||||
filter: (m) => m.author.id === user.id,
|
||||
max: 1,
|
||||
time: 1000 * 60 * 5
|
||||
});
|
||||
if (answer1.first().attachments.size > 0) {
|
||||
await user.send({ embeds: [attachments] });
|
||||
return;
|
||||
}
|
||||
if (answer1.first().content > 16) {
|
||||
await user.send({
|
||||
embeds: [{
|
||||
description: "Max character limit is 16.",
|
||||
color: embedColor
|
||||
}]
|
||||
});
|
||||
return;
|
||||
}
|
||||
try {
|
||||
await fetch(mojangAPI + answer1.first().content);
|
||||
} catch (error) {
|
||||
await user.send({
|
||||
embeds: [{
|
||||
description: "That is not a valid Minecraft username.\n" + "Application cancelled.",
|
||||
color: embedColor
|
||||
}]
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (answer1.size === 0) {
|
||||
await user.send({ embeds: [tooLong] });
|
||||
return;
|
||||
}
|
||||
if (answer1.first().content.toLowerCase() === "cancel") {
|
||||
await user.send({ embeds: [cancelled] });
|
||||
return;
|
||||
}
|
||||
const answer1_1 = answer1.first().content;
|
||||
|
||||
await user.send({
|
||||
embeds: [{
|
||||
title: "**Question 2**",
|
||||
description: ia2 + "\n\nPlease type your answer below or type `cancel` to cancel your application.\n`" + smallM + "`",
|
||||
color: embedColor,
|
||||
footer: {
|
||||
text: "You have 5 minutes to respond to this message."
|
||||
}
|
||||
}]
|
||||
});
|
||||
const answer2 = await user.dmChannel.awaitMessages({
|
||||
filter: (m) => m.author.id === user.id,
|
||||
max: 1,
|
||||
time: 1000 * 60 * 5
|
||||
});
|
||||
if (answer2.first().attachments.size > 0) {
|
||||
await user.send({ embeds: [attachments] });
|
||||
return;
|
||||
}
|
||||
if (answer2.first().content > 128) {
|
||||
await user.send({
|
||||
embeds: [
|
||||
{
|
||||
description: "Max character limit is 128.",
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (answer1.size === 0) {
|
||||
await user.send({ embeds: [tooLong] });
|
||||
return;
|
||||
}
|
||||
if (answer1.first().content.toLowerCase() === "cancel") {
|
||||
await user.send({ embeds: [cancelled] });
|
||||
return;
|
||||
}
|
||||
const answer2_1 = answer1.first().content;
|
||||
await user.send({
|
||||
embeds: [{
|
||||
title: "**Question 2**",
|
||||
description: ia2 + "\n\nPlease type your answer below or type `cancel` to cancel your application.\n`" + smallM + "`",
|
||||
color: embedColor,
|
||||
footer: {
|
||||
text: "You have 5 minutes to respond to this message."
|
||||
}
|
||||
}]
|
||||
});
|
||||
const answer2 = await user.dmChannel.awaitMessages({
|
||||
filter: (m) => m.author.id === user.id,
|
||||
max: 1,
|
||||
time: 1000 * 60 * 5
|
||||
});
|
||||
if (answer2.first().attachments.size > 0) {
|
||||
await user.send({ embeds: [attachments] });
|
||||
return;
|
||||
}
|
||||
if (answer2.first().content > 128) {
|
||||
await user.send({
|
||||
embeds: [{
|
||||
description: "Max character limit is 128.",
|
||||
color: embedColor
|
||||
}]
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (answer1.size === 0) {
|
||||
await user.send({ embeds: [tooLong] });
|
||||
return;
|
||||
}
|
||||
if (answer1.first().content.toLowerCase() === "cancel") {
|
||||
await user.send({ embeds: [cancelled] });
|
||||
return;
|
||||
}
|
||||
const answer2_1 = answer1.first().content;
|
||||
|
||||
await user.send({
|
||||
embeds: [{
|
||||
title: "**Question 3**",
|
||||
description: ia3 + "\n\nPlease type your answer below or type `cancel` to cancel your application.\n`" + largeM + "`",
|
||||
color: embedColor,
|
||||
footer: {
|
||||
text: "You have 15 minutes to respond to this message."
|
||||
}
|
||||
}]
|
||||
});
|
||||
const answer3 = await user.dmChannel.awaitMessages({
|
||||
filter: (m) => m.author.id === user.id,
|
||||
max: 1,
|
||||
time: 1000 * 60 * 15
|
||||
});
|
||||
if (answer3.first().attachments.size > 0) {
|
||||
await user.send({ embeds: [attachments] });
|
||||
return;
|
||||
}
|
||||
if (answer3.first().content > 256) {
|
||||
await user.send({
|
||||
embeds: [
|
||||
{
|
||||
description: "Max character limit is 256",
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (answer1.size === 0) {
|
||||
await user.send({ embeds: [tooLong] });
|
||||
return;
|
||||
}
|
||||
if (answer1.first().content.toLowerCase() === "cancel") {
|
||||
await user.send({ embeds: [cancelled] });
|
||||
return;
|
||||
}
|
||||
const answer3_1 = answer1.first().content;
|
||||
await user.send({
|
||||
embeds: [{
|
||||
title: "**Question 3**",
|
||||
description: ia3 + "\n\nPlease type your answer below or type `cancel` to cancel your application.\n`" + largeM + "`",
|
||||
color: embedColor,
|
||||
footer: {
|
||||
text: "You have 15 minutes to respond to this message."
|
||||
}
|
||||
}]
|
||||
});
|
||||
const answer3 = await user.dmChannel.awaitMessages({
|
||||
filter: (m) => m.author.id === user.id,
|
||||
max: 1,
|
||||
time: 1000 * 60 * 15
|
||||
});
|
||||
if (answer3.first().attachments.size > 0) {
|
||||
await user.send({ embeds: [attachments] });
|
||||
return;
|
||||
}
|
||||
if (answer3.first().content > 256) {
|
||||
await user.send({
|
||||
embeds: [{
|
||||
description: "Max character limit is 256",
|
||||
color: embedColor
|
||||
}]
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (answer1.size === 0) {
|
||||
await user.send({ embeds: [tooLong] });
|
||||
return;
|
||||
}
|
||||
if (answer1.first().content.toLowerCase() === "cancel") {
|
||||
await user.send({ embeds: [cancelled] });
|
||||
return;
|
||||
}
|
||||
const answer3_1 = answer1.first().content;
|
||||
|
||||
await user.send({
|
||||
embeds: [{
|
||||
description: "If you want to submit your application, type `yes` if not, type `no`",
|
||||
color: embedColor
|
||||
}]
|
||||
})
|
||||
const final = await user.dmChannel.awaitMessages({
|
||||
filter: m => m.author.id === user.id,
|
||||
max: 1,
|
||||
time: 1000 * 60 * 5
|
||||
});
|
||||
if (final.first().attachments.size > 0) {
|
||||
await user.send({ embeds: [attachments] });
|
||||
return
|
||||
await user.send({
|
||||
embeds: [{
|
||||
description: "If you want to submit your application, type `yes` if not, type `no`",
|
||||
color: embedColor
|
||||
}]
|
||||
})
|
||||
const final = await user.dmChannel.awaitMessages({
|
||||
filter: m => m.author.id === user.id,
|
||||
max: 1,
|
||||
time: 1000 * 60 * 5
|
||||
});
|
||||
if (final.first().attachments.size > 0) {
|
||||
await user.send({ embeds: [attachments] });
|
||||
return
|
||||
}
|
||||
if (final.size === 0) {
|
||||
await user.send({ embeds: [tooLong] });
|
||||
return
|
||||
}
|
||||
if (final.first().content.toLowerCase() !== 'yes') {
|
||||
await user.send({ embeds: [cancelled] });
|
||||
return
|
||||
}
|
||||
|
||||
await user.send({
|
||||
embeds: [{
|
||||
description: "Your application has been submitted!",
|
||||
color: embedColor
|
||||
}]
|
||||
})
|
||||
|
||||
const appChannel = await guild.channels.cache.get(inactivityLogChannel);
|
||||
|
||||
await appChannel.send({
|
||||
embeds: [{
|
||||
title: user.username + "#" + user.discriminator + " - Inactivity Application",
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: user.displayAvatarURL({ dynamic: true })
|
||||
},
|
||||
fields: [
|
||||
{
|
||||
name: ria1,
|
||||
value: "`" + answer1_1 + "`"
|
||||
},
|
||||
{
|
||||
name: ria2,
|
||||
value: "`" + answer2_1 + "`"
|
||||
},
|
||||
{
|
||||
name: ria3,
|
||||
value: "`" + answer3_1 + "`"
|
||||
}
|
||||
],
|
||||
footer: {
|
||||
icon_url: user.displayAvatarURL({ dynamic: true }),
|
||||
text: "ID: " + user.id
|
||||
}
|
||||
}],
|
||||
components: [
|
||||
new ActionRowBuilder().addComponents(
|
||||
new ButtonBuilder()
|
||||
.setCustomId("inactiveapplicationaccept")
|
||||
.setLabel("Accept")
|
||||
.setStyle(ButtonStyle.Primary),
|
||||
new ButtonBuilder()
|
||||
.setCustomId("inactiveapplicationdeny")
|
||||
.setLabel("Deny")
|
||||
.setStyle(ButtonStyle.Danger),
|
||||
)
|
||||
]
|
||||
});
|
||||
}
|
||||
if (final.size === 0) {
|
||||
await user.send({ embeds: [tooLong] });
|
||||
return
|
||||
}
|
||||
if (final.first().content.toLowerCase() !== 'yes') {
|
||||
await user.send({ embeds: [cancelled]} );
|
||||
return
|
||||
}
|
||||
|
||||
await user.send({
|
||||
embeds: [{
|
||||
description: "Your application has been submitted!",
|
||||
color: embedColor
|
||||
}]
|
||||
})
|
||||
|
||||
const appChannel = await guild.channels.cache.get(inactivityLogChannel);
|
||||
|
||||
await appChannel.send({
|
||||
embeds: [{
|
||||
title: user.username + "#" + user.discriminator + " - Inactivity Application",
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: user.displayAvatarURL({ dynamic: true })
|
||||
},
|
||||
fields: [
|
||||
{
|
||||
name: ria1,
|
||||
value: "`" + answer1_1 + "`"
|
||||
},
|
||||
{
|
||||
name: ria2,
|
||||
value: "`" + answer2_1 + "`"
|
||||
},
|
||||
{
|
||||
name: ria3,
|
||||
value: "`" + answer3_1 + "`"
|
||||
}
|
||||
],
|
||||
footer: {
|
||||
icon_url: user.displayAvatarURL({ dynamic: true }),
|
||||
text: "ID: " + user.id
|
||||
}
|
||||
}],
|
||||
components: [
|
||||
new ActionRowBuilder().addComponents(
|
||||
new ButtonBuilder()
|
||||
.setCustomId("inactiveapplicationaccept")
|
||||
.setLabel("Accept")
|
||||
.setStyle(ButtonStyle.Primary),
|
||||
new ButtonBuilder()
|
||||
.setCustomId("inactiveapplicationdeny")
|
||||
.setLabel("Deny")
|
||||
.setStyle(ButtonStyle.Danger),
|
||||
)
|
||||
]
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
module.exports = {
|
||||
name: "inactiveapplicationaccept",
|
||||
description: "Accept an inactivity application.",
|
||||
type: "button",
|
||||
name: "inactiveapplicationaccept",
|
||||
description: "Accept an inactivity application.",
|
||||
type: "button",
|
||||
|
||||
async execute(interaction) {
|
||||
async execute(interaction) {
|
||||
|
||||
await interaction.reply({ content: "This button is currently disabled.", ephemeral: true });
|
||||
await interaction.reply({ content: "This button is currently disabled.", ephemeral: true });
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,11 @@
|
||||
module.exports = {
|
||||
name: "inactiveapplicationdeny",
|
||||
description: "Denies an inactivity application.",
|
||||
type: "button",
|
||||
name: "inactiveapplicationdeny",
|
||||
description: "Denies an inactivity application.",
|
||||
type: "button",
|
||||
|
||||
async execute(interaction) {
|
||||
async execute(interaction) {
|
||||
|
||||
await interaction.reply({ content: "This button is currently disabled.", ephemeral: true });
|
||||
await interaction.reply({ content: "This button is currently disabled.", ephemeral: true });
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10,7 +10,6 @@ module.exports = {
|
||||
async execute(interaction) {
|
||||
|
||||
const user = interaction.user;
|
||||
const channel = interaction.channel;
|
||||
const guild = interaction.guild;
|
||||
const embedColor = Number(color.replace("#", "0x"));
|
||||
|
||||
|
||||
@@ -27,12 +27,12 @@ module.exports = {
|
||||
await interaction.deferReply({ ephemeral: true });
|
||||
|
||||
if (!userRoles.has(guildRole)) {
|
||||
await interaction.editReply({content: "You must be a member of the guild to apply for staff.", ephemeral: true});
|
||||
await interaction.editReply({ content: "You must be a member of the guild to apply for staff.", ephemeral: true });
|
||||
return
|
||||
}
|
||||
|
||||
if (userRoles.has(guildStaff)) {
|
||||
await interaction.editReply({content: "You are already a staff member.", ephemeral: true});
|
||||
await interaction.editReply({ content: "You are already a staff member.", ephemeral: true });
|
||||
return
|
||||
}
|
||||
|
||||
@@ -53,385 +53,384 @@ module.exports = {
|
||||
.setDescription("You have uploaded an attachment. Please do not upload images, videos, or GIFS.")
|
||||
.setColor(embedColor)
|
||||
|
||||
try {
|
||||
await user.send({
|
||||
embeds: [{
|
||||
title: 'Staff Application',
|
||||
description: "Please answer the following questions to apply for staff.\n" +
|
||||
try {
|
||||
await user.send({
|
||||
embeds: [{
|
||||
title: 'Staff Application',
|
||||
description: "Please answer the following questions to apply for staff.\n" +
|
||||
"If you wish to cancel your application, please press type `cancel` at any time.\n" +
|
||||
"If you wish to proceed with your application, please type `yes`.\n\n" +
|
||||
"**Do not upload images, videos, or GIFS.**\n" +
|
||||
"You have a minute to respond to this message.",
|
||||
color: embedColor,
|
||||
}]
|
||||
})
|
||||
} catch (error) {
|
||||
await interaction.editReply({ content: "Please enable your DMs.", ephemeral: true });
|
||||
return
|
||||
}
|
||||
|
||||
await interaction.editReply({ content: "Please check your DMs.", ephemeral: true})
|
||||
|
||||
const input = await user.dmChannel.awaitMessages({
|
||||
filter: m => m.author.id === user.id,
|
||||
max: 1,
|
||||
time: 1000 * 60
|
||||
});
|
||||
if (input.first().attachments.size > 0) {
|
||||
await user.send({ embeds: [attachments] });
|
||||
return
|
||||
}
|
||||
if (input.size === 0) {
|
||||
await user.send({ embeds: [tooLong] });
|
||||
return
|
||||
}
|
||||
if (input.first().content.toLowerCase() !== 'yes') {
|
||||
await user.send({ embeds: [cancelled]} );
|
||||
return
|
||||
}
|
||||
|
||||
// first question
|
||||
const question1 = await user.send({
|
||||
embeds: [{
|
||||
title : "**Question 1**",
|
||||
description: sq1 + "\n\nPlease type your answer below or type `cancel` to cancel your application.\n`" + ignM + "`",
|
||||
color: embedColor,
|
||||
footer:{
|
||||
text: "You have 5 minutes to respond to this message."
|
||||
}
|
||||
}]
|
||||
})
|
||||
const answer1 = await user.dmChannel.awaitMessages({
|
||||
filter: m => m.author.id === user.id,
|
||||
max: 1,
|
||||
time: 1000 * 60 * 5,
|
||||
});
|
||||
if (answer1.first().attachments.size > 0) {
|
||||
await user.send({ embeds: [attachments] });
|
||||
return
|
||||
}
|
||||
if (answer1.first().content > 16) {
|
||||
await user.send({
|
||||
embeds: [{
|
||||
description: "Max character limit is 16.",
|
||||
color: embedColor
|
||||
}]
|
||||
})
|
||||
return
|
||||
}
|
||||
try {
|
||||
await fetch(mojangAPI + answer1.first().content)
|
||||
} catch (error) {
|
||||
await user.send({
|
||||
embeds: [{
|
||||
description: "That is not a valid Minecraft username.\n" +
|
||||
} catch (error) {
|
||||
await interaction.editReply({ content: "Please enable your DMs.", ephemeral: true });
|
||||
return
|
||||
}
|
||||
|
||||
await interaction.editReply({ content: "Please check your DMs.", ephemeral: true })
|
||||
|
||||
const input = await user.dmChannel.awaitMessages({
|
||||
filter: m => m.author.id === user.id,
|
||||
max: 1,
|
||||
time: 1000 * 60
|
||||
});
|
||||
if (input.first().attachments.size > 0) {
|
||||
await user.send({ embeds: [attachments] });
|
||||
return
|
||||
}
|
||||
if (input.size === 0) {
|
||||
await user.send({ embeds: [tooLong] });
|
||||
return
|
||||
}
|
||||
if (input.first().content.toLowerCase() !== 'yes') {
|
||||
await user.send({ embeds: [cancelled] });
|
||||
return
|
||||
}
|
||||
|
||||
// first question
|
||||
const question1 = await user.send({
|
||||
embeds: [{
|
||||
title: "**Question 1**",
|
||||
description: sq1 + "\n\nPlease type your answer below or type `cancel` to cancel your application.\n`" + ignM + "`",
|
||||
color: embedColor,
|
||||
footer: {
|
||||
text: "You have 5 minutes to respond to this message."
|
||||
}
|
||||
}]
|
||||
})
|
||||
const answer1 = await user.dmChannel.awaitMessages({
|
||||
filter: m => m.author.id === user.id,
|
||||
max: 1,
|
||||
time: 1000 * 60 * 5,
|
||||
});
|
||||
if (answer1.first().attachments.size > 0) {
|
||||
await user.send({ embeds: [attachments] });
|
||||
return
|
||||
}
|
||||
if (answer1.first().content > 16) {
|
||||
await user.send({
|
||||
embeds: [{
|
||||
description: "Max character limit is 16.",
|
||||
color: embedColor
|
||||
}]
|
||||
})
|
||||
return
|
||||
}
|
||||
try {
|
||||
await fetch(mojangAPI + answer1.first().content)
|
||||
} catch (error) {
|
||||
await user.send({
|
||||
embeds: [{
|
||||
description: "That is not a valid Minecraft username.\n" +
|
||||
"Application cancelled.",
|
||||
color: embedColor
|
||||
}]
|
||||
})
|
||||
return
|
||||
}
|
||||
if (answer1.size === 0) {
|
||||
await user.send({ embeds: [tooLong] })
|
||||
return
|
||||
}
|
||||
if (answer1.first().content.toLowerCase() === 'cancel') {
|
||||
await user.send({ embeds: [cancelled] })
|
||||
return
|
||||
}
|
||||
const answer1_1 = answer1.first().content
|
||||
|
||||
// second question
|
||||
const question2 = await user.send({
|
||||
embeds: [{
|
||||
title : "**Question 2**",
|
||||
description: sq2 + "\n\nPlease type your answer below or type `cancel` to cancel your application.\n" + "`(64 characters max)`",
|
||||
color: embedColor,
|
||||
footer:{
|
||||
text: "You have 15 minutes to respond to this message."
|
||||
}
|
||||
color: embedColor
|
||||
}]
|
||||
})
|
||||
const answer2 = await user.dmChannel.awaitMessages({
|
||||
filter: m => m.author.id === user.id,
|
||||
max: 1,
|
||||
time: 1000 * 60 * 15
|
||||
});
|
||||
if (answer2.first().attachments.size > 0) {
|
||||
await user.send({ embeds: [attachments] });
|
||||
return
|
||||
}
|
||||
if (answer2.first().content > 64) {
|
||||
await user.send({
|
||||
embeds: [{
|
||||
description: "Max character limit is 64.",
|
||||
color: embedColor
|
||||
}]
|
||||
})
|
||||
return
|
||||
}
|
||||
if (answer2.size === 0) {
|
||||
await user.send({ embeds: [tooLong] })
|
||||
return
|
||||
}
|
||||
if (answer2.first().content.toLowerCase() === 'cancel') {
|
||||
await user.send({ embeds: [cancelled] })
|
||||
return
|
||||
}
|
||||
const answer2_1 = answer2.first().content
|
||||
return
|
||||
}
|
||||
if (answer1.size === 0) {
|
||||
await user.send({ embeds: [tooLong] })
|
||||
return
|
||||
}
|
||||
if (answer1.first().content.toLowerCase() === 'cancel') {
|
||||
await user.send({ embeds: [cancelled] })
|
||||
return
|
||||
}
|
||||
const answer1_1 = answer1.first().content
|
||||
|
||||
// third question
|
||||
const question3 = await user.send({
|
||||
// second question
|
||||
const question2 = await user.send({
|
||||
embeds: [{
|
||||
title: "**Question 2**",
|
||||
description: sq2 + "\n\nPlease type your answer below or type `cancel` to cancel your application.\n" + "`(64 characters max)`",
|
||||
color: embedColor,
|
||||
footer: {
|
||||
text: "You have 15 minutes to respond to this message."
|
||||
}
|
||||
}]
|
||||
})
|
||||
const answer2 = await user.dmChannel.awaitMessages({
|
||||
filter: m => m.author.id === user.id,
|
||||
max: 1,
|
||||
time: 1000 * 60 * 15
|
||||
});
|
||||
if (answer2.first().attachments.size > 0) {
|
||||
await user.send({ embeds: [attachments] });
|
||||
return
|
||||
}
|
||||
if (answer2.first().content > 64) {
|
||||
await user.send({
|
||||
embeds: [{
|
||||
title : "**Question 3**",
|
||||
description: sq3 + "\n\nPlease type your answer below or type `cancel` to cancel your application.\n`" + largeM + "`",
|
||||
color: embedColor,
|
||||
footer:{
|
||||
text: "You have 15 minutes to respond to this message."
|
||||
}
|
||||
description: "Max character limit is 64.",
|
||||
color: embedColor
|
||||
}]
|
||||
})
|
||||
const answer3 = await user.dmChannel.awaitMessages({
|
||||
filter: m => m.author.id === user.id,
|
||||
max: 1,
|
||||
time: 1000 * 60 * 15
|
||||
});
|
||||
if (answer3.first().attachments.size > 0) {
|
||||
await user.send({ embeds: [attachments] });
|
||||
return
|
||||
}
|
||||
if (answer3.first().content > 256) {
|
||||
await user.send({
|
||||
embeds: [{
|
||||
description: "Max character limit is 256.",
|
||||
color: embedColor
|
||||
}]
|
||||
})
|
||||
}
|
||||
if (answer3.size === 0) {
|
||||
await user.send({ embeds: [tooLong] })
|
||||
return
|
||||
}
|
||||
if (answer3.first().content.toLowerCase() === 'cancel') {
|
||||
await user.send({ embeds: [cancelled] })
|
||||
return
|
||||
}
|
||||
const answer3_1 = answer3.first().content
|
||||
return
|
||||
}
|
||||
if (answer2.size === 0) {
|
||||
await user.send({ embeds: [tooLong] })
|
||||
return
|
||||
}
|
||||
if (answer2.first().content.toLowerCase() === 'cancel') {
|
||||
await user.send({ embeds: [cancelled] })
|
||||
return
|
||||
}
|
||||
const answer2_1 = answer2.first().content
|
||||
|
||||
// fourth question
|
||||
const question4 = await user.send({
|
||||
// third question
|
||||
const question3 = await user.send({
|
||||
embeds: [{
|
||||
title: "**Question 3**",
|
||||
description: sq3 + "\n\nPlease type your answer below or type `cancel` to cancel your application.\n`" + largeM + "`",
|
||||
color: embedColor,
|
||||
footer: {
|
||||
text: "You have 15 minutes to respond to this message."
|
||||
}
|
||||
}]
|
||||
})
|
||||
const answer3 = await user.dmChannel.awaitMessages({
|
||||
filter: m => m.author.id === user.id,
|
||||
max: 1,
|
||||
time: 1000 * 60 * 15
|
||||
});
|
||||
if (answer3.first().attachments.size > 0) {
|
||||
await user.send({ embeds: [attachments] });
|
||||
return
|
||||
}
|
||||
if (answer3.first().content > 256) {
|
||||
await user.send({
|
||||
embeds: [{
|
||||
title : "**Question 4**",
|
||||
description: sq4 + "\n\nPlease type your answer below or type `cancel` to cancel your application.\n`" + largeM + "`",
|
||||
color: embedColor,
|
||||
footer:{
|
||||
text: "You have 15 minutes to respond to this message."
|
||||
}
|
||||
description: "Max character limit is 256.",
|
||||
color: embedColor
|
||||
}]
|
||||
})
|
||||
const answer4 = await user.dmChannel.awaitMessages({
|
||||
filter: m => m.author.id === user.id,
|
||||
max: 1,
|
||||
time: 1000 * 60 * 15
|
||||
});
|
||||
if (answer4.first().attachments.size > 0) {
|
||||
await user.send({ embeds: [attachments] });
|
||||
return
|
||||
}
|
||||
if (answer4.first().content > 256) {
|
||||
await user.send({
|
||||
embeds: [{
|
||||
description: "Max character limit is 256.",
|
||||
color: embedColor
|
||||
}]
|
||||
})
|
||||
}
|
||||
if (answer4.size === 0) {
|
||||
await user.send({ embeds: [tooLong] })
|
||||
return
|
||||
}
|
||||
if (answer4.first().content.toLowerCase() === 'cancel') {
|
||||
await user.send({ embeds: [cancelled] })
|
||||
return
|
||||
}
|
||||
const answer4_1 = answer4.first().content
|
||||
}
|
||||
if (answer3.size === 0) {
|
||||
await user.send({ embeds: [tooLong] })
|
||||
return
|
||||
}
|
||||
if (answer3.first().content.toLowerCase() === 'cancel') {
|
||||
await user.send({ embeds: [cancelled] })
|
||||
return
|
||||
}
|
||||
const answer3_1 = answer3.first().content
|
||||
|
||||
// fifth question
|
||||
const question5 = await user.send({
|
||||
// fourth question
|
||||
const question4 = await user.send({
|
||||
embeds: [{
|
||||
title: "**Question 4**",
|
||||
description: sq4 + "\n\nPlease type your answer below or type `cancel` to cancel your application.\n`" + largeM + "`",
|
||||
color: embedColor,
|
||||
footer: {
|
||||
text: "You have 15 minutes to respond to this message."
|
||||
}
|
||||
}]
|
||||
})
|
||||
const answer4 = await user.dmChannel.awaitMessages({
|
||||
filter: m => m.author.id === user.id,
|
||||
max: 1,
|
||||
time: 1000 * 60 * 15
|
||||
});
|
||||
if (answer4.first().attachments.size > 0) {
|
||||
await user.send({ embeds: [attachments] });
|
||||
return
|
||||
}
|
||||
if (answer4.first().content > 256) {
|
||||
await user.send({
|
||||
embeds: [{
|
||||
title : "**Question 5**",
|
||||
description: sq5 + "\n\nPlease type your answer below or type `cancel` to cancel your application.\n`" + largeM + "`",
|
||||
color: embedColor,
|
||||
footer:{
|
||||
text: "You have 15 minutes to respond to this message."
|
||||
}
|
||||
description: "Max character limit is 256.",
|
||||
color: embedColor
|
||||
}]
|
||||
})
|
||||
const answer5 = await user.dmChannel.awaitMessages({
|
||||
filter: m => m.author.id === user.id,
|
||||
max: 1,
|
||||
time: 1000 * 60 * 15
|
||||
});
|
||||
if (answer5.first().attachments.size > 0) {
|
||||
await user.send({ embeds: [attachments] });
|
||||
return
|
||||
}
|
||||
if (answer5.first().content > 256) {
|
||||
await user.send({
|
||||
embeds: [{
|
||||
description: "Max character limit is 256.",
|
||||
color: embedColor
|
||||
}]
|
||||
})
|
||||
}
|
||||
if (answer5.size === 0) {
|
||||
await user.send({ embeds: [tooLong] })
|
||||
return
|
||||
}
|
||||
if (answer5.first().content.toLowerCase() === 'cancel') {
|
||||
await user.send({ embeds: [cancelled] })
|
||||
return
|
||||
}
|
||||
const answer5_1 = answer5.first().content
|
||||
}
|
||||
if (answer4.size === 0) {
|
||||
await user.send({ embeds: [tooLong] })
|
||||
return
|
||||
}
|
||||
if (answer4.first().content.toLowerCase() === 'cancel') {
|
||||
await user.send({ embeds: [cancelled] })
|
||||
return
|
||||
}
|
||||
const answer4_1 = answer4.first().content
|
||||
|
||||
// sixth question
|
||||
const question6 = await user.send({
|
||||
// fifth question
|
||||
const question5 = await user.send({
|
||||
embeds: [{
|
||||
title: "**Question 5**",
|
||||
description: sq5 + "\n\nPlease type your answer below or type `cancel` to cancel your application.\n`" + largeM + "`",
|
||||
color: embedColor,
|
||||
footer: {
|
||||
text: "You have 15 minutes to respond to this message."
|
||||
}
|
||||
}]
|
||||
})
|
||||
const answer5 = await user.dmChannel.awaitMessages({
|
||||
filter: m => m.author.id === user.id,
|
||||
max: 1,
|
||||
time: 1000 * 60 * 15
|
||||
});
|
||||
if (answer5.first().attachments.size > 0) {
|
||||
await user.send({ embeds: [attachments] });
|
||||
return
|
||||
}
|
||||
if (answer5.first().content > 256) {
|
||||
await user.send({
|
||||
embeds: [{
|
||||
title : "**Question 6**",
|
||||
description: sq6 + "\n\nPlease type your answer below or type `cancel` to cancel your application." +
|
||||
description: "Max character limit is 256.",
|
||||
color: embedColor
|
||||
}]
|
||||
})
|
||||
}
|
||||
if (answer5.size === 0) {
|
||||
await user.send({ embeds: [tooLong] })
|
||||
return
|
||||
}
|
||||
if (answer5.first().content.toLowerCase() === 'cancel') {
|
||||
await user.send({ embeds: [cancelled] })
|
||||
return
|
||||
}
|
||||
const answer5_1 = answer5.first().content
|
||||
|
||||
// sixth question
|
||||
const question6 = await user.send({
|
||||
embeds: [{
|
||||
title: "**Question 6**",
|
||||
description: sq6 + "\n\nPlease type your answer below or type `cancel` to cancel your application." +
|
||||
"`(We expect a longer answer here)`\n`" + largeM + "`",
|
||||
color: embedColor,
|
||||
footer:{
|
||||
text: "You have 15 minutes to respond to this message."
|
||||
}
|
||||
}]
|
||||
})
|
||||
const answer6 = await user.dmChannel.awaitMessages({
|
||||
filter: m => m.author.id === user.id,
|
||||
max: 1,
|
||||
time: 1000 * 60 * 15
|
||||
});
|
||||
if (answer6.first().attachments.size > 0) {
|
||||
await user.send({ embeds: [attachments] });
|
||||
return
|
||||
}
|
||||
if (answer6.first().content > 256) {
|
||||
await user.send({
|
||||
embeds: [{
|
||||
description: "Max character limit is 256.",
|
||||
color: embedColor
|
||||
}]
|
||||
})
|
||||
}
|
||||
if (answer6.size === 0) {
|
||||
await user.send({ embeds: [tooLong] })
|
||||
return
|
||||
}
|
||||
if (answer6.first().content.toLowerCase() === 'cancel') {
|
||||
await user.send({ embeds: [cancelled] })
|
||||
return
|
||||
}
|
||||
const answer6_1 = answer6.first().content
|
||||
|
||||
color: embedColor,
|
||||
footer: {
|
||||
text: "You have 15 minutes to respond to this message."
|
||||
}
|
||||
}]
|
||||
})
|
||||
const answer6 = await user.dmChannel.awaitMessages({
|
||||
filter: m => m.author.id === user.id,
|
||||
max: 1,
|
||||
time: 1000 * 60 * 15
|
||||
});
|
||||
if (answer6.first().attachments.size > 0) {
|
||||
await user.send({ embeds: [attachments] });
|
||||
return
|
||||
}
|
||||
if (answer6.first().content > 256) {
|
||||
await user.send({
|
||||
embeds: [{
|
||||
description: "If you want to submit your application, type `yes` if not, type `no`",
|
||||
description: "Max character limit is 256.",
|
||||
color: embedColor
|
||||
}]
|
||||
})
|
||||
}
|
||||
if (answer6.size === 0) {
|
||||
await user.send({ embeds: [tooLong] })
|
||||
return
|
||||
}
|
||||
if (answer6.first().content.toLowerCase() === 'cancel') {
|
||||
await user.send({ embeds: [cancelled] })
|
||||
return
|
||||
}
|
||||
const answer6_1 = answer6.first().content
|
||||
|
||||
const final = await user.dmChannel.awaitMessages({
|
||||
filter: m => m.author.id === user.id,
|
||||
max: 1,
|
||||
time: 1000 * 60 * 5
|
||||
});
|
||||
if (final.first().attachments.size > 0) {
|
||||
await user.send({ embeds: [attachments] });
|
||||
return
|
||||
}
|
||||
if (final.size === 0) {
|
||||
await user.send({ embeds: [tooLong] });
|
||||
return
|
||||
}
|
||||
if (final.first().content.toLowerCase() !== 'yes') {
|
||||
await user.send({ embeds: [cancelled]} );
|
||||
return
|
||||
}
|
||||
await user.send({
|
||||
embeds: [{
|
||||
description: "If you want to submit your application, type `yes` if not, type `no`",
|
||||
color: embedColor
|
||||
}]
|
||||
})
|
||||
|
||||
await user.send({
|
||||
embeds: [{
|
||||
description: "Your application has been submitted!",
|
||||
color: embedColor
|
||||
}]
|
||||
})
|
||||
const final = await user.dmChannel.awaitMessages({
|
||||
filter: m => m.author.id === user.id,
|
||||
max: 1,
|
||||
time: 1000 * 60 * 5
|
||||
});
|
||||
if (final.first().attachments.size > 0) {
|
||||
await user.send({ embeds: [attachments] });
|
||||
return
|
||||
}
|
||||
if (final.size === 0) {
|
||||
await user.send({ embeds: [tooLong] });
|
||||
return
|
||||
}
|
||||
if (final.first().content.toLowerCase() !== 'yes') {
|
||||
await user.send({ embeds: [cancelled] });
|
||||
return
|
||||
}
|
||||
|
||||
const userCheck = await fetch(mojangAPI + answer1_1)
|
||||
const uuid = userCheck.data.id
|
||||
await user.send({
|
||||
embeds: [{
|
||||
description: "Your application has been submitted!",
|
||||
color: embedColor
|
||||
}]
|
||||
})
|
||||
|
||||
const newStaffApp = new staffapp({
|
||||
_id: new mongoose.Types.ObjectId(),
|
||||
userID: user.id,
|
||||
uuid: uuid,
|
||||
})
|
||||
const userCheck = await fetch(mojangAPI + answer1_1)
|
||||
const uuid = userCheck.data.id
|
||||
|
||||
await newStaffApp.save()
|
||||
await user.deleteDM();
|
||||
const newStaffApp = new staffapp({
|
||||
_id: new mongoose.Types.ObjectId(),
|
||||
userID: user.id,
|
||||
uuid: uuid,
|
||||
})
|
||||
|
||||
const channel = guild.channels.cache.get(staffApplicationsChannel);
|
||||
await newStaffApp.save()
|
||||
await user.deleteDM();
|
||||
|
||||
await channel.send({
|
||||
embeds: [{
|
||||
title: user.username + "#" + user.discriminator + " - Staff Application",
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: user.avatarURL()
|
||||
const channel = guild.channels.cache.get(staffApplicationsChannel);
|
||||
|
||||
await channel.send({
|
||||
embeds: [{
|
||||
title: user.username + "#" + user.discriminator + " - Staff Application",
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: user.avatarURL()
|
||||
},
|
||||
fields: [
|
||||
{
|
||||
name: rsq1,
|
||||
value: "```" + answer1_1 + "```"
|
||||
},
|
||||
fields: [
|
||||
{
|
||||
name: rsq1,
|
||||
value: "```" + answer1_1 + "```"
|
||||
},
|
||||
{
|
||||
name: rsq2,
|
||||
value: "```" + answer2_1 + "```"
|
||||
},
|
||||
{
|
||||
name: rsq3,
|
||||
value: "```" + answer3_1 + "```"
|
||||
},
|
||||
{
|
||||
name: rsq4,
|
||||
value: "```" + answer4_1 + "```"
|
||||
},
|
||||
{
|
||||
name: rsq5,
|
||||
value: "```" + answer5_1 + "```"
|
||||
},
|
||||
{
|
||||
name: rsq6,
|
||||
value: "```" + answer6_1 + "```"
|
||||
}
|
||||
|
||||
],
|
||||
footer: {
|
||||
iconURL: guild.iconURL(),
|
||||
text: "ID: " + user.id
|
||||
{
|
||||
name: rsq2,
|
||||
value: "```" + answer2_1 + "```"
|
||||
},
|
||||
{
|
||||
name: rsq3,
|
||||
value: "```" + answer3_1 + "```"
|
||||
},
|
||||
{
|
||||
name: rsq4,
|
||||
value: "```" + answer4_1 + "```"
|
||||
},
|
||||
{
|
||||
name: rsq5,
|
||||
value: "```" + answer5_1 + "```"
|
||||
},
|
||||
{
|
||||
name: rsq6,
|
||||
value: "```" + answer6_1 + "```"
|
||||
}
|
||||
}],
|
||||
components: [
|
||||
new ActionRowBuilder().addComponents(
|
||||
new ButtonBuilder()
|
||||
.setCustomId("staffapplicationaccept")
|
||||
.setLabel("Accept")
|
||||
.setStyle(ButtonStyle.Primary),
|
||||
new ButtonBuilder()
|
||||
.setCustomId("staffapplicationdeny")
|
||||
.setLabel("Deny")
|
||||
.setStyle(ButtonStyle.Danger)
|
||||
)
|
||||
]
|
||||
}
|
||||
);
|
||||
|
||||
],
|
||||
footer: {
|
||||
iconURL: guild.iconURL(),
|
||||
text: "ID: " + user.id
|
||||
}
|
||||
}],
|
||||
components: [
|
||||
new ActionRowBuilder().addComponents(
|
||||
new ButtonBuilder()
|
||||
.setCustomId("staffapplicationaccept")
|
||||
.setLabel("Accept")
|
||||
.setStyle(ButtonStyle.Primary),
|
||||
new ButtonBuilder()
|
||||
.setCustomId("staffapplicationdeny")
|
||||
.setLabel("Deny")
|
||||
.setStyle(ButtonStyle.Danger)
|
||||
)
|
||||
]
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,27 +2,27 @@ const { ModalBuilder, ActionRowBuilder, TextInputBuilder, TextInputStyle } = req
|
||||
const { color } = require('../../config/options.json')
|
||||
|
||||
module.exports = {
|
||||
name: 'verify',
|
||||
description: 'Configure the bot.',
|
||||
type: 'button',
|
||||
name: 'verify',
|
||||
description: 'Configure the bot.',
|
||||
type: 'button',
|
||||
|
||||
async execute(interaction) {
|
||||
async execute(interaction) {
|
||||
|
||||
const modal = new ModalBuilder()
|
||||
.setTitle("Verification")
|
||||
.setCustomId("verifybox")
|
||||
.setComponents(
|
||||
new ActionRowBuilder().setComponents(
|
||||
new TextInputBuilder()
|
||||
.setLabel("IGN")
|
||||
.setCustomId("verifyfield")
|
||||
.setStyle(TextInputStyle.Short)
|
||||
.setPlaceholder("Enter your ign.")
|
||||
.setRequired(true)
|
||||
.setMinLength(3)
|
||||
.setMaxLength(16)
|
||||
const modal = new ModalBuilder()
|
||||
.setTitle("Verification")
|
||||
.setCustomId("verifybox")
|
||||
.setComponents(
|
||||
new ActionRowBuilder().setComponents(
|
||||
new TextInputBuilder()
|
||||
.setLabel("IGN")
|
||||
.setCustomId("verifyfield")
|
||||
.setStyle(TextInputStyle.Short)
|
||||
.setPlaceholder("Enter your ign.")
|
||||
.setRequired(true)
|
||||
.setMinLength(3)
|
||||
.setMaxLength(16)
|
||||
)
|
||||
)
|
||||
)
|
||||
await interaction.showModal(modal)
|
||||
}
|
||||
await interaction.showModal(modal)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,18 +6,18 @@ const { hypixelGuildID } = require("../../config/options.json")
|
||||
const fetch = require("axios");
|
||||
|
||||
module.exports = {
|
||||
name: 'waitinglistupdate',
|
||||
description: 'Update the waiting list.',
|
||||
type: 'button',
|
||||
name: 'waitinglistupdate',
|
||||
description: 'Update the waiting list.',
|
||||
type: 'button',
|
||||
|
||||
async execute(interaction) {
|
||||
async execute(interaction) {
|
||||
|
||||
await interaction.deferReply({ ephemeral: true });
|
||||
await interaction.deferReply({ ephemeral: true });
|
||||
|
||||
const user = interaction.user;
|
||||
const message = interaction.message;
|
||||
const embed = message.embeds[0];
|
||||
const accepted = await waitinglist.find()
|
||||
const user = interaction.user;
|
||||
const message = interaction.message;
|
||||
const embed = message.embeds[0];
|
||||
const accepted = await waitinglist.find()
|
||||
const guildAPI = "https://api.hypixel.net/guild"
|
||||
const guild = guildAPI + "?key=" + key + "&player="
|
||||
|
||||
@@ -33,34 +33,34 @@ module.exports = {
|
||||
|
||||
}
|
||||
|
||||
let fields = [];
|
||||
let fields = [];
|
||||
|
||||
for (let i = 0; i < accepted.length; i++) {
|
||||
for (let i = 0; i < accepted.length; i++) {
|
||||
|
||||
const timestamp1 = accepted[i].timestamp / 1000
|
||||
const timestamp = Math.floor(timestamp1)
|
||||
|
||||
fields.push({
|
||||
name: `${i + 1}. ${accepted[i].IGN}`,
|
||||
value: `TS: <t:${timestamp}:R>`
|
||||
});
|
||||
}
|
||||
fields.push({
|
||||
name: `${i + 1}. ${accepted[i].IGN}`,
|
||||
value: `TS: <t:${timestamp}:R>`
|
||||
});
|
||||
}
|
||||
|
||||
await message.edit({
|
||||
embeds: [{
|
||||
title: embed.title,
|
||||
description: embed.description,
|
||||
color: embed.color,
|
||||
footer: {
|
||||
text: "Last updated by " + user.username,
|
||||
icon_url: user.avatarURL(),
|
||||
},
|
||||
thumbnail: embed.thumbnail,
|
||||
fields: fields,
|
||||
timestamp: new Date(),
|
||||
}],
|
||||
});
|
||||
await message.edit({
|
||||
embeds: [{
|
||||
title: embed.title,
|
||||
description: embed.description,
|
||||
color: embed.color,
|
||||
footer: {
|
||||
text: "Last updated by " + user.username,
|
||||
icon_url: user.avatarURL(),
|
||||
},
|
||||
thumbnail: embed.thumbnail,
|
||||
fields: fields,
|
||||
timestamp: new Date(),
|
||||
}],
|
||||
});
|
||||
|
||||
await interaction.editReply({ content: 'Updated the waiting list', ephemeral: true });
|
||||
}
|
||||
await interaction.editReply({ content: 'Updated the waiting list', ephemeral: true });
|
||||
}
|
||||
}
|
||||
@@ -52,7 +52,7 @@ module.exports = {
|
||||
|
||||
const dmMessage = new EmbedBuilder()
|
||||
.setDescription("Your application for the Illegitimate guild has been denied\n" +
|
||||
"**Reason:** `" + reason + "`")
|
||||
"**Reason:** `" + reason + "`")
|
||||
.setColor(embedColor);
|
||||
|
||||
await applicant.send({ embeds: [dmMessage] });
|
||||
@@ -63,7 +63,7 @@ module.exports = {
|
||||
embeds: [{
|
||||
title: "Application Denied",
|
||||
description: "The application has been denied by <@" + interaction.user.id + ">.\n" +
|
||||
"**Reason:** `" + reason + "`",
|
||||
"**Reason:** `" + reason + "`",
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: applicant.avatarURL()
|
||||
|
||||
@@ -46,7 +46,7 @@ module.exports = {
|
||||
|
||||
const dmMessage = new EmbedBuilder()
|
||||
.setDescription("Your application for the Illegitimate guild staff has been denied\n" +
|
||||
"**Reason:** `" + reason + "`")
|
||||
"**Reason:** `" + reason + "`")
|
||||
.setColor(embedColor);
|
||||
|
||||
await applicant.send({ embeds: [dmMessage] });
|
||||
@@ -57,7 +57,7 @@ module.exports = {
|
||||
embeds: [{
|
||||
title: "Application Denied",
|
||||
description: "The application has been denied by <@" + interaction.user.id + ">.\n" +
|
||||
"**Reason:** `" + reason + "`",
|
||||
"**Reason:** `" + reason + "`",
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: applicant.avatarURL()
|
||||
|
||||
5
index.js
5
index.js
@@ -209,7 +209,8 @@ client.on(Events.ClientReady, () => {
|
||||
|
||||
client.on(Events.ClientReady, () => {
|
||||
client.user.setActivity(
|
||||
{ name: "over the Illegitimate Server", type: ActivityType.Watching });
|
||||
{ name: "over the Illegitimate Server", type: ActivityType.Watching }
|
||||
);
|
||||
|
||||
const activities = [
|
||||
{ name: "for Martina's return", type: ActivityType.Watching },
|
||||
@@ -229,9 +230,11 @@ client.on(Events.ClientReady, () => {
|
||||
1000 * 60 * 30
|
||||
)
|
||||
});
|
||||
|
||||
client.on(Events.ClientReady, () => {
|
||||
client.user.setStatus('dnd');
|
||||
});
|
||||
|
||||
client.login(token);
|
||||
|
||||
connect(mongoURI, {}).then(() => {
|
||||
|
||||
@@ -8,80 +8,80 @@ const args = process.argv.slice(2);
|
||||
const arg = args[0];
|
||||
|
||||
if (!arg) {
|
||||
console.log('Please specify a command to run!');
|
||||
console.log('Please specify a command to run!');
|
||||
}
|
||||
else if (arg === '--prod') {
|
||||
const commands = [];
|
||||
// Grab all the command files from the commands directory you created earlier
|
||||
const commandFiles = fs.readdirSync('./commands').filter(file => file.endsWith('.js'));
|
||||
const contentMenuCommands = fs.readdirSync('./commands-contextmenu').filter(file => file.endsWith('.js'));
|
||||
const commands = [];
|
||||
// Grab all the command files from the commands directory you created earlier
|
||||
const commandFiles = fs.readdirSync('./commands').filter(file => file.endsWith('.js'));
|
||||
const contentMenuCommands = fs.readdirSync('./commands-contextmenu').filter(file => file.endsWith('.js'));
|
||||
|
||||
// Grab the SlashCommandBuilder#toJSON() output of each command's data for deployment
|
||||
for (const file of commandFiles) {
|
||||
const command = require(`../commands/${file}`);
|
||||
commands.push(command.data.toJSON());
|
||||
}
|
||||
// Grab the SlashCommandBuilder#toJSON() output of each command's data for deployment
|
||||
for (const file of commandFiles) {
|
||||
const command = require(`../commands/${file}`);
|
||||
commands.push(command.data.toJSON());
|
||||
}
|
||||
|
||||
for (const file of contentMenuCommands) {
|
||||
const command = require(`../commands-contextmenu/${file}`);
|
||||
commands.push(command.data.toJSON());
|
||||
}
|
||||
for (const file of contentMenuCommands) {
|
||||
const command = require(`../commands-contextmenu/${file}`);
|
||||
commands.push(command.data.toJSON());
|
||||
}
|
||||
|
||||
// Construct and prepare an instance of the REST module
|
||||
const rest = new REST({ version: '10' }).setToken(token);
|
||||
// Construct and prepare an instance of the REST module
|
||||
const rest = new REST({ version: '10' }).setToken(token);
|
||||
|
||||
|
||||
// and deploy your commands!
|
||||
(async () => {
|
||||
try {
|
||||
console.log(`Started refreshing ${commands.length} application (/) commands.`);
|
||||
// and deploy your commands!
|
||||
(async () => {
|
||||
try {
|
||||
console.log(`Started refreshing ${commands.length} application (/) commands.`);
|
||||
|
||||
// The put method is used to fully refresh all commands in the guild with the current set
|
||||
const data = await rest.put(
|
||||
Routes.applicationCommands(clientId),
|
||||
{ body: commands },
|
||||
);
|
||||
// The put method is used to fully refresh all commands in the guild with the current set
|
||||
const data = await rest.put(
|
||||
Routes.applicationCommands(clientId),
|
||||
{ body: commands },
|
||||
);
|
||||
|
||||
console.log(`Successfully reloaded ${data.length} application (/) commands.`);
|
||||
} catch (error) {
|
||||
// And of course, make sure you catch and log any errors!
|
||||
console.error(error);
|
||||
}
|
||||
})();
|
||||
console.log(`Successfully reloaded ${data.length} application (/) commands.`);
|
||||
} catch (error) {
|
||||
// And of course, make sure you catch and log any errors!
|
||||
console.error(error);
|
||||
}
|
||||
})();
|
||||
}
|
||||
else if (arg === '--dev') {
|
||||
const commands = [];
|
||||
// Grab all the command files from the commands directory you created earlier
|
||||
const commandFiles = fs.readdirSync('./commands-testing').filter(file => file.endsWith('.js'));
|
||||
const commands = [];
|
||||
// Grab all the command files from the commands directory you created earlier
|
||||
const commandFiles = fs.readdirSync('./commands-testing').filter(file => file.endsWith('.js'));
|
||||
|
||||
// Grab the SlashCommandBuilder#toJSON() output of each command's data for deployment
|
||||
for (const file of commandFiles) {
|
||||
const command = require(`../commands-testing/${file}`);
|
||||
commands.push(command.data.toJSON());
|
||||
}
|
||||
// Grab the SlashCommandBuilder#toJSON() output of each command's data for deployment
|
||||
for (const file of commandFiles) {
|
||||
const command = require(`../commands-testing/${file}`);
|
||||
commands.push(command.data.toJSON());
|
||||
}
|
||||
|
||||
// Construct and prepare an instance of the REST module
|
||||
const rest = new REST({ version: '10' }).setToken(token);
|
||||
// Construct and prepare an instance of the REST module
|
||||
const rest = new REST({ version: '10' }).setToken(token);
|
||||
|
||||
|
||||
// and deploy your commands!
|
||||
(async () => {
|
||||
try {
|
||||
console.log(`Started refreshing ${commands.length} application (/) commands.`);
|
||||
// and deploy your commands!
|
||||
(async () => {
|
||||
try {
|
||||
console.log(`Started refreshing ${commands.length} application (/) commands.`);
|
||||
|
||||
// The put method is used to fully refresh all commands in the guild with the current set
|
||||
const data = await rest.put(
|
||||
Routes.applicationGuildCommands(clientId, guildId),
|
||||
{ body: commands },
|
||||
);
|
||||
// The put method is used to fully refresh all commands in the guild with the current set
|
||||
const data = await rest.put(
|
||||
Routes.applicationGuildCommands(clientId, guildId),
|
||||
{ body: commands },
|
||||
);
|
||||
|
||||
console.log(`Successfully reloaded ${data.length} application (/) commands.`);
|
||||
} catch (error) {
|
||||
// And of course, make sure you catch and log any errors!
|
||||
console.error(error);
|
||||
}
|
||||
})();
|
||||
console.log(`Successfully reloaded ${data.length} application (/) commands.`);
|
||||
} catch (error) {
|
||||
// And of course, make sure you catch and log any errors!
|
||||
console.error(error);
|
||||
}
|
||||
})();
|
||||
}
|
||||
else if (arg && arg !== '--prod' && arg !== '--dev') {
|
||||
console.log('Invalid argument!');
|
||||
console.log('Invalid argument!');
|
||||
}
|
||||
|
||||
@@ -9,13 +9,13 @@ const commands = [];
|
||||
// const commandFiles = fs.readdirSync('./commands-testing').filter(file => file.endsWith('.js'));
|
||||
|
||||
const commandFiles = [
|
||||
'./commands/config.js',
|
||||
'./commands/config.js',
|
||||
]
|
||||
|
||||
// Grab the SlashCommandBuilder#toJSON() output of each command's data for deployment
|
||||
for (const file of commandFiles) {
|
||||
const command = require(`${file}`);
|
||||
commands.push(command.data.toJSON());
|
||||
const command = require(`${file}`);
|
||||
commands.push(command.data.toJSON());
|
||||
}
|
||||
|
||||
// Construct and prepare an instance of the REST module
|
||||
@@ -23,19 +23,19 @@ const rest = new REST({ version: '10' }).setToken(token);
|
||||
|
||||
|
||||
// and deploy your commands!
|
||||
(async () => {
|
||||
try {
|
||||
console.log(`Started refreshing ${commands.length} application (/) commands.`);
|
||||
(async () => {
|
||||
try {
|
||||
console.log(`Started refreshing ${commands.length} application (/) commands.`);
|
||||
|
||||
// The put method is used to fully refresh all commands in the guild with the current set
|
||||
const data = await rest.put(
|
||||
Routes.applicationGuildCommands(clientId, guildId),
|
||||
{ body: commands },
|
||||
);
|
||||
// The put method is used to fully refresh all commands in the guild with the current set
|
||||
const data = await rest.put(
|
||||
Routes.applicationGuildCommands(clientId, guildId),
|
||||
{ body: commands },
|
||||
);
|
||||
|
||||
console.log(`Successfully reloaded ${data.length} application (/) commands.`);
|
||||
} catch (error) {
|
||||
// And of course, make sure you catch and log any errors!
|
||||
console.error(error);
|
||||
}
|
||||
})();
|
||||
console.log(`Successfully reloaded ${data.length} application (/) commands.`);
|
||||
} catch (error) {
|
||||
// And of course, make sure you catch and log any errors!
|
||||
console.error(error);
|
||||
}
|
||||
})();
|
||||
|
||||
@@ -1,109 +1,111 @@
|
||||
/* ---------- bedwars level ---------- */
|
||||
function getExpForLevel(level){
|
||||
if(level == 0) return 0;
|
||||
function getExpForLevel(level) {
|
||||
if (level == 0) return 0;
|
||||
|
||||
var respectedLevel = getLevelRespectingPrestige(level);
|
||||
if(respectedLevel > EASY_LEVELS){
|
||||
return 5000;
|
||||
}
|
||||
var respectedLevel = getLevelRespectingPrestige(level);
|
||||
if (respectedLevel > EASY_LEVELS) {
|
||||
return 5000;
|
||||
}
|
||||
|
||||
switch(respectedLevel){
|
||||
case 1:
|
||||
return 500;
|
||||
case 2:
|
||||
return 1000;
|
||||
case 3:
|
||||
return 2000;
|
||||
case 4:
|
||||
return 3500;
|
||||
}
|
||||
return 5000;
|
||||
switch (respectedLevel) {
|
||||
case 1:
|
||||
return 500;
|
||||
case 2:
|
||||
return 1000;
|
||||
case 3:
|
||||
return 2000;
|
||||
case 4:
|
||||
return 3500;
|
||||
}
|
||||
return 5000;
|
||||
}
|
||||
|
||||
function getLevelRespectingPrestige(level){
|
||||
if(level > HIGHEST_PRESTIGE * LEVELS_PER_PRESTIGE){
|
||||
return level - HIGHEST_PRESTIGE * LEVELS_PER_PRESTIGE;
|
||||
}
|
||||
else {
|
||||
return level % LEVELS_PER_PRESTIGE;
|
||||
}
|
||||
function getLevelRespectingPrestige(level) {
|
||||
if (level > HIGHEST_PRESTIGE * LEVELS_PER_PRESTIGE) {
|
||||
return level - HIGHEST_PRESTIGE * LEVELS_PER_PRESTIGE;
|
||||
}
|
||||
else {
|
||||
return level % LEVELS_PER_PRESTIGE;
|
||||
}
|
||||
}
|
||||
|
||||
const EASY_LEVELS = 4;
|
||||
const EASY_LEVELS_XP = 7000;
|
||||
const XP_PER_PRESTIGE = 96 * 5000 + EASY_LEVELS_XP;
|
||||
const LEVELS_PER_PRESTIGE = 100;
|
||||
const HIGHEST_PRESTIGE = 50;
|
||||
function getLevelForExp(exp){
|
||||
var prestiges = Math.floor(exp / XP_PER_PRESTIGE);
|
||||
var level = prestiges * LEVELS_PER_PRESTIGE;
|
||||
var expWithoutPrestiges = exp - (prestiges * XP_PER_PRESTIGE);
|
||||
function getLevelForExp(exp) {
|
||||
var prestiges = Math.floor(exp / XP_PER_PRESTIGE);
|
||||
var level = prestiges * LEVELS_PER_PRESTIGE;
|
||||
var expWithoutPrestiges = exp - (prestiges * XP_PER_PRESTIGE);
|
||||
|
||||
for(let i = 1; i <= EASY_LEVELS; ++i){
|
||||
var expForEasyLevel = getExpForLevel(i);
|
||||
if(expWithoutPrestiges < expForEasyLevel){
|
||||
break;
|
||||
}
|
||||
level++;
|
||||
expWithoutPrestiges -= expForEasyLevel;
|
||||
}
|
||||
return level + expWithoutPrestiges / 5000
|
||||
for (let i = 1; i <= EASY_LEVELS; ++i) {
|
||||
var expForEasyLevel = getExpForLevel(i);
|
||||
if (expWithoutPrestiges < expForEasyLevel) {
|
||||
break;
|
||||
}
|
||||
level++;
|
||||
expWithoutPrestiges -= expForEasyLevel;
|
||||
}
|
||||
return level + expWithoutPrestiges / 5000
|
||||
}
|
||||
|
||||
// hypixel
|
||||
const BASE = 10000;
|
||||
const GROWTH = 2500;
|
||||
|
||||
const HALF_GROWTH = 0.5 * GROWTH;
|
||||
|
||||
const REVERSE_PQ_PREFIX = -(BASE - 0.5 * GROWTH) / GROWTH;
|
||||
const REVERSE_CONST = REVERSE_PQ_PREFIX * REVERSE_PQ_PREFIX;
|
||||
const GROWTH_DIVIDES_2 = 2 / GROWTH;
|
||||
|
||||
function getLevel(exp) {
|
||||
return exp <= 1 ? 1 : Math.floor(1 + REVERSE_PQ_PREFIX + Math.sqrt(REVERSE_CONST + GROWTH_DIVIDES_2 * exp));
|
||||
return exp <= 1 ? 1 : Math.floor(1 + REVERSE_PQ_PREFIX + Math.sqrt(REVERSE_CONST + GROWTH_DIVIDES_2 * exp));
|
||||
}
|
||||
|
||||
function getExactLevel(exp) {
|
||||
return getLevel(exp) + getPercentageToNextLevel(exp);
|
||||
return getLevel(exp) + getPercentageToNextLevel(exp);
|
||||
}
|
||||
|
||||
function getExpFromLevelToNext(level) {
|
||||
return level < 1 ? BASE : GROWTH * (level - 1) + BASE;
|
||||
return level < 1 ? BASE : GROWTH * (level - 1) + BASE;
|
||||
}
|
||||
|
||||
function getTotalExpToLevel(level) {
|
||||
const lv = Math.floor(level); const
|
||||
x0 = getTotalExpToFullLevel(lv);
|
||||
if (level === lv) return x0;
|
||||
return (getTotalExpToFullLevel(lv + 1) - x0) * (level % 1) + x0;
|
||||
const lv = Math.floor(level); const
|
||||
x0 = getTotalExpToFullLevel(lv);
|
||||
if (level === lv) return x0;
|
||||
return (getTotalExpToFullLevel(lv + 1) - x0) * (level % 1) + x0;
|
||||
}
|
||||
|
||||
function getTotalExpToFullLevel(level) {
|
||||
return (HALF_GROWTH * (level - 2) + BASE) * (level - 1);
|
||||
return (HALF_GROWTH * (level - 2) + BASE) * (level - 1);
|
||||
}
|
||||
|
||||
function getPercentageToNextLevel(exp) {
|
||||
const lv = getLevel(exp);
|
||||
const x0 = getTotalExpToLevel(lv);
|
||||
return (exp - x0) / (getTotalExpToLevel(lv + 1) - x0);
|
||||
const lv = getLevel(exp);
|
||||
const x0 = getTotalExpToLevel(lv);
|
||||
return (exp - x0) / (getTotalExpToLevel(lv + 1) - x0);
|
||||
}
|
||||
|
||||
/* ---------- skywars level ---------- */
|
||||
function skywarsLevel(xp) {
|
||||
var xps = [0, 20, 70, 150, 250, 500, 1000, 2000, 3500, 6000, 10000, 15000];
|
||||
let exactLevel = 0
|
||||
if (xp >= 15000) {
|
||||
exactLevel = (xp - 15000) / 10000 + 12;
|
||||
return exactLevel;
|
||||
} else {
|
||||
for (i = 0; i < xps.length; i++) {
|
||||
if (xp < xps[i]) {
|
||||
exactLevel = i + (xp - xps[i-1]) / (xps[i] - xps[i-1]);
|
||||
return exactLevel;
|
||||
}
|
||||
}
|
||||
}
|
||||
var xps = [0, 20, 70, 150, 250, 500, 1000, 2000, 3500, 6000, 10000, 15000];
|
||||
let exactLevel = 0
|
||||
if (xp >= 15000) {
|
||||
exactLevel = (xp - 15000) / 10000 + 12;
|
||||
return exactLevel;
|
||||
} else {
|
||||
for (i = 0; i < xps.length; i++) {
|
||||
if (xp < xps[i]) {
|
||||
exactLevel = i + (xp - xps[i - 1]) / (xps[i] - xps[i - 1]);
|
||||
return exactLevel;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
getExactLevel,
|
||||
skywarsLevel,
|
||||
getLevelForExp
|
||||
getExactLevel,
|
||||
skywarsLevel,
|
||||
getLevelForExp
|
||||
}
|
||||
Reference in New Issue
Block a user