Process of format fixing

This commit is contained in:
2024-01-19 21:36:01 +01:00
parent ee217d5f64
commit 3eed20e788
77 changed files with 1079 additions and 1086 deletions

View File

@@ -23,8 +23,8 @@ export = {
option option
.setName("ign") .setName("ign")
.setDescription("The IGN of the player.") .setDescription("The IGN of the player.")
.setRequired(true), .setRequired(true)
), )
) )
.addSubcommand(subcommand => .addSubcommand(subcommand =>
subcommand subcommand
@@ -34,9 +34,9 @@ export = {
option option
.setName("query") .setName("query")
.setDescription( .setDescription(
"The query to search for. [Default: player]", "The query to search for. [Default: player]"
) )
.setRequired(true), .setRequired(true)
) )
.addStringOption(option => .addStringOption(option =>
option option
@@ -45,9 +45,9 @@ export = {
.addChoices( .addChoices(
{ name: "Guild Member", value: "ign" }, { name: "Guild Member", value: "ign" },
{ name: "Guild Name", value: "name" }, { name: "Guild Name", value: "name" },
{ name: "Guild Id", value: "id" }, { name: "Guild Id", value: "id" }
), )
), )
) )
.addSubcommand(subcommand => .addSubcommand(subcommand =>
subcommand subcommand
@@ -57,9 +57,9 @@ export = {
option option
.setName("query") .setName("query")
.setDescription( .setDescription(
"The query to search for. [Default: player]", "The query to search for. [Default: player]"
) )
.setRequired(true), .setRequired(true)
) )
.addStringOption(option => .addStringOption(option =>
option option
@@ -68,16 +68,16 @@ export = {
.addChoices( .addChoices(
{ name: "Guild Member", value: "ign" }, { name: "Guild Member", value: "ign" },
{ name: "Guild Name", value: "name" }, { name: "Guild Name", value: "name" },
{ name: "Guild Id", value: "id" }, { name: "Guild Id", value: "id" }
), )
) )
.addNumberOption(option => .addNumberOption(option =>
option option
.setName("amount") .setName("amount")
.setDescription( .setDescription(
"The amount of guild members to show. [Default: 10]", "The amount of guild members to show. [Default: 10]"
), )
), )
) )
.setDMPermission(false), .setDMPermission(false),
@@ -107,10 +107,10 @@ export = {
color: embedColor, color: embedColor,
footer: { footer: {
text: interaction.guild!.name + " | " + devMessage, text: interaction.guild!.name + " | " + devMessage,
icon_url: interaction.guild!.iconURL() || undefined, icon_url: interaction.guild!.iconURL() || undefined
}, }
}, }
], ]
}) })
}, }
} as Command } as Command

View File

@@ -4,7 +4,7 @@ import { ChatInputCommandInteraction } from "discord.js"
import { GuildData } from "interfaces" import { GuildData } from "interfaces"
export default async function guildInfo( export default async function guildInfo(
interaction: ChatInputCommandInteraction, interaction: ChatInputCommandInteraction
): Promise<void> { ): Promise<void> {
await interaction.deferReply() await interaction.deferReply()
@@ -18,9 +18,9 @@ export default async function guildInfo(
embeds: [ embeds: [
{ {
description: "Fetching your uuid...", description: "Fetching your uuid...",
color: embedColor, color: embedColor
}, }
], ]
}) })
const uuid = await getUUID(query) const uuid = await getUUID(query)
@@ -29,9 +29,9 @@ export default async function guildInfo(
embeds: [ embeds: [
{ {
description: "That player doen't exist!", description: "That player doen't exist!",
color: embedColor, color: embedColor
}, }
], ]
}) })
return return
} }
@@ -40,9 +40,9 @@ export default async function guildInfo(
embeds: [ embeds: [
{ {
description: "Fetching your player data...", description: "Fetching your player data...",
color: embedColor, color: embedColor
}, }
], ]
}) })
const player = await getPlayer(uuid) const player = await getPlayer(uuid)
@@ -51,9 +51,9 @@ export default async function guildInfo(
embeds: [ embeds: [
{ {
description: "That player has never joined the server!", description: "That player has never joined the server!",
color: embedColor, color: embedColor
}, }
], ]
}) })
return return
} }
@@ -62,9 +62,9 @@ export default async function guildInfo(
embeds: [ embeds: [
{ {
description: "Fetching your guild data...", description: "Fetching your guild data...",
color: embedColor, color: embedColor
}, }
], ]
}) })
guild = await getGuild(uuid, "player") guild = await getGuild(uuid, "player")
@@ -73,9 +73,9 @@ export default async function guildInfo(
embeds: [ embeds: [
{ {
description: "That player is not in a guild!", description: "That player is not in a guild!",
color: embedColor, color: embedColor
}, }
], ]
}) })
return return
} }
@@ -84,9 +84,9 @@ export default async function guildInfo(
embeds: [ embeds: [
{ {
description: "Fetching your guild data...", description: "Fetching your guild data...",
color: embedColor, color: embedColor
}, }
], ]
}) })
guild = await getGuild(query, "name") guild = await getGuild(query, "name")
@@ -95,9 +95,9 @@ export default async function guildInfo(
embeds: [ embeds: [
{ {
description: "That guild doesn't exist!", description: "That guild doesn't exist!",
color: embedColor, color: embedColor
}, }
], ]
}) })
return return
} }
@@ -106,9 +106,9 @@ export default async function guildInfo(
embeds: [ embeds: [
{ {
description: "Fetching your guild data...", description: "Fetching your guild data...",
color: embedColor, color: embedColor
}, }
], ]
}) })
guild = await getGuild(query, "id") guild = await getGuild(query, "id")
@@ -117,9 +117,9 @@ export default async function guildInfo(
embeds: [ embeds: [
{ {
description: "That guild doesn't exist!", description: "That guild doesn't exist!",
color: embedColor, color: embedColor
}, }
], ]
}) })
return return
} }
@@ -157,14 +157,14 @@ export default async function guildInfo(
const guildOwner = guildMembers.find(m => m.rank === "Guild Master")!.uuid const guildOwner = guildMembers.find(m => m.rank === "Guild Master")!.uuid
const guildOwnerName = await getIGN(guildOwner) const guildOwnerName = await getIGN(guildOwner)
const guildRanksUnsorted = guild!.ranks.sort( const guildRanksUnsorted = guild!.ranks.sort(
(a, b) => b.priority - a.priority, (a, b) => b.priority - a.priority
) )
const guildRanks = guildRanksUnsorted const guildRanks = guildRanksUnsorted
.map(r => "**➺ " + r.name + "** `[" + r.tag + "]`") .map(r => "**➺ " + r.name + "** `[" + r.tag + "]`")
.join("\n") .join("\n")
const allGuildMembersWeeklyXP = guildMembers.map( const allGuildMembersWeeklyXP = guildMembers.map(
member => member.expHistory, member => member.expHistory
) )
const guildMembersWeeklyXP = allGuildMembersWeeklyXP.map(member => { const guildMembersWeeklyXP = allGuildMembersWeeklyXP.map(member => {
return Object.values(member).reduce((a, b) => a + b, 0) return Object.values(member).reduce((a, b) => a + b, 0)
@@ -172,17 +172,17 @@ export default async function guildInfo(
const totalGuildMembersWeeklyXPUnformatted = guildMembersWeeklyXP.reduce( const totalGuildMembersWeeklyXPUnformatted = guildMembersWeeklyXP.reduce(
(a, b) => a + b, (a, b) => a + b,
0, 0
) )
const totalGuildMembersWeeklyXP = new Intl.NumberFormat("en-US").format( const totalGuildMembersWeeklyXP = new Intl.NumberFormat("en-US").format(
totalGuildMembersWeeklyXPUnformatted, totalGuildMembersWeeklyXPUnformatted
) )
const averageGuildMembersWeeklyXPUnformatted = Math.round( const averageGuildMembersWeeklyXPUnformatted = Math.round(
totalGuildMembersWeeklyXPUnformatted / 7, totalGuildMembersWeeklyXPUnformatted / 7
) )
const averageGuildMembersWeeklyXP = new Intl.NumberFormat("en-US").format( const averageGuildMembersWeeklyXP = new Intl.NumberFormat("en-US").format(
averageGuildMembersWeeklyXPUnformatted, averageGuildMembersWeeklyXPUnformatted
) )
await interaction.editReply({ await interaction.editReply({
@@ -205,7 +205,7 @@ export default async function guildInfo(
fields: [ fields: [
{ {
name: "**Guild Ranks**", name: "**Guild Ranks**",
value: guildRanks, value: guildRanks
}, },
{ {
name: "**GEXP**", name: "**GEXP**",
@@ -218,19 +218,19 @@ export default async function guildInfo(
"`\n" + "`\n" +
"**➺ Total GEXP:** `" + "**➺ Total GEXP:** `" +
guildExp + guildExp +
"`", "`"
}, },
{ {
name: "**Guild Created**", name: "**Guild Created**",
value: "**➺ **`" + guildCreatedTime + "`", value: "**➺ **`" + guildCreatedTime + "`"
}, }
], ],
color: embedColor, color: embedColor,
footer: { footer: {
text: interaction.guild!.name + " | " + devMessage, text: interaction.guild!.name + " | " + devMessage,
icon_url: interaction.guild!.iconURL() || undefined, icon_url: interaction.guild!.iconURL() || undefined
}, }
}, }
], ]
}) })
} }

View File

@@ -3,7 +3,7 @@ import { color, devMessage } from "config/options.json"
import { ChatInputCommandInteraction } from "discord.js" import { ChatInputCommandInteraction } from "discord.js"
export default async function guildMember( export default async function guildMember(
interaction: ChatInputCommandInteraction, interaction: ChatInputCommandInteraction
): Promise<void> { ): Promise<void> {
await interaction.deferReply() await interaction.deferReply()
@@ -14,9 +14,9 @@ export default async function guildMember(
embeds: [ embeds: [
{ {
description: "Fetching your uuid...", description: "Fetching your uuid...",
color: embedColor, color: embedColor
}, }
], ]
}) })
const uuid = await getUUID(ign) const uuid = await getUUID(ign)
@@ -25,9 +25,9 @@ export default async function guildMember(
embeds: [ embeds: [
{ {
description: "This user does not exist", description: "This user does not exist",
color: embedColor, color: embedColor
}, }
], ]
}) })
return return
} }
@@ -36,9 +36,9 @@ export default async function guildMember(
embeds: [ embeds: [
{ {
description: "Fetching your player data...", description: "Fetching your player data...",
color: embedColor, color: embedColor
}, }
], ]
}) })
const head = await getHeadURL(ign) const head = await getHeadURL(ign)
@@ -50,14 +50,14 @@ export default async function guildMember(
description: "This user never logged on to hypixel", description: "This user never logged on to hypixel",
color: embedColor, color: embedColor,
thumbnail: { thumbnail: {
url: head!, url: head!
}, },
footer: { footer: {
text: interaction.guild!.name + " | " + devMessage, text: interaction.guild!.name + " | " + devMessage,
icon_url: interaction.guild!.iconURL() || undefined, icon_url: interaction.guild!.iconURL() || undefined
}, }
}, }
], ]
}) })
return return
} }
@@ -83,9 +83,9 @@ export default async function guildMember(
embeds: [ embeds: [
{ {
description: "Fetching your guild data...", description: "Fetching your guild data...",
color: embedColor, color: embedColor
}, }
], ]
}) })
const guild = await getGuild(uuid) const guild = await getGuild(uuid)
@@ -96,14 +96,14 @@ export default async function guildMember(
description: "This user is not in a guild", description: "This user is not in a guild",
color: embedColor, color: embedColor,
thumbnail: { thumbnail: {
url: head!, url: head!
}, },
footer: { footer: {
text: interaction.guild!.name + " | " + devMessage, text: interaction.guild!.name + " | " + devMessage,
icon_url: interaction.guild!.iconURL() || undefined, icon_url: interaction.guild!.iconURL() || undefined
}, }
}, }
], ]
}) })
return return
} }
@@ -129,16 +129,16 @@ export default async function guildMember(
const expValue = allDaysGexp.join("") const expValue = allDaysGexp.join("")
const totalWeeklyGexpUnformatted = Object.values(memberGexp).reduce( const totalWeeklyGexpUnformatted = Object.values(memberGexp).reduce(
(a, b) => a + b, (a, b) => a + b,
0, 0
) )
const totalWeeklyGexp = new Intl.NumberFormat("en-US").format( const totalWeeklyGexp = new Intl.NumberFormat("en-US").format(
totalWeeklyGexpUnformatted, totalWeeklyGexpUnformatted
) )
const averageWeeklyGexpUnformatted = Math.round( const averageWeeklyGexpUnformatted = Math.round(
totalWeeklyGexpUnformatted / 7, totalWeeklyGexpUnformatted / 7
) )
const averageWeeklyGexp = new Intl.NumberFormat("en-US").format( const averageWeeklyGexp = new Intl.NumberFormat("en-US").format(
averageWeeklyGexpUnformatted, averageWeeklyGexpUnformatted
) )
const guildMemberJoinMS = guildMember!.joined const guildMemberJoinMS = guildMember!.joined
@@ -176,12 +176,12 @@ export default async function guildMember(
"`\n", "`\n",
color: embedColor, color: embedColor,
thumbnail: { thumbnail: {
url: head!, url: head!
}, },
fields: [ fields: [
{ {
name: "**Daily GEXP**", name: "**Daily GEXP**",
value: expValue, value: expValue
}, },
{ {
name: "**Weekly GEXP**", name: "**Weekly GEXP**",
@@ -191,18 +191,18 @@ export default async function guildMember(
"`\n" + "`\n" +
"**➺ Daily avarage:** `" + "**➺ Daily avarage:** `" +
averageWeeklyGexp + averageWeeklyGexp +
"`", "`"
}, },
{ {
name: "**Join date**", name: "**Join date**",
value: "**➺ **`" + guildMemberJoin + "`", value: "**➺ **`" + guildMemberJoin + "`"
}, }
], ],
footer: { footer: {
text: interaction.guild!.name + " | " + devMessage, text: interaction.guild!.name + " | " + devMessage,
icon_url: interaction.guild!.iconURL() || undefined, icon_url: interaction.guild!.iconURL() || undefined
}, }
}, }
], ]
}) })
} }

View File

@@ -6,7 +6,7 @@ import Illegitimate from "utils/Illegitimate"
const redis = Illegitimate.redis const redis = Illegitimate.redis
export default async function guildTop( export default async function guildTop(
interaction: ChatInputCommandInteraction, interaction: ChatInputCommandInteraction
): Promise<void> { ): Promise<void> {
await interaction.deferReply() await interaction.deferReply()
@@ -21,9 +21,9 @@ export default async function guildTop(
embeds: [ embeds: [
{ {
description: "You can't use this command in DMs!", description: "You can't use this command in DMs!",
color: embedColor, color: embedColor
}, }
], ]
}) })
return return
} }
@@ -33,9 +33,9 @@ export default async function guildTop(
embeds: [ embeds: [
{ {
description: "Fetching your uuid...", description: "Fetching your uuid...",
color: embedColor, color: embedColor
}, }
], ]
}) })
const uuid = await getUUID(query) const uuid = await getUUID(query)
@@ -44,9 +44,9 @@ export default async function guildTop(
embeds: [ embeds: [
{ {
description: "That player doen't exist!", description: "That player doen't exist!",
color: embedColor, color: embedColor
}, }
], ]
}) })
return return
} }
@@ -55,9 +55,9 @@ export default async function guildTop(
embeds: [ embeds: [
{ {
description: "Fetching your player data...", description: "Fetching your player data...",
color: embedColor, color: embedColor
}, }
], ]
}) })
const player = await getPlayer(uuid) const player = await getPlayer(uuid)
@@ -66,9 +66,9 @@ export default async function guildTop(
embeds: [ embeds: [
{ {
description: "That player has never joined the server!", description: "That player has never joined the server!",
color: embedColor, color: embedColor
}, }
], ]
}) })
return return
} }
@@ -77,9 +77,9 @@ export default async function guildTop(
embeds: [ embeds: [
{ {
description: "Fetching your guild data...", description: "Fetching your guild data...",
color: embedColor, color: embedColor
}, }
], ]
}) })
guild = await getGuild(uuid, "player") guild = await getGuild(uuid, "player")
@@ -88,9 +88,9 @@ export default async function guildTop(
embeds: [ embeds: [
{ {
description: "That player is not in a guild!", description: "That player is not in a guild!",
color: embedColor, color: embedColor
}, }
], ]
}) })
return return
} }
@@ -99,9 +99,9 @@ export default async function guildTop(
embeds: [ embeds: [
{ {
description: "Fetching your guild data...", description: "Fetching your guild data...",
color: embedColor, color: embedColor
}, }
], ]
}) })
guild = await getGuild(query, "name") guild = await getGuild(query, "name")
@@ -110,9 +110,9 @@ export default async function guildTop(
embeds: [ embeds: [
{ {
description: "That guild doesn't exist!", description: "That guild doesn't exist!",
color: embedColor, color: embedColor
}, }
], ]
}) })
return return
} }
@@ -121,9 +121,9 @@ export default async function guildTop(
embeds: [ embeds: [
{ {
description: "Fetching your guild data...", description: "Fetching your guild data...",
color: embedColor, color: embedColor
}, }
], ]
}) })
guild = await getGuild(query, "id") guild = await getGuild(query, "id")
@@ -132,9 +132,9 @@ export default async function guildTop(
embeds: [ embeds: [
{ {
description: "That guild doesn't exist!", description: "That guild doesn't exist!",
color: embedColor, color: embedColor
}, }
], ]
}) })
return return
} }
@@ -152,20 +152,20 @@ export default async function guildTop(
}) })
.reduce((a, b) => a + b, 0) .reduce((a, b) => a + b, 0)
const gexpToday = new Intl.NumberFormat("en-US").format( const gexpToday = new Intl.NumberFormat("en-US").format(
gexpTodayUnformatted, gexpTodayUnformatted
) )
const averageGuildMemberGEXPUnformatted = Math.floor( const averageGuildMemberGEXPUnformatted = Math.floor(
gexpTodayUnformatted / guildMembers.length, gexpTodayUnformatted / guildMembers.length
) )
const averageGuildMemberGEXP = new Intl.NumberFormat("en-US").format( const averageGuildMemberGEXP = new Intl.NumberFormat("en-US").format(
averageGuildMemberGEXPUnformatted, averageGuildMemberGEXPUnformatted
) )
const allMembersDailyGEXP = guildMembers.map(member => { const allMembersDailyGEXP = guildMembers.map(member => {
return { return {
uuid: member.uuid, uuid: member.uuid,
gexp: member.expHistory[Object.keys(member.expHistory)[0]], gexp: member.expHistory[Object.keys(member.expHistory)[0]]
} }
}) })
@@ -199,9 +199,9 @@ export default async function guildTop(
" members of " + " members of " +
guildName + guildName +
"...", "...",
color: embedColor, color: embedColor
}, }
], ]
}) })
for (let i = 0; i < allMembersSortedUUIDArray.length; i++) { for (let i = 0; i < allMembersSortedUUIDArray.length; i++) {
@@ -210,7 +210,7 @@ export default async function guildTop(
guildData.push({ guildData.push({
ign: ign!, ign: ign!,
uuid: uuid, uuid: uuid
}) })
} }
@@ -218,7 +218,7 @@ export default async function guildTop(
"guildTop+" + guildId, "guildTop+" + guildId,
JSON.stringify(guildData), JSON.stringify(guildData),
"EX", "EX",
60 * 30, 60 * 30
) )
} else { } else {
cacheStatus = true cacheStatus = true
@@ -231,9 +231,9 @@ export default async function guildTop(
" members of " + " members of " +
guildName + guildName +
"using cache...", "using cache...",
color: embedColor, color: embedColor
}, }
], ]
}) })
guildData = JSON.parse(cachedData) guildData = JSON.parse(cachedData)
} }
@@ -244,7 +244,7 @@ export default async function guildTop(
for (let i = 0; i < amount; i++) { for (let i = 0; i < amount; i++) {
const gexp = new Intl.NumberFormat("en-US").format(topMembers[i].gexp) const gexp = new Intl.NumberFormat("en-US").format(topMembers[i].gexp)
const ign = guildData.find( const ign = guildData.find(
member => member.uuid === topMembers[i].uuid, member => member.uuid === topMembers[i].uuid
)?.ign )?.ign
const position = i + 1 const position = i + 1
@@ -253,7 +253,7 @@ export default async function guildTop(
} }
const list = Array.from({ length: sliceSize }, (_, i) => const list = Array.from({ length: sliceSize }, (_, i) =>
fieldsValueRaw.slice(i * sliceSize, (i + 1) * sliceSize), fieldsValueRaw.slice(i * sliceSize, (i + 1) * sliceSize)
) )
const newList: NewList = [] const newList: NewList = []
@@ -263,7 +263,7 @@ export default async function guildTop(
newList[index] = { newList[index] = {
name: "", name: "",
value: item.join("\n"), value: item.join("\n"),
inline: false, inline: false
} }
}) })
@@ -288,9 +288,9 @@ export default async function guildTop(
" | " + " | " +
devMessage + devMessage +
cacheStatusText, cacheStatusText,
icon_url: interaction.guild!.iconURL() || undefined, icon_url: interaction.guild!.iconURL() || undefined
}, }
}, }
], ]
}) })
} }

View File

