Formatted all files using clang
This commit is contained in:
@@ -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() + "`"
|
||||
}
|
||||
]
|
||||
}]
|
||||
|
||||
@@ -23,9 +23,9 @@ module.exports = {
|
||||
const mojangAPI = "https://api.mojang.com/users/profiles/minecraft/"
|
||||
|
||||
const userRoles = guild.members.cache.get(user.id).roles.cache.map(role => role.id);
|
||||
|
||||
|
||||
if (interaction.customId === 'guildapply') {
|
||||
|
||||
|
||||
await interaction.deferReply({ ephemeral: true });
|
||||
|
||||
if (userRoles.includes(guildRole)) {
|
||||
@@ -39,7 +39,7 @@ module.exports = {
|
||||
await interaction.editReply({ content: "You already have an application in progress.", ephemeral: true });
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
const tooLong = new EmbedBuilder()
|
||||
.setDescription("You took too long to respond.")
|
||||
.setColor(embedColor)
|
||||
@@ -54,11 +54,11 @@ module.exports = {
|
||||
await user.send({
|
||||
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.",
|
||||
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.",
|
||||
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**",
|
||||
description: qu4 + "\n\nPlease type your answer below or type `cancel` to cancel your application." +
|
||||
" `(We expect a longer answer.)`\n`" + largeM + "`",
|
||||
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 + "`",
|
||||
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."
|
||||
}
|
||||
}]
|
||||
@@ -292,14 +292,14 @@ module.exports = {
|
||||
return
|
||||
}
|
||||
const answer5_1 = answer5.first().content
|
||||
|
||||
|
||||
// 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
|
||||
}
|
||||
|
||||
@@ -452,7 +452,7 @@ module.exports = {
|
||||
|
||||
const channel = guild.channels.cache.get(applicationsChannel);
|
||||
await channel.send({
|
||||
embeds: [{
|
||||
embeds: [{
|
||||
title: user.username + "#" + user.discriminator + " - Guild Application",
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
@@ -517,4 +517,4 @@ module.exports = {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}]
|
||||
});
|
||||
@@ -76,7 +76,7 @@ module.exports = {
|
||||
|
||||
|
||||
await interaction.editReply({
|
||||
embeds: [{
|
||||
embeds: [{
|
||||
title: applicantUsername + " - Guild Application",
|
||||
description: "Application has been accepted by <@" + user.id + ">.",
|
||||
color: embedColor,
|
||||
@@ -90,4 +90,4 @@ module.exports = {
|
||||
}]
|
||||
});
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
@@ -29,4 +29,4 @@ module.exports = {
|
||||
)
|
||||
await interaction.showModal(modal);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
@@ -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",
|
||||
|
||||
async execute(interaction) {
|
||||
name: "inactiveapplicationaccept",
|
||||
description: "Accept an inactivity application.",
|
||||
type: "button",
|
||||
|
||||
await interaction.reply({ content: "This button is currently disabled.", ephemeral: true });
|
||||
async execute(interaction) {
|
||||
|
||||
}
|
||||
}
|
||||
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",
|
||||
|
||||
async execute(interaction) {
|
||||
name: "inactiveapplicationdeny",
|
||||
description: "Denies an inactivity application.",
|
||||
type: "button",
|
||||
|
||||
await interaction.reply({ content: "This button is currently disabled.", ephemeral: true });
|
||||
async execute(interaction) {
|
||||
|
||||
}
|
||||
}
|
||||
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"));
|
||||
|
||||
@@ -63,4 +62,4 @@ module.exports = {
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,4 +22,4 @@ module.exports = {
|
||||
)
|
||||
await interaction.showModal(modal);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
@@ -27,22 +27,22 @@ 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
|
||||
}
|
||||
|
||||
const application = await staffapp.findOne({ userID: user.id });
|
||||
|
||||
|
||||
if (application) {
|
||||
await interaction.editReply({ content: "You already have an application in progress.", ephemeral: true });
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
const tooLong = new EmbedBuilder()
|
||||
.setDescription("You took too long to respond.")
|
||||
.setColor(embedColor)
|
||||
@@ -52,386 +52,385 @@ module.exports = {
|
||||
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: '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" +
|
||||
|
||||
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
|
||||
|
||||
// third question
|
||||
const question3 = await user.send({
|
||||
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."
|
||||
}
|
||||
}]
|
||||
})
|
||||
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
|
||||
|
||||
// fourth question
|
||||
const question4 = await user.send({
|
||||
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
|
||||
|
||||
// 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
|
||||
|
||||
// fifth question
|
||||
const question5 = await user.send({
|
||||
}
|
||||
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
|
||||
|
||||
// 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
|
||||
|
||||
// sixth question
|
||||
const question6 = await user.send({
|
||||
}
|
||||
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
|
||||
|
||||
// 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`",
|
||||
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!",
|
||||
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 userCheck = await fetch(mojangAPI + answer1_1)
|
||||
const uuid = userCheck.data.id
|
||||
await user.send({
|
||||
embeds: [{
|
||||
description: "If you want to submit your application, type `yes` if not, type `no`",
|
||||
color: embedColor
|
||||
}]
|
||||
})
|
||||
|
||||
const newStaffApp = new staffapp({
|
||||
_id: new mongoose.Types.ObjectId(),
|
||||
userID: user.id,
|
||||
uuid: uuid,
|
||||
})
|
||||
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 newStaffApp.save()
|
||||
await user.deleteDM();
|
||||
await user.send({
|
||||
embeds: [{
|
||||
description: "Your application has been submitted!",
|
||||
color: embedColor
|
||||
}]
|
||||
})
|
||||
|
||||
const channel = guild.channels.cache.get(staffApplicationsChannel);
|
||||
const userCheck = await fetch(mojangAPI + answer1_1)
|
||||
const uuid = userCheck.data.id
|
||||
|
||||
await channel.send({
|
||||
embeds: [{
|
||||
title: user.username + "#" + user.discriminator + " - Staff Application",
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: user.avatarURL()
|
||||
const newStaffApp = new staffapp({
|
||||
_id: new mongoose.Types.ObjectId(),
|
||||
userID: user.id,
|
||||
uuid: uuid,
|
||||
})
|
||||
|
||||
await newStaffApp.save()
|
||||
await user.deleteDM();
|
||||
|
||||
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 });
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user