Replaced clang format with prettuier (sadly)
This commit is contained in:
@@ -12,23 +12,29 @@ export = {
|
||||
}
|
||||
|
||||
if (focusedOption.value === "") {
|
||||
await interaction.respond([{
|
||||
name: "Please start typing a username to unban",
|
||||
value: "none"
|
||||
}])
|
||||
await interaction.respond([
|
||||
{
|
||||
name: "Please start typing a username to unban",
|
||||
value: "none",
|
||||
},
|
||||
])
|
||||
return
|
||||
}
|
||||
|
||||
const bannedUsers = await interaction.guild!.bans.fetch()
|
||||
const filteredUsers = bannedUsers.filter((user) =>
|
||||
user.user.username.toLowerCase().includes(focusedOption.value.toLowerCase())
|
||||
const filteredUsers = bannedUsers.filter(user =>
|
||||
user.user.username
|
||||
.toLowerCase()
|
||||
.includes(focusedOption.value.toLowerCase()),
|
||||
)
|
||||
|
||||
const results = filteredUsers.map((user) => ({
|
||||
const results = filteredUsers.map(user => ({
|
||||
name: user.user.username,
|
||||
value: user.user.id,
|
||||
}))
|
||||
|
||||
await interaction.respond(results.slice(0, 25)).catch((err) => { console.log(err) })
|
||||
}
|
||||
} as Autocomplete
|
||||
await interaction.respond(results.slice(0, 25)).catch(err => {
|
||||
console.log(err)
|
||||
})
|
||||
},
|
||||
} as Autocomplete
|
||||
|
||||
@@ -1,7 +1,22 @@
|
||||
import { color, devMessage } from "../../../config/options.json"
|
||||
import guildapp from "../../schemas/guildAppSchema"
|
||||
import { bwfkdr, bwstars, bwwins, swstars, swkdr, duelswins, duelswlr } from "../../../config/reqs.json"
|
||||
import { hypixelLevel, bedwarsLevel, skywarsLevel, getPlayer, getGuild, getHeadURL } from "../../utils/Hypixel"
|
||||
import {
|
||||
bwfkdr,
|
||||
bwstars,
|
||||
bwwins,
|
||||
swstars,
|
||||
swkdr,
|
||||
duelswins,
|
||||
duelswlr,
|
||||
} from "../../../config/reqs.json"
|
||||
import {
|
||||
hypixelLevel,
|
||||
bedwarsLevel,
|
||||
skywarsLevel,
|
||||
getPlayer,
|
||||
getGuild,
|
||||
getHeadURL,
|
||||
} from "../../utils/Hypixel"
|
||||
import { Button } from "../../interfaces"
|
||||
|
||||
export = {
|
||||
@@ -22,10 +37,13 @@ export = {
|
||||
const player = await getPlayer(uuid)
|
||||
if (!player) {
|
||||
interaction.editReply({
|
||||
embeds: [{
|
||||
description: "That player hasn't played Hypixel before.",
|
||||
color: embedColor
|
||||
}]
|
||||
embeds: [
|
||||
{
|
||||
description:
|
||||
"That player hasn't played Hypixel before.",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
})
|
||||
return
|
||||
}
|
||||
@@ -69,14 +87,14 @@ export = {
|
||||
if (!guild) {
|
||||
guildRank = "N/A"
|
||||
} else {
|
||||
guildRank = guild.members.find((m) => m.uuid === uuid)!.rank
|
||||
guildRank = guild.members.find(m => m.uuid === uuid)!.rank
|
||||
}
|
||||
|
||||
const statsFields = []
|
||||
if (!player.stats) {
|
||||
statsFields.push({
|
||||
name: "<a:_warning:1178350183457751100> This player never played any games.",
|
||||
value: "**➺ Stats:** `None`"
|
||||
value: "**➺ Stats:** `None`",
|
||||
})
|
||||
} else {
|
||||
if (player.stats.Bedwars) {
|
||||
@@ -88,23 +106,36 @@ export = {
|
||||
const hsbwwins = player.stats?.Bedwars?.wins_bedwars || 0
|
||||
|
||||
let bwtitle = ""
|
||||
if (hsbwstars < bwstars || hsbwfkdr < bwfkdr || hsbwwins < bwwins) {
|
||||
bwtitle = "<a:cross_a:1087808606897983539> This player does not meet the BedWars requirements."
|
||||
if (
|
||||
hsbwstars < bwstars ||
|
||||
hsbwfkdr < bwfkdr ||
|
||||
hsbwwins < bwwins
|
||||
) {
|
||||
bwtitle =
|
||||
"<a:cross_a:1087808606897983539> This player does not meet the BedWars requirements."
|
||||
} else {
|
||||
bwtitle = "<a:check_a:1087808632172847134> This player meets the BedWars requirements."
|
||||
bwtitle =
|
||||
"<a:check_a:1087808632172847134> This player meets the BedWars requirements."
|
||||
}
|
||||
|
||||
statsFields.push({
|
||||
name: bwtitle,
|
||||
value: "**➺ Stars:** `" +
|
||||
hsbwstars.toFixed(2).toString() + " / " +
|
||||
bwstars.toString() + "`\n" +
|
||||
value:
|
||||
"**➺ Stars:** `" +
|
||||
hsbwstars.toFixed(2).toString() +
|
||||
" / " +
|
||||
bwstars.toString() +
|
||||
"`\n" +
|
||||
"**➺ FKDR:** `" +
|
||||
hsbwfkdr.toFixed(2).toString() +
|
||||
" / " + bwfkdr.toString() + "`\n" +
|
||||
" / " +
|
||||
bwfkdr.toString() +
|
||||
"`\n" +
|
||||
"**➺ Wins:** `" +
|
||||
hsbwwins.toString() + " / " +
|
||||
bwwins.toString() + "`"
|
||||
hsbwwins.toString() +
|
||||
" / " +
|
||||
bwwins.toString() +
|
||||
"`",
|
||||
})
|
||||
}
|
||||
|
||||
@@ -118,9 +149,11 @@ export = {
|
||||
|
||||
let swtitle = ""
|
||||
if (hsswstars < swstars || hsswkd < swkdr) {
|
||||
swtitle = "<a:cross_a:1087808606897983539> This player does not meet the SkyWars requirements."
|
||||
swtitle =
|
||||
"<a:cross_a:1087808606897983539> This player does not meet the SkyWars requirements."
|
||||
} else {
|
||||
swtitle = "<a:check_a:1087808632172847134> This player meets the SkyWars requirements."
|
||||
swtitle =
|
||||
"<a:check_a:1087808632172847134> This player meets the SkyWars requirements."
|
||||
}
|
||||
|
||||
statsFields.push({
|
||||
@@ -128,12 +161,17 @@ export = {
|
||||
value:
|
||||
"**➺ Stars:** `" +
|
||||
hsswstars.toFixed(2).toString() +
|
||||
" / " + swstars.toString() + "`\n" +
|
||||
" / " +
|
||||
swstars.toString() +
|
||||
"`\n" +
|
||||
"**➺ KDR:** `" +
|
||||
hsswkd.toFixed(2).toString() + " / " +
|
||||
swkdr.toString() + "`\n" +
|
||||
hsswkd.toFixed(2).toString() +
|
||||
" / " +
|
||||
swkdr.toString() +
|
||||
"`\n" +
|
||||
"**➺ Wins:** `" +
|
||||
hsswwins.toString() + "`"
|
||||
hsswwins.toString() +
|
||||
"`",
|
||||
})
|
||||
}
|
||||
|
||||
@@ -147,21 +185,29 @@ export = {
|
||||
|
||||
let duelstitle = ""
|
||||
if (hsduelswins < duelswins || hsduelswlr < duelswlr) {
|
||||
duelstitle = "<a:cross_a:1087808606897983539> This player does not meet the Duels requirements."
|
||||
duelstitle =
|
||||
"<a:cross_a:1087808606897983539> This player does not meet the Duels requirements."
|
||||
} else {
|
||||
duelstitle = "<a:check_a:1087808632172847134> This player meets the Duels requirements."
|
||||
duelstitle =
|
||||
"<a:check_a:1087808632172847134> This player meets the Duels requirements."
|
||||
}
|
||||
|
||||
statsFields.push({
|
||||
name: duelstitle,
|
||||
value: "**➺ Wins:** `" +
|
||||
value:
|
||||
"**➺ Wins:** `" +
|
||||
hsduelswins.toString() +
|
||||
" / " + duelswins.toString() + "`\n" +
|
||||
" / " +
|
||||
duelswins.toString() +
|
||||
"`\n" +
|
||||
"**➺ WLR:** `" +
|
||||
hsduelswlr.toFixed(2).toString() +
|
||||
" / " + duelswlr.toString() + "`\n" +
|
||||
" / " +
|
||||
duelswlr.toString() +
|
||||
"`\n" +
|
||||
"**➺ KDR:** `" +
|
||||
hsduelskd.toFixed(2).toString() + "`"
|
||||
hsduelskd.toFixed(2).toString() +
|
||||
"`",
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -171,22 +217,30 @@ export = {
|
||||
const level = hypixelLevel(hypixelExp)
|
||||
|
||||
await interaction.editReply({
|
||||
embeds: [{
|
||||
title: rank + player.displayname + guildTag,
|
||||
description: "**Network Level:** `" +
|
||||
level.toFixed(2).toString() + "`\n" +
|
||||
"**Current Guild:** `" + guildName + "`\n" +
|
||||
"**Guild Rank:** `" + guildRank + "`",
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: head!
|
||||
embeds: [
|
||||
{
|
||||
title: rank + player.displayname + guildTag,
|
||||
description:
|
||||
"**Network Level:** `" +
|
||||
level.toFixed(2).toString() +
|
||||
"`\n" +
|
||||
"**Current Guild:** `" +
|
||||
guildName +
|
||||
"`\n" +
|
||||
"**Guild Rank:** `" +
|
||||
guildRank +
|
||||
"`",
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: head!,
|
||||
},
|
||||
footer: {
|
||||
text: interaction.guild!.name + " | " + devMessage,
|
||||
icon_url: interaction.guild!.iconURL()!,
|
||||
},
|
||||
fields: statsFields,
|
||||
},
|
||||
footer: {
|
||||
text: interaction.guild!.name + " | " + devMessage,
|
||||
icon_url: interaction.guild!.iconURL()!
|
||||
},
|
||||
fields: statsFields
|
||||
}]
|
||||
],
|
||||
})
|
||||
}
|
||||
} as Button
|
||||
},
|
||||
} as Button
|
||||
|
||||
@@ -12,7 +12,6 @@ export = {
|
||||
type: "button",
|
||||
|
||||
async execute(interaction) {
|
||||
|
||||
await interaction.deferReply()
|
||||
|
||||
const user = interaction.user
|
||||
@@ -25,7 +24,8 @@ export = {
|
||||
const applicantIGN = embed.fields[0].value.replaceAll("`", "")
|
||||
|
||||
const applicant = await guild.members.fetch(applicantId)
|
||||
const applicantUsername = applicant.user.username + "#" + applicant.user.discriminator
|
||||
const applicantUsername =
|
||||
applicant.user.username + "#" + applicant.user.discriminator
|
||||
|
||||
await message.edit({
|
||||
components: [
|
||||
@@ -44,16 +44,19 @@ export = {
|
||||
.setCustomId("checkstats")
|
||||
.setLabel("Check Stats")
|
||||
.setStyle(ButtonStyle.Secondary)
|
||||
.setDisabled(true)
|
||||
)
|
||||
]
|
||||
.setDisabled(true),
|
||||
),
|
||||
],
|
||||
})
|
||||
|
||||
await applicant.send({
|
||||
embeds: [{
|
||||
description: "Your application for the Illegitimate guild has been accepted.",
|
||||
color: embedColor
|
||||
}]
|
||||
embeds: [
|
||||
{
|
||||
description:
|
||||
"Your application for the Illegitimate guild has been accepted.",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
})
|
||||
|
||||
const applicantEntry = await guildapp.findOne({ userID: applicantId })
|
||||
@@ -65,7 +68,7 @@ export = {
|
||||
userID: applicantId,
|
||||
uuid: applicantUUID,
|
||||
IGN: applicantIGN,
|
||||
timestamp: time
|
||||
timestamp: time,
|
||||
})
|
||||
|
||||
await waitingListAdd.save()
|
||||
@@ -73,20 +76,22 @@ export = {
|
||||
await applicant.roles.add(waitingListRole)
|
||||
await guildapp.findOneAndDelete({ userID: applicantId })
|
||||
|
||||
|
||||
await interaction.editReply({
|
||||
embeds: [{
|
||||
title: applicantUsername + " - Guild Application",
|
||||
description: "Application has been accepted by <@" + user.id + ">.",
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: applicant.avatarURL() || guild.iconURL()!
|
||||
embeds: [
|
||||
{
|
||||
title: applicantUsername + " - Guild Application",
|
||||
description:
|
||||
"Application has been accepted by <@" + user.id + ">.",
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: applicant.avatarURL() || guild.iconURL()!,
|
||||
},
|
||||
footer: {
|
||||
icon_url: guild.iconURL()!,
|
||||
text: "ID: " + applicant.id,
|
||||
},
|
||||
},
|
||||
footer: {
|
||||
icon_url: guild.iconURL()!,
|
||||
text: "ID: " + applicant.id
|
||||
}
|
||||
}]
|
||||
],
|
||||
})
|
||||
}
|
||||
} as Button
|
||||
},
|
||||
} as Button
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
import { ModalBuilder, ActionRowBuilder, TextInputBuilder, TextInputStyle } from "discord.js"
|
||||
import {
|
||||
ModalBuilder,
|
||||
ActionRowBuilder,
|
||||
TextInputBuilder,
|
||||
TextInputStyle,
|
||||
} from "discord.js"
|
||||
import { Button } from "../../interfaces"
|
||||
|
||||
export = {
|
||||
@@ -7,7 +12,6 @@ export = {
|
||||
type: "button",
|
||||
|
||||
async execute(interaction) {
|
||||
|
||||
const modal = new ModalBuilder()
|
||||
.setTitle("Deny Reason")
|
||||
.setCustomId("denyreasonbox")
|
||||
@@ -17,10 +21,12 @@ export = {
|
||||
.setLabel("Deny Reason")
|
||||
.setCustomId("denyreason")
|
||||
.setStyle(TextInputStyle.Paragraph)
|
||||
.setPlaceholder("Enter a reason for denying the application")
|
||||
.setRequired(false)
|
||||
)
|
||||
.setPlaceholder(
|
||||
"Enter a reason for denying the application",
|
||||
)
|
||||
.setRequired(false),
|
||||
),
|
||||
)
|
||||
await interaction.showModal(modal)
|
||||
}
|
||||
} as Button
|
||||
},
|
||||
} as Button
|
||||
|
||||
@@ -1,4 +1,11 @@
|
||||
import { ButtonBuilder, ButtonStyle, ActionRowBuilder, EmbedBuilder, GuildMember, GuildTextBasedChannel } from "discord.js"
|
||||
import {
|
||||
ButtonBuilder,
|
||||
ButtonStyle,
|
||||
ActionRowBuilder,
|
||||
EmbedBuilder,
|
||||
GuildMember,
|
||||
GuildTextBasedChannel,
|
||||
} from "discord.js"
|
||||
import { color } from "../../../config/options.json"
|
||||
import { largeM, smallM, ignM } from "../../../config/limitmessages.json"
|
||||
import { applicationsChannel } from "../../../config/options.json"
|
||||
@@ -15,7 +22,6 @@ export = {
|
||||
type: "button",
|
||||
|
||||
async execute(interaction) {
|
||||
|
||||
const user = interaction.member as GuildMember
|
||||
const guild = interaction.guild!
|
||||
const embedColor = Number(color.replace("#", "0x"))
|
||||
@@ -31,18 +37,21 @@ export = {
|
||||
}
|
||||
|
||||
if (interaction.customId === "guildapply") {
|
||||
|
||||
await interaction.deferReply({ ephemeral: true })
|
||||
|
||||
if (userRoles.includes(guildRole)) {
|
||||
await interaction.editReply("You are already a member of the guild.")
|
||||
await interaction.editReply(
|
||||
"You are already a member of the guild.",
|
||||
)
|
||||
return
|
||||
}
|
||||
|
||||
const application = await guildapp.findOne({ userID: user.user.id })
|
||||
|
||||
if (application) {
|
||||
await interaction.editReply("You already have an application in progress.")
|
||||
await interaction.editReply(
|
||||
"You already have an application in progress.",
|
||||
)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -53,20 +62,25 @@ export = {
|
||||
.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.")
|
||||
.setDescription(
|
||||
"You have uploaded an attachment. Please do not upload images, videos, or GIFS.",
|
||||
)
|
||||
.setColor(embedColor)
|
||||
|
||||
try {
|
||||
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 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,
|
||||
}]
|
||||
embeds: [
|
||||
{
|
||||
title: "Guild Application",
|
||||
description:
|
||||
"Please answer the following questions to apply for the guild.\n" +
|
||||
"If you wish to cancel your application, please 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("Please enable your DMs.")
|
||||
@@ -78,7 +92,7 @@ export = {
|
||||
const input = await user.dmChannel!.awaitMessages({
|
||||
filter: m => m.author.id === user.user.id,
|
||||
max: 1,
|
||||
time: 1000 * 60
|
||||
time: 1000 * 60,
|
||||
})
|
||||
if (input.size === 0) {
|
||||
await user.send({ embeds: [tooLong] })
|
||||
@@ -95,14 +109,20 @@ export = {
|
||||
|
||||
// first question
|
||||
await user.send({
|
||||
embeds: [{
|
||||
title: "**Question 1**",
|
||||
description: qu(1) + "\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."
|
||||
}
|
||||
}]
|
||||
embeds: [
|
||||
{
|
||||
title: "**Question 1**",
|
||||
description:
|
||||
qu(1) +
|
||||
"\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.user.id,
|
||||
@@ -123,21 +143,26 @@ export = {
|
||||
}
|
||||
if (answer1.first()!.content.length > 16) {
|
||||
await user.send({
|
||||
embeds: [{
|
||||
description: "Max character limit is 16.",
|
||||
color: embedColor
|
||||
}]
|
||||
embeds: [
|
||||
{
|
||||
description: "Max character limit is 16.",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
})
|
||||
return
|
||||
}
|
||||
const uuid = await getUUID(answer1.first()!.content)
|
||||
if (!uuid) {
|
||||
await user.send({
|
||||
embeds: [{
|
||||
description: "That is not a valid Minecraft username.\n" +
|
||||
"Application cancelled.",
|
||||
color: embedColor
|
||||
}]
|
||||
embeds: [
|
||||
{
|
||||
description:
|
||||
"That is not a valid Minecraft username.\n" +
|
||||
"Application cancelled.",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
})
|
||||
return
|
||||
}
|
||||
@@ -145,19 +170,24 @@ export = {
|
||||
|
||||
// second question
|
||||
await user.send({
|
||||
embeds: [{
|
||||
title: "**Question 2**",
|
||||
description: qu(2) + "\n\nPlease type your answer below or type `cancel` to cancel your application.\n" + "`(8 characters max)`",
|
||||
color: embedColor,
|
||||
footer: {
|
||||
text: "You have 15 minutes to respond to this message."
|
||||
}
|
||||
}]
|
||||
embeds: [
|
||||
{
|
||||
title: "**Question 2**",
|
||||
description:
|
||||
qu(2) +
|
||||
"\n\nPlease type your answer below or type `cancel` to cancel your application.\n" +
|
||||
"`(8 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.user.id,
|
||||
max: 1,
|
||||
time: 1000 * 60 * 15
|
||||
time: 1000 * 60 * 15,
|
||||
})
|
||||
if (answer2.size === 0) {
|
||||
await user.send({ embeds: [tooLong] })
|
||||
@@ -173,10 +203,12 @@ export = {
|
||||
}
|
||||
if (answer2.first()!.content.length > 8) {
|
||||
await user.send({
|
||||
embeds: [{
|
||||
description: "Max character limit is 8.",
|
||||
color: embedColor
|
||||
}]
|
||||
embeds: [
|
||||
{
|
||||
description: "Max character limit is 8.",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
})
|
||||
return
|
||||
}
|
||||
@@ -184,19 +216,25 @@ export = {
|
||||
|
||||
// third question
|
||||
await user.send({
|
||||
embeds: [{
|
||||
title: "**Question 3**",
|
||||
description: qu(3) + "\n\nPlease type your answer below or type `cancel` to cancel your application.\n`" + smallM + "`",
|
||||
color: embedColor,
|
||||
footer: {
|
||||
text: "You have 15 minutes to respond to this message."
|
||||
}
|
||||
}]
|
||||
embeds: [
|
||||
{
|
||||
title: "**Question 3**",
|
||||
description:
|
||||
qu(3) +
|
||||
"\n\nPlease type your answer below or type `cancel` to cancel your application.\n`" +
|
||||
smallM +
|
||||
"`",
|
||||
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.user.id,
|
||||
max: 1,
|
||||
time: 1000 * 60 * 15
|
||||
time: 1000 * 60 * 15,
|
||||
})
|
||||
if (answer3.size === 0) {
|
||||
await user.send({ embeds: [tooLong] })
|
||||
@@ -212,30 +250,38 @@ export = {
|
||||
}
|
||||
if (answer3.first()!.content.length > 128) {
|
||||
await user.send({
|
||||
embeds: [{
|
||||
description: "Max character limit is 128.",
|
||||
color: embedColor
|
||||
}]
|
||||
embeds: [
|
||||
{
|
||||
description: "Max character limit is 128.",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
})
|
||||
}
|
||||
const answer3_1 = answer3.first()!.content
|
||||
|
||||
// fourth question
|
||||
await user.send({
|
||||
embeds: [{
|
||||
title: "**Question 4**",
|
||||
description: qu(4) + "\n\nPlease type your answer below or type `cancel` to cancel your application." +
|
||||
" `(We expect a longer answer.)`\n`" + largeM + "`",
|
||||
color: embedColor,
|
||||
footer: {
|
||||
text: "You have 15 minutes to respond to this message."
|
||||
}
|
||||
}]
|
||||
embeds: [
|
||||
{
|
||||
title: "**Question 4**",
|
||||
description:
|
||||
qu(4) +
|
||||
"\n\nPlease type your answer below or type `cancel` to cancel your application." +
|
||||
" `(We expect a longer answer.)`\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.user.id,
|
||||
max: 1,
|
||||
time: 1000 * 60 * 15
|
||||
time: 1000 * 60 * 15,
|
||||
})
|
||||
if (answer4.size === 0) {
|
||||
await user.send({ embeds: [tooLong] })
|
||||
@@ -251,29 +297,37 @@ export = {
|
||||
}
|
||||
if (answer4.first()!.content.length > 256) {
|
||||
await user.send({
|
||||
embeds: [{
|
||||
description: "Max character limit is 256.",
|
||||
color: embedColor
|
||||
}]
|
||||
embeds: [
|
||||
{
|
||||
description: "Max character limit is 256.",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
})
|
||||
}
|
||||
const answer4_1 = answer4.first()!.content
|
||||
|
||||
// fifth question
|
||||
await user.send({
|
||||
embeds: [{
|
||||
title: "**Question 5**",
|
||||
description: qu(5) + "\n\nPlease type your answer below or type `cancel` to cancel your application.\n`" + smallM + "`",
|
||||
color: embedColor,
|
||||
footer: {
|
||||
text: "You have 15 minutes to respond to this message."
|
||||
}
|
||||
}]
|
||||
embeds: [
|
||||
{
|
||||
title: "**Question 5**",
|
||||
description:
|
||||
qu(5) +
|
||||
"\n\nPlease type your answer below or type `cancel` to cancel your application.\n`" +
|
||||
smallM +
|
||||
"`",
|
||||
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.user.id,
|
||||
max: 1,
|
||||
time: 1000 * 60 * 15
|
||||
time: 1000 * 60 * 15,
|
||||
})
|
||||
if (answer5.size === 0) {
|
||||
await user.send({ embeds: [tooLong] })
|
||||
@@ -289,29 +343,37 @@ export = {
|
||||
}
|
||||
if (answer5.first()!.content.length > 128) {
|
||||
await user.send({
|
||||
embeds: [{
|
||||
description: "Max character limit is 128.",
|
||||
color: embedColor
|
||||
}]
|
||||
embeds: [
|
||||
{
|
||||
description: "Max character limit is 128.",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
})
|
||||
}
|
||||
const answer5_1 = answer5.first()!.content
|
||||
|
||||
// sixth question
|
||||
await user.send({
|
||||
embeds: [{
|
||||
title: "**Question 6**",
|
||||
description: qu(6) + "\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."
|
||||
}
|
||||
}]
|
||||
embeds: [
|
||||
{
|
||||
title: "**Question 6**",
|
||||
description:
|
||||
qu(6) +
|
||||
"\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 answer6 = await user.dmChannel!.awaitMessages({
|
||||
filter: m => m.author.id === user.user.id,
|
||||
max: 1,
|
||||
time: 1000 * 60 * 15
|
||||
time: 1000 * 60 * 15,
|
||||
})
|
||||
if (answer6.size === 0) {
|
||||
await user.send({ embeds: [tooLong] })
|
||||
@@ -327,29 +389,37 @@ export = {
|
||||
}
|
||||
if (answer6.first()!.content.length > 256) {
|
||||
await user.send({
|
||||
embeds: [{
|
||||
description: "Max character limit is 256.",
|
||||
color: embedColor
|
||||
}]
|
||||
embeds: [
|
||||
{
|
||||
description: "Max character limit is 256.",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
})
|
||||
}
|
||||
const answer6_1 = answer6.first()!.content
|
||||
|
||||
// seventh question
|
||||
await user.send({
|
||||
embeds: [{
|
||||
title: "**Question 7**",
|
||||
description: qu(7) + "\n\nPlease type your answer below or type `cancel` to cancel your application.\n`" + smallM + "`",
|
||||
color: embedColor,
|
||||
footer: {
|
||||
text: "You have 15 minutes to respond to this message."
|
||||
}
|
||||
}]
|
||||
embeds: [
|
||||
{
|
||||
title: "**Question 7**",
|
||||
description:
|
||||
qu(7) +
|
||||
"\n\nPlease type your answer below or type `cancel` to cancel your application.\n`" +
|
||||
smallM +
|
||||
"`",
|
||||
color: embedColor,
|
||||
footer: {
|
||||
text: "You have 15 minutes to respond to this message.",
|
||||
},
|
||||
},
|
||||
],
|
||||
})
|
||||
const answer7 = await user.dmChannel!.awaitMessages({
|
||||
filter: m => m.author.id === user.user.id,
|
||||
max: 1,
|
||||
time: 1000 * 60 * 15
|
||||
time: 1000 * 60 * 15,
|
||||
})
|
||||
if (answer7.size === 0) {
|
||||
await user.send({ embeds: [tooLong] })
|
||||
@@ -365,29 +435,36 @@ export = {
|
||||
}
|
||||
if (answer7.first()!.content.length > 128) {
|
||||
await user.send({
|
||||
embeds: [{
|
||||
description: "Max character limit is 128.",
|
||||
color: embedColor
|
||||
}]
|
||||
embeds: [
|
||||
{
|
||||
description: "Max character limit is 128.",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
})
|
||||
}
|
||||
const answer7_1 = answer7!.first()!.content
|
||||
|
||||
// eighth question
|
||||
await user.send({
|
||||
embeds: [{
|
||||
title: "**Question 8**",
|
||||
description: qu(8) + "\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."
|
||||
}
|
||||
}]
|
||||
embeds: [
|
||||
{
|
||||
title: "**Question 8**",
|
||||
description:
|
||||
qu(8) +
|
||||
"\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 answer8 = await user.dmChannel!.awaitMessages({
|
||||
filter: m => m.author.id === user.user.id,
|
||||
max: 1,
|
||||
time: 1000 * 60 * 15
|
||||
time: 1000 * 60 * 15,
|
||||
})
|
||||
if (answer8.size === 0) {
|
||||
await user.send({ embeds: [tooLong] })
|
||||
@@ -403,25 +480,30 @@ export = {
|
||||
}
|
||||
if (answer8.first()!.content.length > 64) {
|
||||
await user.send({
|
||||
embeds: [{
|
||||
description: "Max character limit is 64.",
|
||||
color: embedColor
|
||||
}]
|
||||
embeds: [
|
||||
{
|
||||
description: "Max character limit is 64.",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
})
|
||||
}
|
||||
const answer8_1 = answer8.first()!.content
|
||||
|
||||
await user.send({
|
||||
embeds: [{
|
||||
description: "If you want to submit your application, type `yes` if not, type `no`",
|
||||
color: embedColor
|
||||
}]
|
||||
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.user.id,
|
||||
max: 1,
|
||||
time: 1000 * 60 * 5
|
||||
time: 1000 * 60 * 5,
|
||||
})
|
||||
if (final.size === 0) {
|
||||
await user.send({ embeds: [tooLong] })
|
||||
@@ -437,10 +519,12 @@ export = {
|
||||
}
|
||||
|
||||
await user.send({
|
||||
embeds: [{
|
||||
description: "Your application has been submitted!",
|
||||
color: embedColor
|
||||
}]
|
||||
embeds: [
|
||||
{
|
||||
description: "Your application has been submitted!",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
})
|
||||
|
||||
const newGuildApp = new guildapp({
|
||||
@@ -451,53 +535,61 @@ export = {
|
||||
|
||||
await newGuildApp.save()
|
||||
|
||||
const channel = guild.channels.cache.get(applicationsChannel) as GuildTextBasedChannel
|
||||
const channel = guild.channels.cache.get(
|
||||
applicationsChannel,
|
||||
) as GuildTextBasedChannel
|
||||
await channel.send({
|
||||
embeds: [{
|
||||
title: user.user.username + "#" + user.user.discriminator + " - Guild Application",
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: user.avatarURL() || guild.iconURL()!
|
||||
embeds: [
|
||||
{
|
||||
title:
|
||||
user.user.username +
|
||||
"#" +
|
||||
user.user.discriminator +
|
||||
" - Guild Application",
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: user.avatarURL() || guild.iconURL()!,
|
||||
},
|
||||
fields: [
|
||||
{
|
||||
name: rq(1),
|
||||
value: "```" + answer1_1 + "```",
|
||||
},
|
||||
{
|
||||
name: rq(2),
|
||||
value: "```" + answer2_1 + "```",
|
||||
},
|
||||
{
|
||||
name: rq(3),
|
||||
value: "```" + answer3_1 + "```",
|
||||
},
|
||||
{
|
||||
name: rq(4),
|
||||
value: "```" + answer4_1 + "```",
|
||||
},
|
||||
{
|
||||
name: rq(5),
|
||||
value: "```" + answer5_1 + "```",
|
||||
},
|
||||
{
|
||||
name: rq(6),
|
||||
value: "```" + answer6_1 + "```",
|
||||
},
|
||||
{
|
||||
name: rq(7),
|
||||
value: "```" + answer7_1 + "```",
|
||||
},
|
||||
{
|
||||
name: rq(8),
|
||||
value: "```" + answer8_1 + "```",
|
||||
},
|
||||
],
|
||||
footer: {
|
||||
icon_url: guild.iconURL()!,
|
||||
text: "ID: " + user.user.id,
|
||||
},
|
||||
},
|
||||
fields: [
|
||||
{
|
||||
name: rq(1),
|
||||
value: "```" + answer1_1 + "```"
|
||||
},
|
||||
{
|
||||
name: rq(2),
|
||||
value: "```" + answer2_1 + "```"
|
||||
},
|
||||
{
|
||||
name: rq(3),
|
||||
value: "```" + answer3_1 + "```"
|
||||
},
|
||||
{
|
||||
name: rq(4),
|
||||
value: "```" + answer4_1 + "```"
|
||||
},
|
||||
{
|
||||
name: rq(5),
|
||||
value: "```" + answer5_1 + "```"
|
||||
},
|
||||
{
|
||||
name: rq(6),
|
||||
value: "```" + answer6_1 + "```"
|
||||
},
|
||||
{
|
||||
name: rq(7),
|
||||
value: "```" + answer7_1 + "```"
|
||||
},
|
||||
{
|
||||
name: rq(8),
|
||||
value: "```" + answer8_1 + "```"
|
||||
}
|
||||
],
|
||||
footer: {
|
||||
icon_url: guild.iconURL()!,
|
||||
text: "ID: " + user.user.id
|
||||
}
|
||||
}],
|
||||
],
|
||||
components: [
|
||||
new ActionRowBuilder<ButtonBuilder>().addComponents(
|
||||
new ButtonBuilder()
|
||||
@@ -511,11 +603,10 @@ export = {
|
||||
new ButtonBuilder()
|
||||
.setCustomId("checkstats")
|
||||
.setLabel("Check Stats")
|
||||
.setStyle(ButtonStyle.Secondary)
|
||||
)
|
||||
]
|
||||
.setStyle(ButtonStyle.Secondary),
|
||||
),
|
||||
],
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
} as Button
|
||||
},
|
||||
} as Button
|
||||
|
||||
@@ -1,10 +1,33 @@
|
||||
import { ButtonBuilder, ActionRowBuilder, ButtonStyle, EmbedBuilder, GuildMember, GuildTextBasedChannel } from "discord.js"
|
||||
import { gm, manager, moderator, beast, member, guildStaff, guildRole } from "../../../config/roles.json"
|
||||
import {
|
||||
ButtonBuilder,
|
||||
ActionRowBuilder,
|
||||
ButtonStyle,
|
||||
EmbedBuilder,
|
||||
GuildMember,
|
||||
GuildTextBasedChannel,
|
||||
} from "discord.js"
|
||||
import {
|
||||
gm,
|
||||
manager,
|
||||
moderator,
|
||||
beast,
|
||||
member,
|
||||
guildStaff,
|
||||
guildRole,
|
||||
} from "../../../config/roles.json"
|
||||
import { ignM, smallM, largeM } from "../../../config/limitmessages.json"
|
||||
import { inactivity } from "../../../config/questions.json"
|
||||
import { color, inactivityLogChannel } from "../../../config/options.json"
|
||||
import { Button } from "../../interfaces"
|
||||
const guildRoles = [gm, manager, moderator, beast, member, guildStaff, guildRole]
|
||||
const guildRoles = [
|
||||
gm,
|
||||
manager,
|
||||
moderator,
|
||||
beast,
|
||||
member,
|
||||
guildStaff,
|
||||
guildRole,
|
||||
]
|
||||
|
||||
module.exports = {
|
||||
name: "guildinactivitylog",
|
||||
@@ -18,10 +41,10 @@ module.exports = {
|
||||
const userRoles = user.roles.cache
|
||||
const mojangAPI = "https://api.mojang.com/users/profiles/minecraft/"
|
||||
|
||||
if (!userRoles.some((role) => guildRoles.includes(role.id))) {
|
||||
if (!userRoles.some(role => guildRoles.includes(role.id))) {
|
||||
return await interaction.reply({
|
||||
content: "Only guild members can use this button.",
|
||||
ephemeral: true
|
||||
ephemeral: true,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -40,30 +63,42 @@ module.exports = {
|
||||
.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.")
|
||||
.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
|
||||
}]
|
||||
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 })
|
||||
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.user.id,
|
||||
filter: m => m.author.id === user.user.id,
|
||||
max: 1,
|
||||
time: 1000 * 60
|
||||
time: 1000 * 60,
|
||||
})
|
||||
if (input.first()!.attachments.size > 0) {
|
||||
await user.send({ embeds: [attachments] })
|
||||
@@ -79,20 +114,26 @@ module.exports = {
|
||||
}
|
||||
|
||||
await user.send({
|
||||
embeds: [{
|
||||
title: "**Question 1**",
|
||||
description: sq(1) + "\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."
|
||||
}
|
||||
}]
|
||||
embeds: [
|
||||
{
|
||||
title: "**Question 1**",
|
||||
description:
|
||||
sq(1) +
|
||||
"\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.user.id,
|
||||
filter: m => m.author.id === user.user.id,
|
||||
max: 1,
|
||||
time: 1000 * 60 * 5
|
||||
time: 1000 * 60 * 5,
|
||||
})
|
||||
if (answer1.first()!.attachments.size > 0) {
|
||||
await user.send({ embeds: [attachments] })
|
||||
@@ -100,10 +141,12 @@ module.exports = {
|
||||
}
|
||||
if (answer1.first()!.content.length > 16) {
|
||||
await user.send({
|
||||
embeds: [{
|
||||
description: "Max character limit is 16.",
|
||||
color: embedColor
|
||||
}]
|
||||
embeds: [
|
||||
{
|
||||
description: "Max character limit is 16.",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
})
|
||||
return
|
||||
}
|
||||
@@ -111,10 +154,14 @@ module.exports = {
|
||||
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
|
||||
}]
|
||||
embeds: [
|
||||
{
|
||||
description:
|
||||
"That is not a valid Minecraft username.\n" +
|
||||
"Application cancelled.",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
})
|
||||
return
|
||||
}
|
||||
@@ -129,19 +176,25 @@ module.exports = {
|
||||
const answer1_1 = answer1.first()!.content
|
||||
|
||||
await user.send({
|
||||
embeds: [{
|
||||
title: "**Question 2**",
|
||||
description: sq(2) + "\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."
|
||||
}
|
||||
}]
|
||||
embeds: [
|
||||
{
|
||||
title: "**Question 2**",
|
||||
description:
|
||||
sq(2) +
|
||||
"\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.user.id,
|
||||
filter: m => m.author.id === user.user.id,
|
||||
max: 1,
|
||||
time: 1000 * 60 * 5
|
||||
time: 1000 * 60 * 5,
|
||||
})
|
||||
if (answer2.first()!.attachments.size > 0) {
|
||||
await user.send({ embeds: [attachments] })
|
||||
@@ -149,10 +202,12 @@ module.exports = {
|
||||
}
|
||||
if (answer2.first()!.content.length > 128) {
|
||||
await user.send({
|
||||
embeds: [{
|
||||
description: "Max character limit is 128.",
|
||||
color: embedColor
|
||||
}]
|
||||
embeds: [
|
||||
{
|
||||
description: "Max character limit is 128.",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
})
|
||||
return
|
||||
}
|
||||
@@ -167,19 +222,25 @@ module.exports = {
|
||||
const answer2_1 = answer1.first()!.content
|
||||
|
||||
await user.send({
|
||||
embeds: [{
|
||||
title: "**Question 3**",
|
||||
description: sq(3) + "\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."
|
||||
}
|
||||
}]
|
||||
embeds: [
|
||||
{
|
||||
title: "**Question 3**",
|
||||
description:
|
||||
sq(3) +
|
||||
"\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.user.id,
|
||||
filter: m => m.author.id === user.user.id,
|
||||
max: 1,
|
||||
time: 1000 * 60 * 15
|
||||
time: 1000 * 60 * 15,
|
||||
})
|
||||
if (answer3.first()!.attachments.size > 0) {
|
||||
await user.send({ embeds: [attachments] })
|
||||
@@ -187,10 +248,12 @@ module.exports = {
|
||||
}
|
||||
if (answer3.first()!.content.length > 256) {
|
||||
await user.send({
|
||||
embeds: [{
|
||||
description: "Max character limit is 256",
|
||||
color: embedColor
|
||||
}]
|
||||
embeds: [
|
||||
{
|
||||
description: "Max character limit is 256",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
})
|
||||
return
|
||||
}
|
||||
@@ -205,15 +268,18 @@ module.exports = {
|
||||
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
|
||||
}]
|
||||
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.user.id,
|
||||
max: 1,
|
||||
time: 1000 * 60 * 5
|
||||
time: 1000 * 60 * 5,
|
||||
})
|
||||
if (final.first()!.attachments.size > 0) {
|
||||
await user.send({ embeds: [attachments] })
|
||||
@@ -229,40 +295,50 @@ module.exports = {
|
||||
}
|
||||
|
||||
await user.send({
|
||||
embeds: [{
|
||||
description: "Your application has been submitted!",
|
||||
color: embedColor
|
||||
}]
|
||||
embeds: [
|
||||
{
|
||||
description: "Your application has been submitted!",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
})
|
||||
|
||||
const appChannel = guild.channels.cache.get(inactivityLogChannel) as GuildTextBasedChannel
|
||||
const appChannel = guild.channels.cache.get(
|
||||
inactivityLogChannel,
|
||||
) as GuildTextBasedChannel
|
||||
|
||||
await appChannel.send({
|
||||
embeds: [{
|
||||
title: user.user.username + "#" + user.user.discriminator + " - Inactivity Application",
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: user.displayAvatarURL({ forceStatic: false })
|
||||
embeds: [
|
||||
{
|
||||
title:
|
||||
user.user.username +
|
||||
"#" +
|
||||
user.user.discriminator +
|
||||
" - Inactivity Application",
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: user.displayAvatarURL({ forceStatic: false }),
|
||||
},
|
||||
fields: [
|
||||
{
|
||||
name: rq(1),
|
||||
value: "`" + answer1_1 + "`",
|
||||
},
|
||||
{
|
||||
name: rq(2),
|
||||
value: "`" + answer2_1 + "`",
|
||||
},
|
||||
{
|
||||
name: rq(3),
|
||||
value: "`" + answer3_1 + "`",
|
||||
},
|
||||
],
|
||||
footer: {
|
||||
icon_url: user.displayAvatarURL({ forceStatic: false }),
|
||||
text: "ID: " + user.user.id,
|
||||
},
|
||||
},
|
||||
fields: [
|
||||
{
|
||||
name: rq(1),
|
||||
value: "`" + answer1_1 + "`"
|
||||
},
|
||||
{
|
||||
name: rq(2),
|
||||
value: "`" + answer2_1 + "`"
|
||||
},
|
||||
{
|
||||
name: rq(3),
|
||||
value: "`" + answer3_1 + "`"
|
||||
}
|
||||
],
|
||||
footer: {
|
||||
icon_url: user.displayAvatarURL({ forceStatic: false }),
|
||||
text: "ID: " + user.user.id
|
||||
}
|
||||
}],
|
||||
],
|
||||
components: [
|
||||
new ActionRowBuilder<ButtonBuilder>().addComponents(
|
||||
new ButtonBuilder()
|
||||
@@ -273,8 +349,8 @@ module.exports = {
|
||||
.setCustomId("inactiveapplicationdeny")
|
||||
.setLabel("Deny")
|
||||
.setStyle(ButtonStyle.Danger),
|
||||
)
|
||||
]
|
||||
),
|
||||
],
|
||||
})
|
||||
}
|
||||
} as Button
|
||||
},
|
||||
} as Button
|
||||
|
||||
@@ -6,8 +6,9 @@ export = {
|
||||
type: "button",
|
||||
|
||||
async execute(interaction) {
|
||||
|
||||
await interaction.reply({ content: "This button is currently disabled.", ephemeral: true })
|
||||
|
||||
}
|
||||
} as Button
|
||||
await interaction.reply({
|
||||
content: "This button is currently disabled.",
|
||||
ephemeral: true,
|
||||
})
|
||||
},
|
||||
} as Button
|
||||
|
||||
@@ -6,8 +6,9 @@ export = {
|
||||
type: "button",
|
||||
|
||||
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,
|
||||
})
|
||||
},
|
||||
} as Button
|
||||
|
||||
@@ -20,13 +20,17 @@ export = {
|
||||
const applicantId = embed.footer!.text.split(" ")[1]
|
||||
|
||||
const applicant = await guild.members.fetch(applicantId)
|
||||
const applicantUsername = applicant.user.username + "#" + applicant.user.discriminator
|
||||
const applicantUsername =
|
||||
applicant.user.username + "#" + applicant.user.discriminator
|
||||
|
||||
await applicant.send({
|
||||
embeds: [{
|
||||
description: "Your application for the Illegitimate staff team has been accepted.",
|
||||
color: embedColor
|
||||
}]
|
||||
embeds: [
|
||||
{
|
||||
description:
|
||||
"Your application for the Illegitimate staff team has been accepted.",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
})
|
||||
|
||||
await message.edit({
|
||||
@@ -41,26 +45,28 @@ export = {
|
||||
.setCustomId("staffapplicationdeny")
|
||||
.setLabel("Deny")
|
||||
.setStyle(ButtonStyle.Danger)
|
||||
.setDisabled(true)
|
||||
)
|
||||
]
|
||||
.setDisabled(true),
|
||||
),
|
||||
],
|
||||
})
|
||||
|
||||
await staffapp.findOneAndDelete({ userID: applicantId })
|
||||
|
||||
await interaction.editReply({
|
||||
embeds: [{
|
||||
title: applicantUsername + " - Staff Application.",
|
||||
description: "Application accepted by <@" + user.id + ">.",
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: applicant.avatarURL()!
|
||||
embeds: [
|
||||
{
|
||||
title: applicantUsername + " - Staff Application.",
|
||||
description: "Application accepted by <@" + user.id + ">.",
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: applicant.avatarURL()!,
|
||||
},
|
||||
footer: {
|
||||
icon_url: guild.iconURL()!,
|
||||
text: "ID: " + applicantId,
|
||||
},
|
||||
},
|
||||
footer: {
|
||||
icon_url: guild.iconURL()!,
|
||||
text: "ID: " + applicantId
|
||||
}
|
||||
}]
|
||||
],
|
||||
})
|
||||
}
|
||||
} as Button
|
||||
},
|
||||
} as Button
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
import { ModalBuilder, ActionRowBuilder, TextInputBuilder, TextInputStyle } from "discord.js"
|
||||
import {
|
||||
ModalBuilder,
|
||||
ActionRowBuilder,
|
||||
TextInputBuilder,
|
||||
TextInputStyle,
|
||||
} from "discord.js"
|
||||
import { Button } from "../../interfaces"
|
||||
|
||||
export = {
|
||||
@@ -7,7 +12,6 @@ export = {
|
||||
type: "button",
|
||||
|
||||
async execute(interaction) {
|
||||
|
||||
const modal = new ModalBuilder()
|
||||
.setTitle("Deny Reason")
|
||||
.setCustomId("staffdenyreasonbox")
|
||||
@@ -17,10 +21,12 @@ export = {
|
||||
.setLabel("Deny Reason")
|
||||
.setCustomId("staffdenyreason")
|
||||
.setStyle(TextInputStyle.Paragraph)
|
||||
.setPlaceholder("Enter a reason for denying the application")
|
||||
.setRequired(false)
|
||||
)
|
||||
.setPlaceholder(
|
||||
"Enter a reason for denying the application",
|
||||
)
|
||||
.setRequired(false),
|
||||
),
|
||||
)
|
||||
await interaction.showModal(modal)
|
||||
}
|
||||
},
|
||||
} as Button
|
||||
|
||||
@@ -1,4 +1,11 @@
|
||||
import { ButtonBuilder, ButtonStyle, ActionRowBuilder, EmbedBuilder, GuildMember, GuildTextBasedChannel } from "discord.js"
|
||||
import {
|
||||
ButtonBuilder,
|
||||
ButtonStyle,
|
||||
ActionRowBuilder,
|
||||
EmbedBuilder,
|
||||
GuildMember,
|
||||
GuildTextBasedChannel,
|
||||
} from "discord.js"
|
||||
import { color, staffApplicationsChannel } from "../../../config/options.json"
|
||||
import { largeM, ignM } from "../../../config/limitmessages.json"
|
||||
import questions from "../../../config/questions.json"
|
||||
@@ -16,7 +23,6 @@ export = {
|
||||
type: "button",
|
||||
|
||||
async execute(interaction) {
|
||||
|
||||
const user = interaction.member as GuildMember
|
||||
const guild = interaction.guild!
|
||||
const embedColor = Number(color.replace("#", "0x"))
|
||||
@@ -34,12 +40,13 @@ export = {
|
||||
}
|
||||
|
||||
if (interaction.customId === "staffapply") {
|
||||
|
||||
await interaction.deferReply({ ephemeral: true })
|
||||
|
||||
if (user.user.id !== config.prod.dev) {
|
||||
if (status === "0") {
|
||||
await interaction.editReply("Staff applications are currently closed.")
|
||||
await interaction.editReply(
|
||||
"Staff applications are currently closed.",
|
||||
)
|
||||
return
|
||||
}
|
||||
}
|
||||
@@ -57,7 +64,9 @@ export = {
|
||||
const application = await staffapp.findOne({ userID: user.user.id })
|
||||
|
||||
if (application) {
|
||||
await interaction.editReply("You already have an application in progress.")
|
||||
await interaction.editReply(
|
||||
"You already have an application in progress.",
|
||||
)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -68,20 +77,25 @@ export = {
|
||||
.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.")
|
||||
.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" +
|
||||
"You have a minute to respond to this message.",
|
||||
color: embedColor,
|
||||
}]
|
||||
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("Please enable your DMs.")
|
||||
@@ -93,7 +107,7 @@ export = {
|
||||
const input = await user.dmChannel!.awaitMessages({
|
||||
filter: m => m.author.id === user.user.id,
|
||||
max: 1,
|
||||
time: 1000 * 60
|
||||
time: 1000 * 60,
|
||||
})
|
||||
if (input.size === 0) {
|
||||
await user.send({ embeds: [tooLong] })
|
||||
@@ -110,14 +124,20 @@ export = {
|
||||
|
||||
// first question
|
||||
await user.send({
|
||||
embeds: [{
|
||||
title: "**Question 1**",
|
||||
description: sq(1) + "\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."
|
||||
}
|
||||
}]
|
||||
embeds: [
|
||||
{
|
||||
title: "**Question 1**",
|
||||
description:
|
||||
sq(1) +
|
||||
"\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.user.id,
|
||||
@@ -138,21 +158,26 @@ export = {
|
||||
}
|
||||
if (answer1.first()!.content.length > 16) {
|
||||
await user.send({
|
||||
embeds: [{
|
||||
description: "Max character limit is 16.",
|
||||
color: embedColor
|
||||
}]
|
||||
embeds: [
|
||||
{
|
||||
description: "Max character limit is 16.",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
})
|
||||
return
|
||||
}
|
||||
const uuid = await getUUID(answer1.first()!.content)
|
||||
if (!uuid) {
|
||||
await user.send({
|
||||
embeds: [{
|
||||
description: "That is not a valid Minecraft username.\n" +
|
||||
"Application cancelled.",
|
||||
color: embedColor
|
||||
}]
|
||||
embeds: [
|
||||
{
|
||||
description:
|
||||
"That is not a valid Minecraft username.\n" +
|
||||
"Application cancelled.",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
})
|
||||
return
|
||||
}
|
||||
@@ -160,19 +185,24 @@ export = {
|
||||
|
||||
// second question
|
||||
await user.send({
|
||||
embeds: [{
|
||||
title: "**Question 2**",
|
||||
description: sq(2) + "\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."
|
||||
}
|
||||
}]
|
||||
embeds: [
|
||||
{
|
||||
title: "**Question 2**",
|
||||
description:
|
||||
sq(2) +
|
||||
"\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.user.id,
|
||||
max: 1,
|
||||
time: 1000 * 60 * 15
|
||||
time: 1000 * 60 * 15,
|
||||
})
|
||||
if (answer2.size === 0) {
|
||||
await user.send({ embeds: [tooLong] })
|
||||
@@ -188,10 +218,12 @@ export = {
|
||||
}
|
||||
if (answer2.first()!.content.length > 64) {
|
||||
await user.send({
|
||||
embeds: [{
|
||||
description: "Max character limit is 64.",
|
||||
color: embedColor
|
||||
}]
|
||||
embeds: [
|
||||
{
|
||||
description: "Max character limit is 64.",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
})
|
||||
return
|
||||
}
|
||||
@@ -199,19 +231,25 @@ export = {
|
||||
|
||||
// third question
|
||||
await user.send({
|
||||
embeds: [{
|
||||
title: "**Question 3**",
|
||||
description: sq(3) + "\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."
|
||||
}
|
||||
}]
|
||||
embeds: [
|
||||
{
|
||||
title: "**Question 3**",
|
||||
description:
|
||||
sq(3) +
|
||||
"\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.user.id,
|
||||
max: 1,
|
||||
time: 1000 * 60 * 15
|
||||
time: 1000 * 60 * 15,
|
||||
})
|
||||
if (answer3.size === 0) {
|
||||
await user.send({ embeds: [tooLong] })
|
||||
@@ -227,29 +265,37 @@ export = {
|
||||
}
|
||||
if (answer3.first()!.content.length > 256) {
|
||||
await user.send({
|
||||
embeds: [{
|
||||
description: "Max character limit is 256.",
|
||||
color: embedColor
|
||||
}]
|
||||
embeds: [
|
||||
{
|
||||
description: "Max character limit is 256.",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
})
|
||||
}
|
||||
const answer3_1 = answer3.first()!.content
|
||||
|
||||
// fourth question
|
||||
await user.send({
|
||||
embeds: [{
|
||||
title: "**Question 4**",
|
||||
description: sq(4) + "\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."
|
||||
}
|
||||
}]
|
||||
embeds: [
|
||||
{
|
||||
title: "**Question 4**",
|
||||
description:
|
||||
sq(4) +
|
||||
"\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.user.id,
|
||||
max: 1,
|
||||
time: 1000 * 60 * 15
|
||||
time: 1000 * 60 * 15,
|
||||
})
|
||||
if (answer4.size === 0) {
|
||||
await user.send({ embeds: [tooLong] })
|
||||
@@ -265,29 +311,37 @@ export = {
|
||||
}
|
||||
if (answer4.first()!.content.length > 256) {
|
||||
await user.send({
|
||||
embeds: [{
|
||||
description: "Max character limit is 256.",
|
||||
color: embedColor
|
||||
}]
|
||||
embeds: [
|
||||
{
|
||||
description: "Max character limit is 256.",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
})
|
||||
}
|
||||
const answer4_1 = answer4.first()!.content
|
||||
|
||||
// fifth question
|
||||
await user.send({
|
||||
embeds: [{
|
||||
title: "**Question 5**",
|
||||
description: sq(5) + "\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."
|
||||
}
|
||||
}]
|
||||
embeds: [
|
||||
{
|
||||
title: "**Question 5**",
|
||||
description:
|
||||
sq(5) +
|
||||
"\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.user.id,
|
||||
max: 1,
|
||||
time: 1000 * 60 * 15
|
||||
time: 1000 * 60 * 15,
|
||||
})
|
||||
if (answer5.size === 0) {
|
||||
await user.send({ embeds: [tooLong] })
|
||||
@@ -303,30 +357,38 @@ export = {
|
||||
}
|
||||
if (answer5.first()!.content.length > 256) {
|
||||
await user.send({
|
||||
embeds: [{
|
||||
description: "Max character limit is 256.",
|
||||
color: embedColor
|
||||
}]
|
||||
embeds: [
|
||||
{
|
||||
description: "Max character limit is 256.",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
})
|
||||
}
|
||||
const answer5_1 = answer5.first()!.content
|
||||
|
||||
// sixth question
|
||||
await user.send({
|
||||
embeds: [{
|
||||
title: "**Question 6**",
|
||||
description: sq(6) + "\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."
|
||||
}
|
||||
}]
|
||||
embeds: [
|
||||
{
|
||||
title: "**Question 6**",
|
||||
description:
|
||||
sq(6) +
|
||||
"\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.user.id,
|
||||
max: 1,
|
||||
time: 1000 * 60 * 15
|
||||
time: 1000 * 60 * 15,
|
||||
})
|
||||
if (answer6.size === 0) {
|
||||
await user.send({ embeds: [tooLong] })
|
||||
@@ -342,25 +404,30 @@ export = {
|
||||
}
|
||||
if (answer6.first()!.content.length > 256) {
|
||||
await user.send({
|
||||
embeds: [{
|
||||
description: "Max character limit is 256.",
|
||||
color: embedColor
|
||||
}]
|
||||
embeds: [
|
||||
{
|
||||
description: "Max character limit is 256.",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
})
|
||||
}
|
||||
const answer6_1 = answer6.first()!.content
|
||||
|
||||
await user.send({
|
||||
embeds: [{
|
||||
description: "If you want to submit your application, type `yes` if not, type `no`",
|
||||
color: embedColor
|
||||
}]
|
||||
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.user.id,
|
||||
max: 1,
|
||||
time: 1000 * 60 * 5
|
||||
time: 1000 * 60 * 5,
|
||||
})
|
||||
if (final.size === 0) {
|
||||
await user.send({ embeds: [tooLong] })
|
||||
@@ -376,10 +443,12 @@ export = {
|
||||
}
|
||||
|
||||
await user.send({
|
||||
embeds: [{
|
||||
description: "Your application has been submitted!",
|
||||
color: embedColor
|
||||
}]
|
||||
embeds: [
|
||||
{
|
||||
description: "Your application has been submitted!",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
})
|
||||
|
||||
const newStaffApp = new staffapp({
|
||||
@@ -391,47 +460,54 @@ export = {
|
||||
await newStaffApp.save()
|
||||
await user.deleteDM()
|
||||
|
||||
const channel = guild.channels.cache.get(staffApplicationsChannel) as GuildTextBasedChannel
|
||||
const channel = guild.channels.cache.get(
|
||||
staffApplicationsChannel,
|
||||
) as GuildTextBasedChannel
|
||||
|
||||
await channel.send({
|
||||
embeds: [{
|
||||
title: user.user.username + "#" + user.user.discriminator + " - Staff Application",
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: user.avatarURL() || guild.iconURL()!
|
||||
embeds: [
|
||||
{
|
||||
title:
|
||||
user.user.username +
|
||||
"#" +
|
||||
user.user.discriminator +
|
||||
" - Staff Application",
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: user.avatarURL() || guild.iconURL()!,
|
||||
},
|
||||
fields: [
|
||||
{
|
||||
name: rq(1),
|
||||
value: "```" + answer1_1 + "```",
|
||||
},
|
||||
{
|
||||
name: rq(2),
|
||||
value: "```" + answer2_1 + "```",
|
||||
},
|
||||
{
|
||||
name: rq(3),
|
||||
value: "```" + answer3_1 + "```",
|
||||
},
|
||||
{
|
||||
name: rq(4),
|
||||
value: "```" + answer4_1 + "```",
|
||||
},
|
||||
{
|
||||
name: rq(5),
|
||||
value: "```" + answer5_1 + "```",
|
||||
},
|
||||
{
|
||||
name: rq(6),
|
||||
value: "```" + answer6_1 + "```",
|
||||
},
|
||||
],
|
||||
footer: {
|
||||
icon_url: guild.iconURL()!,
|
||||
text: "ID: " + user.user.id,
|
||||
},
|
||||
},
|
||||
fields: [
|
||||
{
|
||||
name: rq(1),
|
||||
value: "```" + answer1_1 + "```"
|
||||
},
|
||||
{
|
||||
name: rq(2),
|
||||
value: "```" + answer2_1 + "```"
|
||||
},
|
||||
{
|
||||
name: rq(3),
|
||||
value: "```" + answer3_1 + "```"
|
||||
},
|
||||
{
|
||||
name: rq(4),
|
||||
value: "```" + answer4_1 + "```"
|
||||
},
|
||||
{
|
||||
name: rq(5),
|
||||
value: "```" + answer5_1 + "```"
|
||||
},
|
||||
{
|
||||
name: rq(6),
|
||||
value: "```" + answer6_1 + "```"
|
||||
}
|
||||
|
||||
],
|
||||
footer: {
|
||||
icon_url: guild.iconURL()!,
|
||||
text: "ID: " + user.user.id
|
||||
}
|
||||
}],
|
||||
],
|
||||
components: [
|
||||
new ActionRowBuilder<ButtonBuilder>().addComponents(
|
||||
new ButtonBuilder()
|
||||
@@ -441,10 +517,10 @@ export = {
|
||||
new ButtonBuilder()
|
||||
.setCustomId("staffapplicationdeny")
|
||||
.setLabel("Deny")
|
||||
.setStyle(ButtonStyle.Danger)
|
||||
)
|
||||
]
|
||||
.setStyle(ButtonStyle.Danger),
|
||||
),
|
||||
],
|
||||
})
|
||||
}
|
||||
}
|
||||
} as Button
|
||||
},
|
||||
} as Button
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
import { ModalBuilder, ActionRowBuilder, TextInputBuilder, TextInputStyle } from "discord.js"
|
||||
import {
|
||||
ModalBuilder,
|
||||
ActionRowBuilder,
|
||||
TextInputBuilder,
|
||||
TextInputStyle,
|
||||
} from "discord.js"
|
||||
import { Button } from "../../interfaces"
|
||||
|
||||
export = {
|
||||
@@ -7,7 +12,6 @@ export = {
|
||||
type: "button",
|
||||
|
||||
async execute(interaction) {
|
||||
|
||||
const modal = new ModalBuilder()
|
||||
.setTitle("Verification")
|
||||
.setCustomId("verifybox")
|
||||
@@ -20,9 +24,9 @@ export = {
|
||||
.setPlaceholder("Enter your ign.")
|
||||
.setRequired(true)
|
||||
.setMinLength(3)
|
||||
.setMaxLength(16)
|
||||
)
|
||||
.setMaxLength(16),
|
||||
),
|
||||
)
|
||||
await interaction.showModal(modal)
|
||||
}
|
||||
} as Button
|
||||
},
|
||||
} as Button
|
||||
|
||||
@@ -9,7 +9,6 @@ export = {
|
||||
type: "button",
|
||||
|
||||
async execute(interaction) {
|
||||
|
||||
await interaction.deferReply({ ephemeral: true })
|
||||
|
||||
const user = interaction.user
|
||||
@@ -18,7 +17,6 @@ export = {
|
||||
const accepted = await waitinglist.find()
|
||||
|
||||
for (let i = 0; i < accepted.length; i++) {
|
||||
|
||||
const uuid = accepted[i].uuid
|
||||
const guild = await getGuild(uuid)
|
||||
|
||||
@@ -26,36 +24,36 @@ export = {
|
||||
await waitinglist.findOneAndDelete({ uuid: uuid })
|
||||
continue
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
const fields = []
|
||||
|
||||
for (let i = 0; i < accepted.length; i++) {
|
||||
|
||||
const timestamp = Math.floor(accepted[i].timestamp / 1000)
|
||||
|
||||
fields.push({
|
||||
name: `${i + 1}. ${accepted[i].IGN}`,
|
||||
value: `TS: <t:${timestamp}:R>`
|
||||
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()!,
|
||||
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().toISOString(),
|
||||
},
|
||||
thumbnail: embed.thumbnail!,
|
||||
fields: fields,
|
||||
timestamp: new Date().toISOString(),
|
||||
}],
|
||||
],
|
||||
})
|
||||
|
||||
await interaction.editReply("Updated the waiting list")
|
||||
}
|
||||
} as Button
|
||||
},
|
||||
} as Button
|
||||
|
||||
@@ -1,4 +1,11 @@
|
||||
import { EmbedBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle, Message, GuildMember } from "discord.js"
|
||||
import {
|
||||
EmbedBuilder,
|
||||
ActionRowBuilder,
|
||||
ButtonBuilder,
|
||||
ButtonStyle,
|
||||
Message,
|
||||
GuildMember,
|
||||
} from "discord.js"
|
||||
import { color } from "../../../config/options.json"
|
||||
import guildapp from "../../schemas/guildAppSchema"
|
||||
import { Modal } from "../../interfaces"
|
||||
@@ -16,7 +23,9 @@ export = {
|
||||
const embed = message.embeds[0]
|
||||
const applicantId = embed.footer!.text.split(" ")[1]
|
||||
|
||||
const reason = interaction.fields.fields.get("denyreason")!.value || "No reason provided"
|
||||
const reason =
|
||||
interaction.fields.fields.get("denyreason")!.value ||
|
||||
"No reason provided"
|
||||
const embedColor = Number(color.replace("#", "0x"))
|
||||
|
||||
await message.edit({
|
||||
@@ -36,9 +45,9 @@ export = {
|
||||
.setCustomId("checkstats")
|
||||
.setLabel("Check Stats")
|
||||
.setStyle(ButtonStyle.Secondary)
|
||||
.setDisabled(true)
|
||||
)
|
||||
]
|
||||
.setDisabled(true),
|
||||
),
|
||||
],
|
||||
})
|
||||
|
||||
let applicant: GuildMember | null
|
||||
@@ -49,23 +58,35 @@ export = {
|
||||
}
|
||||
|
||||
const dmMessage = new EmbedBuilder()
|
||||
.setDescription("Your application for the Illegitimate guild has been denied\n" +
|
||||
"**Reason:** `" + reason + "`")
|
||||
.setDescription(
|
||||
"Your application for the Illegitimate guild has been denied\n" +
|
||||
"**Reason:** `" +
|
||||
reason +
|
||||
"`",
|
||||
)
|
||||
.setColor(embedColor)
|
||||
|
||||
const missingUser = new EmbedBuilder()
|
||||
.setDescription("[WARN] User has left the server and cannot be notified.")
|
||||
.setDescription(
|
||||
"[WARN] User has left the server and cannot be notified.",
|
||||
)
|
||||
.setColor(embedColor)
|
||||
|
||||
const responseEmbed = new EmbedBuilder()
|
||||
.setTitle("Application Denied")
|
||||
.setDescription("The application has been denied by <@" + interaction.user.id + ">.\n" +
|
||||
"**Reason:** `" + reason + "`")
|
||||
.setDescription(
|
||||
"The application has been denied by <@" +
|
||||
interaction.user.id +
|
||||
">.\n" +
|
||||
"**Reason:** `" +
|
||||
reason +
|
||||
"`",
|
||||
)
|
||||
.setColor(embedColor)
|
||||
.setThumbnail(guild.iconURL())
|
||||
.setFooter({
|
||||
iconURL: guild.iconURL()!,
|
||||
text: "ID: " + applicantId
|
||||
text: "ID: " + applicantId,
|
||||
})
|
||||
|
||||
if (applicant !== null) {
|
||||
@@ -82,7 +103,7 @@ export = {
|
||||
await guildapp.findOneAndDelete({ userID: applicantId })
|
||||
|
||||
await interaction.editReply({
|
||||
embeds: responseEmbeds
|
||||
embeds: responseEmbeds,
|
||||
})
|
||||
}
|
||||
} as Modal
|
||||
},
|
||||
} as Modal
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
import { EmbedBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle } from "discord.js"
|
||||
import {
|
||||
EmbedBuilder,
|
||||
ActionRowBuilder,
|
||||
ButtonBuilder,
|
||||
ButtonStyle,
|
||||
} from "discord.js"
|
||||
import { color } from "../../../config/options.json"
|
||||
import staffapp from "../../schemas/staffAppSchema"
|
||||
import { Modal } from "../../interfaces"
|
||||
@@ -12,7 +17,9 @@ export = {
|
||||
await interaction.deferReply()
|
||||
|
||||
const guild = interaction.guild
|
||||
const reason = interaction.fields.fields.get("staffdenyreason")!.value || "No reason provided"
|
||||
const reason =
|
||||
interaction.fields.fields.get("staffdenyreason")!.value ||
|
||||
"No reason provided"
|
||||
const embedColor = Number(color.replace("#", "0x"))
|
||||
|
||||
const message = interaction.message!
|
||||
@@ -33,13 +40,17 @@ export = {
|
||||
.setLabel("Deny")
|
||||
.setStyle(ButtonStyle.Danger)
|
||||
.setDisabled(true),
|
||||
)
|
||||
]
|
||||
),
|
||||
],
|
||||
})
|
||||
|
||||
const dmMessage = new EmbedBuilder()
|
||||
.setDescription("Your application for the Illegitimate guild staff has been denied\n" +
|
||||
"**Reason:** `" + reason + "`")
|
||||
.setDescription(
|
||||
"Your application for the Illegitimate guild staff has been denied\n" +
|
||||
"**Reason:** `" +
|
||||
reason +
|
||||
"`",
|
||||
)
|
||||
.setColor(embedColor)
|
||||
|
||||
await applicant.send({ embeds: [dmMessage] })
|
||||
@@ -47,19 +58,26 @@ export = {
|
||||
await staffapp.findOneAndDelete({ userID: applicantId })
|
||||
|
||||
await interaction.editReply({
|
||||
embeds: [{
|
||||
title: "Application Denied",
|
||||
description: "The application has been denied by <@" + interaction.user.id + ">.\n" +
|
||||
"**Reason:** `" + reason + "`",
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: applicant.avatarURL() || guild!.iconURL()!
|
||||
embeds: [
|
||||
{
|
||||
title: "Application Denied",
|
||||
description:
|
||||
"The application has been denied by <@" +
|
||||
interaction.user.id +
|
||||
">.\n" +
|
||||
"**Reason:** `" +
|
||||
reason +
|
||||
"`",
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: applicant.avatarURL() || guild!.iconURL()!,
|
||||
},
|
||||
footer: {
|
||||
icon_url: guild!.iconURL()!,
|
||||
text: "ID: " + applicant.id,
|
||||
},
|
||||
},
|
||||
footer: {
|
||||
icon_url: guild!.iconURL()!,
|
||||
text: "ID: " + applicant.id
|
||||
}
|
||||
}],
|
||||
],
|
||||
})
|
||||
}
|
||||
} as Modal
|
||||
},
|
||||
} as Modal
|
||||
|
||||
@@ -2,7 +2,17 @@ import { getUUID, getPlayer, getGuild, getHeadURL } from "../../utils/Hypixel"
|
||||
import { color, hypixelGuildID, devMessage } from "../../../config/options.json"
|
||||
import verify from "../../schemas/verifySchema"
|
||||
import mongoose from "mongoose"
|
||||
import { gm, manager, moderator, beast, elite, member, guildRole, guildStaff, defaultMember } from "../../../config/roles.json"
|
||||
import {
|
||||
gm,
|
||||
manager,
|
||||
moderator,
|
||||
beast,
|
||||
elite,
|
||||
member,
|
||||
guildRole,
|
||||
guildStaff,
|
||||
defaultMember,
|
||||
} from "../../../config/roles.json"
|
||||
import { Modal } from "../../interfaces"
|
||||
import { GuildMember } from "discord.js"
|
||||
|
||||
@@ -20,17 +30,23 @@ export = {
|
||||
|
||||
const verifyData = await verify.findOne({ userID: user.user.id })
|
||||
if (verifyData) {
|
||||
interaction.editReply("You are already verified.\n" + "Try running /update to update your roles.")
|
||||
interaction.editReply(
|
||||
"You are already verified.\n" +
|
||||
"Try running /update to update your roles.",
|
||||
)
|
||||
return
|
||||
}
|
||||
|
||||
const uuid = await getUUID(ign)
|
||||
if (!uuid) {
|
||||
interaction.editReply({
|
||||
embeds: [{
|
||||
description: "<a:questionmark_pink:1130206038008803488> That player does not exist.",
|
||||
color: embedColor
|
||||
}]
|
||||
embeds: [
|
||||
{
|
||||
description:
|
||||
"<a:questionmark_pink:1130206038008803488> That player does not exist.",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
})
|
||||
return
|
||||
}
|
||||
@@ -39,10 +55,13 @@ export = {
|
||||
const player = await getPlayer(uuid)
|
||||
if (!player) {
|
||||
interaction.editReply({
|
||||
embeds: [{
|
||||
description: "<a:questionmark_pink:1130206038008803488> That player hasn't played Hypixel before.",
|
||||
color: embedColor
|
||||
}]
|
||||
embeds: [
|
||||
{
|
||||
description:
|
||||
"<a:questionmark_pink:1130206038008803488> That player hasn't played Hypixel before.",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
})
|
||||
return
|
||||
}
|
||||
@@ -59,11 +78,16 @@ export = {
|
||||
interaction.editReply({
|
||||
embeds: [
|
||||
{
|
||||
description: "<a:cross_a:1087808606897983539> There is no Discord account linked to `" + player.displayname + "`.\n\n" +
|
||||
"**Please set your Discord tag on hypixel to `" + username + "` and try again.**",
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
description:
|
||||
"<a:cross_a:1087808606897983539> There is no Discord account linked to `" +
|
||||
player.displayname +
|
||||
"`.\n\n" +
|
||||
"**Please set your Discord tag on hypixel to `" +
|
||||
username +
|
||||
"` and try again.**",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
})
|
||||
return
|
||||
}
|
||||
@@ -72,11 +96,18 @@ export = {
|
||||
interaction.editReply({
|
||||
embeds: [
|
||||
{
|
||||
description: "<a:cross_a:1087808606897983539> The Discord account linked to `" + player.displayname + "` is currently `" + linkedDiscord + "`\n\n" +
|
||||
"**Please set your Discord tag on hypixel to `" + username + "` and try again.**",
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
description:
|
||||
"<a:cross_a:1087808606897983539> The Discord account linked to `" +
|
||||
player.displayname +
|
||||
"` is currently `" +
|
||||
linkedDiscord +
|
||||
"`\n\n" +
|
||||
"**Please set your Discord tag on hypixel to `" +
|
||||
username +
|
||||
"` and try again.**",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
})
|
||||
return
|
||||
}
|
||||
@@ -91,7 +122,9 @@ export = {
|
||||
|
||||
if (guildID === hypixelGuildID) {
|
||||
const GuildMembers = guild!.members
|
||||
const guildRank = GuildMembers.find((member) => member.uuid === player.uuid)!.rank
|
||||
const guildRank = GuildMembers.find(
|
||||
member => member.uuid === player.uuid,
|
||||
)!.rank
|
||||
|
||||
if (guildRank === "Guild Master" && guildID === hypixelGuildID) {
|
||||
await user.roles.add(gm, "Verification")
|
||||
@@ -131,7 +164,7 @@ export = {
|
||||
const newVerify = new verify({
|
||||
_id: new mongoose.Types.ObjectId(),
|
||||
userID: user.id,
|
||||
uuid: uuid
|
||||
uuid: uuid,
|
||||
})
|
||||
|
||||
await newVerify.save()
|
||||
@@ -140,19 +173,23 @@ export = {
|
||||
embeds: [
|
||||
{
|
||||
title: interaction.guild!.name,
|
||||
description: "You have successfully verified `" + username + "` with the account `" + player.displayname + "`.",
|
||||
description:
|
||||
"You have successfully verified `" +
|
||||
username +
|
||||
"` with the account `" +
|
||||
player.displayname +
|
||||
"`.",
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: head!
|
||||
url: head!,
|
||||
},
|
||||
footer: {
|
||||
icon_url: interaction.guild!.iconURL()!,
|
||||
text: interaction.guild!.name + " | " + devMessage
|
||||
}
|
||||
}
|
||||
]
|
||||
text: interaction.guild!.name + " | " + devMessage,
|
||||
},
|
||||
},
|
||||
],
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
} as Modal
|
||||
},
|
||||
} as Modal
|
||||
|
||||
@@ -9,34 +9,41 @@ const event: Event = {
|
||||
event: "guildMemberAdd",
|
||||
|
||||
execute(member: GuildMember) {
|
||||
|
||||
const channel = member.guild.channels.cache.get(botLogChannel)
|
||||
const embedColor = Number(color.replace("#", "0x"))
|
||||
|
||||
if (!channel) {
|
||||
console.log("[ERROR] Could not find channel used for new join logging.")
|
||||
console.log(
|
||||
"[ERROR] Could not find channel used for new join logging.",
|
||||
)
|
||||
return
|
||||
}
|
||||
|
||||
if (channel.type !== ChannelType.GuildText) {
|
||||
console.log("[ERROR] The channel used for new join logging is not a text channel.")
|
||||
console.log(
|
||||
"[ERROR] The channel used for new join logging is not a text channel.",
|
||||
)
|
||||
return
|
||||
}
|
||||
|
||||
channel.send({
|
||||
embeds: [{
|
||||
title: "New Member",
|
||||
description: userMention(member.id) + " has joined the server.\n" +
|
||||
"Account created: " + member.user.createdAt.toLocaleString(),
|
||||
color: embedColor,
|
||||
footer: {
|
||||
text: "ID: " + member.id
|
||||
embeds: [
|
||||
{
|
||||
title: "New Member",
|
||||
description:
|
||||
userMention(member.id) +
|
||||
" has joined the server.\n" +
|
||||
"Account created: " +
|
||||
member.user.createdAt.toLocaleString(),
|
||||
color: embedColor,
|
||||
footer: {
|
||||
text: "ID: " + member.id,
|
||||
},
|
||||
timestamp: new Date().toISOString(),
|
||||
},
|
||||
timestamp: new Date().toISOString()
|
||||
}]
|
||||
],
|
||||
})
|
||||
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
export = event
|
||||
export = event
|
||||
|
||||
@@ -10,25 +10,33 @@ const event: Event = {
|
||||
execute(interaction: ChatInputCommandInteraction | ButtonInteraction) {
|
||||
if (interaction.isCommand()) {
|
||||
try {
|
||||
console.log(interaction.user.username + " ran " +
|
||||
interaction.commandName + " " +
|
||||
interaction.options.getSubcommand()
|
||||
console.log(
|
||||
interaction.user.username +
|
||||
" ran " +
|
||||
interaction.commandName +
|
||||
" " +
|
||||
interaction.options.getSubcommand(),
|
||||
)
|
||||
} catch {
|
||||
console.log(interaction.user.username + " ran " +
|
||||
interaction.commandName
|
||||
console.log(
|
||||
interaction.user.username +
|
||||
" ran " +
|
||||
interaction.commandName,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (interaction.isButton()) {
|
||||
console.log(interaction.user.username + "#" +
|
||||
interaction.user.discriminator + " clicked " +
|
||||
interaction.customId
|
||||
console.log(
|
||||
interaction.user.username +
|
||||
"#" +
|
||||
interaction.user.discriminator +
|
||||
" clicked " +
|
||||
interaction.customId,
|
||||
)
|
||||
return
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
export = event
|
||||
export = event
|
||||
|
||||
@@ -8,10 +8,13 @@ const event: Event = {
|
||||
event: "messageCreate",
|
||||
|
||||
async execute(message: Message) {
|
||||
if (message.content.toLowerCase().includes("ur mom") && message.author.username === "taken.lua") {
|
||||
if (
|
||||
message.content.toLowerCase().includes("ur mom") &&
|
||||
message.author.username === "taken.lua"
|
||||
) {
|
||||
message.react("Woot:734345936347725885")
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
export = event
|
||||
export = event
|
||||
|
||||
@@ -9,7 +9,7 @@ const event: Event = {
|
||||
|
||||
execute(client: Client) {
|
||||
console.log("Logged in as " + client.user!.tag + "!")
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
export = event
|
||||
export = event
|
||||
|
||||
@@ -16,7 +16,9 @@ const event: Event = {
|
||||
const embedColor = Number(color.replace("#", "0x"))
|
||||
|
||||
if (!channel) {
|
||||
console.log("[ERROR] Could not find channel used for online message.")
|
||||
console.log(
|
||||
"[ERROR] Could not find channel used for online message.",
|
||||
)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -26,12 +28,14 @@ const event: Event = {
|
||||
}
|
||||
|
||||
channel.send({
|
||||
embeds: [{
|
||||
description: "Bot is online!",
|
||||
color: embedColor
|
||||
}]
|
||||
embeds: [
|
||||
{
|
||||
description: "Bot is online!",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
})
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
export = event
|
||||
export = event
|
||||
|
||||
@@ -9,7 +9,6 @@ const event: Event = {
|
||||
event: "ready",
|
||||
|
||||
execute(client: Client) {
|
||||
|
||||
// Playing 0
|
||||
// Streaming 1
|
||||
// Listening 2
|
||||
@@ -19,20 +18,16 @@ const event: Event = {
|
||||
|
||||
const user = client.user!
|
||||
|
||||
user.setActivity(
|
||||
{ name: statuses[0].name, type: statuses[0].type }
|
||||
)
|
||||
user.setActivity({ name: statuses[0].name, type: statuses[0].type })
|
||||
|
||||
let i = 1
|
||||
setInterval(() =>
|
||||
user.setActivity(
|
||||
statuses[i++ % statuses.length]
|
||||
),
|
||||
1000 * 60 * 10
|
||||
setInterval(
|
||||
() => user.setActivity(statuses[i++ % statuses.length]),
|
||||
1000 * 60 * 10,
|
||||
)
|
||||
|
||||
user.setStatus("dnd")
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
export = event
|
||||
export = event
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
import { userMention, channelMention, VoiceState, ChannelType } from "discord.js"
|
||||
import {
|
||||
userMention,
|
||||
channelMention,
|
||||
VoiceState,
|
||||
ChannelType,
|
||||
} from "discord.js"
|
||||
import { botLogChannel, color } from "../../../../config/options.json"
|
||||
import { Event } from "../../../interfaces"
|
||||
|
||||
@@ -8,21 +13,24 @@ const event: Event = {
|
||||
type: "event",
|
||||
event: "voiceStateUpdate",
|
||||
|
||||
execute(oldState: VoiceState, newState: VoiceState) {
|
||||
|
||||
if (process.env.NODE_ENV === 'dev') return
|
||||
execute(oldState: VoiceState, newState: VoiceState) {
|
||||
if (process.env.NODE_ENV === "dev") return
|
||||
|
||||
const guild = oldState.guild
|
||||
const channel = guild.channels.cache.get(botLogChannel)
|
||||
const embedColor = Number(color.replace("#", "0x"))
|
||||
|
||||
if (!channel) {
|
||||
console.log("[ERROR] Could not find channel used for voice channel join/leave logging.")
|
||||
console.log(
|
||||
"[ERROR] Could not find channel used for voice channel join/leave logging.",
|
||||
)
|
||||
return
|
||||
}
|
||||
|
||||
if (channel.type !== ChannelType.GuildText) {
|
||||
console.log("[ERROR] The channel used for voice channel join/leave logging is not a text channel.")
|
||||
console.log(
|
||||
"[ERROR] The channel used for voice channel join/leave logging is not a text channel.",
|
||||
)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -30,60 +38,62 @@ const event: Event = {
|
||||
const newChannel = newState.channel
|
||||
|
||||
if (oldChannel === null && newChannel !== null) {
|
||||
|
||||
channel.send({
|
||||
embeds: [{
|
||||
title: "Voice Channel Join",
|
||||
description: userMention(newState.member!.id) +
|
||||
" joined " +
|
||||
channelMention(newChannel.id),
|
||||
color: embedColor,
|
||||
footer: {
|
||||
text: "ID: " + newState.member!.id
|
||||
embeds: [
|
||||
{
|
||||
title: "Voice Channel Join",
|
||||
description:
|
||||
userMention(newState.member!.id) +
|
||||
" joined " +
|
||||
channelMention(newChannel.id),
|
||||
color: embedColor,
|
||||
footer: {
|
||||
text: "ID: " + newState.member!.id,
|
||||
},
|
||||
timestamp: new Date().toISOString(),
|
||||
},
|
||||
timestamp: new Date().toISOString()
|
||||
}]
|
||||
],
|
||||
})
|
||||
|
||||
} else if (oldChannel !== null && newChannel === null) {
|
||||
|
||||
channel.send({
|
||||
embeds: [{
|
||||
title: "Voice Channel Leave",
|
||||
description: userMention(oldState.member!.id) +
|
||||
" left " +
|
||||
channelMention(oldChannel.id),
|
||||
color: embedColor,
|
||||
footer: {
|
||||
text: "ID: " + oldState.member!.id
|
||||
embeds: [
|
||||
{
|
||||
title: "Voice Channel Leave",
|
||||
description:
|
||||
userMention(oldState.member!.id) +
|
||||
" left " +
|
||||
channelMention(oldChannel.id),
|
||||
color: embedColor,
|
||||
footer: {
|
||||
text: "ID: " + oldState.member!.id,
|
||||
},
|
||||
timestamp: new Date().toISOString(),
|
||||
},
|
||||
timestamp: new Date().toISOString()
|
||||
}]
|
||||
],
|
||||
})
|
||||
|
||||
} else if (oldChannel !== null && newChannel !== null) {
|
||||
|
||||
if (oldChannel.id === newChannel.id) return
|
||||
|
||||
channel.send({
|
||||
embeds: [{
|
||||
title: "Voice Channel Switch",
|
||||
description: userMention(oldState.member!.id) +
|
||||
" switched from " +
|
||||
channelMention(oldChannel.id) +
|
||||
" to " +
|
||||
channelMention(newChannel.id),
|
||||
color: embedColor,
|
||||
footer: {
|
||||
text: "ID: " + oldState.member!.id
|
||||
embeds: [
|
||||
{
|
||||
title: "Voice Channel Switch",
|
||||
description:
|
||||
userMention(oldState.member!.id) +
|
||||
" switched from " +
|
||||
channelMention(oldChannel.id) +
|
||||
" to " +
|
||||
channelMention(newChannel.id),
|
||||
color: embedColor,
|
||||
footer: {
|
||||
text: "ID: " + oldState.member!.id,
|
||||
},
|
||||
timestamp: new Date().toISOString(),
|
||||
},
|
||||
timestamp: new Date().toISOString()
|
||||
}]
|
||||
],
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
export = event
|
||||
export = event
|
||||
|
||||
Reference in New Issue
Block a user