@@ -24,7 +24,7 @@ export = {
const commandRawList = client.commands.map(command => { const commandRawList = client.commands.map(command => {
return { return {
name: command.name, name: command.name,
command: command, command: command
} }
}) })
@@ -34,22 +34,22 @@ export = {
if (!command.command.subcommands && command.command.public) { if (!command.command.subcommands && command.command.public) {
commandList.push({ commandList.push({
name: "**/" + commandName + "**", name: "**/" + commandName + "**",
value: "`" + command.command.description + "`", value: "`" + command.command.description + "`"
}) })
} else if (command.command.subcommands && command.command.public) { } else if (command.command.subcommands && command.command.public) {
const subcommands = command.command.data.options.map( const subcommands = command.command.data.options.map(
subcommand => { subcommand => {
return { return {
name: commandName + " " + subcommand.toJSON().name, name: commandName + " " + subcommand.toJSON().name,
description: subcommand.toJSON().description, description: subcommand.toJSON().description
} }
}, }
) )
for (const subcommand of subcommands) { for (const subcommand of subcommands) {
commandList.push({ commandList.push({
name: "**/" + subcommand.name + "**", name: "**/" + subcommand.name + "**",
value: "`" + subcommand.description + "`", value: "`" + subcommand.description + "`"
}) })
} }
} }
@@ -65,14 +65,14 @@ export = {
fields: commandList, fields: commandList,
color: embedColor, color: embedColor,
thumbnail: { thumbnail: {
url: interaction.guild!.iconURL() || "", url: interaction.guild!.iconURL() || ""
}, },
footer: { footer: {
icon_url: interaction.guild!.iconURL() || undefined, icon_url: interaction.guild!.iconURL() || undefined,
text: interaction.guild!.name + " | " + devMessage, text: interaction.guild!.name + " | " + devMessage
}, }
}, }
], ]
}) })
}, }
} as Command } as Command

View File

@@ -31,14 +31,14 @@ export = {
color: embedColor, color: embedColor,
footer: { footer: {
text: interaction.guild!.name + " | " + devMessage, text: interaction.guild!.name + " | " + devMessage,
icon_url: interaction.guild!.iconURL() || undefined, icon_url: interaction.guild!.iconURL() || undefined
}, },
image: { image: {
url: instructionsgif, url: instructionsgif,
proxy_url: instructionsgif, proxy_url: instructionsgif
}, }
}, }
], ]
}) })
}, }
} as Command } as Command

View File

@@ -2,7 +2,7 @@ import {
SlashCommandBuilder, SlashCommandBuilder,
PermissionFlagsBits, PermissionFlagsBits,
userMention, userMention,
GuildMember, GuildMember
} from "discord.js" } from "discord.js"
import { admin, helper } from "config/roles.json" import { admin, helper } from "config/roles.json"
import { color, devMessage } from "config/options.json" import { color, devMessage } from "config/options.json"
@@ -22,12 +22,12 @@ export = {
option option
.setName("member") .setName("member")
.setDescription("Member to kick.") .setDescription("Member to kick.")
.setRequired(true), .setRequired(true)
) )
.addStringOption(option => .addStringOption(option =>
option option
.setName("reason") .setName("reason")
.setDescription("Reason for kicking the member."), .setDescription("Reason for kicking the member.")
) )
.setDefaultMemberPermissions(PermissionFlagsBits.KickMembers) .setDefaultMemberPermissions(PermissionFlagsBits.KickMembers)
.setDMPermission(false), .setDMPermission(false),
@@ -46,7 +46,7 @@ export = {
if (!modRoles.includes(helper) && !modRoles.includes(admin)) { if (!modRoles.includes(helper) && !modRoles.includes(admin)) {
await interaction.editReply( await interaction.editReply(
"You do not have permission to use this command.", "You do not have permission to use this command."
) )
return return
} }
@@ -83,7 +83,7 @@ export = {
{ {
author: { author: {
name: mod.user.username, name: mod.user.username,
icon_url: mod.user.avatarURL() || undefined, icon_url: mod.user.avatarURL() || undefined
}, },
title: "Member Kicked", title: "Member Kicked",
description: ` description: `
@@ -93,15 +93,15 @@ export = {
`, `,
color: embedColor, color: embedColor,
thumbnail: { thumbnail: {
url: mod.user.avatarURL() || "", url: mod.user.avatarURL() || ""
}, },
footer: { footer: {
text: "ID: " + member.user.id, text: "ID: " + member.user.id,
icon_url: member.user.avatarURL() || undefined, icon_url: member.user.avatarURL() || undefined
}, },
timestamp: new Date().toISOString(), timestamp: new Date().toISOString()
}, }
], ]
}) })
await interaction.editReply({ await interaction.editReply({
@@ -119,14 +119,14 @@ export = {
mod.user.username, mod.user.username,
color: embedColor, color: embedColor,
thumbnail: { thumbnail: {
url: member.user.avatarURL() || "", url: member.user.avatarURL() || ""
}, },
footer: { footer: {
icon_url: interaction.guild!.iconURL() || undefined, icon_url: interaction.guild!.iconURL() || undefined,
text: interaction.guild!.name + " | " + devMessage, text: interaction.guild!.name + " | " + devMessage
}, }
}, }
], ]
}) })
}, }
} as Command } as Command

View File

@@ -25,11 +25,11 @@ export = {
color: embedColor, color: embedColor,
footer: { footer: {
text: interaction.guild!.name + " | " + devMessage, text: interaction.guild!.name + " | " + devMessage,
icon_url: interaction.guild?.iconURL() || undefined, icon_url: interaction.guild?.iconURL() || undefined
}, },
timestamp: new Date().toISOString(), timestamp: new Date().toISOString()
}, }
], ]
}) })
}, }
} as Command } as Command

View File

@@ -16,7 +16,7 @@ export = {
option option
.setName("user") .setName("user")
.setDescription("User to show pp size") .setDescription("User to show pp size")
.setRequired(false), .setRequired(false)
) )
.setDMPermission(false), .setDMPermission(false),
@@ -37,9 +37,9 @@ export = {
{ {
title: `${user.username}'s pp size`, title: `${user.username}'s pp size`,
description: `8${"=".repeat(size)}D`, description: `8${"=".repeat(size)}D`,
color: embedColor, color: embedColor
}, }
], ]
}) })
}, }
} as Command } as Command

View File

@@ -1,7 +1,7 @@
import { import {
SlashCommandBuilder, SlashCommandBuilder,
PermissionFlagsBits, PermissionFlagsBits,
userMention, userMention
} from "discord.js" } from "discord.js"
import { color, devMessage } from "config/options.json" import { color, devMessage } from "config/options.json"
import waitinglistSchema from "schemas/waitinglistSchema" import waitinglistSchema from "schemas/waitinglistSchema"
@@ -21,13 +21,13 @@ export = {
option option
.setName("user") .setName("user")
.setDescription("The user to remove.") .setDescription("The user to remove.")
.setRequired(true), .setRequired(true)
) )
.addStringOption(option => .addStringOption(option =>
option option
.setName("reason") .setName("reason")
.setDescription("The reason for removing the user.") .setDescription("The reason for removing the user.")
.setRequired(false), .setRequired(false)
) )
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator) .setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
.setDMPermission(false), .setDMPermission(false),
@@ -50,9 +50,9 @@ export = {
description: description:
userMention(user.id) + userMention(user.id) +
" is not on the waiting list.", " is not on the waiting list.",
color: embedColor, color: embedColor
}, }
], ]
}) })
return return
} }
@@ -64,7 +64,7 @@ export = {
{ {
author: { author: {
name: mod.username, name: mod.username,
icon_url: mod.avatarURL() || undefined, icon_url: mod.avatarURL() || undefined
}, },
title: "Waiting List - Remove User", title: "Waiting List - Remove User",
description: ` description: `
@@ -74,15 +74,15 @@ export = {
`, `,
color: embedColor, color: embedColor,
thumbnail: { thumbnail: {
url: mod.avatarURL() || "", url: mod.avatarURL() || ""
}, },
footer: { footer: {
icon_url: user.avatarURL() || undefined, icon_url: user.avatarURL() || undefined,
text: "ID: " + user.id, text: "ID: " + user.id
}, },
timestamp: new Date().toISOString(), timestamp: new Date().toISOString()
}, }
], ]
}) })
await interaction.editReply({ await interaction.editReply({
@@ -99,10 +99,10 @@ export = {
color: embedColor, color: embedColor,
footer: { footer: {
text: interaction.guild!.name + " | " + devMessage, text: interaction.guild!.name + " | " + devMessage,
icon_url: interaction.guild!.iconURL() || undefined, icon_url: interaction.guild!.iconURL() || undefined
}, }
}, }
], ]
}) })
}, }
} as Command } as Command

View File

@@ -7,7 +7,7 @@ import {
swstars, swstars,
swkdr, swkdr,
duelswins, duelswins,
duelswlr, duelswlr
} from "config/reqs.json" } from "config/reqs.json"
import { Command } from "interfaces" import { Command } from "interfaces"
@@ -33,7 +33,7 @@ export = {
"**You must make 100k-150k weekly GEXP.\nAs well as onne of the game stats below**", "**You must make 100k-150k weekly GEXP.\nAs well as onne of the game stats below**",
color: embedColor, color: embedColor,
thumbnail: { thumbnail: {
url: interaction.guild!.iconURL() || "", url: interaction.guild!.iconURL() || ""
}, },
fields: [ fields: [
{ {
@@ -45,7 +45,7 @@ export = {
bwwins.toString() + bwwins.toString() +
"`\n**FKDR:** `" + "`\n**FKDR:** `" +
bwfkdr.toString() + bwfkdr.toString() +
"`", "`"
}, },
{ {
name: "**Skywars**", name: "**Skywars**",
@@ -54,7 +54,7 @@ export = {
swstars.toString() + swstars.toString() +
"`\n**KDR:** `" + "`\n**KDR:** `" +
swkdr.toString() + swkdr.toString() +
"`", "`"
}, },
{ {
name: "**Duels**", name: "**Duels**",
@@ -63,15 +63,15 @@ export = {
duelswins.toString() + duelswins.toString() +
"`\n**WLR:** `" + "`\n**WLR:** `" +
duelswlr.toString() + duelswlr.toString() +
"`", "`"
}, }
], ],
footer: { footer: {
text: interaction.guild!.name + " | " + devMessage, text: interaction.guild!.name + " | " + devMessage,
icon_url: interaction.guild!.iconURL() || undefined, icon_url: interaction.guild!.iconURL() || undefined
}, }
}, }
], ]
}) })
}, }
} as Command } as Command

View File

@@ -2,7 +2,7 @@ import {
SlashCommandBuilder, SlashCommandBuilder,
PermissionFlagsBits, PermissionFlagsBits,
ChannelType, ChannelType,
TextChannel, TextChannel
} from "discord.js" } from "discord.js"
import { color, devMessage } from "config/options.json" import { color, devMessage } from "config/options.json"
import { Command } from "interfaces" import { Command } from "interfaces"
@@ -20,7 +20,7 @@ export = {
option option
.setName("message") .setName("message")
.setDescription("The message to send.") .setDescription("The message to send.")
.setRequired(true), .setRequired(true)
) )
.addChannelOption(option => .addChannelOption(option =>
option option
@@ -28,8 +28,8 @@ export = {
.setDescription("The channel to send the message to.") .setDescription("The channel to send the message to.")
.addChannelTypes( .addChannelTypes(
ChannelType.GuildText, ChannelType.GuildText,
ChannelType.GuildAnnouncement, ChannelType.GuildAnnouncement
), )
) )
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator) .setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
.setDMPermission(false), .setDMPermission(false),
@@ -49,14 +49,14 @@ export = {
description: message, description: message,
color: embedColor, color: embedColor,
thumbnail: { thumbnail: {
url: interaction.guild!.iconURL() || "", url: interaction.guild!.iconURL() || ""
}, },
footer: { footer: {
text: interaction.guild!.id + " | " + devMessage, text: interaction.guild!.id + " | " + devMessage,
icon_url: interaction.guild!.iconURL() || undefined, icon_url: interaction.guild!.iconURL() || undefined
}, }
}, }
], ]
}) })
await interaction.editReply({ await interaction.editReply({
@@ -66,10 +66,10 @@ export = {
color: embedColor, color: embedColor,
footer: { footer: {
text: interaction.guild!.name + " | " + devMessage, text: interaction.guild!.name + " | " + devMessage,
icon_url: interaction.guild!.iconURL() || undefined, icon_url: interaction.guild!.iconURL() || undefined
}, }
}, }
], ]
}) })
}, }
} as Command } as Command

View File

@@ -2,7 +2,7 @@ import {
SlashCommandBuilder, SlashCommandBuilder,
PermissionFlagsBits, PermissionFlagsBits,
userMention, userMention,
GuildMember, GuildMember
} from "discord.js" } from "discord.js"
import { color, devMessage } from "config/options.json" import { color, devMessage } from "config/options.json"
import { Command } from "interfaces" import { Command } from "interfaces"
@@ -21,13 +21,13 @@ export = {
option option
.setName("user") .setName("user")
.setDescription("The user to set the nickname for") .setDescription("The user to set the nickname for")
.setRequired(true), .setRequired(true)
) )
.addStringOption(option => .addStringOption(option =>
option option
.setName("nickname") .setName("nickname")
.setDescription("The nickname to set") .setDescription("The nickname to set")
.setRequired(true), .setRequired(true)
) )
.setDefaultMemberPermissions(PermissionFlagsBits.ManageNicknames) .setDefaultMemberPermissions(PermissionFlagsBits.ManageNicknames)
.setDMPermission(false), .setDMPermission(false),
@@ -40,7 +40,7 @@ export = {
if (!member.manageable) { if (!member.manageable) {
interaction.reply({ interaction.reply({
content: "I cannot set the nickname for this user!", content: "I cannot set the nickname for this user!",
ephemeral: true, ephemeral: true
}) })
return return
} }
@@ -52,7 +52,7 @@ export = {
{ {
author: { author: {
name: interaction.user.username, name: interaction.user.username,
icon_url: interaction.user.avatarURL() || undefined, icon_url: interaction.user.avatarURL() || undefined
}, },
title: "Nickname", title: "Nickname",
description: ` description: `
@@ -62,15 +62,15 @@ export = {
`, `,
color: embedColor, color: embedColor,
thumbnail: { thumbnail: {
url: interaction.user.avatarURL() || "", url: interaction.user.avatarURL() || ""
}, },
footer: { footer: {
text: "ID: " + member.user.id, text: "ID: " + member.user.id,
icon_url: member.user.avatarURL() || undefined, icon_url: member.user.avatarURL() || undefined
}, },
timestamp: new Date().toISOString(), timestamp: new Date().toISOString()
}, }
], ]
}) })
await interaction.reply({ await interaction.reply({
@@ -80,11 +80,11 @@ export = {
color: embedColor, color: embedColor,
footer: { footer: {
text: interaction.guild!.name + " | " + devMessage, text: interaction.guild!.name + " | " + devMessage,
icon_url: interaction.guild!.iconURL() || undefined, icon_url: interaction.guild!.iconURL() || undefined
}, }
}, }
], ],
ephemeral: true, ephemeral: true
}) })
}, }
} as Command } as Command

View File

@@ -5,7 +5,7 @@ import {
ActionRowBuilder, ActionRowBuilder,
ButtonStyle, ButtonStyle,
ChannelType, ChannelType,
TextChannel, TextChannel
} from "discord.js" } from "discord.js"
import { color, devMessage } from "config/options.json" import { color, devMessage } from "config/options.json"
import { Command } from "interfaces" import { Command } from "interfaces"
@@ -28,14 +28,14 @@ export = {
option option
.setName("channel") .setName("channel")
.setDescription( .setDescription(
"The channel to send the application to.", "The channel to send the application to."
) )
.addChannelTypes( .addChannelTypes(
ChannelType.GuildText, ChannelType.GuildText,
ChannelType.GuildAnnouncement, ChannelType.GuildAnnouncement
) )
.setRequired(true), .setRequired(true)
), )
) )
.addSubcommand(subcommand => .addSubcommand(subcommand =>
subcommand subcommand
@@ -45,14 +45,14 @@ export = {
option option
.setName("channel") .setName("channel")
.setDescription( .setDescription(
"The channel to send the application to.", "The channel to send the application to."
) )
.addChannelTypes( .addChannelTypes(
ChannelType.GuildText, ChannelType.GuildText,
ChannelType.GuildAnnouncement, ChannelType.GuildAnnouncement
) )
.setRequired(true), .setRequired(true)
), )
) )
.addSubcommand(subcommand => .addSubcommand(subcommand =>
subcommand subcommand
@@ -62,14 +62,14 @@ export = {
option option
.setName("channel") .setName("channel")
.setDescription( .setDescription(
"The channel to send the verfiy message to.", "The channel to send the verfiy message to."
) )
.addChannelTypes( .addChannelTypes(
ChannelType.GuildText, ChannelType.GuildText,
ChannelType.GuildAnnouncement, ChannelType.GuildAnnouncement
) )
.setRequired(true), .setRequired(true)
), )
) )
.addSubcommand(subcommand => .addSubcommand(subcommand =>
subcommand subcommand
@@ -79,14 +79,14 @@ export = {
option option
.setName("channel") .setName("channel")
.setDescription( .setDescription(
"The channel to send the waiting list message to.", "The channel to send the waiting list message to."
) )
.addChannelTypes( .addChannelTypes(
ChannelType.GuildText, ChannelType.GuildText,
ChannelType.GuildAnnouncement, ChannelType.GuildAnnouncement
) )
.setRequired(true), .setRequired(true)
), )
) )
.addSubcommand(subcommand => .addSubcommand(subcommand =>
subcommand subcommand
@@ -96,14 +96,14 @@ export = {
option option
.setName("channel") .setName("channel")
.setDescription( .setDescription(
"The channel to send the application to.", "The channel to send the application to."
) )
.addChannelTypes( .addChannelTypes(
ChannelType.GuildText, ChannelType.GuildText,
ChannelType.GuildAnnouncement, ChannelType.GuildAnnouncement
) )
.setRequired(true), .setRequired(true)
), )
) )
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator) .setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
.setDMPermission(false), .setDMPermission(false),
@@ -168,13 +168,13 @@ export = {
description: description, description: description,
color: embedColor, color: embedColor,
thumbnail: { thumbnail: {
url: interaction.guild!.iconURL() || "", url: interaction.guild!.iconURL() || ""
}, },
footer: { footer: {
text: interaction.guild!.name + " | " + devMessage, text: interaction.guild!.name + " | " + devMessage,
icon_url: interaction.guild!.iconURL() || undefined, icon_url: interaction.guild!.iconURL() || undefined
}, }
}, }
], ],
components: [ components: [
new ActionRowBuilder<ButtonBuilder>().addComponents( new ActionRowBuilder<ButtonBuilder>().addComponents(
@@ -182,14 +182,14 @@ export = {
.setCustomId(customId) .setCustomId(customId)
.setLabel(label) .setLabel(label)
.setStyle(ButtonStyle.Primary) .setStyle(ButtonStyle.Primary)
.setEmoji({ name: emoji }), .setEmoji({ name: emoji })
), )
], ]
}) })
await interaction.reply({ await interaction.reply({
content: "Message sent", content: "Message sent",
ephemeral: true, ephemeral: true
}) })
}, }
} as Command } as Command

View File

@@ -4,7 +4,7 @@ import {
ChannelType, ChannelType,
TextChannel, TextChannel,
channelMention, channelMention,
userMention, userMention
} from "discord.js" } from "discord.js"
import { color, devMessage } from "config/options.json" import { color, devMessage } from "config/options.json"
import { Command } from "interfaces" import { Command } from "interfaces"
@@ -22,9 +22,7 @@ export = {
.addIntegerOption(option => .addIntegerOption(option =>
option option
.setName("seconds") .setName("seconds")
.setDescription( .setDescription("The amount of seconds to set the slowmode to.")
"The amount of seconds to set the slowmode to.",
),
) )
.addChannelOption(option => .addChannelOption(option =>
option option
@@ -32,8 +30,8 @@ export = {
.setDescription("The channel to set the slowmode of.") .setDescription("The channel to set the slowmode of.")
.addChannelTypes( .addChannelTypes(
ChannelType.GuildText, ChannelType.GuildText,
ChannelType.GuildAnnouncement, ChannelType.GuildAnnouncement
), )
) )
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator) .setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
.setDMPermission(false), .setDMPermission(false),
@@ -55,10 +53,10 @@ export = {
color: embedColor, color: embedColor,
footer: { footer: {
text: interaction.guild!.name + " | " + devMessage, text: interaction.guild!.name + " | " + devMessage,
icon_url: interaction.guild!.iconURL() || undefined, icon_url: interaction.guild!.iconURL() || undefined
}, }
}, }
], ]
}) })
return return
} }
@@ -68,7 +66,7 @@ export = {
{ {
author: { author: {
name: interaction.user.username, name: interaction.user.username,
icon_url: interaction.user.avatarURL() || undefined, icon_url: interaction.user.avatarURL() || undefined
}, },
title: "Slowmode Update", title: "Slowmode Update",
description: ` description: `
@@ -78,15 +76,15 @@ export = {
`, `,
color: embedColor, color: embedColor,
thumbnail: { thumbnail: {
url: interaction.user.avatarURL() || "", url: interaction.user.avatarURL() || ""
}, },
footer: { footer: {
icon_url: interaction.guild!.iconURL() || undefined, icon_url: interaction.guild!.iconURL() || undefined,
text: " ID: " + channel.id, text: " ID: " + channel.id
}, },
timestamp: new Date().toISOString(), timestamp: new Date().toISOString()
}, }
], ]
}) })
await interaction.editReply({ await interaction.editReply({
@@ -96,11 +94,11 @@ export = {
color: embedColor, color: embedColor,
footer: { footer: {
text: interaction.guild!.name + " | " + devMessage, text: interaction.guild!.name + " | " + devMessage,
icon_url: interaction.guild!.iconURL() || undefined, icon_url: interaction.guild!.iconURL() || undefined
}, }
}, }
], ]
}) })
await channel.setRateLimitPerUser(seconds) await channel.setRateLimitPerUser(seconds)
}, }
} as Command } as Command

View File

@@ -17,7 +17,7 @@ export = {
option option
.setName("user") .setName("user")
.setDescription("The user to snipe") .setDescription("The user to snipe")
.setRequired(true), .setRequired(true)
) )
.setDMPermission(false), .setDMPermission(false),
@@ -26,7 +26,7 @@ export = {
const member = interaction.options.getMember("user") as GuildMember const member = interaction.options.getMember("user") as GuildMember
const snipeCache = await snipeCacheSchema.find({ const snipeCache = await snipeCacheSchema.find({
userid: member.user.id, userid: member.user.id,
channelid: interaction.channel!.id, channelid: interaction.channel!.id
}) })
const embedColor = Number(color.replace("#", "0x")) const embedColor = Number(color.replace("#", "0x"))
const messages: string[] = [] const messages: string[] = []
@@ -36,9 +36,9 @@ export = {
embeds: [ embeds: [
{ {
description: "No messages to snipe", description: "No messages to snipe",
color: embedColor, color: embedColor
}, }
], ]
}) })
return return
} }
@@ -51,7 +51,7 @@ export = {
} else { } else {
messages.push(`**Message #${i}:** ${data.content}`) messages.push(`**Message #${i}:** ${data.content}`)
messages.push( messages.push(
`**Attachments:** ${data.attachments.join(", ")}\n`, `**Attachments:** ${data.attachments.join(", ")}\n`
) )
} }
i++ i++
@@ -62,20 +62,20 @@ export = {
{ {
author: { author: {
name: member.user.username, name: member.user.username,
icon_url: member.user.avatarURL() || undefined, icon_url: member.user.avatarURL() || undefined
}, },
description: messages.join("\n"), description: messages.join("\n"),
thumbnail: { thumbnail: {
url: member.user.avatarURL() || "", url: member.user.avatarURL() || ""
}, },
color: embedColor, color: embedColor,
footer: { footer: {
text: "ID: " + member.user.id, text: "ID: " + member.user.id,
icon_url: interaction.guild!.iconURL() || undefined, icon_url: interaction.guild!.iconURL() || undefined
}, },
timestamp: new Date().toISOString(), timestamp: new Date().toISOString()
}, }
], ]
}) })
}, }
} as Command } as Command

View File

@@ -18,7 +18,7 @@ export = {
.addSubcommand(subcommand => .addSubcommand(subcommand =>
subcommand subcommand
.setName("help") .setName("help")
.setDescription("Get help with staff commands"), .setDescription("Get help with staff commands")
) )
.addSubcommand(subcommand => .addSubcommand(subcommand =>
subcommand subcommand
@@ -28,15 +28,13 @@ export = {
option option
.setName("ign") .setName("ign")
.setDescription("The IGN of the player.") .setDescription("The IGN of the player.")
.setRequired(true), .setRequired(true)
), )
) )
.addSubcommand(subcommand => .addSubcommand(subcommand =>
subcommand subcommand
.setName("updatediscordroles") .setName("updatediscordroles")
.setDescription( .setDescription("Update the discord roles of all guild members")
"Update the discord roles of all guild members",
),
) )
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator) .setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
.setDMPermission(false), .setDMPermission(false),
@@ -67,10 +65,10 @@ export = {
color: embedColor, color: embedColor,
footer: { footer: {
text: interaction.guild!.name + " | " + devMessage, text: interaction.guild!.name + " | " + devMessage,
icon_url: interaction.guild!.iconURL() || undefined, icon_url: interaction.guild!.iconURL() || undefined
}, }
}, }
], ]
}) })
}, }
} as Command } as Command

View File

@@ -5,7 +5,7 @@ import {
beastswkdr, beastswkdr,
beastswstars, beastswstars,
beastduelswins, beastduelswins,
duelswlr, duelswlr
} from "config/reqs.json" } from "config/reqs.json"
import { color, devMessage } from "config/options.json" import { color, devMessage } from "config/options.json"
import { import {
@@ -15,12 +15,12 @@ import {
getUUID, getUUID,
getPlayer, getPlayer,
getGuild, getGuild,
getHeadURL, getHeadURL
} from "utils/Hypixel" } from "utils/Hypixel"
import { ChatInputCommandInteraction } from "discord.js" import { ChatInputCommandInteraction } from "discord.js"
export default async function beast( export default async function beast(
interaction: ChatInputCommandInteraction, interaction: ChatInputCommandInteraction
): Promise<void> { ): Promise<void> {
await interaction.deferReply() await interaction.deferReply()
@@ -36,9 +36,9 @@ export default async function beast(
embeds: [ embeds: [
{ {
description: "Fetching your uuid...", description: "Fetching your uuid...",
color: embedColor, color: embedColor
}, }
], ]
}) })
const uuid = await getUUID(ign) const uuid = await getUUID(ign)
@@ -47,9 +47,9 @@ export default async function beast(
embeds: [ embeds: [
{ {
description: "That player doesn't exist.", description: "That player doesn't exist.",
color: embedColor, color: embedColor
}, }
], ]
}) })
return return
} }
@@ -58,9 +58,9 @@ export default async function beast(
embeds: [ embeds: [
{ {
description: "Fetching your player data...", description: "Fetching your player data...",
color: embedColor, color: embedColor
}, }
], ]
}) })
const head = await getHeadURL(ign) const head = await getHeadURL(ign)
@@ -70,9 +70,9 @@ export default async function beast(
embeds: [ embeds: [
{ {
description: "That player hasn't played Hypixel before.", description: "That player hasn't played Hypixel before.",
color: embedColor, color: embedColor
}, }
], ]
}) })
return return
} }
@@ -97,9 +97,9 @@ export default async function beast(
embeds: [ embeds: [
{ {
description: "Fetching your guild data...", description: "Fetching your guild data...",
color: embedColor, color: embedColor
}, }
], ]
}) })
const guild = await getGuild(uuid) const guild = await getGuild(uuid)
@@ -124,7 +124,7 @@ export default async function beast(
if (!player.stats) { if (!player.stats) {
statsFields.push({ statsFields.push({
name: "<a:_warning:1178350183457751100> This player never played any games.", name: "<a:_warning:1178350183457751100> This player never played any games.",
value: "**➺ Stats:** `None`", value: "**➺ Stats:** `None`"
}) })
} else { } else {
if (player.stats.Bedwars) { if (player.stats.Bedwars) {
@@ -165,12 +165,12 @@ export default async function beast(
hsbwwins.toString() + hsbwwins.toString() +
" / " + " / " +
bwwins.toString() + bwwins.toString() +
"`", "`"
}) })
} else { } else {
statsFields.push({ statsFields.push({
name: "<a:_warning:1178350183457751100> This player never played BedWars.", name: "<a:_warning:1178350183457751100> This player never played BedWars.",
value: "**➺ Stats:** `None`", value: "**➺ Stats:** `None`"
}) })
} }
@@ -206,12 +206,12 @@ export default async function beast(
"`\n" + "`\n" +
"**➺ Wins:** `" + "**➺ Wins:** `" +
hsswwins.toString() + hsswwins.toString() +
"`", "`"
}) })
} else { } else {
statsFields.push({ statsFields.push({
name: "<a:_warning:1178350183457751100> This player never played SkyWars.", name: "<a:_warning:1178350183457751100> This player never played SkyWars.",
value: "**➺ Stats:** `None`", value: "**➺ Stats:** `None`"
}) })
} }
@@ -247,12 +247,12 @@ export default async function beast(
"`\n" + "`\n" +
"**➺ KDR:** `" + "**➺ KDR:** `" +
hsduelskd.toFixed(2).toString() + hsduelskd.toFixed(2).toString() +
"`\n", "`\n"
}) })
} else { } else {
statsFields.push({ statsFields.push({
name: "<a:_warning:1178350183457751100> This player never played Duels.", name: "<a:_warning:1178350183457751100> This player never played Duels.",
value: "**➺ Stats:** `None`", value: "**➺ Stats:** `None`"
}) })
} }
} }
@@ -274,14 +274,14 @@ export default async function beast(
"`", "`",
color: embedColor, color: embedColor,
thumbnail: { thumbnail: {
url: head!, url: head!
}, },
footer: { footer: {
text: interaction.guild!.name + " | " + devMessage, text: interaction.guild!.name + " | " + devMessage,
icon_url: interaction.guild!.iconURL() || undefined, icon_url: interaction.guild!.iconURL() || undefined
}, },
fields: statsFields, fields: statsFields
}, }
], ]
}) })
} }

View File

@@ -4,7 +4,7 @@ import { ExtendedClient as Client } from "utils/Client"
export default async function help( export default async function help(
interaction: ChatInputCommandInteraction, interaction: ChatInputCommandInteraction,
client: Client, client: Client
): Promise<void> { ): Promise<void> {
await interaction.deferReply({ ephemeral: true }) await interaction.deferReply({ ephemeral: true })
@@ -16,7 +16,7 @@ export default async function help(
const commandRawList = client.commands.map(command => { const commandRawList = client.commands.map(command => {
return { return {
name: command.name, name: command.name,
command: command, command: command
} }
}) })
@@ -26,20 +26,20 @@ export default async function help(
if (!command.command.subcommands && !command.command.public) { if (!command.command.subcommands && !command.command.public) {
commandList.push({ commandList.push({
name: "**/" + commandName + "**", name: "**/" + commandName + "**",
value: "`" + command.command.description + "`", value: "`" + command.command.description + "`"
}) })
} else if (command.command.subcommands && !command.command.public) { } else if (command.command.subcommands && !command.command.public) {
const subcommands = command.command.data.options.map(subcommand => { const subcommands = command.command.data.options.map(subcommand => {
return { return {
name: commandName + " " + subcommand.toJSON().name, name: commandName + " " + subcommand.toJSON().name,
description: subcommand.toJSON().description, description: subcommand.toJSON().description
} }
}) })
for (const subcommand of subcommands) { for (const subcommand of subcommands) {
commandList.push({ commandList.push({
name: "**/" + subcommand.name + "**", name: "**/" + subcommand.name + "**",
value: "`" + subcommand.description + "`", value: "`" + subcommand.description + "`"
}) })
} }
} }
@@ -55,13 +55,13 @@ export default async function help(
fields: commandList, fields: commandList,
color: embedColor, color: embedColor,
thumbnail: { thumbnail: {
url: interaction.guild!.iconURL() || "", url: interaction.guild!.iconURL() || ""
}, },
footer: { footer: {
icon_url: interaction.guild!.iconURL() || undefined, icon_url: interaction.guild!.iconURL() || undefined,
text: interaction.guild?.name + " | " + devMessage, text: interaction.guild?.name + " | " + devMessage
}, }
}, }
], ]
}) })
} }

View File

@@ -7,7 +7,7 @@ import { getGuild } from "utils/Hypixel"
import { GuildData } from "interfaces" import { GuildData } from "interfaces"
export default async function updateDiscordRoles( export default async function updateDiscordRoles(
interaction: ChatInputCommandInteraction, interaction: ChatInputCommandInteraction
): Promise<void> { ): Promise<void> {
const discordMember = interaction.member as GuildMember const discordMember = interaction.member as GuildMember
const embedColor = Number(color.replace("#", "0x")) const embedColor = Number(color.replace("#", "0x"))
@@ -19,9 +19,9 @@ export default async function updateDiscordRoles(
{ {
description: description:
"You do not have permission to use this command.", "You do not have permission to use this command.",
color: embedColor, color: embedColor
}, }
], ]
}) })
return return
} }
@@ -32,9 +32,9 @@ export default async function updateDiscordRoles(
members.map(member => { members.map(member => {
return { return {
id: member.id, id: member.id,
member: member, member: member
} }
}), })
) )
const guildData = (await getGuild(hypixelGuildID, "id")) as GuildData const guildData = (await getGuild(hypixelGuildID, "id")) as GuildData
@@ -42,7 +42,7 @@ export default async function updateDiscordRoles(
const hypixelGuildMembers = guildData.members.map(gmember => { const hypixelGuildMembers = guildData.members.map(gmember => {
return { return {
uuid: gmember.uuid, uuid: gmember.uuid,
rank: gmember.rank, rank: gmember.rank
} }
}) })
const guildMemberIDs = hypixelGuildMembers.map(gmember => gmember.uuid) const guildMemberIDs = hypixelGuildMembers.map(gmember => gmember.uuid)
@@ -54,7 +54,7 @@ export default async function updateDiscordRoles(
const verifiedUsers = allVerifiedUsers.map(user => { const verifiedUsers = allVerifiedUsers.map(user => {
return { return {
userID: user.userID, userID: user.userID,
uuid: user.uuid, uuid: user.uuid
} }
}) })
@@ -62,21 +62,21 @@ export default async function updateDiscordRoles(
embeds: [ embeds: [
{ {
description: `Updating roles for ${guildMembers.length} members...`, description: `Updating roles for ${guildMembers.length} members...`,
color: embedColor, color: embedColor
}, }
], ]
}) })
for (const gmember of guildMembers) { for (const gmember of guildMembers) {
const memberData = verifiedUsers.find( const memberData = verifiedUsers.find(
user => user.userID === gmember.id, user => user.userID === gmember.id
) )
if (!memberData) { if (!memberData) {
const rolesToremove = roleManage("default").rolesToRemove const rolesToremove = roleManage("default").rolesToRemove
await gmember.member.roles.remove( await gmember.member.roles.remove(
rolesToremove, rolesToremove,
"Updating all discord members", "Updating all discord members"
) )
continue continue
} }
@@ -85,12 +85,12 @@ export default async function updateDiscordRoles(
const rolesToremove = roleManage("default").rolesToRemove const rolesToremove = roleManage("default").rolesToRemove
await gmember.member.roles.remove( await gmember.member.roles.remove(
rolesToremove, rolesToremove,
"Updating all discord members", "Updating all discord members"
) )
continue continue
} else if (guildMemberIDs.includes(memberData!.uuid)) { } else if (guildMemberIDs.includes(memberData!.uuid)) {
const guildMemberRank = hypixelGuildMembers.find( const guildMemberRank = hypixelGuildMembers.find(
gmember => gmember.uuid === memberData!.uuid, gmember => gmember.uuid === memberData!.uuid
)!.rank )!.rank
console.log("Updating roles for " + gmember.member.user.username) console.log("Updating roles for " + gmember.member.user.username)
@@ -103,11 +103,11 @@ export default async function updateDiscordRoles(
const rolesmanage = roleManage("gm") const rolesmanage = roleManage("gm")
gmember.member.roles.remove( gmember.member.roles.remove(
rolesmanage.rolesToRemove, rolesmanage.rolesToRemove,
"Updating all discord members", "Updating all discord members"
) )
gmember.member.roles.add( gmember.member.roles.add(
rolesmanage.rolesToAdd, rolesmanage.rolesToAdd,
"Updating all discord members", "Updating all discord members"
) )
continue continue
} else if (guildMemberRank === "Manager") { } else if (guildMemberRank === "Manager") {
@@ -119,11 +119,11 @@ export default async function updateDiscordRoles(
const rolesmanage = roleManage("manager") const rolesmanage = roleManage("manager")
gmember.member.roles.remove( gmember.member.roles.remove(
rolesmanage.rolesToRemove, rolesmanage.rolesToRemove,
"Updating all discord members", "Updating all discord members"
) )
gmember.member.roles.add( gmember.member.roles.add(
rolesmanage.rolesToAdd, rolesmanage.rolesToAdd,
"Updating all discord members", "Updating all discord members"
) )
continue continue
} else if (guildMemberRank === "Moderator") { } else if (guildMemberRank === "Moderator") {
@@ -135,11 +135,11 @@ export default async function updateDiscordRoles(
const rolesmanage = roleManage("moderator") const rolesmanage = roleManage("moderator")
gmember.member.roles.remove( gmember.member.roles.remove(
rolesmanage.rolesToRemove, rolesmanage.rolesToRemove,
"Updating all discord members", "Updating all discord members"
) )
gmember.member.roles.add( gmember.member.roles.add(
rolesmanage.rolesToAdd, rolesmanage.rolesToAdd,
"Updating all discord members", "Updating all discord members"
) )
continue continue
} else if (guildMemberRank === "Beast") { } else if (guildMemberRank === "Beast") {
@@ -150,11 +150,11 @@ export default async function updateDiscordRoles(
const rolesmanage = roleManage("beast") const rolesmanage = roleManage("beast")
gmember.member.roles.remove( gmember.member.roles.remove(
rolesmanage.rolesToRemove, rolesmanage.rolesToRemove,
"Updating all discord members", "Updating all discord members"
) )
gmember.member.roles.add( gmember.member.roles.add(
rolesmanage.rolesToAdd, rolesmanage.rolesToAdd,
"Updating all discord members", "Updating all discord members"
) )
continue continue
} else if (guildMemberRank === "Elite") { } else if (guildMemberRank === "Elite") {
@@ -165,11 +165,11 @@ export default async function updateDiscordRoles(
const rolesmanage = roleManage("elite") const rolesmanage = roleManage("elite")
gmember.member.roles.remove( gmember.member.roles.remove(
rolesmanage.rolesToRemove, rolesmanage.rolesToRemove,
"Updating all discord members", "Updating all discord members"
) )
gmember.member.roles.add( gmember.member.roles.add(
rolesmanage.rolesToAdd, rolesmanage.rolesToAdd,
"Updating all discord members", "Updating all discord members"
) )
continue continue
} else if (guildMemberRank === "Member") { } else if (guildMemberRank === "Member") {
@@ -180,11 +180,11 @@ export default async function updateDiscordRoles(
const rolesmanage = roleManage("member") const rolesmanage = roleManage("member")
gmember.member.roles.remove( gmember.member.roles.remove(
rolesmanage.rolesToRemove, rolesmanage.rolesToRemove,
"Updating all discord members", "Updating all discord members"
) )
gmember.member.roles.add( gmember.member.roles.add(
rolesmanage.rolesToAdd, rolesmanage.rolesToAdd,
"Updating all discord members", "Updating all discord members"
) )
continue continue
} }
@@ -198,8 +198,8 @@ export default async function updateDiscordRoles(
embeds: [ embeds: [
{ {
description: "Successfully updated all roles.", description: "Successfully updated all roles.",
color: embedColor, color: embedColor
}, }
], ]
}) })
} }

View File

@@ -3,7 +3,7 @@ import {
PermissionFlagsBits, PermissionFlagsBits,
userMention, userMention,
ChatInputCommandInteraction, ChatInputCommandInteraction,
GuildMember, GuildMember
} from "discord.js" } from "discord.js"
import { color, devMessage } from "config/options.json" import { color, devMessage } from "config/options.json"
import { Command } from "interfaces" import { Command } from "interfaces"
@@ -23,18 +23,18 @@ export = {
option option
.setName("user") .setName("user")
.setDescription("The user to timeout") .setDescription("The user to timeout")
.setRequired(true), .setRequired(true)
) )
.addStringOption(option => .addStringOption(option =>
option option
.setName("time") .setName("time")
.setDescription("The time to timeout the user for") .setDescription("The time to timeout the user for")
.setRequired(true), .setRequired(true)
) )
.addStringOption(option => .addStringOption(option =>
option option
.setName("reason") .setName("reason")
.setDescription("The reason for the timeout"), .setDescription("The reason for the timeout")
) )
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator) .setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
.setDMPermission(false), .setDMPermission(false),
@@ -57,9 +57,9 @@ export = {
embeds: [ embeds: [
{ {
description: "You cannot timeout a bot.", description: "You cannot timeout a bot.",
color: embedColor, color: embedColor
}, }
], ]
}) })
return return
} }
@@ -69,9 +69,9 @@ export = {
embeds: [ embeds: [
{ {
description: "You cannot timeout the server owner.", description: "You cannot timeout the server owner.",
color: embedColor, color: embedColor
}, }
], ]
}) })
return return
} }
@@ -85,9 +85,9 @@ export = {
{ {
description: description:
"I cannot timeout this user because their role is higher than mine.", "I cannot timeout this user because their role is higher than mine.",
color: embedColor, color: embedColor
}, }
], ]
}) })
return return
} }
@@ -98,9 +98,9 @@ export = {
{ {
description: description:
"You cannot timeout this user because their role is higher than yours.", "You cannot timeout this user because their role is higher than yours.",
color: embedColor, color: embedColor
}, }
], ]
}) })
return return
} }
@@ -110,9 +110,9 @@ export = {
embeds: [ embeds: [
{ {
description: "You cannot timeout yourself.", description: "You cannot timeout yourself.",
color: embedColor, color: embedColor
}, }
], ]
}) })
return return
} }
@@ -159,7 +159,7 @@ export = {
{ {
author: { author: {
name: mod.user.username, name: mod.user.username,
icon_url: mod.user.avatarURL() || undefined, icon_url: mod.user.avatarURL() || undefined
}, },
title: title, title: title,
description: ` description: `
@@ -170,15 +170,15 @@ export = {
`, `,
color: embedColor, color: embedColor,
thumbnail: { thumbnail: {
url: mod.user.avatarURL() || "", url: mod.user.avatarURL() || ""
}, },
footer: { footer: {
text: "ID: " + target.id, text: "ID: " + target.id,
icon_url: target.user.avatarURL() || undefined, icon_url: target.user.avatarURL() || undefined
}, },
timestamp: new Date().toISOString(), timestamp: new Date().toISOString()
}, }
], ]
}) })
await interaction.editReply({ await interaction.editReply({
@@ -188,10 +188,10 @@ export = {
color: embedColor, color: embedColor,
footer: { footer: {
text: interaction.guild!.name + " | " + devMessage, text: interaction.guild!.name + " | " + devMessage,
icon_url: interaction.guild!.iconURL() || undefined, icon_url: interaction.guild!.iconURL() || undefined
}, }
}, }
], ]
}) })
}, }
} as Command } as Command

View File

@@ -2,7 +2,7 @@ import {
SlashCommandBuilder, SlashCommandBuilder,
PermissionFlagsBits, PermissionFlagsBits,
userMention, userMention,
User, User
} from "discord.js" } from "discord.js"
import { color, devMessage } from "config/options.json" import { color, devMessage } from "config/options.json"
import { Command } from "interfaces" import { Command } from "interfaces"
@@ -22,13 +22,13 @@ export = {
.setName("user") .setName("user")
.setDescription("The user to unban") .setDescription("The user to unban")
.setAutocomplete(true) .setAutocomplete(true)
.setRequired(true), .setRequired(true)
) )
.addStringOption(option => .addStringOption(option =>
option option
.setName("reason") .setName("reason")
.setDescription("The reason for unbanning the user") .setDescription("The reason for unbanning the user")
.setRequired(false), .setRequired(false)
) )
.setDefaultMemberPermissions(PermissionFlagsBits.BanMembers) .setDefaultMemberPermissions(PermissionFlagsBits.BanMembers)
.setDMPermission(false), .setDMPermission(false),
@@ -48,9 +48,9 @@ export = {
embeds: [ embeds: [
{ {
description: "You haven't specified a user to unban", description: "You haven't specified a user to unban",
color: embedColor, color: embedColor
}, }
], ]
}) })
return return
} }
@@ -62,9 +62,9 @@ export = {
embeds: [ embeds: [
{ {
description: "The user you specified is not valid", description: "The user you specified is not valid",
color: embedColor, color: embedColor
}, }
], ]
}) })
return return
} }
@@ -76,7 +76,7 @@ export = {
{ {
author: { author: {
name: mod.username, name: mod.username,
icon_url: mod.avatarURL() || undefined, icon_url: mod.avatarURL() || undefined
}, },
title: "Member Unbanned", title: "Member Unbanned",
description: ` description: `
@@ -86,15 +86,15 @@ export = {
`, `,
color: embedColor, color: embedColor,
thumbnail: { thumbnail: {
url: mod.avatarURL() || "", url: mod.avatarURL() || ""
}, },
footer: { footer: {
text: "ID: " + user!.id, text: "ID: " + user!.id,
icon_url: user.avatarURL() || undefined, icon_url: user.avatarURL() || undefined
}, },
timestamp: new Date().toISOString(), timestamp: new Date().toISOString()
}, }
], ]
}) })
await interaction.editReply({ await interaction.editReply({
@@ -112,14 +112,14 @@ export = {
userMention(mod.id), userMention(mod.id),
color: embedColor, color: embedColor,
thumbnail: { thumbnail: {
url: user!.avatarURL() || "", url: user!.avatarURL() || ""
}, },
footer: { footer: {
icon_url: interaction.guild!.iconURL() || undefined, icon_url: interaction.guild!.iconURL() || undefined,
text: interaction.guild!.name + " | " + devMessage, text: interaction.guild!.name + " | " + devMessage
}, }
}, }
], ]
}) })
}, }
} as Command } as Command

View File

@@ -32,10 +32,10 @@ export = {
color: embedColor, color: embedColor,
footer: { footer: {
text: interaction.guild!.name + " | " + devMessage, text: interaction.guild!.name + " | " + devMessage,
icon_url: interaction.guild!.iconURL() || undefined, icon_url: interaction.guild!.iconURL() || undefined
}, }
}, }
], ]
}) })
return return
} }
@@ -44,9 +44,9 @@ export = {
embeds: [ embeds: [
{ {
description: "Fetching your guild data...", description: "Fetching your guild data...",
color: embedColor, color: embedColor
}, }
], ]
}) })
const guild = await getGuild(verifyData.uuid) const guild = await getGuild(verifyData.uuid)
@@ -63,11 +63,11 @@ export = {
const roles = roleManage("default") const roles = roleManage("default")
await user.roles.remove( await user.roles.remove(
roles.rolesToRemove, roles.rolesToRemove,
"User used the update command", "User used the update command"
) )
await user.roles.add( await user.roles.add(
roles.rolesToAdd, roles.rolesToAdd,
"User used the update command", "User used the update command"
) )
await interaction.editReply({ await interaction.editReply({
@@ -76,14 +76,14 @@ export = {
description: "Updated your roles to `Default Member`", description: "Updated your roles to `Default Member`",
color: embedColor, color: embedColor,
thumbnail: { thumbnail: {
url: head!, url: head!
}, },
footer: { footer: {
text: interaction.guild!.name + " | " + devMessage, text: interaction.guild!.name + " | " + devMessage,
icon_url: interaction.guild!.iconURL() || undefined, icon_url: interaction.guild!.iconURL() || undefined
}, }
}, }
], ]
}) })
return return
} }
@@ -91,24 +91,24 @@ export = {
if (guildID === hypixelGuildID) { if (guildID === hypixelGuildID) {
const GuildMembers = guild!.members const GuildMembers = guild!.members
const guildRank = GuildMembers.find( const guildRank = GuildMembers.find(
member => member.uuid === verifyData.uuid, member => member.uuid === verifyData.uuid
)!.rank )!.rank
let replyRank: string | null = null let replyRank: string | null = null
await user.roles.add( await user.roles.add(
roleManage("default").rolesToAdd, roleManage("default").rolesToAdd,
"User used the update command", "User used the update command"
) )
if (guildRank === "Guild Master") { if (guildRank === "Guild Master") {
const roles = roleManage("gm") const roles = roleManage("gm")
await user.roles.remove( await user.roles.remove(
roles.rolesToRemove, roles.rolesToRemove,
"User used the update command", "User used the update command"
) )
await user.roles.add( await user.roles.add(
roles.rolesToAdd, roles.rolesToAdd,
"User used the update command", "User used the update command"
) )
replyRank = "Guild Master" replyRank = "Guild Master"
} }
@@ -117,11 +117,11 @@ export = {
const roles = roleManage("manager") const roles = roleManage("manager")
await user.roles.remove( await user.roles.remove(
roles.rolesToRemove, roles.rolesToRemove,
"User used the update command", "User used the update command"
) )
await user.roles.add( await user.roles.add(
roles.rolesToAdd, roles.rolesToAdd,
"User used the update command", "User used the update command"
) )
replyRank = "Manager" replyRank = "Manager"
} }
@@ -130,11 +130,11 @@ export = {
const roles = roleManage("moderator") const roles = roleManage("moderator")
await user.roles.remove( await user.roles.remove(
roles.rolesToRemove, roles.rolesToRemove,
"User used the update command", "User used the update command"
) )
await user.roles.add( await user.roles.add(
roles.rolesToAdd, roles.rolesToAdd,
"User used the update command", "User used the update command"
) )
replyRank = "Moderator" replyRank = "Moderator"
} }
@@ -143,11 +143,11 @@ export = {
const roles = roleManage("beast") const roles = roleManage("beast")
await user.roles.remove( await user.roles.remove(
roles.rolesToRemove, roles.rolesToRemove,
"User used the update command", "User used the update command"
) )
await user.roles.add( await user.roles.add(
roles.rolesToAdd, roles.rolesToAdd,
"User used the update command", "User used the update command"
) )
replyRank = "Beast" replyRank = "Beast"
} }
@@ -156,11 +156,11 @@ export = {
const roles = roleManage("elite") const roles = roleManage("elite")
await user.roles.remove( await user.roles.remove(
roles.rolesToRemove, roles.rolesToRemove,
"User used the update command", "User used the update command"
) )
await user.roles.add( await user.roles.add(
roles.rolesToAdd, roles.rolesToAdd,
"User used the update command", "User used the update command"
) )
replyRank = "Elite" replyRank = "Elite"
} }
@@ -169,11 +169,11 @@ export = {
const roles = roleManage("member") const roles = roleManage("member")
await user.roles.remove( await user.roles.remove(
roles.rolesToRemove, roles.rolesToRemove,
"User used the update command", "User used the update command"
) )
await user.roles.add( await user.roles.add(
roles.rolesToAdd, roles.rolesToAdd,
"User used the update command", "User used the update command"
) )
replyRank = "Member" replyRank = "Member"
} }
@@ -185,15 +185,15 @@ export = {
"Updated your roles to `" + replyRank + "`", "Updated your roles to `" + replyRank + "`",
color: embedColor, color: embedColor,
thumbnail: { thumbnail: {
url: head!, url: head!
}, },
footer: { footer: {
text: interaction.guild!.name + " | " + devMessage, text: interaction.guild!.name + " | " + devMessage,
icon_url: interaction.guild!.iconURL() || undefined, icon_url: interaction.guild!.iconURL() || undefined
}, }
}, }
], ]
}) })
} }
}, }
} as Command } as Command

View File

@@ -16,7 +16,7 @@ export = {
option option
.setName("ign") .setName("ign")
.setDescription("Player's name") .setDescription("Player's name")
.setRequired(true), .setRequired(true)
) )
.setDMPermission(false), .setDMPermission(false),
@@ -35,9 +35,9 @@ export = {
embeds: [ embeds: [
{ {
description: "That player doesn't exist!", description: "That player doesn't exist!",
color: embedColor, color: embedColor
}, }
], ]
}) })
return return
} }
@@ -55,14 +55,14 @@ export = {
"`", "`",
color: embedColor, color: embedColor,
thumbnail: { thumbnail: {
url: head!, url: head!
}, },
footer: { footer: {
text: interaction.guild!.name + " | " + devMessage, text: interaction.guild!.name + " | " + devMessage,
icon_url: interaction.guild!.iconURL() || undefined, icon_url: interaction.guild!.iconURL() || undefined
}, }
}, }
], ]
}) })
}, }
} as Command } as Command

View File

@@ -21,7 +21,7 @@ export = {
option option
.setName("ign") .setName("ign")
.setDescription("Your in-game name.") .setDescription("Your in-game name.")
.setRequired(true), .setRequired(true)
) )
.setDMPermission(false), .setDMPermission(false),
@@ -36,7 +36,7 @@ export = {
if (verifyData) { if (verifyData) {
interaction.editReply( interaction.editReply(
"You are already verified.\n" + "You are already verified.\n" +
"Try running /update to update your roles.", "Try running /update to update your roles."
) )
return return
} }
@@ -47,9 +47,9 @@ export = {
{ {
description: description:
"<a:cross_a:1087808606897983539> Please provide your in-game name.", "<a:cross_a:1087808606897983539> Please provide your in-game name.",
color: embedColor, color: embedColor
}, }
], ]
}) })
return return
} }
@@ -58,9 +58,9 @@ export = {
embeds: [ embeds: [
{ {
description: "Fetching your uuid...", description: "Fetching your uuid...",
color: embedColor, color: embedColor
}, }
], ]
}) })
const uuid = await getUUID(ign) const uuid = await getUUID(ign)
@@ -70,9 +70,9 @@ export = {
{ {
description: description:
"<a:questionmark_pink:1130206038008803488> That player does not exist.", "<a:questionmark_pink:1130206038008803488> That player does not exist.",
color: embedColor, color: embedColor
}, }
], ]
}) })
return return
} }
@@ -81,9 +81,9 @@ export = {
embeds: [ embeds: [
{ {
description: "Fetching your player data...", description: "Fetching your player data...",
color: embedColor, color: embedColor
}, }
], ]
}) })
const head = await getHeadURL(ign) const head = await getHeadURL(ign)
@@ -94,9 +94,9 @@ export = {
{ {
description: description:
"<a:questionmark_pink:1130206038008803488> That player hasn't played Hypixel before.", "<a:questionmark_pink:1130206038008803488> That player hasn't played Hypixel before.",
color: embedColor, color: embedColor
}, }
], ]
}) })
return return
} }
@@ -112,9 +112,9 @@ export = {
embeds: [ embeds: [
{ {
description: "Checking your Discord tag...", description: "Checking your Discord tag...",
color: embedColor, color: embedColor
}, }
], ]
}) })
const linkedDiscord = player?.socialMedia?.links?.DISCORD || null const linkedDiscord = player?.socialMedia?.links?.DISCORD || null
@@ -129,9 +129,9 @@ export = {
"**Please set your Discord tag on hypixel to `" + "**Please set your Discord tag on hypixel to `" +
username + username +
"` and try again.**", "` and try again.**",
color: embedColor, color: embedColor
}, }
], ]
}) })
return return
} }
@@ -149,9 +149,9 @@ export = {
"**Please set your Discord tag on hypixel to `" + "**Please set your Discord tag on hypixel to `" +
username + username +
"` and try again.**", "` and try again.**",
color: embedColor, color: embedColor
}, }
], ]
}) })
return return
} }
@@ -160,9 +160,9 @@ export = {
embeds: [ embeds: [
{ {
description: "Fetching your guild data...", description: "Fetching your guild data...",
color: embedColor, color: embedColor
}, }
], ]
}) })
const guild = (await getGuild(uuid)) as GuildData | null const guild = (await getGuild(uuid)) as GuildData | null
@@ -176,7 +176,7 @@ export = {
if (guildID === hypixelGuildID) { if (guildID === hypixelGuildID) {
const GuildMembers = guild!.members const GuildMembers = guild!.members
const guildRank = GuildMembers.find( const guildRank = GuildMembers.find(
member => member.uuid === player.uuid, member => member.uuid === player.uuid
)!.rank )!.rank
if (guildRank === "Guild Master") { if (guildRank === "Guild Master") {
@@ -215,7 +215,7 @@ export = {
const newVerify = new verify({ const newVerify = new verify({
_id: new mongoose.Types.ObjectId(), _id: new mongoose.Types.ObjectId(),
userID: user.id, userID: user.id,
uuid: uuid, uuid: uuid
}) })
await newVerify.save() await newVerify.save()
@@ -232,14 +232,14 @@ export = {
"`.", "`.",
color: embedColor, color: embedColor,
thumbnail: { thumbnail: {
url: head!, url: head!
}, },
footer: { footer: {
icon_url: interaction.guild!.iconURL() || undefined, icon_url: interaction.guild!.iconURL() || undefined,
text: interaction.guild!.name + " | " + devMessage, text: interaction.guild!.name + " | " + devMessage
}, }
}, }
], ]
}) })
}, }
} as Command } as Command

View File

@@ -27,9 +27,9 @@ export = {
embeds: [ embeds: [
{ {
description: "You are not verified!", description: "You are not verified!",
color: embedColor, color: embedColor
}, }
], ]
}) })
return return
} }
@@ -49,14 +49,14 @@ export = {
"`", "`",
color: embedColor, color: embedColor,
thumbnail: { thumbnail: {
url: head!, url: head!
}, },
footer: { footer: {
text: interaction.guild!.name + " | " + devMessage, text: interaction.guild!.name + " | " + devMessage,
icon_url: interaction.guild!.iconURL() || undefined, icon_url: interaction.guild!.iconURL() || undefined
}, }
}, }
], ]
}) })
}, }
} as Command } as Command

View File

@@ -1,7 +1,7 @@
import { import {
SlashCommandBuilder, SlashCommandBuilder,
PermissionFlagsBits, PermissionFlagsBits,
userMention, userMention
} from "discord.js" } from "discord.js"
import { getIGN, getHeadURL } from "utils/Hypixel" import { getIGN, getHeadURL } from "utils/Hypixel"
import { color, devMessage } from "config/options.json" import { color, devMessage } from "config/options.json"
@@ -21,7 +21,7 @@ export = {
option option
.setName("user") .setName("user")
.setDescription("The user to get the ign of.") .setDescription("The user to get the ign of.")
.setRequired(true), .setRequired(true)
) )
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator) .setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
.setDMPermission(false), .setDMPermission(false),
@@ -35,7 +35,7 @@ export = {
const verifiedUser = await verify.findOne({ userID: user.id }) const verifiedUser = await verify.findOne({ userID: user.id })
if (!verifiedUser) { if (!verifiedUser) {
interaction.editReply({ interaction.editReply({
content: "This user has not verified their account.", content: "This user has not verified their account."
}) })
return return
} }
@@ -54,14 +54,14 @@ export = {
ign, ign,
color: embedColor, color: embedColor,
thumbnail: { thumbnail: {
url: head!, url: head!
}, },
footer: { footer: {
text: interaction.guild!.name + " | " + devMessage, text: interaction.guild!.name + " | " + devMessage,
icon_url: interaction.guild!.iconURL() || undefined, icon_url: interaction.guild!.iconURL() || undefined
}, }
}, }
], ]
}) })
}, }
} as Command } as Command

View File

@@ -12,8 +12,8 @@ export = {
await interaction.respond([ await interaction.respond([
{ {
name: "Please start typing a username to unban", name: "Please start typing a username to unban",
value: "none", value: "none"
}, }
]) ])
return return
} }
@@ -22,16 +22,16 @@ export = {
const filteredUsers = bannedUsers.filter(user => const filteredUsers = bannedUsers.filter(user =>
user.user.username user.user.username
.toLowerCase() .toLowerCase()
.includes(focusedOption.value.toLowerCase()), .includes(focusedOption.value.toLowerCase())
) )
const results = filteredUsers.map(user => ({ const results = filteredUsers.map(user => ({
name: user.user.username, name: user.user.username,
value: user.user.id, value: user.user.id
})) }))
await interaction.respond(results.slice(0, 25)).catch(err => { await interaction.respond(results.slice(0, 25)).catch(err => {
console.log(err) console.log(err)
}) })
}, }
} as Autocomplete } as Autocomplete

View File

@@ -7,7 +7,7 @@ import {
swstars, swstars,
swkdr, swkdr,
duelswins, duelswins,
duelswlr, duelswlr
} from "config/reqs.json" } from "config/reqs.json"
import { import {
hypixelLevel, hypixelLevel,
@@ -15,7 +15,7 @@ import {
skywarsLevel, skywarsLevel,
getPlayer, getPlayer,
getGuild, getGuild,
getHeadURL, getHeadURL
} from "utils/Hypixel" } from "utils/Hypixel"
import { Button } from "interfaces" import { Button } from "interfaces"
@@ -40,9 +40,9 @@ export = {
{ {
description: description:
"That player hasn't played Hypixel before.", "That player hasn't played Hypixel before.",
color: embedColor, color: embedColor
}, }
], ]
}) })
return return
} }
@@ -93,7 +93,7 @@ export = {
if (!player.stats) { if (!player.stats) {
statsFields.push({ statsFields.push({
name: "<a:_warning:1178350183457751100> This player never played any games.", name: "<a:_warning:1178350183457751100> This player never played any games.",
value: "**➺ Stats:** `None`", value: "**➺ Stats:** `None`"
}) })
} else { } else {
if (player.stats.Bedwars) { if (player.stats.Bedwars) {
@@ -134,7 +134,7 @@ export = {
hsbwwins.toString() + hsbwwins.toString() +
" / " + " / " +
bwwins.toString() + bwwins.toString() +
"`", "`"
}) })
} }
@@ -170,7 +170,7 @@ export = {
"`\n" + "`\n" +
"**➺ Wins:** `" + "**➺ Wins:** `" +
hsswwins.toString() + hsswwins.toString() +
"`", "`"
}) })
} }
@@ -206,7 +206,7 @@ export = {
"`\n" + "`\n" +
"**➺ KDR:** `" + "**➺ KDR:** `" +
hsduelskd.toFixed(2).toString() + hsduelskd.toFixed(2).toString() +
"`", "`"
}) })
} }
} }
@@ -231,15 +231,15 @@ export = {
"`", "`",
color: embedColor, color: embedColor,
thumbnail: { thumbnail: {
url: head!, url: head!
}, },
footer: { footer: {
text: interaction.guild!.name + " | " + devMessage, text: interaction.guild!.name + " | " + devMessage,
icon_url: interaction.guild!.iconURL() || undefined, icon_url: interaction.guild!.iconURL() || undefined
}, },
fields: statsFields, fields: statsFields
}, }
], ]
}) })
}, }
} as Button } as Button

View File

@@ -2,13 +2,13 @@ import {
ActionRowBuilder, ActionRowBuilder,
ButtonStyle, ButtonStyle,
ButtonBuilder, ButtonBuilder,
TextChannel, TextChannel
} from "discord.js" } from "discord.js"
import { import {
color, color,
waitingListChannel, waitingListChannel,
waitingListMessage, waitingListMessage,
hypixelGuildID, hypixelGuildID
} from "config/options.json" } from "config/options.json"
import colorLog from "utils/functions/colors" import colorLog from "utils/functions/colors"
import mongoose from "mongoose" import mongoose from "mongoose"
@@ -55,9 +55,9 @@ export = {
.setCustomId("checkstats") .setCustomId("checkstats")
.setLabel("Check Stats") .setLabel("Check Stats")
.setStyle(ButtonStyle.Secondary) .setStyle(ButtonStyle.Secondary)
.setDisabled(true), .setDisabled(true)
), )
], ]
}) })
await applicant.send({ await applicant.send({
@@ -66,9 +66,9 @@ export = {
description: description:
"Your application for the Illegitimate guild has been accepted.\n\n" + "Your application for the Illegitimate guild has been accepted.\n\n" +
"Make sure to leave your current guild so that we can invite you.", "Make sure to leave your current guild so that we can invite you.",
color: embedColor, color: embedColor
}, }
], ]
}) })
const applicantEntry = await guildapp.findOne({ userID: applicantId }) const applicantEntry = await guildapp.findOne({ userID: applicantId })
@@ -80,7 +80,7 @@ export = {
userID: applicantId, userID: applicantId,
uuid: applicantUUID, uuid: applicantUUID,
IGN: applicantIGN, IGN: applicantIGN,
timestamp: time, timestamp: time
}) })
await waitingListAdd.save() await waitingListAdd.save()
@@ -96,20 +96,20 @@ export = {
"Application has been accepted by <@" + user.id + ">.", "Application has been accepted by <@" + user.id + ">.",
color: embedColor, color: embedColor,
thumbnail: { thumbnail: {
url: applicant.avatarURL() || "", url: applicant.avatarURL() || ""
}, },
footer: { footer: {
icon_url: guild.iconURL() || undefined, icon_url: guild.iconURL() || undefined,
text: "ID: " + applicant.id, text: "ID: " + applicant.id
}, }
}, }
], ]
}) })
if (process.env.NODE_ENV === "dev") return if (process.env.NODE_ENV === "dev") return
try { try {
const channel = guild.channels.cache.get( const channel = guild.channels.cache.get(
waitingListChannel, waitingListChannel
) as TextChannel ) as TextChannel
const wlmessage = await channel!.messages.fetch(waitingListMessage) const wlmessage = await channel!.messages.fetch(waitingListMessage)
@@ -133,7 +133,7 @@ export = {
fields.push({ fields.push({
name: `${i + 1}. ${accepted[i].IGN}`, name: `${i + 1}. ${accepted[i].IGN}`,
value: `TS: <t:${timestamp}:R>`, value: `TS: <t:${timestamp}:R>`
}) })
} }
@@ -145,18 +145,18 @@ export = {
color: wlembed.color!, color: wlembed.color!,
footer: { footer: {
text: "Last updated by " + user.username, text: "Last updated by " + user.username,
icon_url: user.avatarURL() || undefined, icon_url: user.avatarURL() || undefined
}, },
thumbnail: wlembed.thumbnail!, thumbnail: wlembed.thumbnail!,
fields: fields, fields: fields,
timestamp: new Date().toISOString(), timestamp: new Date().toISOString()
}, }
], ]
}) })
} catch (err) { } catch (err) {
console.log( console.log(
colorLog("Error while trying to update waiting list.", "red"), colorLog("Error while trying to update waiting list.", "red")
) )
} }
}, }
} as Button } as Button

View File

@@ -2,7 +2,7 @@ import {
ModalBuilder, ModalBuilder,
ActionRowBuilder, ActionRowBuilder,
TextInputBuilder, TextInputBuilder,
TextInputStyle, TextInputStyle
} from "discord.js" } from "discord.js"
import { Button } from "interfaces" import { Button } from "interfaces"
@@ -21,11 +21,11 @@ export = {
.setCustomId("denyreason") .setCustomId("denyreason")
.setStyle(TextInputStyle.Paragraph) .setStyle(TextInputStyle.Paragraph)
.setPlaceholder( .setPlaceholder(
"Enter a reason for denying the application", "Enter a reason for denying the application"
) )
.setRequired(false), .setRequired(false)
), )
) )
await interaction.showModal(modal) await interaction.showModal(modal)
}, }
} as Button } as Button

View File

@@ -4,7 +4,7 @@ import {
ActionRowBuilder, ActionRowBuilder,
EmbedBuilder, EmbedBuilder,
GuildMember, GuildMember,
TextChannel, TextChannel
} from "discord.js" } from "discord.js"
import { color } from "config/options.json" import { color } from "config/options.json"
import { largeM, smallM, ignM } from "config/limitmessages.json" import { largeM, smallM, ignM } from "config/limitmessages.json"
@@ -40,7 +40,7 @@ export = {
if (userRoles.includes(guildRole)) { if (userRoles.includes(guildRole)) {
await interaction.editReply( await interaction.editReply(
"You are already a member of the guild.", "You are already a member of the guild."
) )
return return
} }
@@ -49,7 +49,7 @@ export = {
if (application) { if (application) {
await interaction.editReply( await interaction.editReply(
"You already have an application in progress.", "You already have an application in progress."
) )
return return
} }
@@ -62,7 +62,7 @@ export = {
.setColor(embedColor) .setColor(embedColor)
const attachments = new EmbedBuilder() const attachments = new EmbedBuilder()
.setDescription( .setDescription(
"You have uploaded an attachment. Please do not upload images, videos, or GIFS.", "You have uploaded an attachment. Please do not upload images, videos, or GIFS."
) )
.setColor(embedColor) .setColor(embedColor)
@@ -75,9 +75,9 @@ export = {
"If you wish to proceed with your application, please type `yes` otherwise type `cancel`.\n\n" + "If you wish to proceed with your application, please type `yes` otherwise type `cancel`.\n\n" +
"**Do not upload images, videos, or GIFS.**\n" + "**Do not upload images, videos, or GIFS.**\n" +
"You have a minute to respond to this message.", "You have a minute to respond to this message.",
color: embedColor, color: embedColor
}, }
], ]
}) })
} catch (error) { } catch (error) {
await interaction.editReply("Please enable your DMs.") await interaction.editReply("Please enable your DMs.")
@@ -89,7 +89,7 @@ export = {
const input = await user.dmChannel!.awaitMessages({ const input = await user.dmChannel!.awaitMessages({
filter: m => m.author.id === user.user.id, filter: m => m.author.id === user.user.id,
max: 1, max: 1,
time: 1000 * 60, time: 1000 * 60
}) })
if (input.size === 0) { if (input.size === 0) {
await user.send({ embeds: [tooLong] }) await user.send({ embeds: [tooLong] })
@@ -116,15 +116,15 @@ export = {
"`", "`",
color: embedColor, color: embedColor,
footer: { footer: {
text: "You have 5 minutes to respond to this message.", text: "You have 5 minutes to respond to this message."
}, }
}, }
], ]
}) })
const answer1 = await user.dmChannel!.awaitMessages({ const answer1 = await user.dmChannel!.awaitMessages({
filter: m => m.author.id === user.user.id, filter: m => m.author.id === user.user.id,
max: 1, max: 1,
time: 1000 * 60 * 5, time: 1000 * 60 * 5
}) })
if (answer1.size === 0) { if (answer1.size === 0) {
await user.send({ embeds: [tooLong] }) await user.send({ embeds: [tooLong] })
@@ -143,9 +143,9 @@ export = {
embeds: [ embeds: [
{ {
description: "Max character limit is 16.", description: "Max character limit is 16.",
color: embedColor, color: embedColor
}, }
], ]
}) })
return return
} }
@@ -157,9 +157,9 @@ export = {
description: description:
"That is not a valid Minecraft username.\n" + "That is not a valid Minecraft username.\n" +
"Application cancelled.", "Application cancelled.",
color: embedColor, color: embedColor
}, }
], ]
}) })
return return
} }
@@ -176,15 +176,15 @@ export = {
"`(8 characters max)`", "`(8 characters max)`",
color: embedColor, color: embedColor,
footer: { footer: {
text: "You have 15 minutes to respond to this message.", text: "You have 15 minutes to respond to this message."
}, }
}, }
], ]
}) })
const answer2 = await user.dmChannel!.awaitMessages({ const answer2 = await user.dmChannel!.awaitMessages({
filter: m => m.author.id === user.user.id, filter: m => m.author.id === user.user.id,
max: 1, max: 1,
time: 1000 * 60 * 15, time: 1000 * 60 * 15
}) })
if (answer2.size === 0) { if (answer2.size === 0) {
await user.send({ embeds: [tooLong] }) await user.send({ embeds: [tooLong] })
@@ -203,9 +203,9 @@ export = {
embeds: [ embeds: [
{ {
description: "Max character limit is 8.", description: "Max character limit is 8.",
color: embedColor, color: embedColor
}, }
], ]
}) })
return return
} }
@@ -223,15 +223,15 @@ export = {
"`", "`",
color: embedColor, color: embedColor,
footer: { footer: {
text: "You have 15 minutes to respond to this message.", text: "You have 15 minutes to respond to this message."
}, }
}, }
], ]
}) })
const answer3 = await user.dmChannel!.awaitMessages({ const answer3 = await user.dmChannel!.awaitMessages({
filter: m => m.author.id === user.user.id, filter: m => m.author.id === user.user.id,
max: 1, max: 1,
time: 1000 * 60 * 15, time: 1000 * 60 * 15
}) })
if (answer3.size === 0) { if (answer3.size === 0) {
await user.send({ embeds: [tooLong] }) await user.send({ embeds: [tooLong] })
@@ -250,9 +250,9 @@ export = {
embeds: [ embeds: [
{ {
description: "Max character limit is 128.", description: "Max character limit is 128.",
color: embedColor, color: embedColor
}, }
], ]
}) })
} }
const answer3_1 = answer3.first()!.content const answer3_1 = answer3.first()!.content
@@ -270,15 +270,15 @@ export = {
"`", "`",
color: embedColor, color: embedColor,
footer: { footer: {
text: "You have 15 minutes to respond to this message.", text: "You have 15 minutes to respond to this message."
}, }
}, }
], ]
}) })
const answer4 = await user.dmChannel!.awaitMessages({ const answer4 = await user.dmChannel!.awaitMessages({
filter: m => m.author.id === user.user.id, filter: m => m.author.id === user.user.id,
max: 1, max: 1,
time: 1000 * 60 * 15, time: 1000 * 60 * 15
}) })
if (answer4.size === 0) { if (answer4.size === 0) {
await user.send({ embeds: [tooLong] }) await user.send({ embeds: [tooLong] })
@@ -297,9 +297,9 @@ export = {
embeds: [ embeds: [
{ {
description: "Max character limit is 256.", description: "Max character limit is 256.",
color: embedColor, color: embedColor
}, }
], ]
}) })
} }
const answer4_1 = answer4.first()!.content const answer4_1 = answer4.first()!.content
@@ -316,15 +316,15 @@ export = {
"`", "`",
color: embedColor, color: embedColor,
footer: { footer: {
text: "You have 15 minutes to respond to this message.", text: "You have 15 minutes to respond to this message."
}, }
}, }
], ]
}) })
const answer5 = await user.dmChannel!.awaitMessages({ const answer5 = await user.dmChannel!.awaitMessages({
filter: m => m.author.id === user.user.id, filter: m => m.author.id === user.user.id,
max: 1, max: 1,
time: 1000 * 60 * 15, time: 1000 * 60 * 15
}) })
if (answer5.size === 0) { if (answer5.size === 0) {
await user.send({ embeds: [tooLong] }) await user.send({ embeds: [tooLong] })
@@ -343,9 +343,9 @@ export = {
embeds: [ embeds: [
{ {
description: "Max character limit is 128.", description: "Max character limit is 128.",
color: embedColor, color: embedColor
}, }
], ]
}) })
} }
const answer5_1 = answer5.first()!.content const answer5_1 = answer5.first()!.content
@@ -362,15 +362,15 @@ export = {
"`", "`",
color: embedColor, color: embedColor,
footer: { footer: {
text: "You have 15 minutes to respond to this message.", text: "You have 15 minutes to respond to this message."
}, }
}, }
], ]
}) })
const answer6 = await user.dmChannel!.awaitMessages({ const answer6 = await user.dmChannel!.awaitMessages({
filter: m => m.author.id === user.user.id, filter: m => m.author.id === user.user.id,
max: 1, max: 1,
time: 1000 * 60 * 15, time: 1000 * 60 * 15
}) })
if (answer6.size === 0) { if (answer6.size === 0) {
await user.send({ embeds: [tooLong] }) await user.send({ embeds: [tooLong] })
@@ -389,9 +389,9 @@ export = {
embeds: [ embeds: [
{ {
description: "Max character limit is 256.", description: "Max character limit is 256.",
color: embedColor, color: embedColor
}, }
], ]
}) })
} }
const answer6_1 = answer6.first()!.content const answer6_1 = answer6.first()!.content
@@ -408,15 +408,15 @@ export = {
"`", "`",
color: embedColor, color: embedColor,
footer: { footer: {
text: "You have 15 minutes to respond to this message.", text: "You have 15 minutes to respond to this message."
}, }
}, }
], ]
}) })
const answer7 = await user.dmChannel!.awaitMessages({ const answer7 = await user.dmChannel!.awaitMessages({
filter: m => m.author.id === user.user.id, filter: m => m.author.id === user.user.id,
max: 1, max: 1,
time: 1000 * 60 * 15, time: 1000 * 60 * 15
}) })
if (answer7.size === 0) { if (answer7.size === 0) {
await user.send({ embeds: [tooLong] }) await user.send({ embeds: [tooLong] })
@@ -435,9 +435,9 @@ export = {
embeds: [ embeds: [
{ {
description: "Max character limit is 128.", description: "Max character limit is 128.",
color: embedColor, color: embedColor
}, }
], ]
}) })
} }
const answer7_1 = answer7!.first()!.content const answer7_1 = answer7!.first()!.content
@@ -453,15 +453,15 @@ export = {
"`(64 characters max)`", "`(64 characters max)`",
color: embedColor, color: embedColor,
footer: { footer: {
text: "You have 15 minutes to respond to this message.", text: "You have 15 minutes to respond to this message."
}, }
}, }
], ]
}) })
const answer8 = await user.dmChannel!.awaitMessages({ const answer8 = await user.dmChannel!.awaitMessages({
filter: m => m.author.id === user.user.id, filter: m => m.author.id === user.user.id,
max: 1, max: 1,
time: 1000 * 60 * 15, time: 1000 * 60 * 15
}) })
if (answer8.size === 0) { if (answer8.size === 0) {
await user.send({ embeds: [tooLong] }) await user.send({ embeds: [tooLong] })
@@ -480,9 +480,9 @@ export = {
embeds: [ embeds: [
{ {
description: "Max character limit is 64.", description: "Max character limit is 64.",
color: embedColor, color: embedColor
}, }
], ]
}) })
} }
const answer8_1 = answer8.first()!.content const answer8_1 = answer8.first()!.content
@@ -492,15 +492,15 @@ export = {
{ {
description: description:
"If you want to submit your application, type `yes` if not, type `no`", "If you want to submit your application, type `yes` if not, type `no`",
color: embedColor, color: embedColor
}, }
], ]
}) })
const final = await user.dmChannel!.awaitMessages({ const final = await user.dmChannel!.awaitMessages({
filter: m => m.author.id === user.user.id, filter: m => m.author.id === user.user.id,
max: 1, max: 1,
time: 1000 * 60 * 5, time: 1000 * 60 * 5
}) })
if (final.size === 0) { if (final.size === 0) {
await user.send({ embeds: [tooLong] }) await user.send({ embeds: [tooLong] })
@@ -519,21 +519,21 @@ export = {
embeds: [ embeds: [
{ {
description: "Your application has been submitted!", description: "Your application has been submitted!",
color: embedColor, color: embedColor
}, }
], ]
}) })
const newGuildApp = new guildapp({ const newGuildApp = new guildapp({
_id: new mongoose.Types.ObjectId(), _id: new mongoose.Types.ObjectId(),
userID: user.user.id, userID: user.user.id,
uuid: uuid, uuid: uuid
}) })
await newGuildApp.save() await newGuildApp.save()
const channel = guild.channels.cache.get( const channel = guild.channels.cache.get(
applicationsChannel, applicationsChannel
) as TextChannel ) as TextChannel
await channel.send({ await channel.send({
embeds: [ embeds: [
@@ -545,47 +545,47 @@ export = {
" - Guild Application", " - Guild Application",
color: embedColor, color: embedColor,
thumbnail: { thumbnail: {
url: user.avatarURL() || "", url: user.avatarURL() || ""
}, },
fields: [ fields: [
{ {
name: rq(1), name: rq(1),
value: "```" + answer1_1 + "```", value: "```" + answer1_1 + "```"
}, },
{ {
name: rq(2), name: rq(2),
value: "```" + answer2_1 + "```", value: "```" + answer2_1 + "```"
}, },
{ {
name: rq(3), name: rq(3),
value: "```" + answer3_1 + "```", value: "```" + answer3_1 + "```"
}, },
{ {
name: rq(4), name: rq(4),
value: "```" + answer4_1 + "```", value: "```" + answer4_1 + "```"
}, },
{ {
name: rq(5), name: rq(5),
value: "```" + answer5_1 + "```", value: "```" + answer5_1 + "```"
}, },
{ {
name: rq(6), name: rq(6),
value: "```" + answer6_1 + "```", value: "```" + answer6_1 + "```"
}, },
{ {
name: rq(7), name: rq(7),
value: "```" + answer7_1 + "```", value: "```" + answer7_1 + "```"
}, },
{ {
name: rq(8), name: rq(8),
value: "```" + answer8_1 + "```", value: "```" + answer8_1 + "```"
}, }
], ],
footer: { footer: {
icon_url: guild.iconURL() || "", icon_url: guild.iconURL() || "",
text: "ID: " + user.user.id, text: "ID: " + user.user.id
}, }
}, }
], ],
components: [ components: [
new ActionRowBuilder<ButtonBuilder>().addComponents( new ActionRowBuilder<ButtonBuilder>().addComponents(
@@ -600,10 +600,10 @@ export = {
new ButtonBuilder() new ButtonBuilder()
.setCustomId("checkstats") .setCustomId("checkstats")
.setLabel("Check Stats") .setLabel("Check Stats")
.setStyle(ButtonStyle.Secondary), .setStyle(ButtonStyle.Secondary)
), )
], ]
}) })
} }
}, }
} as Button } as Button

View File

@@ -4,7 +4,7 @@ import {
ButtonStyle, ButtonStyle,
EmbedBuilder, EmbedBuilder,
GuildMember, GuildMember,
TextChannel, TextChannel
} from "discord.js" } from "discord.js"
import { import {
gm, gm,
@@ -13,7 +13,7 @@ import {
beast, beast,
member, member,
guildStaff, guildStaff,
guildRole, guildRole
} from "config/roles.json" } from "config/roles.json"
import { ignM, smallM, largeM } from "config/limitmessages.json" import { ignM, smallM, largeM } from "config/limitmessages.json"
import { inactivity } from "config/questions.json" import { inactivity } from "config/questions.json"
@@ -26,7 +26,7 @@ const guildRoles = [
beast, beast,
member, member,
guildStaff, guildStaff,
guildRole, guildRole
] ]
module.exports = { module.exports = {
@@ -43,7 +43,7 @@ module.exports = {
if (!userRoles.some(role => guildRoles.includes(role.id))) { if (!userRoles.some(role => guildRoles.includes(role.id))) {
return await interaction.reply({ return await interaction.reply({
content: "Only guild members can use this button.", content: "Only guild members can use this button.",
ephemeral: true, ephemeral: true
}) })
} }
@@ -63,7 +63,7 @@ module.exports = {
.setColor(embedColor) .setColor(embedColor)
const attachments = new EmbedBuilder() const attachments = new EmbedBuilder()
.setDescription( .setDescription(
"You have uploaded an attachment. Please do not upload images, videos, or GIFS.", "You have uploaded an attachment. Please do not upload images, videos, or GIFS."
) )
.setColor(embedColor) .setColor(embedColor)
@@ -78,26 +78,26 @@ module.exports = {
"If you wish to proceed with your form, please type `yes`.\n\n" + "If you wish to proceed with your form, please type `yes`.\n\n" +
"**Do not upload images, videos, or GIFS.**\n" + "**Do not upload images, videos, or GIFS.**\n" +
"You have a minute to respond to this message.", "You have a minute to respond to this message.",
color: embedColor, color: embedColor
}, }
], ]
}) })
} catch (error) { } catch (error) {
return await interaction.reply({ return await interaction.reply({
content: "Please enable your DMs.", content: "Please enable your DMs.",
ephemeral: true, ephemeral: true
}) })
} }
await interaction.reply({ await interaction.reply({
content: "Please check your DMs.", content: "Please check your DMs.",
ephemeral: true, ephemeral: true
}) })
const input = await user.dmChannel!.awaitMessages({ const input = await user.dmChannel!.awaitMessages({
filter: m => m.author.id === user.user.id, filter: m => m.author.id === user.user.id,
max: 1, max: 1,
time: 1000 * 60, time: 1000 * 60
}) })
if (input.first()!.attachments.size > 0) { if (input.first()!.attachments.size > 0) {
await user.send({ embeds: [attachments] }) await user.send({ embeds: [attachments] })
@@ -123,16 +123,16 @@ module.exports = {
"`", "`",
color: embedColor, color: embedColor,
footer: { footer: {
text: "You have 5 minutes to respond to this message.", text: "You have 5 minutes to respond to this message."
}, }
}, }
], ]
}) })
const answer1 = await user.dmChannel!.awaitMessages({ const answer1 = await user.dmChannel!.awaitMessages({
filter: m => m.author.id === user.user.id, filter: m => m.author.id === user.user.id,
max: 1, max: 1,
time: 1000 * 60 * 5, time: 1000 * 60 * 5
}) })
if (answer1.first()!.attachments.size > 0) { if (answer1.first()!.attachments.size > 0) {
await user.send({ embeds: [attachments] }) await user.send({ embeds: [attachments] })
@@ -143,9 +143,9 @@ module.exports = {
embeds: [ embeds: [
{ {
description: "Max character limit is 16.", description: "Max character limit is 16.",
color: embedColor, color: embedColor
}, }
], ]
}) })
return return
} }
@@ -158,9 +158,9 @@ module.exports = {
description: description:
"That is not a valid Minecraft username.\n" + "That is not a valid Minecraft username.\n" +
"Application cancelled.", "Application cancelled.",
color: embedColor, color: embedColor
}, }
], ]
}) })
return return
} }
@@ -185,15 +185,15 @@ module.exports = {
"`", "`",
color: embedColor, color: embedColor,
footer: { footer: {
text: "You have 5 minutes to respond to this message.", text: "You have 5 minutes to respond to this message."
}, }
}, }
], ]
}) })
const answer2 = await user.dmChannel!.awaitMessages({ const answer2 = await user.dmChannel!.awaitMessages({
filter: m => m.author.id === user.user.id, filter: m => m.author.id === user.user.id,
max: 1, max: 1,
time: 1000 * 60 * 5, time: 1000 * 60 * 5
}) })
if (answer2.first()!.attachments.size > 0) { if (answer2.first()!.attachments.size > 0) {
await user.send({ embeds: [attachments] }) await user.send({ embeds: [attachments] })
@@ -204,9 +204,9 @@ module.exports = {
embeds: [ embeds: [
{ {
description: "Max character limit is 128.", description: "Max character limit is 128.",
color: embedColor, color: embedColor
}, }
], ]
}) })
return return
} }
@@ -231,15 +231,15 @@ module.exports = {
"`", "`",
color: embedColor, color: embedColor,
footer: { footer: {
text: "You have 15 minutes to respond to this message.", text: "You have 15 minutes to respond to this message."
}, }
}, }
], ]
}) })
const answer3 = await user.dmChannel!.awaitMessages({ const answer3 = await user.dmChannel!.awaitMessages({
filter: m => m.author.id === user.user.id, filter: m => m.author.id === user.user.id,
max: 1, max: 1,
time: 1000 * 60 * 15, time: 1000 * 60 * 15
}) })
if (answer3.first()!.attachments.size > 0) { if (answer3.first()!.attachments.size > 0) {
await user.send({ embeds: [attachments] }) await user.send({ embeds: [attachments] })
@@ -250,9 +250,9 @@ module.exports = {
embeds: [ embeds: [
{ {
description: "Max character limit is 256", description: "Max character limit is 256",
color: embedColor, color: embedColor
}, }
], ]
}) })
return return
} }
@@ -271,14 +271,14 @@ module.exports = {
{ {
description: description:
"If you want to submit your application, type `yes` if not, type `no`", "If you want to submit your application, type `yes` if not, type `no`",
color: embedColor, color: embedColor
}, }
], ]
}) })
const final = await user.dmChannel!.awaitMessages({ const final = await user.dmChannel!.awaitMessages({
filter: m => m.author.id === user.user.id, filter: m => m.author.id === user.user.id,
max: 1, max: 1,
time: 1000 * 60 * 5, time: 1000 * 60 * 5
}) })
if (final.first()!.attachments.size > 0) { if (final.first()!.attachments.size > 0) {
await user.send({ embeds: [attachments] }) await user.send({ embeds: [attachments] })
@@ -297,13 +297,13 @@ module.exports = {
embeds: [ embeds: [
{ {
description: "Your application has been submitted!", description: "Your application has been submitted!",
color: embedColor, color: embedColor
}, }
], ]
}) })
const appChannel = guild.channels.cache.get( const appChannel = guild.channels.cache.get(
inactivityLogChannel, inactivityLogChannel
) as TextChannel ) as TextChannel
await appChannel.send({ await appChannel.send({
@@ -316,27 +316,27 @@ module.exports = {
" - Inactivity Application", " - Inactivity Application",
color: embedColor, color: embedColor,
thumbnail: { thumbnail: {
url: user.avatarURL() || "", url: user.avatarURL() || ""
}, },
fields: [ fields: [
{ {
name: rq(1), name: rq(1),
value: "`" + answer1_1 + "`", value: "`" + answer1_1 + "`"
}, },
{ {
name: rq(2), name: rq(2),
value: "`" + answer2_1 + "`", value: "`" + answer2_1 + "`"
}, },
{ {
name: rq(3), name: rq(3),
value: "`" + answer3_1 + "`", value: "`" + answer3_1 + "`"
}, }
], ],
footer: { footer: {
icon_url: user.avatarURL() || undefined, icon_url: user.avatarURL() || undefined,
text: "ID: " + user.user.id, text: "ID: " + user.user.id
}, }
}, }
], ],
components: [ components: [
new ActionRowBuilder<ButtonBuilder>().addComponents( new ActionRowBuilder<ButtonBuilder>().addComponents(
@@ -347,9 +347,9 @@ module.exports = {
new ButtonBuilder() new ButtonBuilder()
.setCustomId("inactiveapplicationdeny") .setCustomId("inactiveapplicationdeny")
.setLabel("Deny") .setLabel("Deny")
.setStyle(ButtonStyle.Danger), .setStyle(ButtonStyle.Danger)
), )
], ]
}) })
}, }
} as Button } as Button

View File

@@ -7,7 +7,7 @@ export = {
async execute(interaction) { async execute(interaction) {
await interaction.reply({ await interaction.reply({
content: "This button is currently disabled.", content: "This button is currently disabled.",
ephemeral: true, ephemeral: true
}) })
}, }
} as Button } as Button

View File

@@ -7,7 +7,7 @@ export = {
async execute(interaction) { async execute(interaction) {
await interaction.reply({ await interaction.reply({
content: "This button is currently disabled.", content: "This button is currently disabled.",
ephemeral: true, ephemeral: true
}) })
}, }
} as Button } as Button

View File

@@ -27,9 +27,9 @@ export = {
{ {
description: description:
"Your application for the Illegitimate staff team has been accepted.", "Your application for the Illegitimate staff team has been accepted.",
color: embedColor, color: embedColor
}, }
], ]
}) })
await message.edit({ await message.edit({
@@ -44,9 +44,9 @@ export = {
.setCustomId("staffapplicationdeny") .setCustomId("staffapplicationdeny")
.setLabel("Deny") .setLabel("Deny")
.setStyle(ButtonStyle.Danger) .setStyle(ButtonStyle.Danger)
.setDisabled(true), .setDisabled(true)
), )
], ]
}) })
await staffapp.findOneAndDelete({ userID: applicantId }) await staffapp.findOneAndDelete({ userID: applicantId })
@@ -58,14 +58,14 @@ export = {
description: "Application accepted by <@" + user.id + ">.", description: "Application accepted by <@" + user.id + ">.",
color: embedColor, color: embedColor,
thumbnail: { thumbnail: {
url: applicant.avatarURL() || "", url: applicant.avatarURL() || ""
}, },
footer: { footer: {
icon_url: guild.iconURL() || undefined, icon_url: guild.iconURL() || undefined,
text: "ID: " + applicantId, text: "ID: " + applicantId
}, }
}, }
], ]
}) })
}, }
} as Button } as Button

View File

@@ -2,7 +2,7 @@ import {
ModalBuilder, ModalBuilder,
ActionRowBuilder, ActionRowBuilder,
TextInputBuilder, TextInputBuilder,
TextInputStyle, TextInputStyle
} from "discord.js" } from "discord.js"
import { Button } from "interfaces" import { Button } from "interfaces"
@@ -21,11 +21,11 @@ export = {
.setCustomId("staffdenyreason") .setCustomId("staffdenyreason")
.setStyle(TextInputStyle.Paragraph) .setStyle(TextInputStyle.Paragraph)
.setPlaceholder( .setPlaceholder(
"Enter a reason for denying the application", "Enter a reason for denying the application"
) )
.setRequired(false), .setRequired(false)
), )
) )
await interaction.showModal(modal) await interaction.showModal(modal)
}, }
} as Button } as Button

View File

@@ -4,7 +4,7 @@ import {
ActionRowBuilder, ActionRowBuilder,
EmbedBuilder, EmbedBuilder,
GuildMember, GuildMember,
TextChannel, TextChannel
} from "discord.js" } from "discord.js"
import { color, staffApplicationsChannel } from "config/options.json" import { color, staffApplicationsChannel } from "config/options.json"
import { largeM, ignM } from "config/limitmessages.json" import { largeM, ignM } from "config/limitmessages.json"
@@ -44,7 +44,7 @@ export = {
if (user.user.id !== env.prod.dev) { if (user.user.id !== env.prod.dev) {
if (status === "0") { if (status === "0") {
await interaction.editReply( await interaction.editReply(
"Staff applications are currently closed.", "Staff applications are currently closed."
) )
return return
} }
@@ -52,7 +52,7 @@ export = {
if (!userRoles.has(guildRole)) { if (!userRoles.has(guildRole)) {
await interaction.editReply( await interaction.editReply(
"You must be a member of the guild to apply for staff.", "You must be a member of the guild to apply for staff."
) )
return return
} }
@@ -66,7 +66,7 @@ export = {
if (application) { if (application) {
await interaction.editReply( await interaction.editReply(
"You already have an application in progress.", "You already have an application in progress."
) )
return return
} }
@@ -79,7 +79,7 @@ export = {
.setColor(embedColor) .setColor(embedColor)
const attachments = new EmbedBuilder() const attachments = new EmbedBuilder()
.setDescription( .setDescription(
"You have uploaded an attachment. Please do not upload images, videos, or GIFS.", "You have uploaded an attachment. Please do not upload images, videos, or GIFS."
) )
.setColor(embedColor) .setColor(embedColor)
@@ -92,9 +92,9 @@ export = {
"If you wish to proceed with your application, please type `yes` otherwise type `cancel`.\n\n" + "If you wish to proceed with your application, please type `yes` otherwise type `cancel`.\n\n" +
"**Do not upload images, videos, or GIFS.**\n" + "**Do not upload images, videos, or GIFS.**\n" +
"You have a minute to respond to this message.", "You have a minute to respond to this message.",
color: embedColor, color: embedColor
}, }
], ]
}) })
} catch (error) { } catch (error) {
await interaction.editReply("Please enable your DMs.") await interaction.editReply("Please enable your DMs.")
@@ -106,7 +106,7 @@ export = {
const input = await user.dmChannel!.awaitMessages({ const input = await user.dmChannel!.awaitMessages({
filter: m => m.author.id === user.user.id, filter: m => m.author.id === user.user.id,
max: 1, max: 1,
time: 1000 * 60, time: 1000 * 60
}) })
if (input.size === 0) { if (input.size === 0) {
await user.send({ embeds: [tooLong] }) await user.send({ embeds: [tooLong] })
@@ -133,15 +133,15 @@ export = {
"`", "`",
color: embedColor, color: embedColor,
footer: { footer: {
text: "You have 5 minutes to respond to this message.", text: "You have 5 minutes to respond to this message."
}, }
}, }
], ]
}) })
const answer1 = await user.dmChannel!.awaitMessages({ const answer1 = await user.dmChannel!.awaitMessages({
filter: m => m.author.id === user.user.id, filter: m => m.author.id === user.user.id,
max: 1, max: 1,
time: 1000 * 60 * 5, time: 1000 * 60 * 5
}) })
if (answer1.size === 0) { if (answer1.size === 0) {
await user.send({ embeds: [tooLong] }) await user.send({ embeds: [tooLong] })
@@ -160,9 +160,9 @@ export = {
embeds: [ embeds: [
{ {
description: "Max character limit is 16.", description: "Max character limit is 16.",
color: embedColor, color: embedColor
}, }
], ]
}) })
return return
} }
@@ -174,9 +174,9 @@ export = {
description: description:
"That is not a valid Minecraft username.\n" + "That is not a valid Minecraft username.\n" +
"Application cancelled.", "Application cancelled.",
color: embedColor, color: embedColor
}, }
], ]
}) })
return return
} }
@@ -193,15 +193,15 @@ export = {
"`(64 characters max)`", "`(64 characters max)`",
color: embedColor, color: embedColor,
footer: { footer: {
text: "You have 15 minutes to respond to this message.", text: "You have 15 minutes to respond to this message."
}, }
}, }
], ]
}) })
const answer2 = await user.dmChannel!.awaitMessages({ const answer2 = await user.dmChannel!.awaitMessages({
filter: m => m.author.id === user.user.id, filter: m => m.author.id === user.user.id,
max: 1, max: 1,
time: 1000 * 60 * 15, time: 1000 * 60 * 15
}) })
if (answer2.size === 0) { if (answer2.size === 0) {
await user.send({ embeds: [tooLong] }) await user.send({ embeds: [tooLong] })
@@ -220,9 +220,9 @@ export = {
embeds: [ embeds: [
{ {
description: "Max character limit is 64.", description: "Max character limit is 64.",
color: embedColor, color: embedColor
}, }
], ]
}) })
return return
} }
@@ -240,15 +240,15 @@ export = {
"`", "`",
color: embedColor, color: embedColor,
footer: { footer: {
text: "You have 15 minutes to respond to this message.", text: "You have 15 minutes to respond to this message."
}, }
}, }
], ]
}) })
const answer3 = await user.dmChannel!.awaitMessages({ const answer3 = await user.dmChannel!.awaitMessages({
filter: m => m.author.id === user.user.id, filter: m => m.author.id === user.user.id,
max: 1, max: 1,
time: 1000 * 60 * 15, time: 1000 * 60 * 15
}) })
if (answer3.size === 0) { if (answer3.size === 0) {
await user.send({ embeds: [tooLong] }) await user.send({ embeds: [tooLong] })
@@ -267,9 +267,9 @@ export = {
embeds: [ embeds: [
{ {
description: "Max character limit is 256.", description: "Max character limit is 256.",
color: embedColor, color: embedColor
}, }
], ]
}) })
} }
const answer3_1 = answer3.first()!.content const answer3_1 = answer3.first()!.content
@@ -286,15 +286,15 @@ export = {
"`", "`",
color: embedColor, color: embedColor,
footer: { footer: {
text: "You have 15 minutes to respond to this message.", text: "You have 15 minutes to respond to this message."
}, }
}, }
], ]
}) })
const answer4 = await user.dmChannel!.awaitMessages({ const answer4 = await user.dmChannel!.awaitMessages({
filter: m => m.author.id === user.user.id, filter: m => m.author.id === user.user.id,
max: 1, max: 1,
time: 1000 * 60 * 15, time: 1000 * 60 * 15
}) })
if (answer4.size === 0) { if (answer4.size === 0) {
await user.send({ embeds: [tooLong] }) await user.send({ embeds: [tooLong] })
@@ -313,9 +313,9 @@ export = {
embeds: [ embeds: [
{ {
description: "Max character limit is 256.", description: "Max character limit is 256.",
color: embedColor, color: embedColor
}, }
], ]
}) })
} }
const answer4_1 = answer4.first()!.content const answer4_1 = answer4.first()!.content
@@ -332,15 +332,15 @@ export = {
"`", "`",
color: embedColor, color: embedColor,
footer: { footer: {
text: "You have 15 minutes to respond to this message.", text: "You have 15 minutes to respond to this message."
}, }
}, }
], ]
}) })
const answer5 = await user.dmChannel!.awaitMessages({ const answer5 = await user.dmChannel!.awaitMessages({
filter: m => m.author.id === user.user.id, filter: m => m.author.id === user.user.id,
max: 1, max: 1,
time: 1000 * 60 * 15, time: 1000 * 60 * 15
}) })
if (answer5.size === 0) { if (answer5.size === 0) {
await user.send({ embeds: [tooLong] }) await user.send({ embeds: [tooLong] })
@@ -359,9 +359,9 @@ export = {
embeds: [ embeds: [
{ {
description: "Max character limit is 256.", description: "Max character limit is 256.",
color: embedColor, color: embedColor
}, }
], ]
}) })
} }
const answer5_1 = answer5.first()!.content const answer5_1 = answer5.first()!.content
@@ -379,15 +379,15 @@ export = {
"`", "`",
color: embedColor, color: embedColor,
footer: { footer: {
text: "You have 15 minutes to respond to this message.", text: "You have 15 minutes to respond to this message."
}, }
}, }
], ]
}) })
const answer6 = await user.dmChannel!.awaitMessages({ const answer6 = await user.dmChannel!.awaitMessages({
filter: m => m.author.id === user.user.id, filter: m => m.author.id === user.user.id,
max: 1, max: 1,
time: 1000 * 60 * 15, time: 1000 * 60 * 15
}) })
if (answer6.size === 0) { if (answer6.size === 0) {
await user.send({ embeds: [tooLong] }) await user.send({ embeds: [tooLong] })
@@ -406,9 +406,9 @@ export = {
embeds: [ embeds: [
{ {
description: "Max character limit is 256.", description: "Max character limit is 256.",
color: embedColor, color: embedColor
}, }
], ]
}) })
} }
const answer6_1 = answer6.first()!.content const answer6_1 = answer6.first()!.content
@@ -418,15 +418,15 @@ export = {
{ {
description: description:
"If you want to submit your application, type `yes` if not, type `no`", "If you want to submit your application, type `yes` if not, type `no`",
color: embedColor, color: embedColor
}, }
], ]
}) })
const final = await user.dmChannel!.awaitMessages({ const final = await user.dmChannel!.awaitMessages({
filter: m => m.author.id === user.user.id, filter: m => m.author.id === user.user.id,
max: 1, max: 1,
time: 1000 * 60 * 5, time: 1000 * 60 * 5
}) })
if (final.size === 0) { if (final.size === 0) {
await user.send({ embeds: [tooLong] }) await user.send({ embeds: [tooLong] })
@@ -445,22 +445,22 @@ export = {
embeds: [ embeds: [
{ {
description: "Your application has been submitted!", description: "Your application has been submitted!",
color: embedColor, color: embedColor
}, }
], ]
}) })
const newStaffApp = new staffapp({ const newStaffApp = new staffapp({
_id: new mongoose.Types.ObjectId(), _id: new mongoose.Types.ObjectId(),
userID: user.user.id, userID: user.user.id,
uuid: uuid, uuid: uuid
}) })
await newStaffApp.save() await newStaffApp.save()
await user.deleteDM() await user.deleteDM()
const channel = guild.channels.cache.get( const channel = guild.channels.cache.get(
staffApplicationsChannel, staffApplicationsChannel
) as TextChannel ) as TextChannel
await channel.send({ await channel.send({
@@ -473,39 +473,39 @@ export = {
" - Staff Application", " - Staff Application",
color: embedColor, color: embedColor,
thumbnail: { thumbnail: {
url: user.avatarURL() || "", url: user.avatarURL() || ""
}, },
fields: [ fields: [
{ {
name: rq(1), name: rq(1),
value: "```" + answer1_1 + "```", value: "```" + answer1_1 + "```"
}, },
{ {
name: rq(2), name: rq(2),
value: "```" + answer2_1 + "```", value: "```" + answer2_1 + "```"
}, },
{ {
name: rq(3), name: rq(3),
value: "```" + answer3_1 + "```", value: "```" + answer3_1 + "```"
}, },
{ {
name: rq(4), name: rq(4),
value: "```" + answer4_1 + "```", value: "```" + answer4_1 + "```"
}, },
{ {
name: rq(5), name: rq(5),
value: "```" + answer5_1 + "```", value: "```" + answer5_1 + "```"
}, },
{ {
name: rq(6), name: rq(6),
value: "```" + answer6_1 + "```", value: "```" + answer6_1 + "```"
}, }
], ],
footer: { footer: {
icon_url: guild.iconURL() || undefined, icon_url: guild.iconURL() || undefined,
text: "ID: " + user.user.id, text: "ID: " + user.user.id
}, }
}, }
], ],
components: [ components: [
new ActionRowBuilder<ButtonBuilder>().addComponents( new ActionRowBuilder<ButtonBuilder>().addComponents(
@@ -516,10 +516,10 @@ export = {
new ButtonBuilder() new ButtonBuilder()
.setCustomId("staffapplicationdeny") .setCustomId("staffapplicationdeny")
.setLabel("Deny") .setLabel("Deny")
.setStyle(ButtonStyle.Danger), .setStyle(ButtonStyle.Danger)
), )
], ]
}) })
} }
}, }
} as Button } as Button

View File

@@ -2,7 +2,7 @@ import {
ModalBuilder, ModalBuilder,
ActionRowBuilder, ActionRowBuilder,
TextInputBuilder, TextInputBuilder,
TextInputStyle, TextInputStyle
} from "discord.js" } from "discord.js"
import { Button } from "interfaces" import { Button } from "interfaces"
@@ -23,9 +23,9 @@ export = {
.setPlaceholder("Enter your ign.") .setPlaceholder("Enter your ign.")
.setRequired(true) .setRequired(true)
.setMinLength(3) .setMinLength(3)
.setMaxLength(16), .setMaxLength(16)
), )
) )
await interaction.showModal(modal) await interaction.showModal(modal)
}, }
} as Button } as Button

View File

@@ -32,7 +32,7 @@ export = {
fields.push({ fields.push({
name: `${i + 1}. ${accepted[i].IGN}`, name: `${i + 1}. ${accepted[i].IGN}`,
value: `TS: <t:${timestamp}:R>`, value: `TS: <t:${timestamp}:R>`
}) })
} }
@@ -44,15 +44,15 @@ export = {
color: embed.color!, color: embed.color!,
footer: { footer: {
text: "Last updated by " + user.username, text: "Last updated by " + user.username,
icon_url: user.avatarURL() || undefined, icon_url: user.avatarURL() || undefined
}, },
thumbnail: embed.thumbnail!, thumbnail: embed.thumbnail!,
fields: fields, fields: fields,
timestamp: new Date().toISOString(), timestamp: new Date().toISOString()
}, }
], ]
}) })
await interaction.editReply("Updated the waiting list") await interaction.editReply("Updated the waiting list")
}, }
} as Button } as Button

View File

@@ -4,7 +4,7 @@ import {
ButtonBuilder, ButtonBuilder,
ButtonStyle, ButtonStyle,
Message, Message,
GuildMember, GuildMember
} from "discord.js" } from "discord.js"
import { color } from "config/options.json" import { color } from "config/options.json"
import guildapp from "schemas/guildAppSchema" import guildapp from "schemas/guildAppSchema"
@@ -44,9 +44,9 @@ export = {
.setCustomId("checkstats") .setCustomId("checkstats")
.setLabel("Check Stats") .setLabel("Check Stats")
.setStyle(ButtonStyle.Secondary) .setStyle(ButtonStyle.Secondary)
.setDisabled(true), .setDisabled(true)
), )
], ]
}) })
let applicant: GuildMember | null let applicant: GuildMember | null
@@ -61,13 +61,13 @@ export = {
"Your application for the Illegitimate guild has been denied\n" + "Your application for the Illegitimate guild has been denied\n" +
"**Reason:** `" + "**Reason:** `" +
reason + reason +
"`", "`"
) )
.setColor(embedColor) .setColor(embedColor)
const missingUser = new EmbedBuilder() const missingUser = new EmbedBuilder()
.setDescription( .setDescription(
"[WARN] User has left the server and cannot be notified.", "[WARN] User has left the server and cannot be notified."
) )
.setColor(embedColor) .setColor(embedColor)
@@ -79,13 +79,13 @@ export = {
">.\n" + ">.\n" +
"**Reason:** `" + "**Reason:** `" +
reason + reason +
"`", "`"
) )
.setColor(embedColor) .setColor(embedColor)
.setThumbnail(guild.iconURL() || "") .setThumbnail(guild.iconURL() || "")
.setFooter({ .setFooter({
iconURL: guild.iconURL() || undefined, iconURL: guild.iconURL() || undefined,
text: "ID: " + applicantId, text: "ID: " + applicantId
}) })
if (applicant !== null) { if (applicant !== null) {
@@ -102,7 +102,7 @@ export = {
await guildapp.findOneAndDelete({ userID: applicantId }) await guildapp.findOneAndDelete({ userID: applicantId })
await interaction.editReply({ await interaction.editReply({
embeds: responseEmbeds, embeds: responseEmbeds
}) })
}, }
} as Modal } as Modal

View File

@@ -2,7 +2,7 @@ import {
EmbedBuilder, EmbedBuilder,
ActionRowBuilder, ActionRowBuilder,
ButtonBuilder, ButtonBuilder,
ButtonStyle, ButtonStyle
} from "discord.js" } from "discord.js"
import { color } from "config/options.json" import { color } from "config/options.json"
import staffapp from "schemas/staffAppSchema" import staffapp from "schemas/staffAppSchema"
@@ -38,9 +38,9 @@ export = {
.setCustomId("staffapplicationdeny") .setCustomId("staffapplicationdeny")
.setLabel("Deny") .setLabel("Deny")
.setStyle(ButtonStyle.Danger) .setStyle(ButtonStyle.Danger)
.setDisabled(true), .setDisabled(true)
), )
], ]
}) })
const dmMessage = new EmbedBuilder() const dmMessage = new EmbedBuilder()
@@ -48,7 +48,7 @@ export = {
"Your application for the Illegitimate guild staff has been denied\n" + "Your application for the Illegitimate guild staff has been denied\n" +
"**Reason:** `" + "**Reason:** `" +
reason + reason +
"`", "`"
) )
.setColor(embedColor) .setColor(embedColor)
@@ -69,14 +69,14 @@ export = {
"`", "`",
color: embedColor, color: embedColor,
thumbnail: { thumbnail: {
url: applicant.avatarURL() || "", url: applicant.avatarURL() || ""
}, },
footer: { footer: {
icon_url: guild!.iconURL() || undefined, icon_url: guild!.iconURL() || undefined,
text: "ID: " + applicant.id, text: "ID: " + applicant.id
}, }
}, }
], ]
}) })
}, }
} as Modal } as Modal

View File

@@ -11,7 +11,7 @@ import {
member, member,
guildRole, guildRole,
guildStaff, guildStaff,
defaultMember, defaultMember
} from "config/roles.json" } from "config/roles.json"
import { Modal } from "interfaces" import { Modal } from "interfaces"
import { GuildMember } from "discord.js" import { GuildMember } from "discord.js"
@@ -31,7 +31,7 @@ export = {
if (verifyData) { if (verifyData) {
interaction.editReply( interaction.editReply(
"You are already verified.\n" + "You are already verified.\n" +
"Try running /update to update your roles.", "Try running /update to update your roles."
) )
return return
} }
@@ -43,9 +43,9 @@ export = {
{ {
description: description:
"<a:questionmark_pink:1130206038008803488> That player does not exist.", "<a:questionmark_pink:1130206038008803488> That player does not exist.",
color: embedColor, color: embedColor
}, }
], ]
}) })
return return
} }
@@ -58,9 +58,9 @@ export = {
{ {
description: description:
"<a:questionmark_pink:1130206038008803488> That player hasn't played Hypixel before.", "<a:questionmark_pink:1130206038008803488> That player hasn't played Hypixel before.",
color: embedColor, color: embedColor
}, }
], ]
}) })
return return
} }
@@ -84,9 +84,9 @@ export = {
"**Please set your Discord tag on hypixel to `" + "**Please set your Discord tag on hypixel to `" +
username + username +
"` and try again.**", "` and try again.**",
color: embedColor, color: embedColor
}, }
], ]
}) })
return return
} }
@@ -104,9 +104,9 @@ export = {
"**Please set your Discord tag on hypixel to `" + "**Please set your Discord tag on hypixel to `" +
username + username +
"` and try again.**", "` and try again.**",
color: embedColor, color: embedColor
}, }
], ]
}) })
return return
} }
@@ -122,7 +122,7 @@ export = {
if (guildID === hypixelGuildID) { if (guildID === hypixelGuildID) {
const GuildMembers = guild!.members const GuildMembers = guild!.members
const guildRank = GuildMembers.find( const guildRank = GuildMembers.find(
member => member.uuid === player.uuid, member => member.uuid === player.uuid
)!.rank )!.rank
if (guildRank === "Guild Master" && guildID === hypixelGuildID) { if (guildRank === "Guild Master" && guildID === hypixelGuildID) {
@@ -163,7 +163,7 @@ export = {
const newVerify = new verify({ const newVerify = new verify({
_id: new mongoose.Types.ObjectId(), _id: new mongoose.Types.ObjectId(),
userID: user.id, userID: user.id,
uuid: uuid, uuid: uuid
}) })
await newVerify.save() await newVerify.save()
@@ -180,15 +180,15 @@ export = {
"`.", "`.",
color: embedColor, color: embedColor,
thumbnail: { thumbnail: {
url: head!, url: head!
}, },
footer: { footer: {
icon_url: interaction.guild!.iconURL() || undefined, icon_url: interaction.guild!.iconURL() || undefined,
text: interaction.guild!.name + " | " + devMessage, text: interaction.guild!.name + " | " + devMessage
}, }
}, }
], ]
}) })
} }
}, }
} as Modal } as Modal

View File

@@ -2,7 +2,7 @@ import {
hypixelGuildID, hypixelGuildID,
guildLogChannel, guildLogChannel,
color, color,
devMessage, devMessage
} from "config/options.json" } from "config/options.json"
import colorLog from "utils/functions/colors" import colorLog from "utils/functions/colors"
import { getGuild, getIGN } from "utils/Hypixel" import { getGuild, getIGN } from "utils/Hypixel"
@@ -25,9 +25,9 @@ async function guildWeekly() {
embeds: [ embeds: [
{ {
description: "Starting to fetch guild data...", description: "Starting to fetch guild data...",
color: embedColor, color: embedColor
}, }
], ]
}) })
const guild = (await getGuild(hypixelGuildID, "id")) as GuildData const guild = (await getGuild(hypixelGuildID, "id")) as GuildData
@@ -45,10 +45,7 @@ async function guildWeekly() {
.map(member => { .map(member => {
return { return {
uuid: member.uuid, uuid: member.uuid,
exp: Object.values(member.expHistory).reduce( exp: Object.values(member.expHistory).reduce((a, b) => a + b, 0)
(a, b) => a + b,
0,
),
} }
}) })
.sort((a, b) => b.exp - a.exp) .sort((a, b) => b.exp - a.exp)
@@ -56,16 +53,16 @@ async function guildWeekly() {
for (let i = 0; i < allMembersGexpSorted.length; i++) { for (let i = 0; i < allMembersGexpSorted.length; i++) {
const ign = await getIGN(allMembersGexpSorted[i].uuid) const ign = await getIGN(allMembersGexpSorted[i].uuid)
const gexp = new Intl.NumberFormat("en-US").format( const gexp = new Intl.NumberFormat("en-US").format(
allMembersGexpSorted[i].exp, allMembersGexpSorted[i].exp
) )
const position = i + 1 const position = i + 1
guildMembersList.push( guildMembersList.push(
"**#" + position + " " + ign + ":** `" + gexp + "`", "**#" + position + " " + ign + ":** `" + gexp + "`"
) )
} }
const list = Array.from({ length: sliceSize }, (_, i) => const list = Array.from({ length: sliceSize }, (_, i) =>
guildMembersList.slice(i * sliceSize, (i + 1) * sliceSize), guildMembersList.slice(i * sliceSize, (i + 1) * sliceSize)
) )
list.forEach((item, index) => { list.forEach((item, index) => {
@@ -74,30 +71,30 @@ async function guildWeekly() {
topWeeklyMembers[index] = { topWeeklyMembers[index] = {
name: "", name: "",
value: item.join("\n"), value: item.join("\n"),
inline: false, inline: false
} }
}) })
// combined weekly gexp // combined weekly gexp
const allGuildMembersWeeklyXP = guildMembers.map( const allGuildMembersWeeklyXP = guildMembers.map(
member => member.expHistory, member => member.expHistory
) )
const guildMembersWeeklyXP = allGuildMembersWeeklyXP.map(member => { const guildMembersWeeklyXP = allGuildMembersWeeklyXP.map(member => {
return Object.values(member).reduce((a, b) => a + b, 0) return Object.values(member).reduce((a, b) => a + b, 0)
}) })
const totalGuildMembersWeeklyXPUnformatted = guildMembersWeeklyXP.reduce( const totalGuildMembersWeeklyXPUnformatted = guildMembersWeeklyXP.reduce(
(a, b) => a + b, (a, b) => a + b,
0, 0
) )
const averageGuildMembersDailyXPUnformatted = const averageGuildMembersDailyXPUnformatted =
totalGuildMembersWeeklyXPUnformatted / 7 totalGuildMembersWeeklyXPUnformatted / 7
// final values // final values
const totalGuildMembersWeeklyXP = new Intl.NumberFormat("en-US").format( const totalGuildMembersWeeklyXP = new Intl.NumberFormat("en-US").format(
totalGuildMembersWeeklyXPUnformatted, totalGuildMembersWeeklyXPUnformatted
) )
const averageGuildMembersWeeklyXP = new Intl.NumberFormat("en-US").format( const averageGuildMembersWeeklyXP = new Intl.NumberFormat("en-US").format(
averageGuildMembersDailyXPUnformatted, averageGuildMembersDailyXPUnformatted
) )
await message.edit({ await message.edit({
@@ -115,10 +112,10 @@ async function guildWeekly() {
timestamp: new Date().toISOString(), timestamp: new Date().toISOString(),
footer: { footer: {
text: channel.guild.name + " | " + devMessage, text: channel.guild.name + " | " + devMessage,
icon_url: channel.guild.iconURL() || undefined, icon_url: channel.guild.iconURL() || undefined
}, }
}, }
], ]
}) })
} }
@@ -129,10 +126,10 @@ export = {
hours: 21, hours: 21,
dayOfWeek: 7, dayOfWeek: 7,
dayOfMonth: "*", dayOfMonth: "*",
month: "*", month: "*"
}, },
execute: guildWeekly, execute: guildWeekly,
onComplete: null, onComplete: null,
start: true, start: true,
timeZone: "Europe/Zagreb", timeZone: "Europe/Zagreb"
} as Cron } as Cron

View File

@@ -23,15 +23,15 @@ export = {
member.user.createdAt.toLocaleString(), member.user.createdAt.toLocaleString(),
color: embedColor, color: embedColor,
thumbnail: { thumbnail: {
url: member.user.avatarURL() || "", url: member.user.avatarURL() || ""
}, },
footer: { footer: {
text: "ID: " + member.id, text: "ID: " + member.id,
icon_url: member.user.avatarURL() || undefined, icon_url: member.user.avatarURL() || undefined
}, },
timestamp: new Date().toISOString(), timestamp: new Date().toISOString()
}, }
], ]
}) })
}, }
} as Event } as Event

View File

@@ -17,8 +17,8 @@ export = {
interaction.commandName + interaction.commandName +
" " + " " +
interaction.options.getSubcommand(), interaction.options.getSubcommand(),
"pink", "pink"
), )
) )
} catch { } catch {
console.log( console.log(
@@ -26,8 +26,8 @@ export = {
interaction.user.username + interaction.user.username +
" ran " + " ran " +
interaction.commandName, interaction.commandName,
"pink", "pink"
), )
) )
} }
} }
@@ -40,10 +40,10 @@ export = {
interaction.user.discriminator + interaction.user.discriminator +
" clicked " + " clicked " +
interaction.customId, interaction.customId,
"pink", "pink"
), )
) )
return return
} }
}, }
} as Event } as Event

View File

@@ -21,18 +21,18 @@ export = {
await message.channel.send({ await message.channel.send({
embeds: [ embeds: [
{ {
description: `\`\`\`js\n${outputString}\`\`\``, description: `\`\`\`js\n${outputString}\`\`\``
}, }
], ]
}) })
} catch (error) { } catch (error) {
await message.channel.send({ await message.channel.send({
embeds: [ embeds: [
{ {
description: `\`\`\`js\n${error}\`\`\``, description: `\`\`\`js\n${error}\`\`\``
}, }
], ]
}) })
} }
}, }
} as Event } as Event

View File

@@ -13,5 +13,5 @@ export = {
) { ) {
message.react("Woot:734345936347725885") message.react("Woot:734345936347725885")
} }
}, }
} as Event } as Event

View File

@@ -20,16 +20,16 @@ export = {
channel: message.channel.id, channel: message.channel.id,
createdAt: message.createdTimestamp, createdAt: message.createdTimestamp,
deletedAt: Date.now(), deletedAt: Date.now(),
attachments: message.attachments.map(a => a.url) || [], attachments: message.attachments.map(a => a.url) || []
} }
const snipeCache = new snipeCacheSchema({ const snipeCache = new snipeCacheSchema({
_id: new mongoose.Types.ObjectId(), _id: new mongoose.Types.ObjectId(),
userid: message.author.id, userid: message.author.id,
channelid: message.channel.id, channelid: message.channel.id,
data: msg, data: msg
}) })
await snipeCache.save() await snipeCache.save()
}, }
} as Event } as Event

View File

@@ -9,5 +9,5 @@ export = {
execute(client: Client) { execute(client: Client) {
console.log(color("Logged in as " + client.user!.tag + "!", "green")) console.log(color("Logged in as " + client.user!.tag + "!", "green"))
}, }
} as Event } as Event

View File

@@ -16,9 +16,9 @@ export = {
embeds: [ embeds: [
{ {
description: "Bot is online!", description: "Bot is online!",
color: embedColor, color: embedColor
}, }
], ]
}) })
}, }
} as Event } as Event

View File

@@ -22,9 +22,9 @@ export = {
let i = 1 let i = 1
setInterval( setInterval(
() => user.setActivity(statuses[i++ % statuses.length]), () => user.setActivity(statuses[i++ % statuses.length]),
1000 * 60 * 10, 1000 * 60 * 10
) )
user.setStatus("dnd") user.setStatus("dnd")
}, }
} as Event } as Event

View File

@@ -28,11 +28,11 @@ export = {
footer: { footer: {
text: "ID: " + newState.member!.id, text: "ID: " + newState.member!.id,
icon_url: icon_url:
newState.member!.user.avatarURL() || undefined, newState.member!.user.avatarURL() || undefined
}, },
timestamp: new Date().toISOString(), timestamp: new Date().toISOString()
}, }
], ]
}) })
} else if (oldChannel !== null && newChannel === null) { } else if (oldChannel !== null && newChannel === null) {
logToChannel("bot", { logToChannel("bot", {
@@ -47,11 +47,11 @@ export = {
footer: { footer: {
text: "ID: " + oldState.member!.id, text: "ID: " + oldState.member!.id,
icon_url: icon_url:
oldState.member!.user.avatarURL() || undefined, oldState.member!.user.avatarURL() || undefined
}, },
timestamp: new Date().toISOString(), timestamp: new Date().toISOString()
}, }
], ]
}) })
} else if (oldChannel !== null && newChannel !== null) { } else if (oldChannel !== null && newChannel !== null) {
if (oldChannel.id === newChannel.id) return if (oldChannel.id === newChannel.id) return
@@ -70,12 +70,12 @@ export = {
footer: { footer: {
text: "ID: " + oldState.member!.id, text: "ID: " + oldState.member!.id,
icon_url: icon_url:
oldState.member!.user.avatarURL() || undefined, oldState.member!.user.avatarURL() || undefined
}, },
timestamp: new Date().toISOString(), timestamp: new Date().toISOString()
}, }
], ]
}) })
} }
}, }
} as Event } as Event

View File

@@ -12,6 +12,6 @@ export default interface Command {
data: SlashCommandBuilder data: SlashCommandBuilder
execute: ( execute: (
interaction: ChatInputCommandInteraction, interaction: ChatInputCommandInteraction,
client: Client, client: Client
) => Promise<void> ) => Promise<void>
} }

View File

@@ -1,7 +1,7 @@
/* eslint-disable no-unused-vars */ /* eslint-disable no-unused-vars */
import { import {
ContextMenuCommandInteraction, ContextMenuCommandInteraction,
ContextMenuCommandBuilder, ContextMenuCommandBuilder
} from "discord.js" } from "discord.js"
export default interface ContextMenu { export default interface ContextMenu {

View File

@@ -25,5 +25,5 @@ export {
Guild, Guild,
GuildData, GuildData,
Player, Player,
PlayerData, PlayerData
} }

View File

@@ -3,7 +3,7 @@ import { Schema, model } from "mongoose"
const guildAppSchema = new Schema({ const guildAppSchema = new Schema({
_id: Schema.Types.ObjectId, _id: Schema.Types.ObjectId,
userID: { type: String, required: true }, userID: { type: String, required: true },
uuid: { type: String, required: true }, uuid: { type: String, required: true }
}) })
export = model("guildapp", guildAppSchema, "guildapp") export = model("guildapp", guildAppSchema, "guildapp")

View File

@@ -3,7 +3,7 @@ import { Schema, model } from "mongoose"
const settingsSchema = new Schema({ const settingsSchema = new Schema({
_id: Schema.Types.ObjectId, _id: Schema.Types.ObjectId,
name: { type: String, required: true }, name: { type: String, required: true },
value: { type: String, required: true }, value: { type: String, required: true }
}) })
export = model("settings", settingsSchema, "settings") export = model("settings", settingsSchema, "settings")

View File

@@ -5,7 +5,7 @@ const snipeCacheSchema = new Schema({
userid: { type: String, required: true }, userid: { type: String, required: true },
channelid: { type: String, required: true }, channelid: { type: String, required: true },
data: { type: Object, required: true }, data: { type: Object, required: true },
date: { type: Date, default: Date.now(), expires: 600 }, date: { type: Date, default: Date.now(), expires: 600 }
}) })
export default model("snipeCache", snipeCacheSchema, "snipeCache") export default model("snipeCache", snipeCacheSchema, "snipeCache")

View File

@@ -3,7 +3,7 @@ import { Schema, model } from "mongoose"
const staffAppSchema = new Schema({ const staffAppSchema = new Schema({
_id: Schema.Types.ObjectId, _id: Schema.Types.ObjectId,
userID: { type: String, required: true }, userID: { type: String, required: true },
uuid: { type: String, required: true }, uuid: { type: String, required: true }
}) })
export = model("staffapp", staffAppSchema, "staffapp") export = model("staffapp", staffAppSchema, "staffapp")

View File

@@ -3,7 +3,7 @@ import { Schema, model } from "mongoose"
const verifySchema = new Schema({ const verifySchema = new Schema({
_id: Schema.Types.ObjectId, _id: Schema.Types.ObjectId,
userID: { type: String, required: true }, userID: { type: String, required: true },
uuid: { type: String, required: true }, uuid: { type: String, required: true }
}) })
export = model("verify", verifySchema, "verify") export = model("verify", verifySchema, "verify")

View File

@@ -5,7 +5,7 @@ const waitinglistSchema = new Schema({
userID: { type: String, required: true }, userID: { type: String, required: true },
uuid: { type: String, required: true }, uuid: { type: String, required: true },
IGN: { type: String, required: true }, IGN: { type: String, required: true },
timestamp: { type: Number, required: true }, timestamp: { type: Number, required: true }
}) })
export = model("waitinglist", waitinglistSchema, "waitinglist") export = model("waitinglist", waitinglistSchema, "waitinglist")

View File

@@ -5,7 +5,7 @@ import {
REST, REST,
RESTGetAPIApplicationGuildCommandResult, RESTGetAPIApplicationGuildCommandResult,
RESTPutAPIApplicationGuildCommandsJSONBody, RESTPutAPIApplicationGuildCommandsJSONBody,
Routes, Routes
} from "discord.js" } from "discord.js"
import fs from "fs" import fs from "fs"
type FileType = "js" | "ts" type FileType = "js" | "ts"
@@ -47,27 +47,27 @@ export default async function autoDeployCommands(fileType: FileType) {
const rest = new REST({ version: "10" }).setToken(env.dev.devtoken!) const rest = new REST({ version: "10" }).setToken(env.dev.devtoken!)
const currentCommands = (await rest.get( const currentCommands = (await rest.get(
Routes.applicationGuildCommands(env.dev.devid!, env.dev.guildid!), Routes.applicationGuildCommands(env.dev.devid!, env.dev.guildid!)
)) as RESTGetAPIApplicationGuildCommandResult[] )) as RESTGetAPIApplicationGuildCommandResult[]
const currentCommandsInfo = currentCommands.map(command => { const currentCommandsInfo = currentCommands.map(command => {
return { return {
name: command.name, name: command.name,
description: command.description, description: command.description
} }
}) })
const newCommandsInfo = commands.map(command => { const newCommandsInfo = commands.map(command => {
return { return {
name: command.name, name: command.name,
description: command.description, description: command.description
} }
}) })
const sortedCurrentCommandsInfo = currentCommandsInfo.sort((a, b) => const sortedCurrentCommandsInfo = currentCommandsInfo.sort((a, b) =>
a.name.localeCompare(b.name), a.name.localeCompare(b.name)
) )
const sortedNewCommandsInfo = newCommandsInfo.sort((a, b) => const sortedNewCommandsInfo = newCommandsInfo.sort((a, b) =>
a.name.localeCompare(b.name), a.name.localeCompare(b.name)
) )
const newCmds = sortedNewCommandsInfo const newCmds = sortedNewCommandsInfo
@@ -86,7 +86,7 @@ export default async function autoDeployCommands(fileType: FileType) {
JSON.stringify(sortedCurrentCommandsInfo) JSON.stringify(sortedCurrentCommandsInfo)
) { ) {
console.log( console.log(
color("Commands are the same, skipping deploy.", "lavender"), color("Commands are the same, skipping deploy.", "lavender")
) )
console.log(color(newCmds, "lavender")) console.log(color(newCmds, "lavender"))
return return
@@ -96,18 +96,18 @@ export default async function autoDeployCommands(fileType: FileType) {
console.log(color("Commands are different, starting deploy.", "red")) console.log(color("Commands are different, starting deploy.", "red"))
console.log(color(currentCmds, "red")) console.log(color(currentCmds, "red"))
console.log( console.log(
`Started refreshing ${commands.length} application (/) commands.`, `Started refreshing ${commands.length} application (/) commands.`
) )
const data = (await rest.put( const data = (await rest.put(
Routes.applicationGuildCommands(env.dev.devid!, env.dev.guildid!), Routes.applicationGuildCommands(env.dev.devid!, env.dev.guildid!),
{ body: commands }, { body: commands }
)) as RESTPutAPIApplicationGuildCommandsJSONBody[] )) as RESTPutAPIApplicationGuildCommandsJSONBody[]
console.log(color("New commands deployed.", "lavender")) console.log(color("New commands deployed.", "lavender"))
console.log(color(newCmds, "lavender")) console.log(color(newCmds, "lavender"))
console.log( console.log(
`Successfully reloaded ${data.length} application (/) commands.`, `Successfully reloaded ${data.length} application (/) commands.`
) )
} catch (error) { } catch (error) {
console.error(error) console.error(error)

View File

@@ -20,14 +20,14 @@ export class ExtendedClient extends Client {
GatewayIntentBits.GuildMembers, GatewayIntentBits.GuildMembers,
GatewayIntentBits.MessageContent, GatewayIntentBits.MessageContent,
GatewayIntentBits.DirectMessages, GatewayIntentBits.DirectMessages,
GatewayIntentBits.GuildVoiceStates, GatewayIntentBits.GuildVoiceStates
], ],
partials: [ partials: [
Partials.GuildMember, Partials.GuildMember,
Partials.User, Partials.User,
Partials.Message, Partials.Message,
Partials.Channel, Partials.Channel
], ]
}) })
} }
@@ -35,7 +35,7 @@ export class ExtendedClient extends Client {
let token: string let token: string
if (process.env.NODE_ENV === "dev" && process.env.TYPESCRIPT) { if (process.env.NODE_ENV === "dev" && process.env.TYPESCRIPT) {
console.log( console.log(
color("Running in development mode. [ts-node]", "lavender"), color("Running in development mode. [ts-node]", "lavender")
) )
loadAllEvents(this, "ts") loadAllEvents(this, "ts")
token = env.dev.devtoken! token = env.dev.devtoken!

View File

@@ -7,14 +7,14 @@ const env: Env = {
mongoURI: process.env.MONGOURI, mongoURI: process.env.MONGOURI,
dev: process.env.DEV, dev: process.env.DEV,
hypixelapikey: process.env.HYPIXELAPIKEY, hypixelapikey: process.env.HYPIXELAPIKEY,
redisURI: process.env.REDISURI, redisURI: process.env.REDISURI
}, },
dev: { dev: {
devtoken: process.env.DEVTOKEN, devtoken: process.env.DEVTOKEN,
clientid: process.env.CLIENTID, clientid: process.env.CLIENTID,
devid: process.env.DEVID, devid: process.env.DEVID,
guildid: process.env.GUILDID, guildid: process.env.GUILDID
}, }
} }
export default env export default env

View File

@@ -15,7 +15,7 @@ export default function loadAutocompleteEvents(client: Client, ft: FileType) {
"..", "..",
"..", "..",
"components", "components",
"autocomplete", "autocomplete"
) )
const autocompleteFiles = fs const autocompleteFiles = fs
.readdirSync(autocompletePath) .readdirSync(autocompletePath)
@@ -31,8 +31,8 @@ export default function loadAutocompleteEvents(client: Client, ft: FileType) {
console.log( console.log(
colorLog( colorLog(
`[WARNING] The autocomplete at ${filePath} is missing a required "name", "execute" or "type" property.`, `[WARNING] The autocomplete at ${filePath} is missing a required "name", "execute" or "type" property.`,
"red", "red"
), )
) )
} }
} }
@@ -44,7 +44,7 @@ export default function loadAutocompleteEvents(client: Client, ft: FileType) {
if (!autocomplete) { if (!autocomplete) {
console.error( console.error(
`No autocomplete matching ${interaction.commandName} was found.`, `No autocomplete matching ${interaction.commandName} was found.`
) )
return return
} }
@@ -65,10 +65,10 @@ export default function loadAutocompleteEvents(client: Client, ft: FileType) {
text: text:
interaction.user.username + interaction.user.username +
" | " + " | " +
interaction.commandName, interaction.commandName
}, }
}, }
], ]
}) })
} }
console.error(error) console.error(error)

View File

@@ -23,8 +23,8 @@ export default function loadButtonEvents(client: Client, ft: FileType) {
console.log( console.log(
colorLog( colorLog(
`[WARNING] The button at ${filePath} is missing a required "name", "execute" or "type" property.`, `[WARNING] The button at ${filePath} is missing a required "name", "execute" or "type" property.`,
"red", "red"
), )
) )
} }
} }
@@ -36,7 +36,7 @@ export default function loadButtonEvents(client: Client, ft: FileType) {
if (!button) { if (!button) {
console.error( console.error(
`No event matching ${interaction.customId} was found.`, `No event matching ${interaction.customId} was found.`
) )
return return
} }
@@ -57,10 +57,10 @@ export default function loadButtonEvents(client: Client, ft: FileType) {
text: text:
interaction.user.username + interaction.user.username +
" | " + " | " +
interaction.customId, interaction.customId
}, }
}, }
], ]
}) })
} }
@@ -71,10 +71,10 @@ export default function loadButtonEvents(client: Client, ft: FileType) {
{ {
description: description:
"There was an error while executing this button!", "There was an error while executing this button!",
color: embedColor, color: embedColor
}, }
], ],
ephemeral: true, ephemeral: true
}) })
} else { } else {
await interaction.editReply({ await interaction.editReply({
@@ -82,9 +82,9 @@ export default function loadButtonEvents(client: Client, ft: FileType) {
{ {
description: description:
"There was an error while executing this button! 2", "There was an error while executing this button! 2",
color: embedColor, color: embedColor
}, }
], ]
}) })
} }
} }

View File

@@ -23,8 +23,8 @@ export default function loadSlashCommandsEvents(client: Client, ft: FileType) {
console.log( console.log(
colorLog( colorLog(
`[WARNING] The command at ${filePath} is missing a required "data", "execute" or "type" property.`, `[WARNING] The command at ${filePath} is missing a required "data", "execute" or "type" property.`,
"red", "red"
), )
) )
} }
} }
@@ -37,7 +37,7 @@ export default function loadSlashCommandsEvents(client: Client, ft: FileType) {
if (!command) { if (!command) {
console.error( console.error(
`No command matching ${interaction.commandName} was found.`, `No command matching ${interaction.commandName} was found.`
) )
return return
} }
@@ -58,10 +58,10 @@ export default function loadSlashCommandsEvents(client: Client, ft: FileType) {
text: text:
interaction.user.username + interaction.user.username +
" | " + " | " +
interaction.commandName, interaction.commandName
}, }
}, }
], ]
}) })
} }
@@ -72,10 +72,10 @@ export default function loadSlashCommandsEvents(client: Client, ft: FileType) {
{ {
description: description:
"There was an error while executing this command!", "There was an error while executing this command!",
color: embedColor, color: embedColor
}, }
], ],
ephemeral: true, ephemeral: true
}) })
} else { } else {
await interaction.editReply({ await interaction.editReply({
@@ -83,9 +83,9 @@ export default function loadSlashCommandsEvents(client: Client, ft: FileType) {
{ {
description: description:
"There was an error while executing this command!", "There was an error while executing this command!",
color: embedColor, color: embedColor
}, }
], ]
}) })
} }
} }

View File

@@ -14,7 +14,7 @@ export default function loadContextMenuEvents(client: Client, ft: FileType) {
__dirname, __dirname,
"..", "..",
"..", "..",
"commands-contextmenu", "commands-contextmenu"
) )
const contextMenuFiles = fs const contextMenuFiles = fs
.readdirSync(contextMenuPath) .readdirSync(contextMenuPath)
@@ -30,8 +30,8 @@ export default function loadContextMenuEvents(client: Client, ft: FileType) {
console.log( console.log(
colorLog( colorLog(
`[WARNING] The command at ${filePath} is missing a required "data", "execute" or "type" property.`, `[WARNING] The command at ${filePath} is missing a required "data", "execute" or "type" property.`,
"red", "red"
), )
) )
} }
} }
@@ -44,7 +44,7 @@ export default function loadContextMenuEvents(client: Client, ft: FileType) {
if (!command) { if (!command) {
console.error( console.error(
`No command matching ${interaction.commandName} was found.`, `No command matching ${interaction.commandName} was found.`
) )
return return
} }
@@ -65,10 +65,10 @@ export default function loadContextMenuEvents(client: Client, ft: FileType) {
text: text:
interaction.user.username + interaction.user.username +
" | " + " | " +
interaction.commandName, interaction.commandName
}, }
}, }
], ]
}) })
} }
@@ -79,10 +79,10 @@ export default function loadContextMenuEvents(client: Client, ft: FileType) {
{ {
description: description:
"There was an error while executing this contextmenu command!", "There was an error while executing this contextmenu command!",
color: embedColor, color: embedColor
}, }
], ],
ephemeral: true, ephemeral: true
}) })
} else { } else {
await interaction.editReply({ await interaction.editReply({
@@ -90,9 +90,9 @@ export default function loadContextMenuEvents(client: Client, ft: FileType) {
{ {
description: description:
"There was an error while executing this contextmenu command!", "There was an error while executing this contextmenu command!",
color: embedColor, color: embedColor
}, }
], ]
}) })
} }
} }

View File

@@ -31,7 +31,7 @@ export default function loadCronEvents() {
cron.execute, cron.execute,
cron.onComplete, cron.onComplete,
cron.start, cron.start,
cron.timeZone, cron.timeZone
).start() ).start()
} }
} }

View File

@@ -25,8 +25,8 @@ export default function loadModalEvents(client: Client, ft: FileType) {
console.log( console.log(
colorLog( colorLog(
`[WARNING] The modal at ${filePath} is missing a required "name", "execute" or "type" property.`, `[WARNING] The modal at ${filePath} is missing a required "name", "execute" or "type" property.`,
"red", "red"
), )
) )
} }
} }
@@ -38,7 +38,7 @@ export default function loadModalEvents(client: Client, ft: FileType) {
if (!modal) { if (!modal) {
console.error( console.error(
`No modal matching ${interaction.customId} was found.`, `No modal matching ${interaction.customId} was found.`
) )
return return
} }
@@ -59,10 +59,10 @@ export default function loadModalEvents(client: Client, ft: FileType) {
text: text:
interaction.user.username + interaction.user.username +
" | " + " | " +
interaction.customId, interaction.customId
}, }
}, }
], ]
}) })
} }
@@ -73,9 +73,9 @@ export default function loadModalEvents(client: Client, ft: FileType) {
{ {
description: description:
"There was an error while executing this modal!", "There was an error while executing this modal!",
color: embedColor, color: embedColor
}, }
], ]
}) })
} else { } else {
await interaction.editReply({ await interaction.editReply({
@@ -83,9 +83,9 @@ export default function loadModalEvents(client: Client, ft: FileType) {
{ {
description: description:
"There was an error while executing this modal!", "There was an error while executing this modal!",
color: embedColor, color: embedColor
}, }
], ]
}) })
} }
} }

View File

@@ -48,8 +48,8 @@ async function getPlayer(uuid: string): Promise<PlayerData | null> {
const playerReq: Player = await fetch(hypixel, { const playerReq: Player = await fetch(hypixel, {
params: { params: {
key: apikey, key: apikey,
uuid: uuid, uuid: uuid
}, }
}) })
if (!playerReq.data.player) { if (!playerReq.data.player) {
@@ -61,15 +61,15 @@ async function getPlayer(uuid: string): Promise<PlayerData | null> {
async function getGuild( async function getGuild(
query: string, query: string,
type?: GuildQuerqType, type?: GuildQuerqType
): Promise<GuildData | null> { ): Promise<GuildData | null> {
const reqType = type ? type : "player" const reqType = type ? type : "player"
const guildReq: Guild = await fetch(guild, { const guildReq: Guild = await fetch(guild, {
params: { params: {
key: apikey, key: apikey,
[reqType]: query, [reqType]: query
}, }
}) })
if (!guildReq.data.guild) { if (!guildReq.data.guild) {

View File

@@ -4,7 +4,7 @@
function guildLevel(exp: number): number { function guildLevel(exp: number): number {
const EXP_NEEDED = [ const EXP_NEEDED = [
100000, 150000, 250000, 500000, 750000, 1000000, 1250000, 1500000, 100000, 150000, 250000, 500000, 750000, 1000000, 1250000, 1500000,
2000000, 2500000, 2500000, 2500000, 2500000, 2500000, 3000000, 2000000, 2500000, 2500000, 2500000, 2500000, 2500000, 3000000
] ]
let level = 0 let level = 0

View File

@@ -12,7 +12,7 @@ function getLevel(exp: number): number {
if (exp <= 1) return 1 if (exp <= 1) return 1
return Math.floor( return Math.floor(
1 + REVERSE_PQ_PREFIX + Math.sqrt(REVERSE_CONST + GROWTHDIV2 * exp), 1 + REVERSE_PQ_PREFIX + Math.sqrt(REVERSE_CONST + GROWTHDIV2 * exp)
) )
} }

View File

@@ -4,7 +4,7 @@ const colors = {
red: "#f38ba8", red: "#f38ba8",
lavender: "#b4befe", lavender: "#b4befe",
green: "#a6e3a1", green: "#a6e3a1",
pink: "#f5c2e7", pink: "#f5c2e7"
} }
export default function color(text: string, type: keyof typeof colors) { export default function color(text: string, type: keyof typeof colors) {

View File

@@ -5,7 +5,7 @@ import {
guildLogChannel, guildLogChannel,
errorLogChannel, errorLogChannel,
moderationLogChannel, moderationLogChannel,
devLogChannel, devLogChannel
} from "config/options.json" } from "config/options.json"
import { Guild, MessageCreateOptions, TextChannel } from "discord.js" import { Guild, MessageCreateOptions, TextChannel } from "discord.js"
import Illegitimate from "utils/Illegitimate" import Illegitimate from "utils/Illegitimate"
@@ -16,14 +16,14 @@ const channels = {
guild: guildLogChannel, guild: guildLogChannel,
error: errorLogChannel, error: errorLogChannel,
mod: moderationLogChannel, mod: moderationLogChannel,
dev: devLogChannel, dev: devLogChannel
} }
type Channel = keyof typeof channels type Channel = keyof typeof channels
export default async function logToChannel( export default async function logToChannel(
channel: Channel, channel: Channel,
message: MessageCreateOptions, message: MessageCreateOptions
): Promise<void | null> { ): Promise<void | null> {
const guild = Illegitimate.client.guilds.cache.get(guildid) as Guild const guild = Illegitimate.client.guilds.cache.get(guildid) as Guild
let logChannel: TextChannel let logChannel: TextChannel
@@ -36,7 +36,7 @@ export default async function logToChannel(
if (!logChannel) { if (!logChannel) {
console.log( console.log(
`[ERROR] Could not find channel used for ${channel} logging.`, `[ERROR] Could not find channel used for ${channel} logging.`
) )
return return
} }

View File

@@ -7,7 +7,7 @@ import {
member, member,
guildStaff, guildStaff,
guildRole, guildRole,
defaultMember, defaultMember
} from "config/roles.json" } from "config/roles.json"
const roles = [ const roles = [
gm, gm,
@@ -17,7 +17,7 @@ const roles = [
elite, elite,
member, member,
guildStaff, guildStaff,
guildRole, guildRole
] ]
type RoleType = type RoleType =
@@ -36,7 +36,7 @@ export default function roleManage(role: RoleType): {
} { } {
if (role === "gm") { if (role === "gm") {
const rolesToRemove = roles.filter( const rolesToRemove = roles.filter(
role => role !== gm && role !== guildStaff && role !== guildRole, role => role !== gm && role !== guildStaff && role !== guildRole
) )
const rolesToAdd = [gm, guildStaff, guildRole] const rolesToAdd = [gm, guildStaff, guildRole]
return { rolesToRemove, rolesToAdd } return { rolesToRemove, rolesToAdd }
@@ -45,7 +45,7 @@ export default function roleManage(role: RoleType): {
if (role === "manager") { if (role === "manager") {
const rolesToRemove = roles.filter( const rolesToRemove = roles.filter(
role => role =>
role !== manager && role !== guildStaff && role !== guildRole, role !== manager && role !== guildStaff && role !== guildRole
) )
const rolesToAdd = [manager, guildStaff, guildRole] const rolesToAdd = [manager, guildStaff, guildRole]
return { rolesToRemove, rolesToAdd } return { rolesToRemove, rolesToAdd }
@@ -54,7 +54,7 @@ export default function roleManage(role: RoleType): {
if (role === "moderator") { if (role === "moderator") {
const rolesToRemove = roles.filter( const rolesToRemove = roles.filter(
role => role =>
role !== moderator && role !== guildStaff && role !== guildRole, role !== moderator && role !== guildStaff && role !== guildRole
) )
const rolesToAdd = [moderator, guildStaff, guildRole] const rolesToAdd = [moderator, guildStaff, guildRole]
return { rolesToRemove, rolesToAdd } return { rolesToRemove, rolesToAdd }
@@ -62,7 +62,7 @@ export default function roleManage(role: RoleType): {
if (role === "beast") { if (role === "beast") {
const rolesToRemove = roles.filter( const rolesToRemove = roles.filter(
role => role !== beast && role !== guildRole, role => role !== beast && role !== guildRole
) )
const rolesToAdd = [beast, guildRole] const rolesToAdd = [beast, guildRole]
return { rolesToRemove, rolesToAdd } return { rolesToRemove, rolesToAdd }
@@ -70,7 +70,7 @@ export default function roleManage(role: RoleType): {
if (role === "elite") { if (role === "elite") {
const rolesToRemove = roles.filter( const rolesToRemove = roles.filter(
role => role !== elite && role !== guildRole, role => role !== elite && role !== guildRole
) )
const rolesToAdd = [elite, guildRole] const rolesToAdd = [elite, guildRole]
return { rolesToRemove, rolesToAdd } return { rolesToRemove, rolesToAdd }
@@ -78,7 +78,7 @@ export default function roleManage(role: RoleType): {
if (role === "member") { if (role === "member") {
const rolesToRemove = roles.filter( const rolesToRemove = roles.filter(
role => role !== member && role !== guildRole, role => role !== member && role !== guildRole
) )
const rolesToAdd = [member, guildRole] const rolesToAdd = [member, guildRole]
return { rolesToRemove, rolesToAdd } return { rolesToRemove, rolesToAdd }