Process of format fixing
This commit is contained in:
@@ -23,8 +23,8 @@ export = {
|
||||
option
|
||||
.setName("ign")
|
||||
.setDescription("The IGN of the player.")
|
||||
.setRequired(true),
|
||||
),
|
||||
.setRequired(true)
|
||||
)
|
||||
)
|
||||
.addSubcommand(subcommand =>
|
||||
subcommand
|
||||
@@ -34,9 +34,9 @@ export = {
|
||||
option
|
||||
.setName("query")
|
||||
.setDescription(
|
||||
"The query to search for. [Default: player]",
|
||||
"The query to search for. [Default: player]"
|
||||
)
|
||||
.setRequired(true),
|
||||
.setRequired(true)
|
||||
)
|
||||
.addStringOption(option =>
|
||||
option
|
||||
@@ -45,9 +45,9 @@ export = {
|
||||
.addChoices(
|
||||
{ name: "Guild Member", value: "ign" },
|
||||
{ name: "Guild Name", value: "name" },
|
||||
{ name: "Guild Id", value: "id" },
|
||||
),
|
||||
),
|
||||
{ name: "Guild Id", value: "id" }
|
||||
)
|
||||
)
|
||||
)
|
||||
.addSubcommand(subcommand =>
|
||||
subcommand
|
||||
@@ -57,9 +57,9 @@ export = {
|
||||
option
|
||||
.setName("query")
|
||||
.setDescription(
|
||||
"The query to search for. [Default: player]",
|
||||
"The query to search for. [Default: player]"
|
||||
)
|
||||
.setRequired(true),
|
||||
.setRequired(true)
|
||||
)
|
||||
.addStringOption(option =>
|
||||
option
|
||||
@@ -68,16 +68,16 @@ export = {
|
||||
.addChoices(
|
||||
{ name: "Guild Member", value: "ign" },
|
||||
{ name: "Guild Name", value: "name" },
|
||||
{ name: "Guild Id", value: "id" },
|
||||
),
|
||||
{ name: "Guild Id", value: "id" }
|
||||
)
|
||||
)
|
||||
.addNumberOption(option =>
|
||||
option
|
||||
.setName("amount")
|
||||
.setDescription(
|
||||
"The amount of guild members to show. [Default: 10]",
|
||||
),
|
||||
),
|
||||
"The amount of guild members to show. [Default: 10]"
|
||||
)
|
||||
)
|
||||
)
|
||||
.setDMPermission(false),
|
||||
|
||||
@@ -107,10 +107,10 @@ export = {
|
||||
color: embedColor,
|
||||
footer: {
|
||||
text: interaction.guild!.name + " | " + devMessage,
|
||||
icon_url: interaction.guild!.iconURL() || undefined,
|
||||
},
|
||||
},
|
||||
],
|
||||
icon_url: interaction.guild!.iconURL() || undefined
|
||||
}
|
||||
}
|
||||
]
|
||||
})
|
||||
},
|
||||
}
|
||||
} as Command
|
||||
|
||||
@@ -4,7 +4,7 @@ import { ChatInputCommandInteraction } from "discord.js"
|
||||
import { GuildData } from "interfaces"
|
||||
|
||||
export default async function guildInfo(
|
||||
interaction: ChatInputCommandInteraction,
|
||||
interaction: ChatInputCommandInteraction
|
||||
): Promise<void> {
|
||||
await interaction.deferReply()
|
||||
|
||||
@@ -18,9 +18,9 @@ export default async function guildInfo(
|
||||
embeds: [
|
||||
{
|
||||
description: "Fetching your uuid...",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
const uuid = await getUUID(query)
|
||||
@@ -29,9 +29,9 @@ export default async function guildInfo(
|
||||
embeds: [
|
||||
{
|
||||
description: "That player doen't exist!",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
})
|
||||
return
|
||||
}
|
||||
@@ -40,9 +40,9 @@ export default async function guildInfo(
|
||||
embeds: [
|
||||
{
|
||||
description: "Fetching your player data...",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
const player = await getPlayer(uuid)
|
||||
@@ -51,9 +51,9 @@ export default async function guildInfo(
|
||||
embeds: [
|
||||
{
|
||||
description: "That player has never joined the server!",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
})
|
||||
return
|
||||
}
|
||||
@@ -62,9 +62,9 @@ export default async function guildInfo(
|
||||
embeds: [
|
||||
{
|
||||
description: "Fetching your guild data...",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
guild = await getGuild(uuid, "player")
|
||||
@@ -73,9 +73,9 @@ export default async function guildInfo(
|
||||
embeds: [
|
||||
{
|
||||
description: "That player is not in a guild!",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
})
|
||||
return
|
||||
}
|
||||
@@ -84,9 +84,9 @@ export default async function guildInfo(
|
||||
embeds: [
|
||||
{
|
||||
description: "Fetching your guild data...",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
guild = await getGuild(query, "name")
|
||||
@@ -95,9 +95,9 @@ export default async function guildInfo(
|
||||
embeds: [
|
||||
{
|
||||
description: "That guild doesn't exist!",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
})
|
||||
return
|
||||
}
|
||||
@@ -106,9 +106,9 @@ export default async function guildInfo(
|
||||
embeds: [
|
||||
{
|
||||
description: "Fetching your guild data...",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
guild = await getGuild(query, "id")
|
||||
@@ -117,9 +117,9 @@ export default async function guildInfo(
|
||||
embeds: [
|
||||
{
|
||||
description: "That guild doesn't exist!",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
})
|
||||
return
|
||||
}
|
||||
@@ -157,14 +157,14 @@ export default async function guildInfo(
|
||||
const guildOwner = guildMembers.find(m => m.rank === "Guild Master")!.uuid
|
||||
const guildOwnerName = await getIGN(guildOwner)
|
||||
const guildRanksUnsorted = guild!.ranks.sort(
|
||||
(a, b) => b.priority - a.priority,
|
||||
(a, b) => b.priority - a.priority
|
||||
)
|
||||
const guildRanks = guildRanksUnsorted
|
||||
.map(r => "**➺ " + r.name + "** `[" + r.tag + "]`")
|
||||
.join("\n")
|
||||
|
||||
const allGuildMembersWeeklyXP = guildMembers.map(
|
||||
member => member.expHistory,
|
||||
member => member.expHistory
|
||||
)
|
||||
const guildMembersWeeklyXP = allGuildMembersWeeklyXP.map(member => {
|
||||
return Object.values(member).reduce((a, b) => a + b, 0)
|
||||
@@ -172,17 +172,17 @@ export default async function guildInfo(
|
||||
|
||||
const totalGuildMembersWeeklyXPUnformatted = guildMembersWeeklyXP.reduce(
|
||||
(a, b) => a + b,
|
||||
0,
|
||||
0
|
||||
)
|
||||
const totalGuildMembersWeeklyXP = new Intl.NumberFormat("en-US").format(
|
||||
totalGuildMembersWeeklyXPUnformatted,
|
||||
totalGuildMembersWeeklyXPUnformatted
|
||||
)
|
||||
|
||||
const averageGuildMembersWeeklyXPUnformatted = Math.round(
|
||||
totalGuildMembersWeeklyXPUnformatted / 7,
|
||||
totalGuildMembersWeeklyXPUnformatted / 7
|
||||
)
|
||||
const averageGuildMembersWeeklyXP = new Intl.NumberFormat("en-US").format(
|
||||
averageGuildMembersWeeklyXPUnformatted,
|
||||
averageGuildMembersWeeklyXPUnformatted
|
||||
)
|
||||
|
||||
await interaction.editReply({
|
||||
@@ -205,7 +205,7 @@ export default async function guildInfo(
|
||||
fields: [
|
||||
{
|
||||
name: "**Guild Ranks**",
|
||||
value: guildRanks,
|
||||
value: guildRanks
|
||||
},
|
||||
{
|
||||
name: "**GEXP**",
|
||||
@@ -218,19 +218,19 @@ export default async function guildInfo(
|
||||
"`\n" +
|
||||
"**➺ Total GEXP:** `" +
|
||||
guildExp +
|
||||
"`",
|
||||
"`"
|
||||
},
|
||||
{
|
||||
name: "**Guild Created**",
|
||||
value: "**➺ **`" + guildCreatedTime + "`",
|
||||
},
|
||||
value: "**➺ **`" + guildCreatedTime + "`"
|
||||
}
|
||||
],
|
||||
color: embedColor,
|
||||
footer: {
|
||||
text: interaction.guild!.name + " | " + devMessage,
|
||||
icon_url: interaction.guild!.iconURL() || undefined,
|
||||
},
|
||||
},
|
||||
],
|
||||
icon_url: interaction.guild!.iconURL() || undefined
|
||||
}
|
||||
}
|
||||
]
|
||||
})
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ import { color, devMessage } from "config/options.json"
|
||||
import { ChatInputCommandInteraction } from "discord.js"
|
||||
|
||||
export default async function guildMember(
|
||||
interaction: ChatInputCommandInteraction,
|
||||
interaction: ChatInputCommandInteraction
|
||||
): Promise<void> {
|
||||
await interaction.deferReply()
|
||||
|
||||
@@ -14,9 +14,9 @@ export default async function guildMember(
|
||||
embeds: [
|
||||
{
|
||||
description: "Fetching your uuid...",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
const uuid = await getUUID(ign)
|
||||
@@ -25,9 +25,9 @@ export default async function guildMember(
|
||||
embeds: [
|
||||
{
|
||||
description: "This user does not exist",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
})
|
||||
return
|
||||
}
|
||||
@@ -36,9 +36,9 @@ export default async function guildMember(
|
||||
embeds: [
|
||||
{
|
||||
description: "Fetching your player data...",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
const head = await getHeadURL(ign)
|
||||
@@ -50,14 +50,14 @@ export default async function guildMember(
|
||||
description: "This user never logged on to hypixel",
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: head!,
|
||||
url: head!
|
||||
},
|
||||
footer: {
|
||||
text: interaction.guild!.name + " | " + devMessage,
|
||||
icon_url: interaction.guild!.iconURL() || undefined,
|
||||
},
|
||||
},
|
||||
],
|
||||
icon_url: interaction.guild!.iconURL() || undefined
|
||||
}
|
||||
}
|
||||
]
|
||||
})
|
||||
return
|
||||
}
|
||||
@@ -83,9 +83,9 @@ export default async function guildMember(
|
||||
embeds: [
|
||||
{
|
||||
description: "Fetching your guild data...",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
const guild = await getGuild(uuid)
|
||||
@@ -96,14 +96,14 @@ export default async function guildMember(
|
||||
description: "This user is not in a guild",
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: head!,
|
||||
url: head!
|
||||
},
|
||||
footer: {
|
||||
text: interaction.guild!.name + " | " + devMessage,
|
||||
icon_url: interaction.guild!.iconURL() || undefined,
|
||||
},
|
||||
},
|
||||
],
|
||||
icon_url: interaction.guild!.iconURL() || undefined
|
||||
}
|
||||
}
|
||||
]
|
||||
})
|
||||
return
|
||||
}
|
||||
@@ -129,16 +129,16 @@ export default async function guildMember(
|
||||
const expValue = allDaysGexp.join("")
|
||||
const totalWeeklyGexpUnformatted = Object.values(memberGexp).reduce(
|
||||
(a, b) => a + b,
|
||||
0,
|
||||
0
|
||||
)
|
||||
const totalWeeklyGexp = new Intl.NumberFormat("en-US").format(
|
||||
totalWeeklyGexpUnformatted,
|
||||
totalWeeklyGexpUnformatted
|
||||
)
|
||||
const averageWeeklyGexpUnformatted = Math.round(
|
||||
totalWeeklyGexpUnformatted / 7,
|
||||
totalWeeklyGexpUnformatted / 7
|
||||
)
|
||||
const averageWeeklyGexp = new Intl.NumberFormat("en-US").format(
|
||||
averageWeeklyGexpUnformatted,
|
||||
averageWeeklyGexpUnformatted
|
||||
)
|
||||
|
||||
const guildMemberJoinMS = guildMember!.joined
|
||||
@@ -176,12 +176,12 @@ export default async function guildMember(
|
||||
"`\n",
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: head!,
|
||||
url: head!
|
||||
},
|
||||
fields: [
|
||||
{
|
||||
name: "**Daily GEXP**",
|
||||
value: expValue,
|
||||
value: expValue
|
||||
},
|
||||
{
|
||||
name: "**Weekly GEXP**",
|
||||
@@ -191,18 +191,18 @@ export default async function guildMember(
|
||||
"`\n" +
|
||||
"**➺ Daily avarage:** `" +
|
||||
averageWeeklyGexp +
|
||||
"`",
|
||||
"`"
|
||||
},
|
||||
{
|
||||
name: "**Join date**",
|
||||
value: "**➺ **`" + guildMemberJoin + "`",
|
||||
},
|
||||
value: "**➺ **`" + guildMemberJoin + "`"
|
||||
}
|
||||
],
|
||||
footer: {
|
||||
text: interaction.guild!.name + " | " + devMessage,
|
||||
icon_url: interaction.guild!.iconURL() || undefined,
|
||||
},
|
||||
},
|
||||
],
|
||||
icon_url: interaction.guild!.iconURL() || undefined
|
||||
}
|
||||
}
|
||||
]
|
||||
})
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import Illegitimate from "utils/Illegitimate"
|
||||
const redis = Illegitimate.redis
|
||||
|
||||
export default async function guildTop(
|
||||
interaction: ChatInputCommandInteraction,
|
||||
interaction: ChatInputCommandInteraction
|
||||
): Promise<void> {
|
||||
await interaction.deferReply()
|
||||
|
||||
@@ -21,9 +21,9 @@ export default async function guildTop(
|
||||
embeds: [
|
||||
{
|
||||
description: "You can't use this command in DMs!",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
})
|
||||
return
|
||||
}
|
||||
@@ -33,9 +33,9 @@ export default async function guildTop(
|
||||
embeds: [
|
||||
{
|
||||
description: "Fetching your uuid...",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
const uuid = await getUUID(query)
|
||||
@@ -44,9 +44,9 @@ export default async function guildTop(
|
||||
embeds: [
|
||||
{
|
||||
description: "That player doen't exist!",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
})
|
||||
return
|
||||
}
|
||||
@@ -55,9 +55,9 @@ export default async function guildTop(
|
||||
embeds: [
|
||||
{
|
||||
description: "Fetching your player data...",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
const player = await getPlayer(uuid)
|
||||
@@ -66,9 +66,9 @@ export default async function guildTop(
|
||||
embeds: [
|
||||
{
|
||||
description: "That player has never joined the server!",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
})
|
||||
return
|
||||
}
|
||||
@@ -77,9 +77,9 @@ export default async function guildTop(
|
||||
embeds: [
|
||||
{
|
||||
description: "Fetching your guild data...",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
guild = await getGuild(uuid, "player")
|
||||
@@ -88,9 +88,9 @@ export default async function guildTop(
|
||||
embeds: [
|
||||
{
|
||||
description: "That player is not in a guild!",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
})
|
||||
return
|
||||
}
|
||||
@@ -99,9 +99,9 @@ export default async function guildTop(
|
||||
embeds: [
|
||||
{
|
||||
description: "Fetching your guild data...",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
guild = await getGuild(query, "name")
|
||||
@@ -110,9 +110,9 @@ export default async function guildTop(
|
||||
embeds: [
|
||||
{
|
||||
description: "That guild doesn't exist!",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
})
|
||||
return
|
||||
}
|
||||
@@ -121,9 +121,9 @@ export default async function guildTop(
|
||||
embeds: [
|
||||
{
|
||||
description: "Fetching your guild data...",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
guild = await getGuild(query, "id")
|
||||
@@ -132,9 +132,9 @@ export default async function guildTop(
|
||||
embeds: [
|
||||
{
|
||||
description: "That guild doesn't exist!",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
})
|
||||
return
|
||||
}
|
||||
@@ -152,20 +152,20 @@ export default async function guildTop(
|
||||
})
|
||||
.reduce((a, b) => a + b, 0)
|
||||
const gexpToday = new Intl.NumberFormat("en-US").format(
|
||||
gexpTodayUnformatted,
|
||||
gexpTodayUnformatted
|
||||
)
|
||||
|
||||
const averageGuildMemberGEXPUnformatted = Math.floor(
|
||||
gexpTodayUnformatted / guildMembers.length,
|
||||
gexpTodayUnformatted / guildMembers.length
|
||||
)
|
||||
const averageGuildMemberGEXP = new Intl.NumberFormat("en-US").format(
|
||||
averageGuildMemberGEXPUnformatted,
|
||||
averageGuildMemberGEXPUnformatted
|
||||
)
|
||||
|
||||
const allMembersDailyGEXP = guildMembers.map(member => {
|
||||
return {
|
||||
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 " +
|
||||
guildName +
|
||||
"...",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
for (let i = 0; i < allMembersSortedUUIDArray.length; i++) {
|
||||
@@ -210,7 +210,7 @@ export default async function guildTop(
|
||||
|
||||
guildData.push({
|
||||
ign: ign!,
|
||||
uuid: uuid,
|
||||
uuid: uuid
|
||||
})
|
||||
}
|
||||
|
||||
@@ -218,7 +218,7 @@ export default async function guildTop(
|
||||
"guildTop+" + guildId,
|
||||
JSON.stringify(guildData),
|
||||
"EX",
|
||||
60 * 30,
|
||||
60 * 30
|
||||
)
|
||||
} else {
|
||||
cacheStatus = true
|
||||
@@ -231,9 +231,9 @@ export default async function guildTop(
|
||||
" members of " +
|
||||
guildName +
|
||||
"using cache...",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
})
|
||||
guildData = JSON.parse(cachedData)
|
||||
}
|
||||
@@ -244,7 +244,7 @@ export default async function guildTop(
|
||||
for (let i = 0; i < amount; i++) {
|
||||
const gexp = new Intl.NumberFormat("en-US").format(topMembers[i].gexp)
|
||||
const ign = guildData.find(
|
||||
member => member.uuid === topMembers[i].uuid,
|
||||
member => member.uuid === topMembers[i].uuid
|
||||
)?.ign
|
||||
|
||||
const position = i + 1
|
||||
@@ -253,7 +253,7 @@ export default async function guildTop(
|
||||
}
|
||||
|
||||
const list = Array.from({ length: sliceSize }, (_, i) =>
|
||||
fieldsValueRaw.slice(i * sliceSize, (i + 1) * sliceSize),
|
||||
fieldsValueRaw.slice(i * sliceSize, (i + 1) * sliceSize)
|
||||
)
|
||||
const newList: NewList = []
|
||||
|
||||
@@ -263,7 +263,7 @@ export default async function guildTop(
|
||||
newList[index] = {
|
||||
name: "",
|
||||
value: item.join("\n"),
|
||||
inline: false,
|
||||
inline: false
|
||||
}
|
||||
})
|
||||
|
||||
@@ -288,9 +288,9 @@ export default async function guildTop(
|
||||
" | " +
|
||||
devMessage +
|
||||
cacheStatusText,
|
||||
icon_url: interaction.guild!.iconURL() || undefined,
|
||||
},
|
||||
},
|
||||
],
|
||||
icon_url: interaction.guild!.iconURL() || undefined
|
||||
}
|
||||
}
|
||||
]
|
||||
})
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ export = {
|
||||
const commandRawList = client.commands.map(command => {
|
||||
return {
|
||||
name: command.name,
|
||||
command: command,
|
||||
command: command
|
||||
}
|
||||
})
|
||||
|
||||
@@ -34,22 +34,22 @@ export = {
|
||||
if (!command.command.subcommands && command.command.public) {
|
||||
commandList.push({
|
||||
name: "**/" + commandName + "**",
|
||||
value: "`" + command.command.description + "`",
|
||||
value: "`" + command.command.description + "`"
|
||||
})
|
||||
} else if (command.command.subcommands && command.command.public) {
|
||||
const subcommands = command.command.data.options.map(
|
||||
subcommand => {
|
||||
return {
|
||||
name: commandName + " " + subcommand.toJSON().name,
|
||||
description: subcommand.toJSON().description,
|
||||
description: subcommand.toJSON().description
|
||||
}
|
||||
}
|
||||
},
|
||||
)
|
||||
|
||||
for (const subcommand of subcommands) {
|
||||
commandList.push({
|
||||
name: "**/" + subcommand.name + "**",
|
||||
value: "`" + subcommand.description + "`",
|
||||
value: "`" + subcommand.description + "`"
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -65,14 +65,14 @@ export = {
|
||||
fields: commandList,
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: interaction.guild!.iconURL() || "",
|
||||
url: interaction.guild!.iconURL() || ""
|
||||
},
|
||||
footer: {
|
||||
icon_url: interaction.guild!.iconURL() || undefined,
|
||||
text: interaction.guild!.name + " | " + devMessage,
|
||||
},
|
||||
},
|
||||
],
|
||||
text: interaction.guild!.name + " | " + devMessage
|
||||
}
|
||||
}
|
||||
]
|
||||
})
|
||||
},
|
||||
}
|
||||
} as Command
|
||||
|
||||
@@ -31,14 +31,14 @@ export = {
|
||||
color: embedColor,
|
||||
footer: {
|
||||
text: interaction.guild!.name + " | " + devMessage,
|
||||
icon_url: interaction.guild!.iconURL() || undefined,
|
||||
icon_url: interaction.guild!.iconURL() || undefined
|
||||
},
|
||||
image: {
|
||||
url: instructionsgif,
|
||||
proxy_url: instructionsgif,
|
||||
},
|
||||
},
|
||||
],
|
||||
proxy_url: instructionsgif
|
||||
}
|
||||
}
|
||||
]
|
||||
})
|
||||
},
|
||||
}
|
||||
} as Command
|
||||
|
||||
@@ -2,7 +2,7 @@ import {
|
||||
SlashCommandBuilder,
|
||||
PermissionFlagsBits,
|
||||
userMention,
|
||||
GuildMember,
|
||||
GuildMember
|
||||
} from "discord.js"
|
||||
import { admin, helper } from "config/roles.json"
|
||||
import { color, devMessage } from "config/options.json"
|
||||
@@ -22,12 +22,12 @@ export = {
|
||||
option
|
||||
.setName("member")
|
||||
.setDescription("Member to kick.")
|
||||
.setRequired(true),
|
||||
.setRequired(true)
|
||||
)
|
||||
.addStringOption(option =>
|
||||
option
|
||||
.setName("reason")
|
||||
.setDescription("Reason for kicking the member."),
|
||||
.setDescription("Reason for kicking the member.")
|
||||
)
|
||||
.setDefaultMemberPermissions(PermissionFlagsBits.KickMembers)
|
||||
.setDMPermission(false),
|
||||
@@ -46,7 +46,7 @@ export = {
|
||||
|
||||
if (!modRoles.includes(helper) && !modRoles.includes(admin)) {
|
||||
await interaction.editReply(
|
||||
"You do not have permission to use this command.",
|
||||
"You do not have permission to use this command."
|
||||
)
|
||||
return
|
||||
}
|
||||
@@ -83,7 +83,7 @@ export = {
|
||||
{
|
||||
author: {
|
||||
name: mod.user.username,
|
||||
icon_url: mod.user.avatarURL() || undefined,
|
||||
icon_url: mod.user.avatarURL() || undefined
|
||||
},
|
||||
title: "Member Kicked",
|
||||
description: `
|
||||
@@ -93,15 +93,15 @@ export = {
|
||||
`,
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: mod.user.avatarURL() || "",
|
||||
url: mod.user.avatarURL() || ""
|
||||
},
|
||||
footer: {
|
||||
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({
|
||||
@@ -119,14 +119,14 @@ export = {
|
||||
mod.user.username,
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: member.user.avatarURL() || "",
|
||||
url: member.user.avatarURL() || ""
|
||||
},
|
||||
footer: {
|
||||
icon_url: interaction.guild!.iconURL() || undefined,
|
||||
text: interaction.guild!.name + " | " + devMessage,
|
||||
},
|
||||
},
|
||||
],
|
||||
text: interaction.guild!.name + " | " + devMessage
|
||||
}
|
||||
}
|
||||
]
|
||||
})
|
||||
},
|
||||
}
|
||||
} as Command
|
||||
|
||||
@@ -25,11 +25,11 @@ export = {
|
||||
color: embedColor,
|
||||
footer: {
|
||||
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
|
||||
|
||||
@@ -16,7 +16,7 @@ export = {
|
||||
option
|
||||
.setName("user")
|
||||
.setDescription("User to show pp size")
|
||||
.setRequired(false),
|
||||
.setRequired(false)
|
||||
)
|
||||
.setDMPermission(false),
|
||||
|
||||
@@ -37,9 +37,9 @@ export = {
|
||||
{
|
||||
title: `${user.username}'s pp size`,
|
||||
description: `8${"=".repeat(size)}D`,
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
})
|
||||
},
|
||||
}
|
||||
} as Command
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import {
|
||||
SlashCommandBuilder,
|
||||
PermissionFlagsBits,
|
||||
userMention,
|
||||
userMention
|
||||
} from "discord.js"
|
||||
import { color, devMessage } from "config/options.json"
|
||||
import waitinglistSchema from "schemas/waitinglistSchema"
|
||||
@@ -21,13 +21,13 @@ export = {
|
||||
option
|
||||
.setName("user")
|
||||
.setDescription("The user to remove.")
|
||||
.setRequired(true),
|
||||
.setRequired(true)
|
||||
)
|
||||
.addStringOption(option =>
|
||||
option
|
||||
.setName("reason")
|
||||
.setDescription("The reason for removing the user.")
|
||||
.setRequired(false),
|
||||
.setRequired(false)
|
||||
)
|
||||
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
|
||||
.setDMPermission(false),
|
||||
@@ -50,9 +50,9 @@ export = {
|
||||
description:
|
||||
userMention(user.id) +
|
||||
" is not on the waiting list.",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
})
|
||||
return
|
||||
}
|
||||
@@ -64,7 +64,7 @@ export = {
|
||||
{
|
||||
author: {
|
||||
name: mod.username,
|
||||
icon_url: mod.avatarURL() || undefined,
|
||||
icon_url: mod.avatarURL() || undefined
|
||||
},
|
||||
title: "Waiting List - Remove User",
|
||||
description: `
|
||||
@@ -74,15 +74,15 @@ export = {
|
||||
`,
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: mod.avatarURL() || "",
|
||||
url: mod.avatarURL() || ""
|
||||
},
|
||||
footer: {
|
||||
icon_url: user.avatarURL() || undefined,
|
||||
text: "ID: " + user.id,
|
||||
text: "ID: " + user.id
|
||||
},
|
||||
timestamp: new Date().toISOString(),
|
||||
},
|
||||
],
|
||||
timestamp: new Date().toISOString()
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
await interaction.editReply({
|
||||
@@ -99,10 +99,10 @@ export = {
|
||||
color: embedColor,
|
||||
footer: {
|
||||
text: interaction.guild!.name + " | " + devMessage,
|
||||
icon_url: interaction.guild!.iconURL() || undefined,
|
||||
},
|
||||
},
|
||||
],
|
||||
icon_url: interaction.guild!.iconURL() || undefined
|
||||
}
|
||||
}
|
||||
]
|
||||
})
|
||||
},
|
||||
}
|
||||
} as Command
|
||||
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
swstars,
|
||||
swkdr,
|
||||
duelswins,
|
||||
duelswlr,
|
||||
duelswlr
|
||||
} from "config/reqs.json"
|
||||
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**",
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: interaction.guild!.iconURL() || "",
|
||||
url: interaction.guild!.iconURL() || ""
|
||||
},
|
||||
fields: [
|
||||
{
|
||||
@@ -45,7 +45,7 @@ export = {
|
||||
bwwins.toString() +
|
||||
"`\n**FKDR:** `" +
|
||||
bwfkdr.toString() +
|
||||
"`",
|
||||
"`"
|
||||
},
|
||||
{
|
||||
name: "**Skywars**",
|
||||
@@ -54,7 +54,7 @@ export = {
|
||||
swstars.toString() +
|
||||
"`\n**KDR:** `" +
|
||||
swkdr.toString() +
|
||||
"`",
|
||||
"`"
|
||||
},
|
||||
{
|
||||
name: "**Duels**",
|
||||
@@ -63,15 +63,15 @@ export = {
|
||||
duelswins.toString() +
|
||||
"`\n**WLR:** `" +
|
||||
duelswlr.toString() +
|
||||
"`",
|
||||
},
|
||||
"`"
|
||||
}
|
||||
],
|
||||
footer: {
|
||||
text: interaction.guild!.name + " | " + devMessage,
|
||||
icon_url: interaction.guild!.iconURL() || undefined,
|
||||
},
|
||||
},
|
||||
],
|
||||
icon_url: interaction.guild!.iconURL() || undefined
|
||||
}
|
||||
}
|
||||
]
|
||||
})
|
||||
},
|
||||
}
|
||||
} as Command
|
||||
|
||||
@@ -2,7 +2,7 @@ import {
|
||||
SlashCommandBuilder,
|
||||
PermissionFlagsBits,
|
||||
ChannelType,
|
||||
TextChannel,
|
||||
TextChannel
|
||||
} from "discord.js"
|
||||
import { color, devMessage } from "config/options.json"
|
||||
import { Command } from "interfaces"
|
||||
@@ -20,7 +20,7 @@ export = {
|
||||
option
|
||||
.setName("message")
|
||||
.setDescription("The message to send.")
|
||||
.setRequired(true),
|
||||
.setRequired(true)
|
||||
)
|
||||
.addChannelOption(option =>
|
||||
option
|
||||
@@ -28,8 +28,8 @@ export = {
|
||||
.setDescription("The channel to send the message to.")
|
||||
.addChannelTypes(
|
||||
ChannelType.GuildText,
|
||||
ChannelType.GuildAnnouncement,
|
||||
),
|
||||
ChannelType.GuildAnnouncement
|
||||
)
|
||||
)
|
||||
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
|
||||
.setDMPermission(false),
|
||||
@@ -49,14 +49,14 @@ export = {
|
||||
description: message,
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: interaction.guild!.iconURL() || "",
|
||||
url: interaction.guild!.iconURL() || ""
|
||||
},
|
||||
footer: {
|
||||
text: interaction.guild!.id + " | " + devMessage,
|
||||
icon_url: interaction.guild!.iconURL() || undefined,
|
||||
},
|
||||
},
|
||||
],
|
||||
icon_url: interaction.guild!.iconURL() || undefined
|
||||
}
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
await interaction.editReply({
|
||||
@@ -66,10 +66,10 @@ export = {
|
||||
color: embedColor,
|
||||
footer: {
|
||||
text: interaction.guild!.name + " | " + devMessage,
|
||||
icon_url: interaction.guild!.iconURL() || undefined,
|
||||
},
|
||||
},
|
||||
],
|
||||
icon_url: interaction.guild!.iconURL() || undefined
|
||||
}
|
||||
}
|
||||
]
|
||||
})
|
||||
},
|
||||
}
|
||||
} as Command
|
||||
|
||||
@@ -2,7 +2,7 @@ import {
|
||||
SlashCommandBuilder,
|
||||
PermissionFlagsBits,
|
||||
userMention,
|
||||
GuildMember,
|
||||
GuildMember
|
||||
} from "discord.js"
|
||||
import { color, devMessage } from "config/options.json"
|
||||
import { Command } from "interfaces"
|
||||
@@ -21,13 +21,13 @@ export = {
|
||||
option
|
||||
.setName("user")
|
||||
.setDescription("The user to set the nickname for")
|
||||
.setRequired(true),
|
||||
.setRequired(true)
|
||||
)
|
||||
.addStringOption(option =>
|
||||
option
|
||||
.setName("nickname")
|
||||
.setDescription("The nickname to set")
|
||||
.setRequired(true),
|
||||
.setRequired(true)
|
||||
)
|
||||
.setDefaultMemberPermissions(PermissionFlagsBits.ManageNicknames)
|
||||
.setDMPermission(false),
|
||||
@@ -40,7 +40,7 @@ export = {
|
||||
if (!member.manageable) {
|
||||
interaction.reply({
|
||||
content: "I cannot set the nickname for this user!",
|
||||
ephemeral: true,
|
||||
ephemeral: true
|
||||
})
|
||||
return
|
||||
}
|
||||
@@ -52,7 +52,7 @@ export = {
|
||||
{
|
||||
author: {
|
||||
name: interaction.user.username,
|
||||
icon_url: interaction.user.avatarURL() || undefined,
|
||||
icon_url: interaction.user.avatarURL() || undefined
|
||||
},
|
||||
title: "Nickname",
|
||||
description: `
|
||||
@@ -62,15 +62,15 @@ export = {
|
||||
`,
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: interaction.user.avatarURL() || "",
|
||||
url: interaction.user.avatarURL() || ""
|
||||
},
|
||||
footer: {
|
||||
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({
|
||||
@@ -80,11 +80,11 @@ export = {
|
||||
color: embedColor,
|
||||
footer: {
|
||||
text: interaction.guild!.name + " | " + devMessage,
|
||||
icon_url: interaction.guild!.iconURL() || undefined,
|
||||
},
|
||||
},
|
||||
icon_url: interaction.guild!.iconURL() || undefined
|
||||
}
|
||||
}
|
||||
],
|
||||
ephemeral: true,
|
||||
ephemeral: true
|
||||
})
|
||||
},
|
||||
}
|
||||
} as Command
|
||||
|
||||
@@ -5,7 +5,7 @@ import {
|
||||
ActionRowBuilder,
|
||||
ButtonStyle,
|
||||
ChannelType,
|
||||
TextChannel,
|
||||
TextChannel
|
||||
} from "discord.js"
|
||||
import { color, devMessage } from "config/options.json"
|
||||
import { Command } from "interfaces"
|
||||
@@ -28,14 +28,14 @@ export = {
|
||||
option
|
||||
.setName("channel")
|
||||
.setDescription(
|
||||
"The channel to send the application to.",
|
||||
"The channel to send the application to."
|
||||
)
|
||||
.addChannelTypes(
|
||||
ChannelType.GuildText,
|
||||
ChannelType.GuildAnnouncement,
|
||||
ChannelType.GuildAnnouncement
|
||||
)
|
||||
.setRequired(true)
|
||||
)
|
||||
.setRequired(true),
|
||||
),
|
||||
)
|
||||
.addSubcommand(subcommand =>
|
||||
subcommand
|
||||
@@ -45,14 +45,14 @@ export = {
|
||||
option
|
||||
.setName("channel")
|
||||
.setDescription(
|
||||
"The channel to send the application to.",
|
||||
"The channel to send the application to."
|
||||
)
|
||||
.addChannelTypes(
|
||||
ChannelType.GuildText,
|
||||
ChannelType.GuildAnnouncement,
|
||||
ChannelType.GuildAnnouncement
|
||||
)
|
||||
.setRequired(true)
|
||||
)
|
||||
.setRequired(true),
|
||||
),
|
||||
)
|
||||
.addSubcommand(subcommand =>
|
||||
subcommand
|
||||
@@ -62,14 +62,14 @@ export = {
|
||||
option
|
||||
.setName("channel")
|
||||
.setDescription(
|
||||
"The channel to send the verfiy message to.",
|
||||
"The channel to send the verfiy message to."
|
||||
)
|
||||
.addChannelTypes(
|
||||
ChannelType.GuildText,
|
||||
ChannelType.GuildAnnouncement,
|
||||
ChannelType.GuildAnnouncement
|
||||
)
|
||||
.setRequired(true)
|
||||
)
|
||||
.setRequired(true),
|
||||
),
|
||||
)
|
||||
.addSubcommand(subcommand =>
|
||||
subcommand
|
||||
@@ -79,14 +79,14 @@ export = {
|
||||
option
|
||||
.setName("channel")
|
||||
.setDescription(
|
||||
"The channel to send the waiting list message to.",
|
||||
"The channel to send the waiting list message to."
|
||||
)
|
||||
.addChannelTypes(
|
||||
ChannelType.GuildText,
|
||||
ChannelType.GuildAnnouncement,
|
||||
ChannelType.GuildAnnouncement
|
||||
)
|
||||
.setRequired(true)
|
||||
)
|
||||
.setRequired(true),
|
||||
),
|
||||
)
|
||||
.addSubcommand(subcommand =>
|
||||
subcommand
|
||||
@@ -96,14 +96,14 @@ export = {
|
||||
option
|
||||
.setName("channel")
|
||||
.setDescription(
|
||||
"The channel to send the application to.",
|
||||
"The channel to send the application to."
|
||||
)
|
||||
.addChannelTypes(
|
||||
ChannelType.GuildText,
|
||||
ChannelType.GuildAnnouncement,
|
||||
ChannelType.GuildAnnouncement
|
||||
)
|
||||
.setRequired(true)
|
||||
)
|
||||
.setRequired(true),
|
||||
),
|
||||
)
|
||||
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
|
||||
.setDMPermission(false),
|
||||
@@ -168,13 +168,13 @@ export = {
|
||||
description: description,
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: interaction.guild!.iconURL() || "",
|
||||
url: interaction.guild!.iconURL() || ""
|
||||
},
|
||||
footer: {
|
||||
text: interaction.guild!.name + " | " + devMessage,
|
||||
icon_url: interaction.guild!.iconURL() || undefined,
|
||||
},
|
||||
},
|
||||
icon_url: interaction.guild!.iconURL() || undefined
|
||||
}
|
||||
}
|
||||
],
|
||||
components: [
|
||||
new ActionRowBuilder<ButtonBuilder>().addComponents(
|
||||
@@ -182,14 +182,14 @@ export = {
|
||||
.setCustomId(customId)
|
||||
.setLabel(label)
|
||||
.setStyle(ButtonStyle.Primary)
|
||||
.setEmoji({ name: emoji }),
|
||||
),
|
||||
],
|
||||
.setEmoji({ name: emoji })
|
||||
)
|
||||
]
|
||||
})
|
||||
|
||||
await interaction.reply({
|
||||
content: "Message sent",
|
||||
ephemeral: true,
|
||||
ephemeral: true
|
||||
})
|
||||
},
|
||||
}
|
||||
} as Command
|
||||
|
||||
@@ -4,7 +4,7 @@ import {
|
||||
ChannelType,
|
||||
TextChannel,
|
||||
channelMention,
|
||||
userMention,
|
||||
userMention
|
||||
} from "discord.js"
|
||||
import { color, devMessage } from "config/options.json"
|
||||
import { Command } from "interfaces"
|
||||
@@ -22,9 +22,7 @@ export = {
|
||||
.addIntegerOption(option =>
|
||||
option
|
||||
.setName("seconds")
|
||||
.setDescription(
|
||||
"The amount of seconds to set the slowmode to.",
|
||||
),
|
||||
.setDescription("The amount of seconds to set the slowmode to.")
|
||||
)
|
||||
.addChannelOption(option =>
|
||||
option
|
||||
@@ -32,8 +30,8 @@ export = {
|
||||
.setDescription("The channel to set the slowmode of.")
|
||||
.addChannelTypes(
|
||||
ChannelType.GuildText,
|
||||
ChannelType.GuildAnnouncement,
|
||||
),
|
||||
ChannelType.GuildAnnouncement
|
||||
)
|
||||
)
|
||||
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
|
||||
.setDMPermission(false),
|
||||
@@ -55,10 +53,10 @@ export = {
|
||||
color: embedColor,
|
||||
footer: {
|
||||
text: interaction.guild!.name + " | " + devMessage,
|
||||
icon_url: interaction.guild!.iconURL() || undefined,
|
||||
},
|
||||
},
|
||||
],
|
||||
icon_url: interaction.guild!.iconURL() || undefined
|
||||
}
|
||||
}
|
||||
]
|
||||
})
|
||||
return
|
||||
}
|
||||
@@ -68,7 +66,7 @@ export = {
|
||||
{
|
||||
author: {
|
||||
name: interaction.user.username,
|
||||
icon_url: interaction.user.avatarURL() || undefined,
|
||||
icon_url: interaction.user.avatarURL() || undefined
|
||||
},
|
||||
title: "Slowmode Update",
|
||||
description: `
|
||||
@@ -78,15 +76,15 @@ export = {
|
||||
`,
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: interaction.user.avatarURL() || "",
|
||||
url: interaction.user.avatarURL() || ""
|
||||
},
|
||||
footer: {
|
||||
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({
|
||||
@@ -96,11 +94,11 @@ export = {
|
||||
color: embedColor,
|
||||
footer: {
|
||||
text: interaction.guild!.name + " | " + devMessage,
|
||||
icon_url: interaction.guild!.iconURL() || undefined,
|
||||
},
|
||||
},
|
||||
],
|
||||
icon_url: interaction.guild!.iconURL() || undefined
|
||||
}
|
||||
}
|
||||
]
|
||||
})
|
||||
await channel.setRateLimitPerUser(seconds)
|
||||
},
|
||||
}
|
||||
} as Command
|
||||
|
||||
@@ -17,7 +17,7 @@ export = {
|
||||
option
|
||||
.setName("user")
|
||||
.setDescription("The user to snipe")
|
||||
.setRequired(true),
|
||||
.setRequired(true)
|
||||
)
|
||||
.setDMPermission(false),
|
||||
|
||||
@@ -26,7 +26,7 @@ export = {
|
||||
const member = interaction.options.getMember("user") as GuildMember
|
||||
const snipeCache = await snipeCacheSchema.find({
|
||||
userid: member.user.id,
|
||||
channelid: interaction.channel!.id,
|
||||
channelid: interaction.channel!.id
|
||||
})
|
||||
const embedColor = Number(color.replace("#", "0x"))
|
||||
const messages: string[] = []
|
||||
@@ -36,9 +36,9 @@ export = {
|
||||
embeds: [
|
||||
{
|
||||
description: "No messages to snipe",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
})
|
||||
return
|
||||
}
|
||||
@@ -51,7 +51,7 @@ export = {
|
||||
} else {
|
||||
messages.push(`**Message #${i}:** ${data.content}`)
|
||||
messages.push(
|
||||
`**Attachments:** ${data.attachments.join(", ")}\n`,
|
||||
`**Attachments:** ${data.attachments.join(", ")}\n`
|
||||
)
|
||||
}
|
||||
i++
|
||||
@@ -62,20 +62,20 @@ export = {
|
||||
{
|
||||
author: {
|
||||
name: member.user.username,
|
||||
icon_url: member.user.avatarURL() || undefined,
|
||||
icon_url: member.user.avatarURL() || undefined
|
||||
},
|
||||
description: messages.join("\n"),
|
||||
thumbnail: {
|
||||
url: member.user.avatarURL() || "",
|
||||
url: member.user.avatarURL() || ""
|
||||
},
|
||||
color: embedColor,
|
||||
footer: {
|
||||
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
|
||||
|
||||
@@ -18,7 +18,7 @@ export = {
|
||||
.addSubcommand(subcommand =>
|
||||
subcommand
|
||||
.setName("help")
|
||||
.setDescription("Get help with staff commands"),
|
||||
.setDescription("Get help with staff commands")
|
||||
)
|
||||
.addSubcommand(subcommand =>
|
||||
subcommand
|
||||
@@ -28,15 +28,13 @@ export = {
|
||||
option
|
||||
.setName("ign")
|
||||
.setDescription("The IGN of the player.")
|
||||
.setRequired(true),
|
||||
),
|
||||
.setRequired(true)
|
||||
)
|
||||
)
|
||||
.addSubcommand(subcommand =>
|
||||
subcommand
|
||||
.setName("updatediscordroles")
|
||||
.setDescription(
|
||||
"Update the discord roles of all guild members",
|
||||
),
|
||||
.setDescription("Update the discord roles of all guild members")
|
||||
)
|
||||
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
|
||||
.setDMPermission(false),
|
||||
@@ -67,10 +65,10 @@ export = {
|
||||
color: embedColor,
|
||||
footer: {
|
||||
text: interaction.guild!.name + " | " + devMessage,
|
||||
icon_url: interaction.guild!.iconURL() || undefined,
|
||||
},
|
||||
},
|
||||
],
|
||||
icon_url: interaction.guild!.iconURL() || undefined
|
||||
}
|
||||
}
|
||||
]
|
||||
})
|
||||
},
|
||||
}
|
||||
} as Command
|
||||
|
||||
@@ -5,7 +5,7 @@ import {
|
||||
beastswkdr,
|
||||
beastswstars,
|
||||
beastduelswins,
|
||||
duelswlr,
|
||||
duelswlr
|
||||
} from "config/reqs.json"
|
||||
import { color, devMessage } from "config/options.json"
|
||||
import {
|
||||
@@ -15,12 +15,12 @@ import {
|
||||
getUUID,
|
||||
getPlayer,
|
||||
getGuild,
|
||||
getHeadURL,
|
||||
getHeadURL
|
||||
} from "utils/Hypixel"
|
||||
import { ChatInputCommandInteraction } from "discord.js"
|
||||
|
||||
export default async function beast(
|
||||
interaction: ChatInputCommandInteraction,
|
||||
interaction: ChatInputCommandInteraction
|
||||
): Promise<void> {
|
||||
await interaction.deferReply()
|
||||
|
||||
@@ -36,9 +36,9 @@ export default async function beast(
|
||||
embeds: [
|
||||
{
|
||||
description: "Fetching your uuid...",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
const uuid = await getUUID(ign)
|
||||
@@ -47,9 +47,9 @@ export default async function beast(
|
||||
embeds: [
|
||||
{
|
||||
description: "That player doesn't exist.",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
})
|
||||
return
|
||||
}
|
||||
@@ -58,9 +58,9 @@ export default async function beast(
|
||||
embeds: [
|
||||
{
|
||||
description: "Fetching your player data...",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
const head = await getHeadURL(ign)
|
||||
@@ -70,9 +70,9 @@ export default async function beast(
|
||||
embeds: [
|
||||
{
|
||||
description: "That player hasn't played Hypixel before.",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
})
|
||||
return
|
||||
}
|
||||
@@ -97,9 +97,9 @@ export default async function beast(
|
||||
embeds: [
|
||||
{
|
||||
description: "Fetching your guild data...",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
const guild = await getGuild(uuid)
|
||||
@@ -124,7 +124,7 @@ export default async function beast(
|
||||
if (!player.stats) {
|
||||
statsFields.push({
|
||||
name: "<a:_warning:1178350183457751100> This player never played any games.",
|
||||
value: "**➺ Stats:** `None`",
|
||||
value: "**➺ Stats:** `None`"
|
||||
})
|
||||
} else {
|
||||
if (player.stats.Bedwars) {
|
||||
@@ -165,12 +165,12 @@ export default async function beast(
|
||||
hsbwwins.toString() +
|
||||
" / " +
|
||||
bwwins.toString() +
|
||||
"`",
|
||||
"`"
|
||||
})
|
||||
} else {
|
||||
statsFields.push({
|
||||
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" +
|
||||
"**➺ Wins:** `" +
|
||||
hsswwins.toString() +
|
||||
"`",
|
||||
"`"
|
||||
})
|
||||
} else {
|
||||
statsFields.push({
|
||||
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" +
|
||||
"**➺ KDR:** `" +
|
||||
hsduelskd.toFixed(2).toString() +
|
||||
"`\n",
|
||||
"`\n"
|
||||
})
|
||||
} else {
|
||||
statsFields.push({
|
||||
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,
|
||||
thumbnail: {
|
||||
url: head!,
|
||||
url: head!
|
||||
},
|
||||
footer: {
|
||||
text: interaction.guild!.name + " | " + devMessage,
|
||||
icon_url: interaction.guild!.iconURL() || undefined,
|
||||
icon_url: interaction.guild!.iconURL() || undefined
|
||||
},
|
||||
fields: statsFields,
|
||||
},
|
||||
],
|
||||
fields: statsFields
|
||||
}
|
||||
]
|
||||
})
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ import { ExtendedClient as Client } from "utils/Client"
|
||||
|
||||
export default async function help(
|
||||
interaction: ChatInputCommandInteraction,
|
||||
client: Client,
|
||||
client: Client
|
||||
): Promise<void> {
|
||||
await interaction.deferReply({ ephemeral: true })
|
||||
|
||||
@@ -16,7 +16,7 @@ export default async function help(
|
||||
const commandRawList = client.commands.map(command => {
|
||||
return {
|
||||
name: command.name,
|
||||
command: command,
|
||||
command: command
|
||||
}
|
||||
})
|
||||
|
||||
@@ -26,20 +26,20 @@ export default async function help(
|
||||
if (!command.command.subcommands && !command.command.public) {
|
||||
commandList.push({
|
||||
name: "**/" + commandName + "**",
|
||||
value: "`" + command.command.description + "`",
|
||||
value: "`" + command.command.description + "`"
|
||||
})
|
||||
} else if (command.command.subcommands && !command.command.public) {
|
||||
const subcommands = command.command.data.options.map(subcommand => {
|
||||
return {
|
||||
name: commandName + " " + subcommand.toJSON().name,
|
||||
description: subcommand.toJSON().description,
|
||||
description: subcommand.toJSON().description
|
||||
}
|
||||
})
|
||||
|
||||
for (const subcommand of subcommands) {
|
||||
commandList.push({
|
||||
name: "**/" + subcommand.name + "**",
|
||||
value: "`" + subcommand.description + "`",
|
||||
value: "`" + subcommand.description + "`"
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -55,13 +55,13 @@ export default async function help(
|
||||
fields: commandList,
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: interaction.guild!.iconURL() || "",
|
||||
url: interaction.guild!.iconURL() || ""
|
||||
},
|
||||
footer: {
|
||||
icon_url: interaction.guild!.iconURL() || undefined,
|
||||
text: interaction.guild?.name + " | " + devMessage,
|
||||
},
|
||||
},
|
||||
],
|
||||
text: interaction.guild?.name + " | " + devMessage
|
||||
}
|
||||
}
|
||||
]
|
||||
})
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ import { getGuild } from "utils/Hypixel"
|
||||
import { GuildData } from "interfaces"
|
||||
|
||||
export default async function updateDiscordRoles(
|
||||
interaction: ChatInputCommandInteraction,
|
||||
interaction: ChatInputCommandInteraction
|
||||
): Promise<void> {
|
||||
const discordMember = interaction.member as GuildMember
|
||||
const embedColor = Number(color.replace("#", "0x"))
|
||||
@@ -19,9 +19,9 @@ export default async function updateDiscordRoles(
|
||||
{
|
||||
description:
|
||||
"You do not have permission to use this command.",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
})
|
||||
return
|
||||
}
|
||||
@@ -32,9 +32,9 @@ export default async function updateDiscordRoles(
|
||||
members.map(member => {
|
||||
return {
|
||||
id: member.id,
|
||||
member: member,
|
||||
member: member
|
||||
}
|
||||
}),
|
||||
})
|
||||
)
|
||||
|
||||
const guildData = (await getGuild(hypixelGuildID, "id")) as GuildData
|
||||
@@ -42,7 +42,7 @@ export default async function updateDiscordRoles(
|
||||
const hypixelGuildMembers = guildData.members.map(gmember => {
|
||||
return {
|
||||
uuid: gmember.uuid,
|
||||
rank: gmember.rank,
|
||||
rank: gmember.rank
|
||||
}
|
||||
})
|
||||
const guildMemberIDs = hypixelGuildMembers.map(gmember => gmember.uuid)
|
||||
@@ -54,7 +54,7 @@ export default async function updateDiscordRoles(
|
||||
const verifiedUsers = allVerifiedUsers.map(user => {
|
||||
return {
|
||||
userID: user.userID,
|
||||
uuid: user.uuid,
|
||||
uuid: user.uuid
|
||||
}
|
||||
})
|
||||
|
||||
@@ -62,21 +62,21 @@ export default async function updateDiscordRoles(
|
||||
embeds: [
|
||||
{
|
||||
description: `Updating roles for ${guildMembers.length} members...`,
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
for (const gmember of guildMembers) {
|
||||
const memberData = verifiedUsers.find(
|
||||
user => user.userID === gmember.id,
|
||||
user => user.userID === gmember.id
|
||||
)
|
||||
|
||||
if (!memberData) {
|
||||
const rolesToremove = roleManage("default").rolesToRemove
|
||||
await gmember.member.roles.remove(
|
||||
rolesToremove,
|
||||
"Updating all discord members",
|
||||
"Updating all discord members"
|
||||
)
|
||||
continue
|
||||
}
|
||||
@@ -85,12 +85,12 @@ export default async function updateDiscordRoles(
|
||||
const rolesToremove = roleManage("default").rolesToRemove
|
||||
await gmember.member.roles.remove(
|
||||
rolesToremove,
|
||||
"Updating all discord members",
|
||||
"Updating all discord members"
|
||||
)
|
||||
continue
|
||||
} else if (guildMemberIDs.includes(memberData!.uuid)) {
|
||||
const guildMemberRank = hypixelGuildMembers.find(
|
||||
gmember => gmember.uuid === memberData!.uuid,
|
||||
gmember => gmember.uuid === memberData!.uuid
|
||||
)!.rank
|
||||
console.log("Updating roles for " + gmember.member.user.username)
|
||||
|
||||
@@ -103,11 +103,11 @@ export default async function updateDiscordRoles(
|
||||
const rolesmanage = roleManage("gm")
|
||||
gmember.member.roles.remove(
|
||||
rolesmanage.rolesToRemove,
|
||||
"Updating all discord members",
|
||||
"Updating all discord members"
|
||||
)
|
||||
gmember.member.roles.add(
|
||||
rolesmanage.rolesToAdd,
|
||||
"Updating all discord members",
|
||||
"Updating all discord members"
|
||||
)
|
||||
continue
|
||||
} else if (guildMemberRank === "Manager") {
|
||||
@@ -119,11 +119,11 @@ export default async function updateDiscordRoles(
|
||||
const rolesmanage = roleManage("manager")
|
||||
gmember.member.roles.remove(
|
||||
rolesmanage.rolesToRemove,
|
||||
"Updating all discord members",
|
||||
"Updating all discord members"
|
||||
)
|
||||
gmember.member.roles.add(
|
||||
rolesmanage.rolesToAdd,
|
||||
"Updating all discord members",
|
||||
"Updating all discord members"
|
||||
)
|
||||
continue
|
||||
} else if (guildMemberRank === "Moderator") {
|
||||
@@ -135,11 +135,11 @@ export default async function updateDiscordRoles(
|
||||
const rolesmanage = roleManage("moderator")
|
||||
gmember.member.roles.remove(
|
||||
rolesmanage.rolesToRemove,
|
||||
"Updating all discord members",
|
||||
"Updating all discord members"
|
||||
)
|
||||
gmember.member.roles.add(
|
||||
rolesmanage.rolesToAdd,
|
||||
"Updating all discord members",
|
||||
"Updating all discord members"
|
||||
)
|
||||
continue
|
||||
} else if (guildMemberRank === "Beast") {
|
||||
@@ -150,11 +150,11 @@ export default async function updateDiscordRoles(
|
||||
const rolesmanage = roleManage("beast")
|
||||
gmember.member.roles.remove(
|
||||
rolesmanage.rolesToRemove,
|
||||
"Updating all discord members",
|
||||
"Updating all discord members"
|
||||
)
|
||||
gmember.member.roles.add(
|
||||
rolesmanage.rolesToAdd,
|
||||
"Updating all discord members",
|
||||
"Updating all discord members"
|
||||
)
|
||||
continue
|
||||
} else if (guildMemberRank === "Elite") {
|
||||
@@ -165,11 +165,11 @@ export default async function updateDiscordRoles(
|
||||
const rolesmanage = roleManage("elite")
|
||||
gmember.member.roles.remove(
|
||||
rolesmanage.rolesToRemove,
|
||||
"Updating all discord members",
|
||||
"Updating all discord members"
|
||||
)
|
||||
gmember.member.roles.add(
|
||||
rolesmanage.rolesToAdd,
|
||||
"Updating all discord members",
|
||||
"Updating all discord members"
|
||||
)
|
||||
continue
|
||||
} else if (guildMemberRank === "Member") {
|
||||
@@ -180,11 +180,11 @@ export default async function updateDiscordRoles(
|
||||
const rolesmanage = roleManage("member")
|
||||
gmember.member.roles.remove(
|
||||
rolesmanage.rolesToRemove,
|
||||
"Updating all discord members",
|
||||
"Updating all discord members"
|
||||
)
|
||||
gmember.member.roles.add(
|
||||
rolesmanage.rolesToAdd,
|
||||
"Updating all discord members",
|
||||
"Updating all discord members"
|
||||
)
|
||||
continue
|
||||
}
|
||||
@@ -198,8 +198,8 @@ export default async function updateDiscordRoles(
|
||||
embeds: [
|
||||
{
|
||||
description: "Successfully updated all roles.",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
})
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ import {
|
||||
PermissionFlagsBits,
|
||||
userMention,
|
||||
ChatInputCommandInteraction,
|
||||
GuildMember,
|
||||
GuildMember
|
||||
} from "discord.js"
|
||||
import { color, devMessage } from "config/options.json"
|
||||
import { Command } from "interfaces"
|
||||
@@ -23,18 +23,18 @@ export = {
|
||||
option
|
||||
.setName("user")
|
||||
.setDescription("The user to timeout")
|
||||
.setRequired(true),
|
||||
.setRequired(true)
|
||||
)
|
||||
.addStringOption(option =>
|
||||
option
|
||||
.setName("time")
|
||||
.setDescription("The time to timeout the user for")
|
||||
.setRequired(true),
|
||||
.setRequired(true)
|
||||
)
|
||||
.addStringOption(option =>
|
||||
option
|
||||
.setName("reason")
|
||||
.setDescription("The reason for the timeout"),
|
||||
.setDescription("The reason for the timeout")
|
||||
)
|
||||
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
|
||||
.setDMPermission(false),
|
||||
@@ -57,9 +57,9 @@ export = {
|
||||
embeds: [
|
||||
{
|
||||
description: "You cannot timeout a bot.",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
})
|
||||
return
|
||||
}
|
||||
@@ -69,9 +69,9 @@ export = {
|
||||
embeds: [
|
||||
{
|
||||
description: "You cannot timeout the server owner.",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
})
|
||||
return
|
||||
}
|
||||
@@ -85,9 +85,9 @@ export = {
|
||||
{
|
||||
description:
|
||||
"I cannot timeout this user because their role is higher than mine.",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
})
|
||||
return
|
||||
}
|
||||
@@ -98,9 +98,9 @@ export = {
|
||||
{
|
||||
description:
|
||||
"You cannot timeout this user because their role is higher than yours.",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
})
|
||||
return
|
||||
}
|
||||
@@ -110,9 +110,9 @@ export = {
|
||||
embeds: [
|
||||
{
|
||||
description: "You cannot timeout yourself.",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
})
|
||||
return
|
||||
}
|
||||
@@ -159,7 +159,7 @@ export = {
|
||||
{
|
||||
author: {
|
||||
name: mod.user.username,
|
||||
icon_url: mod.user.avatarURL() || undefined,
|
||||
icon_url: mod.user.avatarURL() || undefined
|
||||
},
|
||||
title: title,
|
||||
description: `
|
||||
@@ -170,15 +170,15 @@ export = {
|
||||
`,
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: mod.user.avatarURL() || "",
|
||||
url: mod.user.avatarURL() || ""
|
||||
},
|
||||
footer: {
|
||||
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({
|
||||
@@ -188,10 +188,10 @@ export = {
|
||||
color: embedColor,
|
||||
footer: {
|
||||
text: interaction.guild!.name + " | " + devMessage,
|
||||
icon_url: interaction.guild!.iconURL() || undefined,
|
||||
},
|
||||
},
|
||||
],
|
||||
icon_url: interaction.guild!.iconURL() || undefined
|
||||
}
|
||||
}
|
||||
]
|
||||
})
|
||||
},
|
||||
}
|
||||
} as Command
|
||||
|
||||
@@ -2,7 +2,7 @@ import {
|
||||
SlashCommandBuilder,
|
||||
PermissionFlagsBits,
|
||||
userMention,
|
||||
User,
|
||||
User
|
||||
} from "discord.js"
|
||||
import { color, devMessage } from "config/options.json"
|
||||
import { Command } from "interfaces"
|
||||
@@ -22,13 +22,13 @@ export = {
|
||||
.setName("user")
|
||||
.setDescription("The user to unban")
|
||||
.setAutocomplete(true)
|
||||
.setRequired(true),
|
||||
.setRequired(true)
|
||||
)
|
||||
.addStringOption(option =>
|
||||
option
|
||||
.setName("reason")
|
||||
.setDescription("The reason for unbanning the user")
|
||||
.setRequired(false),
|
||||
.setRequired(false)
|
||||
)
|
||||
.setDefaultMemberPermissions(PermissionFlagsBits.BanMembers)
|
||||
.setDMPermission(false),
|
||||
@@ -48,9 +48,9 @@ export = {
|
||||
embeds: [
|
||||
{
|
||||
description: "You haven't specified a user to unban",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
})
|
||||
return
|
||||
}
|
||||
@@ -62,9 +62,9 @@ export = {
|
||||
embeds: [
|
||||
{
|
||||
description: "The user you specified is not valid",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
})
|
||||
return
|
||||
}
|
||||
@@ -76,7 +76,7 @@ export = {
|
||||
{
|
||||
author: {
|
||||
name: mod.username,
|
||||
icon_url: mod.avatarURL() || undefined,
|
||||
icon_url: mod.avatarURL() || undefined
|
||||
},
|
||||
title: "Member Unbanned",
|
||||
description: `
|
||||
@@ -86,15 +86,15 @@ export = {
|
||||
`,
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: mod.avatarURL() || "",
|
||||
url: mod.avatarURL() || ""
|
||||
},
|
||||
footer: {
|
||||
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({
|
||||
@@ -112,14 +112,14 @@ export = {
|
||||
userMention(mod.id),
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: user!.avatarURL() || "",
|
||||
url: user!.avatarURL() || ""
|
||||
},
|
||||
footer: {
|
||||
icon_url: interaction.guild!.iconURL() || undefined,
|
||||
text: interaction.guild!.name + " | " + devMessage,
|
||||
},
|
||||
},
|
||||
],
|
||||
text: interaction.guild!.name + " | " + devMessage
|
||||
}
|
||||
}
|
||||
]
|
||||
})
|
||||
},
|
||||
}
|
||||
} as Command
|
||||
|
||||
@@ -32,10 +32,10 @@ export = {
|
||||
color: embedColor,
|
||||
footer: {
|
||||
text: interaction.guild!.name + " | " + devMessage,
|
||||
icon_url: interaction.guild!.iconURL() || undefined,
|
||||
},
|
||||
},
|
||||
],
|
||||
icon_url: interaction.guild!.iconURL() || undefined
|
||||
}
|
||||
}
|
||||
]
|
||||
})
|
||||
return
|
||||
}
|
||||
@@ -44,9 +44,9 @@ export = {
|
||||
embeds: [
|
||||
{
|
||||
description: "Fetching your guild data...",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
const guild = await getGuild(verifyData.uuid)
|
||||
@@ -63,11 +63,11 @@ export = {
|
||||
const roles = roleManage("default")
|
||||
await user.roles.remove(
|
||||
roles.rolesToRemove,
|
||||
"User used the update command",
|
||||
"User used the update command"
|
||||
)
|
||||
await user.roles.add(
|
||||
roles.rolesToAdd,
|
||||
"User used the update command",
|
||||
"User used the update command"
|
||||
)
|
||||
|
||||
await interaction.editReply({
|
||||
@@ -76,14 +76,14 @@ export = {
|
||||
description: "Updated your roles to `Default Member`",
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: head!,
|
||||
url: head!
|
||||
},
|
||||
footer: {
|
||||
text: interaction.guild!.name + " | " + devMessage,
|
||||
icon_url: interaction.guild!.iconURL() || undefined,
|
||||
},
|
||||
},
|
||||
],
|
||||
icon_url: interaction.guild!.iconURL() || undefined
|
||||
}
|
||||
}
|
||||
]
|
||||
})
|
||||
return
|
||||
}
|
||||
@@ -91,24 +91,24 @@ export = {
|
||||
if (guildID === hypixelGuildID) {
|
||||
const GuildMembers = guild!.members
|
||||
const guildRank = GuildMembers.find(
|
||||
member => member.uuid === verifyData.uuid,
|
||||
member => member.uuid === verifyData.uuid
|
||||
)!.rank
|
||||
let replyRank: string | null = null
|
||||
|
||||
await user.roles.add(
|
||||
roleManage("default").rolesToAdd,
|
||||
"User used the update command",
|
||||
"User used the update command"
|
||||
)
|
||||
|
||||
if (guildRank === "Guild Master") {
|
||||
const roles = roleManage("gm")
|
||||
await user.roles.remove(
|
||||
roles.rolesToRemove,
|
||||
"User used the update command",
|
||||
"User used the update command"
|
||||
)
|
||||
await user.roles.add(
|
||||
roles.rolesToAdd,
|
||||
"User used the update command",
|
||||
"User used the update command"
|
||||
)
|
||||
replyRank = "Guild Master"
|
||||
}
|
||||
@@ -117,11 +117,11 @@ export = {
|
||||
const roles = roleManage("manager")
|
||||
await user.roles.remove(
|
||||
roles.rolesToRemove,
|
||||
"User used the update command",
|
||||
"User used the update command"
|
||||
)
|
||||
await user.roles.add(
|
||||
roles.rolesToAdd,
|
||||
"User used the update command",
|
||||
"User used the update command"
|
||||
)
|
||||
replyRank = "Manager"
|
||||
}
|
||||
@@ -130,11 +130,11 @@ export = {
|
||||
const roles = roleManage("moderator")
|
||||
await user.roles.remove(
|
||||
roles.rolesToRemove,
|
||||
"User used the update command",
|
||||
"User used the update command"
|
||||
)
|
||||
await user.roles.add(
|
||||
roles.rolesToAdd,
|
||||
"User used the update command",
|
||||
"User used the update command"
|
||||
)
|
||||
replyRank = "Moderator"
|
||||
}
|
||||
@@ -143,11 +143,11 @@ export = {
|
||||
const roles = roleManage("beast")
|
||||
await user.roles.remove(
|
||||
roles.rolesToRemove,
|
||||
"User used the update command",
|
||||
"User used the update command"
|
||||
)
|
||||
await user.roles.add(
|
||||
roles.rolesToAdd,
|
||||
"User used the update command",
|
||||
"User used the update command"
|
||||
)
|
||||
replyRank = "Beast"
|
||||
}
|
||||
@@ -156,11 +156,11 @@ export = {
|
||||
const roles = roleManage("elite")
|
||||
await user.roles.remove(
|
||||
roles.rolesToRemove,
|
||||
"User used the update command",
|
||||
"User used the update command"
|
||||
)
|
||||
await user.roles.add(
|
||||
roles.rolesToAdd,
|
||||
"User used the update command",
|
||||
"User used the update command"
|
||||
)
|
||||
replyRank = "Elite"
|
||||
}
|
||||
@@ -169,11 +169,11 @@ export = {
|
||||
const roles = roleManage("member")
|
||||
await user.roles.remove(
|
||||
roles.rolesToRemove,
|
||||
"User used the update command",
|
||||
"User used the update command"
|
||||
)
|
||||
await user.roles.add(
|
||||
roles.rolesToAdd,
|
||||
"User used the update command",
|
||||
"User used the update command"
|
||||
)
|
||||
replyRank = "Member"
|
||||
}
|
||||
@@ -185,15 +185,15 @@ export = {
|
||||
"Updated your roles to `" + replyRank + "`",
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: head!,
|
||||
url: head!
|
||||
},
|
||||
footer: {
|
||||
text: interaction.guild!.name + " | " + devMessage,
|
||||
icon_url: interaction.guild!.iconURL() || undefined,
|
||||
},
|
||||
},
|
||||
],
|
||||
icon_url: interaction.guild!.iconURL() || undefined
|
||||
}
|
||||
}
|
||||
]
|
||||
})
|
||||
}
|
||||
},
|
||||
}
|
||||
} as Command
|
||||
|
||||
@@ -16,7 +16,7 @@ export = {
|
||||
option
|
||||
.setName("ign")
|
||||
.setDescription("Player's name")
|
||||
.setRequired(true),
|
||||
.setRequired(true)
|
||||
)
|
||||
.setDMPermission(false),
|
||||
|
||||
@@ -35,9 +35,9 @@ export = {
|
||||
embeds: [
|
||||
{
|
||||
description: "That player doesn't exist!",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
})
|
||||
return
|
||||
}
|
||||
@@ -55,14 +55,14 @@ export = {
|
||||
"`",
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: head!,
|
||||
url: head!
|
||||
},
|
||||
footer: {
|
||||
text: interaction.guild!.name + " | " + devMessage,
|
||||
icon_url: interaction.guild!.iconURL() || undefined,
|
||||
},
|
||||
},
|
||||
],
|
||||
icon_url: interaction.guild!.iconURL() || undefined
|
||||
}
|
||||
}
|
||||
]
|
||||
})
|
||||
},
|
||||
}
|
||||
} as Command
|
||||
|
||||
@@ -21,7 +21,7 @@ export = {
|
||||
option
|
||||
.setName("ign")
|
||||
.setDescription("Your in-game name.")
|
||||
.setRequired(true),
|
||||
.setRequired(true)
|
||||
)
|
||||
.setDMPermission(false),
|
||||
|
||||
@@ -36,7 +36,7 @@ export = {
|
||||
if (verifyData) {
|
||||
interaction.editReply(
|
||||
"You are already verified.\n" +
|
||||
"Try running /update to update your roles.",
|
||||
"Try running /update to update your roles."
|
||||
)
|
||||
return
|
||||
}
|
||||
@@ -47,9 +47,9 @@ export = {
|
||||
{
|
||||
description:
|
||||
"<a:cross_a:1087808606897983539> Please provide your in-game name.",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
})
|
||||
return
|
||||
}
|
||||
@@ -58,9 +58,9 @@ export = {
|
||||
embeds: [
|
||||
{
|
||||
description: "Fetching your uuid...",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
const uuid = await getUUID(ign)
|
||||
@@ -70,9 +70,9 @@ export = {
|
||||
{
|
||||
description:
|
||||
"<a:questionmark_pink:1130206038008803488> That player does not exist.",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
})
|
||||
return
|
||||
}
|
||||
@@ -81,9 +81,9 @@ export = {
|
||||
embeds: [
|
||||
{
|
||||
description: "Fetching your player data...",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
const head = await getHeadURL(ign)
|
||||
@@ -94,9 +94,9 @@ export = {
|
||||
{
|
||||
description:
|
||||
"<a:questionmark_pink:1130206038008803488> That player hasn't played Hypixel before.",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
})
|
||||
return
|
||||
}
|
||||
@@ -112,9 +112,9 @@ export = {
|
||||
embeds: [
|
||||
{
|
||||
description: "Checking your Discord tag...",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
const linkedDiscord = player?.socialMedia?.links?.DISCORD || null
|
||||
@@ -129,9 +129,9 @@ export = {
|
||||
"**Please set your Discord tag on hypixel to `" +
|
||||
username +
|
||||
"` and try again.**",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
})
|
||||
return
|
||||
}
|
||||
@@ -149,9 +149,9 @@ export = {
|
||||
"**Please set your Discord tag on hypixel to `" +
|
||||
username +
|
||||
"` and try again.**",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
})
|
||||
return
|
||||
}
|
||||
@@ -160,9 +160,9 @@ export = {
|
||||
embeds: [
|
||||
{
|
||||
description: "Fetching your guild data...",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
const guild = (await getGuild(uuid)) as GuildData | null
|
||||
@@ -176,7 +176,7 @@ export = {
|
||||
if (guildID === hypixelGuildID) {
|
||||
const GuildMembers = guild!.members
|
||||
const guildRank = GuildMembers.find(
|
||||
member => member.uuid === player.uuid,
|
||||
member => member.uuid === player.uuid
|
||||
)!.rank
|
||||
|
||||
if (guildRank === "Guild Master") {
|
||||
@@ -215,7 +215,7 @@ export = {
|
||||
const newVerify = new verify({
|
||||
_id: new mongoose.Types.ObjectId(),
|
||||
userID: user.id,
|
||||
uuid: uuid,
|
||||
uuid: uuid
|
||||
})
|
||||
|
||||
await newVerify.save()
|
||||
@@ -232,14 +232,14 @@ export = {
|
||||
"`.",
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: head!,
|
||||
url: head!
|
||||
},
|
||||
footer: {
|
||||
icon_url: interaction.guild!.iconURL() || undefined,
|
||||
text: interaction.guild!.name + " | " + devMessage,
|
||||
},
|
||||
},
|
||||
],
|
||||
text: interaction.guild!.name + " | " + devMessage
|
||||
}
|
||||
}
|
||||
]
|
||||
})
|
||||
},
|
||||
}
|
||||
} as Command
|
||||
|
||||
@@ -27,9 +27,9 @@ export = {
|
||||
embeds: [
|
||||
{
|
||||
description: "You are not verified!",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
})
|
||||
return
|
||||
}
|
||||
@@ -49,14 +49,14 @@ export = {
|
||||
"`",
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: head!,
|
||||
url: head!
|
||||
},
|
||||
footer: {
|
||||
text: interaction.guild!.name + " | " + devMessage,
|
||||
icon_url: interaction.guild!.iconURL() || undefined,
|
||||
},
|
||||
},
|
||||
],
|
||||
icon_url: interaction.guild!.iconURL() || undefined
|
||||
}
|
||||
}
|
||||
]
|
||||
})
|
||||
},
|
||||
}
|
||||
} as Command
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import {
|
||||
SlashCommandBuilder,
|
||||
PermissionFlagsBits,
|
||||
userMention,
|
||||
userMention
|
||||
} from "discord.js"
|
||||
import { getIGN, getHeadURL } from "utils/Hypixel"
|
||||
import { color, devMessage } from "config/options.json"
|
||||
@@ -21,7 +21,7 @@ export = {
|
||||
option
|
||||
.setName("user")
|
||||
.setDescription("The user to get the ign of.")
|
||||
.setRequired(true),
|
||||
.setRequired(true)
|
||||
)
|
||||
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
|
||||
.setDMPermission(false),
|
||||
@@ -35,7 +35,7 @@ export = {
|
||||
const verifiedUser = await verify.findOne({ userID: user.id })
|
||||
if (!verifiedUser) {
|
||||
interaction.editReply({
|
||||
content: "This user has not verified their account.",
|
||||
content: "This user has not verified their account."
|
||||
})
|
||||
return
|
||||
}
|
||||
@@ -54,14 +54,14 @@ export = {
|
||||
ign,
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: head!,
|
||||
url: head!
|
||||
},
|
||||
footer: {
|
||||
text: interaction.guild!.name + " | " + devMessage,
|
||||
icon_url: interaction.guild!.iconURL() || undefined,
|
||||
},
|
||||
},
|
||||
],
|
||||
icon_url: interaction.guild!.iconURL() || undefined
|
||||
}
|
||||
}
|
||||
]
|
||||
})
|
||||
},
|
||||
}
|
||||
} as Command
|
||||
|
||||
@@ -12,8 +12,8 @@ export = {
|
||||
await interaction.respond([
|
||||
{
|
||||
name: "Please start typing a username to unban",
|
||||
value: "none",
|
||||
},
|
||||
value: "none"
|
||||
}
|
||||
])
|
||||
return
|
||||
}
|
||||
@@ -22,16 +22,16 @@ export = {
|
||||
const filteredUsers = bannedUsers.filter(user =>
|
||||
user.user.username
|
||||
.toLowerCase()
|
||||
.includes(focusedOption.value.toLowerCase()),
|
||||
.includes(focusedOption.value.toLowerCase())
|
||||
)
|
||||
|
||||
const results = filteredUsers.map(user => ({
|
||||
name: user.user.username,
|
||||
value: user.user.id,
|
||||
value: user.user.id
|
||||
}))
|
||||
|
||||
await interaction.respond(results.slice(0, 25)).catch(err => {
|
||||
console.log(err)
|
||||
})
|
||||
},
|
||||
}
|
||||
} as Autocomplete
|
||||
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
swstars,
|
||||
swkdr,
|
||||
duelswins,
|
||||
duelswlr,
|
||||
duelswlr
|
||||
} from "config/reqs.json"
|
||||
import {
|
||||
hypixelLevel,
|
||||
@@ -15,7 +15,7 @@ import {
|
||||
skywarsLevel,
|
||||
getPlayer,
|
||||
getGuild,
|
||||
getHeadURL,
|
||||
getHeadURL
|
||||
} from "utils/Hypixel"
|
||||
import { Button } from "interfaces"
|
||||
|
||||
@@ -40,9 +40,9 @@ export = {
|
||||
{
|
||||
description:
|
||||
"That player hasn't played Hypixel before.",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
})
|
||||
return
|
||||
}
|
||||
@@ -93,7 +93,7 @@ export = {
|
||||
if (!player.stats) {
|
||||
statsFields.push({
|
||||
name: "<a:_warning:1178350183457751100> This player never played any games.",
|
||||
value: "**➺ Stats:** `None`",
|
||||
value: "**➺ Stats:** `None`"
|
||||
})
|
||||
} else {
|
||||
if (player.stats.Bedwars) {
|
||||
@@ -134,7 +134,7 @@ export = {
|
||||
hsbwwins.toString() +
|
||||
" / " +
|
||||
bwwins.toString() +
|
||||
"`",
|
||||
"`"
|
||||
})
|
||||
}
|
||||
|
||||
@@ -170,7 +170,7 @@ export = {
|
||||
"`\n" +
|
||||
"**➺ Wins:** `" +
|
||||
hsswwins.toString() +
|
||||
"`",
|
||||
"`"
|
||||
})
|
||||
}
|
||||
|
||||
@@ -206,7 +206,7 @@ export = {
|
||||
"`\n" +
|
||||
"**➺ KDR:** `" +
|
||||
hsduelskd.toFixed(2).toString() +
|
||||
"`",
|
||||
"`"
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -231,15 +231,15 @@ export = {
|
||||
"`",
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: head!,
|
||||
url: head!
|
||||
},
|
||||
footer: {
|
||||
text: interaction.guild!.name + " | " + devMessage,
|
||||
icon_url: interaction.guild!.iconURL() || undefined,
|
||||
icon_url: interaction.guild!.iconURL() || undefined
|
||||
},
|
||||
fields: statsFields,
|
||||
},
|
||||
],
|
||||
fields: statsFields
|
||||
}
|
||||
]
|
||||
})
|
||||
},
|
||||
}
|
||||
} as Button
|
||||
|
||||
@@ -2,13 +2,13 @@ import {
|
||||
ActionRowBuilder,
|
||||
ButtonStyle,
|
||||
ButtonBuilder,
|
||||
TextChannel,
|
||||
TextChannel
|
||||
} from "discord.js"
|
||||
import {
|
||||
color,
|
||||
waitingListChannel,
|
||||
waitingListMessage,
|
||||
hypixelGuildID,
|
||||
hypixelGuildID
|
||||
} from "config/options.json"
|
||||
import colorLog from "utils/functions/colors"
|
||||
import mongoose from "mongoose"
|
||||
@@ -55,9 +55,9 @@ export = {
|
||||
.setCustomId("checkstats")
|
||||
.setLabel("Check Stats")
|
||||
.setStyle(ButtonStyle.Secondary)
|
||||
.setDisabled(true),
|
||||
),
|
||||
],
|
||||
.setDisabled(true)
|
||||
)
|
||||
]
|
||||
})
|
||||
|
||||
await applicant.send({
|
||||
@@ -66,9 +66,9 @@ export = {
|
||||
description:
|
||||
"Your application for the Illegitimate guild has been accepted.\n\n" +
|
||||
"Make sure to leave your current guild so that we can invite you.",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
const applicantEntry = await guildapp.findOne({ userID: applicantId })
|
||||
@@ -80,7 +80,7 @@ export = {
|
||||
userID: applicantId,
|
||||
uuid: applicantUUID,
|
||||
IGN: applicantIGN,
|
||||
timestamp: time,
|
||||
timestamp: time
|
||||
})
|
||||
|
||||
await waitingListAdd.save()
|
||||
@@ -96,20 +96,20 @@ export = {
|
||||
"Application has been accepted by <@" + user.id + ">.",
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: applicant.avatarURL() || "",
|
||||
url: applicant.avatarURL() || ""
|
||||
},
|
||||
footer: {
|
||||
icon_url: guild.iconURL() || undefined,
|
||||
text: "ID: " + applicant.id,
|
||||
},
|
||||
},
|
||||
],
|
||||
text: "ID: " + applicant.id
|
||||
}
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
if (process.env.NODE_ENV === "dev") return
|
||||
try {
|
||||
const channel = guild.channels.cache.get(
|
||||
waitingListChannel,
|
||||
waitingListChannel
|
||||
) as TextChannel
|
||||
const wlmessage = await channel!.messages.fetch(waitingListMessage)
|
||||
|
||||
@@ -133,7 +133,7 @@ export = {
|
||||
|
||||
fields.push({
|
||||
name: `${i + 1}. ${accepted[i].IGN}`,
|
||||
value: `TS: <t:${timestamp}:R>`,
|
||||
value: `TS: <t:${timestamp}:R>`
|
||||
})
|
||||
}
|
||||
|
||||
@@ -145,18 +145,18 @@ export = {
|
||||
color: wlembed.color!,
|
||||
footer: {
|
||||
text: "Last updated by " + user.username,
|
||||
icon_url: user.avatarURL() || undefined,
|
||||
icon_url: user.avatarURL() || undefined
|
||||
},
|
||||
thumbnail: wlembed.thumbnail!,
|
||||
fields: fields,
|
||||
timestamp: new Date().toISOString(),
|
||||
},
|
||||
],
|
||||
timestamp: new Date().toISOString()
|
||||
}
|
||||
]
|
||||
})
|
||||
} catch (err) {
|
||||
console.log(
|
||||
colorLog("Error while trying to update waiting list.", "red"),
|
||||
colorLog("Error while trying to update waiting list.", "red")
|
||||
)
|
||||
}
|
||||
},
|
||||
}
|
||||
} as Button
|
||||
|
||||
@@ -2,7 +2,7 @@ import {
|
||||
ModalBuilder,
|
||||
ActionRowBuilder,
|
||||
TextInputBuilder,
|
||||
TextInputStyle,
|
||||
TextInputStyle
|
||||
} from "discord.js"
|
||||
import { Button } from "interfaces"
|
||||
|
||||
@@ -21,11 +21,11 @@ export = {
|
||||
.setCustomId("denyreason")
|
||||
.setStyle(TextInputStyle.Paragraph)
|
||||
.setPlaceholder(
|
||||
"Enter a reason for denying the application",
|
||||
"Enter a reason for denying the application"
|
||||
)
|
||||
.setRequired(false)
|
||||
)
|
||||
.setRequired(false),
|
||||
),
|
||||
)
|
||||
await interaction.showModal(modal)
|
||||
},
|
||||
}
|
||||
} as Button
|
||||
|
||||
@@ -4,7 +4,7 @@ import {
|
||||
ActionRowBuilder,
|
||||
EmbedBuilder,
|
||||
GuildMember,
|
||||
TextChannel,
|
||||
TextChannel
|
||||
} from "discord.js"
|
||||
import { color } from "config/options.json"
|
||||
import { largeM, smallM, ignM } from "config/limitmessages.json"
|
||||
@@ -40,7 +40,7 @@ export = {
|
||||
|
||||
if (userRoles.includes(guildRole)) {
|
||||
await interaction.editReply(
|
||||
"You are already a member of the guild.",
|
||||
"You are already a member of the guild."
|
||||
)
|
||||
return
|
||||
}
|
||||
@@ -49,7 +49,7 @@ export = {
|
||||
|
||||
if (application) {
|
||||
await interaction.editReply(
|
||||
"You already have an application in progress.",
|
||||
"You already have an application in progress."
|
||||
)
|
||||
return
|
||||
}
|
||||
@@ -62,7 +62,7 @@ export = {
|
||||
.setColor(embedColor)
|
||||
const attachments = new EmbedBuilder()
|
||||
.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)
|
||||
|
||||
@@ -75,9 +75,9 @@ export = {
|
||||
"If you wish to proceed with your application, please type `yes` otherwise type `cancel`.\n\n" +
|
||||
"**Do not upload images, videos, or GIFS.**\n" +
|
||||
"You have a minute to respond to this message.",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
})
|
||||
} catch (error) {
|
||||
await interaction.editReply("Please enable your DMs.")
|
||||
@@ -89,7 +89,7 @@ export = {
|
||||
const input = await user.dmChannel!.awaitMessages({
|
||||
filter: m => m.author.id === user.user.id,
|
||||
max: 1,
|
||||
time: 1000 * 60,
|
||||
time: 1000 * 60
|
||||
})
|
||||
if (input.size === 0) {
|
||||
await user.send({ embeds: [tooLong] })
|
||||
@@ -116,15 +116,15 @@ export = {
|
||||
"`",
|
||||
color: embedColor,
|
||||
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({
|
||||
filter: m => m.author.id === user.user.id,
|
||||
max: 1,
|
||||
time: 1000 * 60 * 5,
|
||||
time: 1000 * 60 * 5
|
||||
})
|
||||
if (answer1.size === 0) {
|
||||
await user.send({ embeds: [tooLong] })
|
||||
@@ -143,9 +143,9 @@ export = {
|
||||
embeds: [
|
||||
{
|
||||
description: "Max character limit is 16.",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
})
|
||||
return
|
||||
}
|
||||
@@ -157,9 +157,9 @@ export = {
|
||||
description:
|
||||
"That is not a valid Minecraft username.\n" +
|
||||
"Application cancelled.",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
})
|
||||
return
|
||||
}
|
||||
@@ -176,15 +176,15 @@ export = {
|
||||
"`(8 characters max)`",
|
||||
color: embedColor,
|
||||
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({
|
||||
filter: m => m.author.id === user.user.id,
|
||||
max: 1,
|
||||
time: 1000 * 60 * 15,
|
||||
time: 1000 * 60 * 15
|
||||
})
|
||||
if (answer2.size === 0) {
|
||||
await user.send({ embeds: [tooLong] })
|
||||
@@ -203,9 +203,9 @@ export = {
|
||||
embeds: [
|
||||
{
|
||||
description: "Max character limit is 8.",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
})
|
||||
return
|
||||
}
|
||||
@@ -223,15 +223,15 @@ export = {
|
||||
"`",
|
||||
color: embedColor,
|
||||
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({
|
||||
filter: m => m.author.id === user.user.id,
|
||||
max: 1,
|
||||
time: 1000 * 60 * 15,
|
||||
time: 1000 * 60 * 15
|
||||
})
|
||||
if (answer3.size === 0) {
|
||||
await user.send({ embeds: [tooLong] })
|
||||
@@ -250,9 +250,9 @@ export = {
|
||||
embeds: [
|
||||
{
|
||||
description: "Max character limit is 128.",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
})
|
||||
}
|
||||
const answer3_1 = answer3.first()!.content
|
||||
@@ -270,15 +270,15 @@ export = {
|
||||
"`",
|
||||
color: embedColor,
|
||||
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({
|
||||
filter: m => m.author.id === user.user.id,
|
||||
max: 1,
|
||||
time: 1000 * 60 * 15,
|
||||
time: 1000 * 60 * 15
|
||||
})
|
||||
if (answer4.size === 0) {
|
||||
await user.send({ embeds: [tooLong] })
|
||||
@@ -297,9 +297,9 @@ export = {
|
||||
embeds: [
|
||||
{
|
||||
description: "Max character limit is 256.",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
})
|
||||
}
|
||||
const answer4_1 = answer4.first()!.content
|
||||
@@ -316,15 +316,15 @@ export = {
|
||||
"`",
|
||||
color: embedColor,
|
||||
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({
|
||||
filter: m => m.author.id === user.user.id,
|
||||
max: 1,
|
||||
time: 1000 * 60 * 15,
|
||||
time: 1000 * 60 * 15
|
||||
})
|
||||
if (answer5.size === 0) {
|
||||
await user.send({ embeds: [tooLong] })
|
||||
@@ -343,9 +343,9 @@ export = {
|
||||
embeds: [
|
||||
{
|
||||
description: "Max character limit is 128.",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
})
|
||||
}
|
||||
const answer5_1 = answer5.first()!.content
|
||||
@@ -362,15 +362,15 @@ export = {
|
||||
"`",
|
||||
color: embedColor,
|
||||
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({
|
||||
filter: m => m.author.id === user.user.id,
|
||||
max: 1,
|
||||
time: 1000 * 60 * 15,
|
||||
time: 1000 * 60 * 15
|
||||
})
|
||||
if (answer6.size === 0) {
|
||||
await user.send({ embeds: [tooLong] })
|
||||
@@ -389,9 +389,9 @@ export = {
|
||||
embeds: [
|
||||
{
|
||||
description: "Max character limit is 256.",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
})
|
||||
}
|
||||
const answer6_1 = answer6.first()!.content
|
||||
@@ -408,15 +408,15 @@ export = {
|
||||
"`",
|
||||
color: embedColor,
|
||||
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({
|
||||
filter: m => m.author.id === user.user.id,
|
||||
max: 1,
|
||||
time: 1000 * 60 * 15,
|
||||
time: 1000 * 60 * 15
|
||||
})
|
||||
if (answer7.size === 0) {
|
||||
await user.send({ embeds: [tooLong] })
|
||||
@@ -435,9 +435,9 @@ export = {
|
||||
embeds: [
|
||||
{
|
||||
description: "Max character limit is 128.",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
})
|
||||
}
|
||||
const answer7_1 = answer7!.first()!.content
|
||||
@@ -453,15 +453,15 @@ export = {
|
||||
"`(64 characters max)`",
|
||||
color: embedColor,
|
||||
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({
|
||||
filter: m => m.author.id === user.user.id,
|
||||
max: 1,
|
||||
time: 1000 * 60 * 15,
|
||||
time: 1000 * 60 * 15
|
||||
})
|
||||
if (answer8.size === 0) {
|
||||
await user.send({ embeds: [tooLong] })
|
||||
@@ -480,9 +480,9 @@ export = {
|
||||
embeds: [
|
||||
{
|
||||
description: "Max character limit is 64.",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
})
|
||||
}
|
||||
const answer8_1 = answer8.first()!.content
|
||||
@@ -492,15 +492,15 @@ export = {
|
||||
{
|
||||
description:
|
||||
"If you want to submit your application, type `yes` if not, type `no`",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
const final = await user.dmChannel!.awaitMessages({
|
||||
filter: m => m.author.id === user.user.id,
|
||||
max: 1,
|
||||
time: 1000 * 60 * 5,
|
||||
time: 1000 * 60 * 5
|
||||
})
|
||||
if (final.size === 0) {
|
||||
await user.send({ embeds: [tooLong] })
|
||||
@@ -519,21 +519,21 @@ export = {
|
||||
embeds: [
|
||||
{
|
||||
description: "Your application has been submitted!",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
const newGuildApp = new guildapp({
|
||||
_id: new mongoose.Types.ObjectId(),
|
||||
userID: user.user.id,
|
||||
uuid: uuid,
|
||||
uuid: uuid
|
||||
})
|
||||
|
||||
await newGuildApp.save()
|
||||
|
||||
const channel = guild.channels.cache.get(
|
||||
applicationsChannel,
|
||||
applicationsChannel
|
||||
) as TextChannel
|
||||
await channel.send({
|
||||
embeds: [
|
||||
@@ -545,47 +545,47 @@ export = {
|
||||
" - Guild Application",
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: user.avatarURL() || "",
|
||||
url: user.avatarURL() || ""
|
||||
},
|
||||
fields: [
|
||||
{
|
||||
name: rq(1),
|
||||
value: "```" + answer1_1 + "```",
|
||||
value: "```" + answer1_1 + "```"
|
||||
},
|
||||
{
|
||||
name: rq(2),
|
||||
value: "```" + answer2_1 + "```",
|
||||
value: "```" + answer2_1 + "```"
|
||||
},
|
||||
{
|
||||
name: rq(3),
|
||||
value: "```" + answer3_1 + "```",
|
||||
value: "```" + answer3_1 + "```"
|
||||
},
|
||||
{
|
||||
name: rq(4),
|
||||
value: "```" + answer4_1 + "```",
|
||||
value: "```" + answer4_1 + "```"
|
||||
},
|
||||
{
|
||||
name: rq(5),
|
||||
value: "```" + answer5_1 + "```",
|
||||
value: "```" + answer5_1 + "```"
|
||||
},
|
||||
{
|
||||
name: rq(6),
|
||||
value: "```" + answer6_1 + "```",
|
||||
value: "```" + answer6_1 + "```"
|
||||
},
|
||||
{
|
||||
name: rq(7),
|
||||
value: "```" + answer7_1 + "```",
|
||||
value: "```" + answer7_1 + "```"
|
||||
},
|
||||
{
|
||||
name: rq(8),
|
||||
value: "```" + answer8_1 + "```",
|
||||
},
|
||||
value: "```" + answer8_1 + "```"
|
||||
}
|
||||
],
|
||||
footer: {
|
||||
icon_url: guild.iconURL() || "",
|
||||
text: "ID: " + user.user.id,
|
||||
},
|
||||
},
|
||||
text: "ID: " + user.user.id
|
||||
}
|
||||
}
|
||||
],
|
||||
components: [
|
||||
new ActionRowBuilder<ButtonBuilder>().addComponents(
|
||||
@@ -600,10 +600,10 @@ export = {
|
||||
new ButtonBuilder()
|
||||
.setCustomId("checkstats")
|
||||
.setLabel("Check Stats")
|
||||
.setStyle(ButtonStyle.Secondary),
|
||||
),
|
||||
],
|
||||
.setStyle(ButtonStyle.Secondary)
|
||||
)
|
||||
]
|
||||
})
|
||||
}
|
||||
},
|
||||
}
|
||||
} as Button
|
||||
|
||||
@@ -4,7 +4,7 @@ import {
|
||||
ButtonStyle,
|
||||
EmbedBuilder,
|
||||
GuildMember,
|
||||
TextChannel,
|
||||
TextChannel
|
||||
} from "discord.js"
|
||||
import {
|
||||
gm,
|
||||
@@ -13,7 +13,7 @@ import {
|
||||
beast,
|
||||
member,
|
||||
guildStaff,
|
||||
guildRole,
|
||||
guildRole
|
||||
} from "config/roles.json"
|
||||
import { ignM, smallM, largeM } from "config/limitmessages.json"
|
||||
import { inactivity } from "config/questions.json"
|
||||
@@ -26,7 +26,7 @@ const guildRoles = [
|
||||
beast,
|
||||
member,
|
||||
guildStaff,
|
||||
guildRole,
|
||||
guildRole
|
||||
]
|
||||
|
||||
module.exports = {
|
||||
@@ -43,7 +43,7 @@ module.exports = {
|
||||
if (!userRoles.some(role => guildRoles.includes(role.id))) {
|
||||
return await interaction.reply({
|
||||
content: "Only guild members can use this button.",
|
||||
ephemeral: true,
|
||||
ephemeral: true
|
||||
})
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ module.exports = {
|
||||
.setColor(embedColor)
|
||||
const attachments = new EmbedBuilder()
|
||||
.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)
|
||||
|
||||
@@ -78,26 +78,26 @@ module.exports = {
|
||||
"If you wish to proceed with your form, please type `yes`.\n\n" +
|
||||
"**Do not upload images, videos, or GIFS.**\n" +
|
||||
"You have a minute to respond to this message.",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
})
|
||||
} catch (error) {
|
||||
return await interaction.reply({
|
||||
content: "Please enable your DMs.",
|
||||
ephemeral: true,
|
||||
ephemeral: true
|
||||
})
|
||||
}
|
||||
|
||||
await interaction.reply({
|
||||
content: "Please check your DMs.",
|
||||
ephemeral: true,
|
||||
ephemeral: true
|
||||
})
|
||||
|
||||
const input = await user.dmChannel!.awaitMessages({
|
||||
filter: m => m.author.id === user.user.id,
|
||||
max: 1,
|
||||
time: 1000 * 60,
|
||||
time: 1000 * 60
|
||||
})
|
||||
if (input.first()!.attachments.size > 0) {
|
||||
await user.send({ embeds: [attachments] })
|
||||
@@ -123,16 +123,16 @@ module.exports = {
|
||||
"`",
|
||||
color: embedColor,
|
||||
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({
|
||||
filter: m => m.author.id === user.user.id,
|
||||
max: 1,
|
||||
time: 1000 * 60 * 5,
|
||||
time: 1000 * 60 * 5
|
||||
})
|
||||
if (answer1.first()!.attachments.size > 0) {
|
||||
await user.send({ embeds: [attachments] })
|
||||
@@ -143,9 +143,9 @@ module.exports = {
|
||||
embeds: [
|
||||
{
|
||||
description: "Max character limit is 16.",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
})
|
||||
return
|
||||
}
|
||||
@@ -158,9 +158,9 @@ module.exports = {
|
||||
description:
|
||||
"That is not a valid Minecraft username.\n" +
|
||||
"Application cancelled.",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
})
|
||||
return
|
||||
}
|
||||
@@ -185,15 +185,15 @@ module.exports = {
|
||||
"`",
|
||||
color: embedColor,
|
||||
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({
|
||||
filter: m => m.author.id === user.user.id,
|
||||
max: 1,
|
||||
time: 1000 * 60 * 5,
|
||||
time: 1000 * 60 * 5
|
||||
})
|
||||
if (answer2.first()!.attachments.size > 0) {
|
||||
await user.send({ embeds: [attachments] })
|
||||
@@ -204,9 +204,9 @@ module.exports = {
|
||||
embeds: [
|
||||
{
|
||||
description: "Max character limit is 128.",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
})
|
||||
return
|
||||
}
|
||||
@@ -231,15 +231,15 @@ module.exports = {
|
||||
"`",
|
||||
color: embedColor,
|
||||
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({
|
||||
filter: m => m.author.id === user.user.id,
|
||||
max: 1,
|
||||
time: 1000 * 60 * 15,
|
||||
time: 1000 * 60 * 15
|
||||
})
|
||||
if (answer3.first()!.attachments.size > 0) {
|
||||
await user.send({ embeds: [attachments] })
|
||||
@@ -250,9 +250,9 @@ module.exports = {
|
||||
embeds: [
|
||||
{
|
||||
description: "Max character limit is 256",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
})
|
||||
return
|
||||
}
|
||||
@@ -271,14 +271,14 @@ module.exports = {
|
||||
{
|
||||
description:
|
||||
"If you want to submit your application, type `yes` if not, type `no`",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
})
|
||||
const final = await user.dmChannel!.awaitMessages({
|
||||
filter: m => m.author.id === user.user.id,
|
||||
max: 1,
|
||||
time: 1000 * 60 * 5,
|
||||
time: 1000 * 60 * 5
|
||||
})
|
||||
if (final.first()!.attachments.size > 0) {
|
||||
await user.send({ embeds: [attachments] })
|
||||
@@ -297,13 +297,13 @@ module.exports = {
|
||||
embeds: [
|
||||
{
|
||||
description: "Your application has been submitted!",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
const appChannel = guild.channels.cache.get(
|
||||
inactivityLogChannel,
|
||||
inactivityLogChannel
|
||||
) as TextChannel
|
||||
|
||||
await appChannel.send({
|
||||
@@ -316,27 +316,27 @@ module.exports = {
|
||||
" - Inactivity Application",
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: user.avatarURL() || "",
|
||||
url: user.avatarURL() || ""
|
||||
},
|
||||
fields: [
|
||||
{
|
||||
name: rq(1),
|
||||
value: "`" + answer1_1 + "`",
|
||||
value: "`" + answer1_1 + "`"
|
||||
},
|
||||
{
|
||||
name: rq(2),
|
||||
value: "`" + answer2_1 + "`",
|
||||
value: "`" + answer2_1 + "`"
|
||||
},
|
||||
{
|
||||
name: rq(3),
|
||||
value: "`" + answer3_1 + "`",
|
||||
},
|
||||
value: "`" + answer3_1 + "`"
|
||||
}
|
||||
],
|
||||
footer: {
|
||||
icon_url: user.avatarURL() || undefined,
|
||||
text: "ID: " + user.user.id,
|
||||
},
|
||||
},
|
||||
text: "ID: " + user.user.id
|
||||
}
|
||||
}
|
||||
],
|
||||
components: [
|
||||
new ActionRowBuilder<ButtonBuilder>().addComponents(
|
||||
@@ -347,9 +347,9 @@ module.exports = {
|
||||
new ButtonBuilder()
|
||||
.setCustomId("inactiveapplicationdeny")
|
||||
.setLabel("Deny")
|
||||
.setStyle(ButtonStyle.Danger),
|
||||
),
|
||||
],
|
||||
.setStyle(ButtonStyle.Danger)
|
||||
)
|
||||
]
|
||||
})
|
||||
},
|
||||
}
|
||||
} as Button
|
||||
|
||||
@@ -7,7 +7,7 @@ export = {
|
||||
async execute(interaction) {
|
||||
await interaction.reply({
|
||||
content: "This button is currently disabled.",
|
||||
ephemeral: true,
|
||||
ephemeral: true
|
||||
})
|
||||
},
|
||||
}
|
||||
} as Button
|
||||
|
||||
@@ -7,7 +7,7 @@ export = {
|
||||
async execute(interaction) {
|
||||
await interaction.reply({
|
||||
content: "This button is currently disabled.",
|
||||
ephemeral: true,
|
||||
ephemeral: true
|
||||
})
|
||||
},
|
||||
}
|
||||
} as Button
|
||||
|
||||
@@ -27,9 +27,9 @@ export = {
|
||||
{
|
||||
description:
|
||||
"Your application for the Illegitimate staff team has been accepted.",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
await message.edit({
|
||||
@@ -44,9 +44,9 @@ export = {
|
||||
.setCustomId("staffapplicationdeny")
|
||||
.setLabel("Deny")
|
||||
.setStyle(ButtonStyle.Danger)
|
||||
.setDisabled(true),
|
||||
),
|
||||
],
|
||||
.setDisabled(true)
|
||||
)
|
||||
]
|
||||
})
|
||||
|
||||
await staffapp.findOneAndDelete({ userID: applicantId })
|
||||
@@ -58,14 +58,14 @@ export = {
|
||||
description: "Application accepted by <@" + user.id + ">.",
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: applicant.avatarURL() || "",
|
||||
url: applicant.avatarURL() || ""
|
||||
},
|
||||
footer: {
|
||||
icon_url: guild.iconURL() || undefined,
|
||||
text: "ID: " + applicantId,
|
||||
},
|
||||
},
|
||||
],
|
||||
text: "ID: " + applicantId
|
||||
}
|
||||
}
|
||||
]
|
||||
})
|
||||
},
|
||||
}
|
||||
} as Button
|
||||
|
||||
@@ -2,7 +2,7 @@ import {
|
||||
ModalBuilder,
|
||||
ActionRowBuilder,
|
||||
TextInputBuilder,
|
||||
TextInputStyle,
|
||||
TextInputStyle
|
||||
} from "discord.js"
|
||||
import { Button } from "interfaces"
|
||||
|
||||
@@ -21,11 +21,11 @@ export = {
|
||||
.setCustomId("staffdenyreason")
|
||||
.setStyle(TextInputStyle.Paragraph)
|
||||
.setPlaceholder(
|
||||
"Enter a reason for denying the application",
|
||||
"Enter a reason for denying the application"
|
||||
)
|
||||
.setRequired(false)
|
||||
)
|
||||
.setRequired(false),
|
||||
),
|
||||
)
|
||||
await interaction.showModal(modal)
|
||||
},
|
||||
}
|
||||
} as Button
|
||||
|
||||
@@ -4,7 +4,7 @@ import {
|
||||
ActionRowBuilder,
|
||||
EmbedBuilder,
|
||||
GuildMember,
|
||||
TextChannel,
|
||||
TextChannel
|
||||
} from "discord.js"
|
||||
import { color, staffApplicationsChannel } from "config/options.json"
|
||||
import { largeM, ignM } from "config/limitmessages.json"
|
||||
@@ -44,7 +44,7 @@ export = {
|
||||
if (user.user.id !== env.prod.dev) {
|
||||
if (status === "0") {
|
||||
await interaction.editReply(
|
||||
"Staff applications are currently closed.",
|
||||
"Staff applications are currently closed."
|
||||
)
|
||||
return
|
||||
}
|
||||
@@ -52,7 +52,7 @@ export = {
|
||||
|
||||
if (!userRoles.has(guildRole)) {
|
||||
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
|
||||
}
|
||||
@@ -66,7 +66,7 @@ export = {
|
||||
|
||||
if (application) {
|
||||
await interaction.editReply(
|
||||
"You already have an application in progress.",
|
||||
"You already have an application in progress."
|
||||
)
|
||||
return
|
||||
}
|
||||
@@ -79,7 +79,7 @@ export = {
|
||||
.setColor(embedColor)
|
||||
const attachments = new EmbedBuilder()
|
||||
.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)
|
||||
|
||||
@@ -92,9 +92,9 @@ export = {
|
||||
"If you wish to proceed with your application, please type `yes` otherwise type `cancel`.\n\n" +
|
||||
"**Do not upload images, videos, or GIFS.**\n" +
|
||||
"You have a minute to respond to this message.",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
})
|
||||
} catch (error) {
|
||||
await interaction.editReply("Please enable your DMs.")
|
||||
@@ -106,7 +106,7 @@ export = {
|
||||
const input = await user.dmChannel!.awaitMessages({
|
||||
filter: m => m.author.id === user.user.id,
|
||||
max: 1,
|
||||
time: 1000 * 60,
|
||||
time: 1000 * 60
|
||||
})
|
||||
if (input.size === 0) {
|
||||
await user.send({ embeds: [tooLong] })
|
||||
@@ -133,15 +133,15 @@ export = {
|
||||
"`",
|
||||
color: embedColor,
|
||||
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({
|
||||
filter: m => m.author.id === user.user.id,
|
||||
max: 1,
|
||||
time: 1000 * 60 * 5,
|
||||
time: 1000 * 60 * 5
|
||||
})
|
||||
if (answer1.size === 0) {
|
||||
await user.send({ embeds: [tooLong] })
|
||||
@@ -160,9 +160,9 @@ export = {
|
||||
embeds: [
|
||||
{
|
||||
description: "Max character limit is 16.",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
})
|
||||
return
|
||||
}
|
||||
@@ -174,9 +174,9 @@ export = {
|
||||
description:
|
||||
"That is not a valid Minecraft username.\n" +
|
||||
"Application cancelled.",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
})
|
||||
return
|
||||
}
|
||||
@@ -193,15 +193,15 @@ export = {
|
||||
"`(64 characters max)`",
|
||||
color: embedColor,
|
||||
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({
|
||||
filter: m => m.author.id === user.user.id,
|
||||
max: 1,
|
||||
time: 1000 * 60 * 15,
|
||||
time: 1000 * 60 * 15
|
||||
})
|
||||
if (answer2.size === 0) {
|
||||
await user.send({ embeds: [tooLong] })
|
||||
@@ -220,9 +220,9 @@ export = {
|
||||
embeds: [
|
||||
{
|
||||
description: "Max character limit is 64.",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
})
|
||||
return
|
||||
}
|
||||
@@ -240,15 +240,15 @@ export = {
|
||||
"`",
|
||||
color: embedColor,
|
||||
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({
|
||||
filter: m => m.author.id === user.user.id,
|
||||
max: 1,
|
||||
time: 1000 * 60 * 15,
|
||||
time: 1000 * 60 * 15
|
||||
})
|
||||
if (answer3.size === 0) {
|
||||
await user.send({ embeds: [tooLong] })
|
||||
@@ -267,9 +267,9 @@ export = {
|
||||
embeds: [
|
||||
{
|
||||
description: "Max character limit is 256.",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
})
|
||||
}
|
||||
const answer3_1 = answer3.first()!.content
|
||||
@@ -286,15 +286,15 @@ export = {
|
||||
"`",
|
||||
color: embedColor,
|
||||
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({
|
||||
filter: m => m.author.id === user.user.id,
|
||||
max: 1,
|
||||
time: 1000 * 60 * 15,
|
||||
time: 1000 * 60 * 15
|
||||
})
|
||||
if (answer4.size === 0) {
|
||||
await user.send({ embeds: [tooLong] })
|
||||
@@ -313,9 +313,9 @@ export = {
|
||||
embeds: [
|
||||
{
|
||||
description: "Max character limit is 256.",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
})
|
||||
}
|
||||
const answer4_1 = answer4.first()!.content
|
||||
@@ -332,15 +332,15 @@ export = {
|
||||
"`",
|
||||
color: embedColor,
|
||||
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({
|
||||
filter: m => m.author.id === user.user.id,
|
||||
max: 1,
|
||||
time: 1000 * 60 * 15,
|
||||
time: 1000 * 60 * 15
|
||||
})
|
||||
if (answer5.size === 0) {
|
||||
await user.send({ embeds: [tooLong] })
|
||||
@@ -359,9 +359,9 @@ export = {
|
||||
embeds: [
|
||||
{
|
||||
description: "Max character limit is 256.",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
})
|
||||
}
|
||||
const answer5_1 = answer5.first()!.content
|
||||
@@ -379,15 +379,15 @@ export = {
|
||||
"`",
|
||||
color: embedColor,
|
||||
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({
|
||||
filter: m => m.author.id === user.user.id,
|
||||
max: 1,
|
||||
time: 1000 * 60 * 15,
|
||||
time: 1000 * 60 * 15
|
||||
})
|
||||
if (answer6.size === 0) {
|
||||
await user.send({ embeds: [tooLong] })
|
||||
@@ -406,9 +406,9 @@ export = {
|
||||
embeds: [
|
||||
{
|
||||
description: "Max character limit is 256.",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
})
|
||||
}
|
||||
const answer6_1 = answer6.first()!.content
|
||||
@@ -418,15 +418,15 @@ export = {
|
||||
{
|
||||
description:
|
||||
"If you want to submit your application, type `yes` if not, type `no`",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
const final = await user.dmChannel!.awaitMessages({
|
||||
filter: m => m.author.id === user.user.id,
|
||||
max: 1,
|
||||
time: 1000 * 60 * 5,
|
||||
time: 1000 * 60 * 5
|
||||
})
|
||||
if (final.size === 0) {
|
||||
await user.send({ embeds: [tooLong] })
|
||||
@@ -445,22 +445,22 @@ export = {
|
||||
embeds: [
|
||||
{
|
||||
description: "Your application has been submitted!",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
const newStaffApp = new staffapp({
|
||||
_id: new mongoose.Types.ObjectId(),
|
||||
userID: user.user.id,
|
||||
uuid: uuid,
|
||||
uuid: uuid
|
||||
})
|
||||
|
||||
await newStaffApp.save()
|
||||
await user.deleteDM()
|
||||
|
||||
const channel = guild.channels.cache.get(
|
||||
staffApplicationsChannel,
|
||||
staffApplicationsChannel
|
||||
) as TextChannel
|
||||
|
||||
await channel.send({
|
||||
@@ -473,39 +473,39 @@ export = {
|
||||
" - Staff Application",
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: user.avatarURL() || "",
|
||||
url: user.avatarURL() || ""
|
||||
},
|
||||
fields: [
|
||||
{
|
||||
name: rq(1),
|
||||
value: "```" + answer1_1 + "```",
|
||||
value: "```" + answer1_1 + "```"
|
||||
},
|
||||
{
|
||||
name: rq(2),
|
||||
value: "```" + answer2_1 + "```",
|
||||
value: "```" + answer2_1 + "```"
|
||||
},
|
||||
{
|
||||
name: rq(3),
|
||||
value: "```" + answer3_1 + "```",
|
||||
value: "```" + answer3_1 + "```"
|
||||
},
|
||||
{
|
||||
name: rq(4),
|
||||
value: "```" + answer4_1 + "```",
|
||||
value: "```" + answer4_1 + "```"
|
||||
},
|
||||
{
|
||||
name: rq(5),
|
||||
value: "```" + answer5_1 + "```",
|
||||
value: "```" + answer5_1 + "```"
|
||||
},
|
||||
{
|
||||
name: rq(6),
|
||||
value: "```" + answer6_1 + "```",
|
||||
},
|
||||
value: "```" + answer6_1 + "```"
|
||||
}
|
||||
],
|
||||
footer: {
|
||||
icon_url: guild.iconURL() || undefined,
|
||||
text: "ID: " + user.user.id,
|
||||
},
|
||||
},
|
||||
text: "ID: " + user.user.id
|
||||
}
|
||||
}
|
||||
],
|
||||
components: [
|
||||
new ActionRowBuilder<ButtonBuilder>().addComponents(
|
||||
@@ -516,10 +516,10 @@ export = {
|
||||
new ButtonBuilder()
|
||||
.setCustomId("staffapplicationdeny")
|
||||
.setLabel("Deny")
|
||||
.setStyle(ButtonStyle.Danger),
|
||||
),
|
||||
],
|
||||
.setStyle(ButtonStyle.Danger)
|
||||
)
|
||||
]
|
||||
})
|
||||
}
|
||||
},
|
||||
}
|
||||
} as Button
|
||||
|
||||
@@ -2,7 +2,7 @@ import {
|
||||
ModalBuilder,
|
||||
ActionRowBuilder,
|
||||
TextInputBuilder,
|
||||
TextInputStyle,
|
||||
TextInputStyle
|
||||
} from "discord.js"
|
||||
import { Button } from "interfaces"
|
||||
|
||||
@@ -23,9 +23,9 @@ export = {
|
||||
.setPlaceholder("Enter your ign.")
|
||||
.setRequired(true)
|
||||
.setMinLength(3)
|
||||
.setMaxLength(16),
|
||||
),
|
||||
.setMaxLength(16)
|
||||
)
|
||||
)
|
||||
await interaction.showModal(modal)
|
||||
},
|
||||
}
|
||||
} as Button
|
||||
|
||||
@@ -32,7 +32,7 @@ export = {
|
||||
|
||||
fields.push({
|
||||
name: `${i + 1}. ${accepted[i].IGN}`,
|
||||
value: `TS: <t:${timestamp}:R>`,
|
||||
value: `TS: <t:${timestamp}:R>`
|
||||
})
|
||||
}
|
||||
|
||||
@@ -44,15 +44,15 @@ export = {
|
||||
color: embed.color!,
|
||||
footer: {
|
||||
text: "Last updated by " + user.username,
|
||||
icon_url: user.avatarURL() || undefined,
|
||||
icon_url: user.avatarURL() || undefined
|
||||
},
|
||||
thumbnail: embed.thumbnail!,
|
||||
fields: fields,
|
||||
timestamp: new Date().toISOString(),
|
||||
},
|
||||
],
|
||||
timestamp: new Date().toISOString()
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
await interaction.editReply("Updated the waiting list")
|
||||
},
|
||||
}
|
||||
} as Button
|
||||
|
||||
@@ -4,7 +4,7 @@ import {
|
||||
ButtonBuilder,
|
||||
ButtonStyle,
|
||||
Message,
|
||||
GuildMember,
|
||||
GuildMember
|
||||
} from "discord.js"
|
||||
import { color } from "config/options.json"
|
||||
import guildapp from "schemas/guildAppSchema"
|
||||
@@ -44,9 +44,9 @@ export = {
|
||||
.setCustomId("checkstats")
|
||||
.setLabel("Check Stats")
|
||||
.setStyle(ButtonStyle.Secondary)
|
||||
.setDisabled(true),
|
||||
),
|
||||
],
|
||||
.setDisabled(true)
|
||||
)
|
||||
]
|
||||
})
|
||||
|
||||
let applicant: GuildMember | null
|
||||
@@ -61,13 +61,13 @@ export = {
|
||||
"Your application for the Illegitimate guild has been denied\n" +
|
||||
"**Reason:** `" +
|
||||
reason +
|
||||
"`",
|
||||
"`"
|
||||
)
|
||||
.setColor(embedColor)
|
||||
|
||||
const missingUser = new EmbedBuilder()
|
||||
.setDescription(
|
||||
"[WARN] User has left the server and cannot be notified.",
|
||||
"[WARN] User has left the server and cannot be notified."
|
||||
)
|
||||
.setColor(embedColor)
|
||||
|
||||
@@ -79,13 +79,13 @@ export = {
|
||||
">.\n" +
|
||||
"**Reason:** `" +
|
||||
reason +
|
||||
"`",
|
||||
"`"
|
||||
)
|
||||
.setColor(embedColor)
|
||||
.setThumbnail(guild.iconURL() || "")
|
||||
.setFooter({
|
||||
iconURL: guild.iconURL() || undefined,
|
||||
text: "ID: " + applicantId,
|
||||
text: "ID: " + applicantId
|
||||
})
|
||||
|
||||
if (applicant !== null) {
|
||||
@@ -102,7 +102,7 @@ export = {
|
||||
await guildapp.findOneAndDelete({ userID: applicantId })
|
||||
|
||||
await interaction.editReply({
|
||||
embeds: responseEmbeds,
|
||||
embeds: responseEmbeds
|
||||
})
|
||||
},
|
||||
}
|
||||
} as Modal
|
||||
|
||||
@@ -2,7 +2,7 @@ import {
|
||||
EmbedBuilder,
|
||||
ActionRowBuilder,
|
||||
ButtonBuilder,
|
||||
ButtonStyle,
|
||||
ButtonStyle
|
||||
} from "discord.js"
|
||||
import { color } from "config/options.json"
|
||||
import staffapp from "schemas/staffAppSchema"
|
||||
@@ -38,9 +38,9 @@ export = {
|
||||
.setCustomId("staffapplicationdeny")
|
||||
.setLabel("Deny")
|
||||
.setStyle(ButtonStyle.Danger)
|
||||
.setDisabled(true),
|
||||
),
|
||||
],
|
||||
.setDisabled(true)
|
||||
)
|
||||
]
|
||||
})
|
||||
|
||||
const dmMessage = new EmbedBuilder()
|
||||
@@ -48,7 +48,7 @@ export = {
|
||||
"Your application for the Illegitimate guild staff has been denied\n" +
|
||||
"**Reason:** `" +
|
||||
reason +
|
||||
"`",
|
||||
"`"
|
||||
)
|
||||
.setColor(embedColor)
|
||||
|
||||
@@ -69,14 +69,14 @@ export = {
|
||||
"`",
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: applicant.avatarURL() || "",
|
||||
url: applicant.avatarURL() || ""
|
||||
},
|
||||
footer: {
|
||||
icon_url: guild!.iconURL() || undefined,
|
||||
text: "ID: " + applicant.id,
|
||||
},
|
||||
},
|
||||
],
|
||||
text: "ID: " + applicant.id
|
||||
}
|
||||
}
|
||||
]
|
||||
})
|
||||
},
|
||||
}
|
||||
} as Modal
|
||||
|
||||
@@ -11,7 +11,7 @@ import {
|
||||
member,
|
||||
guildRole,
|
||||
guildStaff,
|
||||
defaultMember,
|
||||
defaultMember
|
||||
} from "config/roles.json"
|
||||
import { Modal } from "interfaces"
|
||||
import { GuildMember } from "discord.js"
|
||||
@@ -31,7 +31,7 @@ export = {
|
||||
if (verifyData) {
|
||||
interaction.editReply(
|
||||
"You are already verified.\n" +
|
||||
"Try running /update to update your roles.",
|
||||
"Try running /update to update your roles."
|
||||
)
|
||||
return
|
||||
}
|
||||
@@ -43,9 +43,9 @@ export = {
|
||||
{
|
||||
description:
|
||||
"<a:questionmark_pink:1130206038008803488> That player does not exist.",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
})
|
||||
return
|
||||
}
|
||||
@@ -58,9 +58,9 @@ export = {
|
||||
{
|
||||
description:
|
||||
"<a:questionmark_pink:1130206038008803488> That player hasn't played Hypixel before.",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
})
|
||||
return
|
||||
}
|
||||
@@ -84,9 +84,9 @@ export = {
|
||||
"**Please set your Discord tag on hypixel to `" +
|
||||
username +
|
||||
"` and try again.**",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
})
|
||||
return
|
||||
}
|
||||
@@ -104,9 +104,9 @@ export = {
|
||||
"**Please set your Discord tag on hypixel to `" +
|
||||
username +
|
||||
"` and try again.**",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
})
|
||||
return
|
||||
}
|
||||
@@ -122,7 +122,7 @@ export = {
|
||||
if (guildID === hypixelGuildID) {
|
||||
const GuildMembers = guild!.members
|
||||
const guildRank = GuildMembers.find(
|
||||
member => member.uuid === player.uuid,
|
||||
member => member.uuid === player.uuid
|
||||
)!.rank
|
||||
|
||||
if (guildRank === "Guild Master" && guildID === hypixelGuildID) {
|
||||
@@ -163,7 +163,7 @@ export = {
|
||||
const newVerify = new verify({
|
||||
_id: new mongoose.Types.ObjectId(),
|
||||
userID: user.id,
|
||||
uuid: uuid,
|
||||
uuid: uuid
|
||||
})
|
||||
|
||||
await newVerify.save()
|
||||
@@ -180,15 +180,15 @@ export = {
|
||||
"`.",
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: head!,
|
||||
url: head!
|
||||
},
|
||||
footer: {
|
||||
icon_url: interaction.guild!.iconURL() || undefined,
|
||||
text: interaction.guild!.name + " | " + devMessage,
|
||||
},
|
||||
},
|
||||
],
|
||||
text: interaction.guild!.name + " | " + devMessage
|
||||
}
|
||||
}
|
||||
]
|
||||
})
|
||||
}
|
||||
},
|
||||
}
|
||||
} as Modal
|
||||
|
||||
@@ -2,7 +2,7 @@ import {
|
||||
hypixelGuildID,
|
||||
guildLogChannel,
|
||||
color,
|
||||
devMessage,
|
||||
devMessage
|
||||
} from "config/options.json"
|
||||
import colorLog from "utils/functions/colors"
|
||||
import { getGuild, getIGN } from "utils/Hypixel"
|
||||
@@ -25,9 +25,9 @@ async function guildWeekly() {
|
||||
embeds: [
|
||||
{
|
||||
description: "Starting to fetch guild data...",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
const guild = (await getGuild(hypixelGuildID, "id")) as GuildData
|
||||
@@ -45,10 +45,7 @@ async function guildWeekly() {
|
||||
.map(member => {
|
||||
return {
|
||||
uuid: member.uuid,
|
||||
exp: Object.values(member.expHistory).reduce(
|
||||
(a, b) => a + b,
|
||||
0,
|
||||
),
|
||||
exp: Object.values(member.expHistory).reduce((a, b) => a + b, 0)
|
||||
}
|
||||
})
|
||||
.sort((a, b) => b.exp - a.exp)
|
||||
@@ -56,16 +53,16 @@ async function guildWeekly() {
|
||||
for (let i = 0; i < allMembersGexpSorted.length; i++) {
|
||||
const ign = await getIGN(allMembersGexpSorted[i].uuid)
|
||||
const gexp = new Intl.NumberFormat("en-US").format(
|
||||
allMembersGexpSorted[i].exp,
|
||||
allMembersGexpSorted[i].exp
|
||||
)
|
||||
const position = i + 1
|
||||
guildMembersList.push(
|
||||
"**#" + position + " " + ign + ":** `" + gexp + "`",
|
||||
"**#" + position + " " + ign + ":** `" + gexp + "`"
|
||||
)
|
||||
}
|
||||
|
||||
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) => {
|
||||
@@ -74,30 +71,30 @@ async function guildWeekly() {
|
||||
topWeeklyMembers[index] = {
|
||||
name: "",
|
||||
value: item.join("\n"),
|
||||
inline: false,
|
||||
inline: false
|
||||
}
|
||||
})
|
||||
|
||||
// combined weekly gexp
|
||||
const allGuildMembersWeeklyXP = guildMembers.map(
|
||||
member => member.expHistory,
|
||||
member => member.expHistory
|
||||
)
|
||||
const guildMembersWeeklyXP = allGuildMembersWeeklyXP.map(member => {
|
||||
return Object.values(member).reduce((a, b) => a + b, 0)
|
||||
})
|
||||
const totalGuildMembersWeeklyXPUnformatted = guildMembersWeeklyXP.reduce(
|
||||
(a, b) => a + b,
|
||||
0,
|
||||
0
|
||||
)
|
||||
const averageGuildMembersDailyXPUnformatted =
|
||||
totalGuildMembersWeeklyXPUnformatted / 7
|
||||
|
||||
// final values
|
||||
const totalGuildMembersWeeklyXP = new Intl.NumberFormat("en-US").format(
|
||||
totalGuildMembersWeeklyXPUnformatted,
|
||||
totalGuildMembersWeeklyXPUnformatted
|
||||
)
|
||||
const averageGuildMembersWeeklyXP = new Intl.NumberFormat("en-US").format(
|
||||
averageGuildMembersDailyXPUnformatted,
|
||||
averageGuildMembersDailyXPUnformatted
|
||||
)
|
||||
|
||||
await message.edit({
|
||||
@@ -115,10 +112,10 @@ async function guildWeekly() {
|
||||
timestamp: new Date().toISOString(),
|
||||
footer: {
|
||||
text: channel.guild.name + " | " + devMessage,
|
||||
icon_url: channel.guild.iconURL() || undefined,
|
||||
},
|
||||
},
|
||||
],
|
||||
icon_url: channel.guild.iconURL() || undefined
|
||||
}
|
||||
}
|
||||
]
|
||||
})
|
||||
}
|
||||
|
||||
@@ -129,10 +126,10 @@ export = {
|
||||
hours: 21,
|
||||
dayOfWeek: 7,
|
||||
dayOfMonth: "*",
|
||||
month: "*",
|
||||
month: "*"
|
||||
},
|
||||
execute: guildWeekly,
|
||||
onComplete: null,
|
||||
start: true,
|
||||
timeZone: "Europe/Zagreb",
|
||||
timeZone: "Europe/Zagreb"
|
||||
} as Cron
|
||||
|
||||
@@ -23,15 +23,15 @@ export = {
|
||||
member.user.createdAt.toLocaleString(),
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: member.user.avatarURL() || "",
|
||||
url: member.user.avatarURL() || ""
|
||||
},
|
||||
footer: {
|
||||
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
|
||||
|
||||
@@ -17,8 +17,8 @@ export = {
|
||||
interaction.commandName +
|
||||
" " +
|
||||
interaction.options.getSubcommand(),
|
||||
"pink",
|
||||
),
|
||||
"pink"
|
||||
)
|
||||
)
|
||||
} catch {
|
||||
console.log(
|
||||
@@ -26,8 +26,8 @@ export = {
|
||||
interaction.user.username +
|
||||
" ran " +
|
||||
interaction.commandName,
|
||||
"pink",
|
||||
),
|
||||
"pink"
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -40,10 +40,10 @@ export = {
|
||||
interaction.user.discriminator +
|
||||
" clicked " +
|
||||
interaction.customId,
|
||||
"pink",
|
||||
),
|
||||
"pink"
|
||||
)
|
||||
)
|
||||
return
|
||||
}
|
||||
},
|
||||
}
|
||||
} as Event
|
||||
|
||||
@@ -21,18 +21,18 @@ export = {
|
||||
await message.channel.send({
|
||||
embeds: [
|
||||
{
|
||||
description: `\`\`\`js\n${outputString}\`\`\``,
|
||||
},
|
||||
],
|
||||
description: `\`\`\`js\n${outputString}\`\`\``
|
||||
}
|
||||
]
|
||||
})
|
||||
} catch (error) {
|
||||
await message.channel.send({
|
||||
embeds: [
|
||||
{
|
||||
description: `\`\`\`js\n${error}\`\`\``,
|
||||
},
|
||||
],
|
||||
description: `\`\`\`js\n${error}\`\`\``
|
||||
}
|
||||
]
|
||||
})
|
||||
}
|
||||
},
|
||||
}
|
||||
} as Event
|
||||
|
||||
@@ -13,5 +13,5 @@ export = {
|
||||
) {
|
||||
message.react("Woot:734345936347725885")
|
||||
}
|
||||
},
|
||||
}
|
||||
} as Event
|
||||
|
||||
@@ -20,16 +20,16 @@ export = {
|
||||
channel: message.channel.id,
|
||||
createdAt: message.createdTimestamp,
|
||||
deletedAt: Date.now(),
|
||||
attachments: message.attachments.map(a => a.url) || [],
|
||||
attachments: message.attachments.map(a => a.url) || []
|
||||
}
|
||||
|
||||
const snipeCache = new snipeCacheSchema({
|
||||
_id: new mongoose.Types.ObjectId(),
|
||||
userid: message.author.id,
|
||||
channelid: message.channel.id,
|
||||
data: msg,
|
||||
data: msg
|
||||
})
|
||||
|
||||
await snipeCache.save()
|
||||
},
|
||||
}
|
||||
} as Event
|
||||
|
||||
@@ -9,5 +9,5 @@ export = {
|
||||
|
||||
execute(client: Client) {
|
||||
console.log(color("Logged in as " + client.user!.tag + "!", "green"))
|
||||
},
|
||||
}
|
||||
} as Event
|
||||
|
||||
@@ -16,9 +16,9 @@ export = {
|
||||
embeds: [
|
||||
{
|
||||
description: "Bot is online!",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
})
|
||||
},
|
||||
}
|
||||
} as Event
|
||||
|
||||
@@ -22,9 +22,9 @@ export = {
|
||||
let i = 1
|
||||
setInterval(
|
||||
() => user.setActivity(statuses[i++ % statuses.length]),
|
||||
1000 * 60 * 10,
|
||||
1000 * 60 * 10
|
||||
)
|
||||
|
||||
user.setStatus("dnd")
|
||||
},
|
||||
}
|
||||
} as Event
|
||||
|
||||
@@ -28,11 +28,11 @@ export = {
|
||||
footer: {
|
||||
text: "ID: " + newState.member!.id,
|
||||
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) {
|
||||
logToChannel("bot", {
|
||||
@@ -47,11 +47,11 @@ export = {
|
||||
footer: {
|
||||
text: "ID: " + oldState.member!.id,
|
||||
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) {
|
||||
if (oldChannel.id === newChannel.id) return
|
||||
@@ -70,12 +70,12 @@ export = {
|
||||
footer: {
|
||||
text: "ID: " + oldState.member!.id,
|
||||
icon_url:
|
||||
oldState.member!.user.avatarURL() || undefined,
|
||||
oldState.member!.user.avatarURL() || undefined
|
||||
},
|
||||
timestamp: new Date().toISOString(),
|
||||
},
|
||||
],
|
||||
timestamp: new Date().toISOString()
|
||||
}
|
||||
]
|
||||
})
|
||||
}
|
||||
},
|
||||
}
|
||||
} as Event
|
||||
|
||||
@@ -12,6 +12,6 @@ export default interface Command {
|
||||
data: SlashCommandBuilder
|
||||
execute: (
|
||||
interaction: ChatInputCommandInteraction,
|
||||
client: Client,
|
||||
client: Client
|
||||
) => Promise<void>
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/* eslint-disable no-unused-vars */
|
||||
import {
|
||||
ContextMenuCommandInteraction,
|
||||
ContextMenuCommandBuilder,
|
||||
ContextMenuCommandBuilder
|
||||
} from "discord.js"
|
||||
|
||||
export default interface ContextMenu {
|
||||
|
||||
@@ -25,5 +25,5 @@ export {
|
||||
Guild,
|
||||
GuildData,
|
||||
Player,
|
||||
PlayerData,
|
||||
PlayerData
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ import { Schema, model } from "mongoose"
|
||||
const guildAppSchema = new Schema({
|
||||
_id: Schema.Types.ObjectId,
|
||||
userID: { type: String, required: true },
|
||||
uuid: { type: String, required: true },
|
||||
uuid: { type: String, required: true }
|
||||
})
|
||||
|
||||
export = model("guildapp", guildAppSchema, "guildapp")
|
||||
|
||||
@@ -3,7 +3,7 @@ import { Schema, model } from "mongoose"
|
||||
const settingsSchema = new Schema({
|
||||
_id: Schema.Types.ObjectId,
|
||||
name: { type: String, required: true },
|
||||
value: { type: String, required: true },
|
||||
value: { type: String, required: true }
|
||||
})
|
||||
|
||||
export = model("settings", settingsSchema, "settings")
|
||||
|
||||
@@ -5,7 +5,7 @@ const snipeCacheSchema = new Schema({
|
||||
userid: { type: String, required: true },
|
||||
channelid: { type: String, 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")
|
||||
|
||||
@@ -3,7 +3,7 @@ import { Schema, model } from "mongoose"
|
||||
const staffAppSchema = new Schema({
|
||||
_id: Schema.Types.ObjectId,
|
||||
userID: { type: String, required: true },
|
||||
uuid: { type: String, required: true },
|
||||
uuid: { type: String, required: true }
|
||||
})
|
||||
|
||||
export = model("staffapp", staffAppSchema, "staffapp")
|
||||
|
||||
@@ -3,7 +3,7 @@ import { Schema, model } from "mongoose"
|
||||
const verifySchema = new Schema({
|
||||
_id: Schema.Types.ObjectId,
|
||||
userID: { type: String, required: true },
|
||||
uuid: { type: String, required: true },
|
||||
uuid: { type: String, required: true }
|
||||
})
|
||||
|
||||
export = model("verify", verifySchema, "verify")
|
||||
|
||||
@@ -5,7 +5,7 @@ const waitinglistSchema = new Schema({
|
||||
userID: { type: String, required: true },
|
||||
uuid: { type: String, required: true },
|
||||
IGN: { type: String, required: true },
|
||||
timestamp: { type: Number, required: true },
|
||||
timestamp: { type: Number, required: true }
|
||||
})
|
||||
|
||||
export = model("waitinglist", waitinglistSchema, "waitinglist")
|
||||
|
||||
@@ -5,7 +5,7 @@ import {
|
||||
REST,
|
||||
RESTGetAPIApplicationGuildCommandResult,
|
||||
RESTPutAPIApplicationGuildCommandsJSONBody,
|
||||
Routes,
|
||||
Routes
|
||||
} from "discord.js"
|
||||
import fs from "fs"
|
||||
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 currentCommands = (await rest.get(
|
||||
Routes.applicationGuildCommands(env.dev.devid!, env.dev.guildid!),
|
||||
Routes.applicationGuildCommands(env.dev.devid!, env.dev.guildid!)
|
||||
)) as RESTGetAPIApplicationGuildCommandResult[]
|
||||
|
||||
const currentCommandsInfo = currentCommands.map(command => {
|
||||
return {
|
||||
name: command.name,
|
||||
description: command.description,
|
||||
description: command.description
|
||||
}
|
||||
})
|
||||
const newCommandsInfo = commands.map(command => {
|
||||
return {
|
||||
name: command.name,
|
||||
description: command.description,
|
||||
description: command.description
|
||||
}
|
||||
})
|
||||
|
||||
const sortedCurrentCommandsInfo = currentCommandsInfo.sort((a, b) =>
|
||||
a.name.localeCompare(b.name),
|
||||
a.name.localeCompare(b.name)
|
||||
)
|
||||
const sortedNewCommandsInfo = newCommandsInfo.sort((a, b) =>
|
||||
a.name.localeCompare(b.name),
|
||||
a.name.localeCompare(b.name)
|
||||
)
|
||||
|
||||
const newCmds = sortedNewCommandsInfo
|
||||
@@ -86,7 +86,7 @@ export default async function autoDeployCommands(fileType: FileType) {
|
||||
JSON.stringify(sortedCurrentCommandsInfo)
|
||||
) {
|
||||
console.log(
|
||||
color("Commands are the same, skipping deploy.", "lavender"),
|
||||
color("Commands are the same, skipping deploy.", "lavender")
|
||||
)
|
||||
console.log(color(newCmds, "lavender"))
|
||||
return
|
||||
@@ -96,18 +96,18 @@ export default async function autoDeployCommands(fileType: FileType) {
|
||||
console.log(color("Commands are different, starting deploy.", "red"))
|
||||
console.log(color(currentCmds, "red"))
|
||||
console.log(
|
||||
`Started refreshing ${commands.length} application (/) commands.`,
|
||||
`Started refreshing ${commands.length} application (/) commands.`
|
||||
)
|
||||
|
||||
const data = (await rest.put(
|
||||
Routes.applicationGuildCommands(env.dev.devid!, env.dev.guildid!),
|
||||
{ body: commands },
|
||||
{ body: commands }
|
||||
)) as RESTPutAPIApplicationGuildCommandsJSONBody[]
|
||||
|
||||
console.log(color("New commands deployed.", "lavender"))
|
||||
console.log(color(newCmds, "lavender"))
|
||||
console.log(
|
||||
`Successfully reloaded ${data.length} application (/) commands.`,
|
||||
`Successfully reloaded ${data.length} application (/) commands.`
|
||||
)
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
|
||||
@@ -20,14 +20,14 @@ export class ExtendedClient extends Client {
|
||||
GatewayIntentBits.GuildMembers,
|
||||
GatewayIntentBits.MessageContent,
|
||||
GatewayIntentBits.DirectMessages,
|
||||
GatewayIntentBits.GuildVoiceStates,
|
||||
GatewayIntentBits.GuildVoiceStates
|
||||
],
|
||||
partials: [
|
||||
Partials.GuildMember,
|
||||
Partials.User,
|
||||
Partials.Message,
|
||||
Partials.Channel,
|
||||
],
|
||||
Partials.Channel
|
||||
]
|
||||
})
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ export class ExtendedClient extends Client {
|
||||
let token: string
|
||||
if (process.env.NODE_ENV === "dev" && process.env.TYPESCRIPT) {
|
||||
console.log(
|
||||
color("Running in development mode. [ts-node]", "lavender"),
|
||||
color("Running in development mode. [ts-node]", "lavender")
|
||||
)
|
||||
loadAllEvents(this, "ts")
|
||||
token = env.dev.devtoken!
|
||||
|
||||
@@ -7,14 +7,14 @@ const env: Env = {
|
||||
mongoURI: process.env.MONGOURI,
|
||||
dev: process.env.DEV,
|
||||
hypixelapikey: process.env.HYPIXELAPIKEY,
|
||||
redisURI: process.env.REDISURI,
|
||||
redisURI: process.env.REDISURI
|
||||
},
|
||||
dev: {
|
||||
devtoken: process.env.DEVTOKEN,
|
||||
clientid: process.env.CLIENTID,
|
||||
devid: process.env.DEVID,
|
||||
guildid: process.env.GUILDID,
|
||||
},
|
||||
guildid: process.env.GUILDID
|
||||
}
|
||||
}
|
||||
|
||||
export default env
|
||||
|
||||
@@ -15,7 +15,7 @@ export default function loadAutocompleteEvents(client: Client, ft: FileType) {
|
||||
"..",
|
||||
"..",
|
||||
"components",
|
||||
"autocomplete",
|
||||
"autocomplete"
|
||||
)
|
||||
const autocompleteFiles = fs
|
||||
.readdirSync(autocompletePath)
|
||||
@@ -31,8 +31,8 @@ export default function loadAutocompleteEvents(client: Client, ft: FileType) {
|
||||
console.log(
|
||||
colorLog(
|
||||
`[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) {
|
||||
console.error(
|
||||
`No autocomplete matching ${interaction.commandName} was found.`,
|
||||
`No autocomplete matching ${interaction.commandName} was found.`
|
||||
)
|
||||
return
|
||||
}
|
||||
@@ -65,10 +65,10 @@ export default function loadAutocompleteEvents(client: Client, ft: FileType) {
|
||||
text:
|
||||
interaction.user.username +
|
||||
" | " +
|
||||
interaction.commandName,
|
||||
},
|
||||
},
|
||||
],
|
||||
interaction.commandName
|
||||
}
|
||||
}
|
||||
]
|
||||
})
|
||||
}
|
||||
console.error(error)
|
||||
|
||||
@@ -23,8 +23,8 @@ export default function loadButtonEvents(client: Client, ft: FileType) {
|
||||
console.log(
|
||||
colorLog(
|
||||
`[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) {
|
||||
console.error(
|
||||
`No event matching ${interaction.customId} was found.`,
|
||||
`No event matching ${interaction.customId} was found.`
|
||||
)
|
||||
return
|
||||
}
|
||||
@@ -57,10 +57,10 @@ export default function loadButtonEvents(client: Client, ft: FileType) {
|
||||
text:
|
||||
interaction.user.username +
|
||||
" | " +
|
||||
interaction.customId,
|
||||
},
|
||||
},
|
||||
],
|
||||
interaction.customId
|
||||
}
|
||||
}
|
||||
]
|
||||
})
|
||||
}
|
||||
|
||||
@@ -71,10 +71,10 @@ export default function loadButtonEvents(client: Client, ft: FileType) {
|
||||
{
|
||||
description:
|
||||
"There was an error while executing this button!",
|
||||
color: embedColor,
|
||||
},
|
||||
color: embedColor
|
||||
}
|
||||
],
|
||||
ephemeral: true,
|
||||
ephemeral: true
|
||||
})
|
||||
} else {
|
||||
await interaction.editReply({
|
||||
@@ -82,9 +82,9 @@ export default function loadButtonEvents(client: Client, ft: FileType) {
|
||||
{
|
||||
description:
|
||||
"There was an error while executing this button! 2",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,8 +23,8 @@ export default function loadSlashCommandsEvents(client: Client, ft: FileType) {
|
||||
console.log(
|
||||
colorLog(
|
||||
`[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) {
|
||||
console.error(
|
||||
`No command matching ${interaction.commandName} was found.`,
|
||||
`No command matching ${interaction.commandName} was found.`
|
||||
)
|
||||
return
|
||||
}
|
||||
@@ -58,10 +58,10 @@ export default function loadSlashCommandsEvents(client: Client, ft: FileType) {
|
||||
text:
|
||||
interaction.user.username +
|
||||
" | " +
|
||||
interaction.commandName,
|
||||
},
|
||||
},
|
||||
],
|
||||
interaction.commandName
|
||||
}
|
||||
}
|
||||
]
|
||||
})
|
||||
}
|
||||
|
||||
@@ -72,10 +72,10 @@ export default function loadSlashCommandsEvents(client: Client, ft: FileType) {
|
||||
{
|
||||
description:
|
||||
"There was an error while executing this command!",
|
||||
color: embedColor,
|
||||
},
|
||||
color: embedColor
|
||||
}
|
||||
],
|
||||
ephemeral: true,
|
||||
ephemeral: true
|
||||
})
|
||||
} else {
|
||||
await interaction.editReply({
|
||||
@@ -83,9 +83,9 @@ export default function loadSlashCommandsEvents(client: Client, ft: FileType) {
|
||||
{
|
||||
description:
|
||||
"There was an error while executing this command!",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ export default function loadContextMenuEvents(client: Client, ft: FileType) {
|
||||
__dirname,
|
||||
"..",
|
||||
"..",
|
||||
"commands-contextmenu",
|
||||
"commands-contextmenu"
|
||||
)
|
||||
const contextMenuFiles = fs
|
||||
.readdirSync(contextMenuPath)
|
||||
@@ -30,8 +30,8 @@ export default function loadContextMenuEvents(client: Client, ft: FileType) {
|
||||
console.log(
|
||||
colorLog(
|
||||
`[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) {
|
||||
console.error(
|
||||
`No command matching ${interaction.commandName} was found.`,
|
||||
`No command matching ${interaction.commandName} was found.`
|
||||
)
|
||||
return
|
||||
}
|
||||
@@ -65,10 +65,10 @@ export default function loadContextMenuEvents(client: Client, ft: FileType) {
|
||||
text:
|
||||
interaction.user.username +
|
||||
" | " +
|
||||
interaction.commandName,
|
||||
},
|
||||
},
|
||||
],
|
||||
interaction.commandName
|
||||
}
|
||||
}
|
||||
]
|
||||
})
|
||||
}
|
||||
|
||||
@@ -79,10 +79,10 @@ export default function loadContextMenuEvents(client: Client, ft: FileType) {
|
||||
{
|
||||
description:
|
||||
"There was an error while executing this contextmenu command!",
|
||||
color: embedColor,
|
||||
},
|
||||
color: embedColor
|
||||
}
|
||||
],
|
||||
ephemeral: true,
|
||||
ephemeral: true
|
||||
})
|
||||
} else {
|
||||
await interaction.editReply({
|
||||
@@ -90,9 +90,9 @@ export default function loadContextMenuEvents(client: Client, ft: FileType) {
|
||||
{
|
||||
description:
|
||||
"There was an error while executing this contextmenu command!",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ export default function loadCronEvents() {
|
||||
cron.execute,
|
||||
cron.onComplete,
|
||||
cron.start,
|
||||
cron.timeZone,
|
||||
cron.timeZone
|
||||
).start()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,8 +25,8 @@ export default function loadModalEvents(client: Client, ft: FileType) {
|
||||
console.log(
|
||||
colorLog(
|
||||
`[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) {
|
||||
console.error(
|
||||
`No modal matching ${interaction.customId} was found.`,
|
||||
`No modal matching ${interaction.customId} was found.`
|
||||
)
|
||||
return
|
||||
}
|
||||
@@ -59,10 +59,10 @@ export default function loadModalEvents(client: Client, ft: FileType) {
|
||||
text:
|
||||
interaction.user.username +
|
||||
" | " +
|
||||
interaction.customId,
|
||||
},
|
||||
},
|
||||
],
|
||||
interaction.customId
|
||||
}
|
||||
}
|
||||
]
|
||||
})
|
||||
}
|
||||
|
||||
@@ -73,9 +73,9 @@ export default function loadModalEvents(client: Client, ft: FileType) {
|
||||
{
|
||||
description:
|
||||
"There was an error while executing this modal!",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
})
|
||||
} else {
|
||||
await interaction.editReply({
|
||||
@@ -83,9 +83,9 @@ export default function loadModalEvents(client: Client, ft: FileType) {
|
||||
{
|
||||
description:
|
||||
"There was an error while executing this modal!",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
color: embedColor
|
||||
}
|
||||
]
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,8 +48,8 @@ async function getPlayer(uuid: string): Promise<PlayerData | null> {
|
||||
const playerReq: Player = await fetch(hypixel, {
|
||||
params: {
|
||||
key: apikey,
|
||||
uuid: uuid,
|
||||
},
|
||||
uuid: uuid
|
||||
}
|
||||
})
|
||||
|
||||
if (!playerReq.data.player) {
|
||||
@@ -61,15 +61,15 @@ async function getPlayer(uuid: string): Promise<PlayerData | null> {
|
||||
|
||||
async function getGuild(
|
||||
query: string,
|
||||
type?: GuildQuerqType,
|
||||
type?: GuildQuerqType
|
||||
): Promise<GuildData | null> {
|
||||
const reqType = type ? type : "player"
|
||||
|
||||
const guildReq: Guild = await fetch(guild, {
|
||||
params: {
|
||||
key: apikey,
|
||||
[reqType]: query,
|
||||
},
|
||||
[reqType]: query
|
||||
}
|
||||
})
|
||||
|
||||
if (!guildReq.data.guild) {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
function guildLevel(exp: number): number {
|
||||
const EXP_NEEDED = [
|
||||
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
|
||||
|
||||
@@ -12,7 +12,7 @@ function getLevel(exp: number): number {
|
||||
if (exp <= 1) return 1
|
||||
|
||||
return Math.floor(
|
||||
1 + REVERSE_PQ_PREFIX + Math.sqrt(REVERSE_CONST + GROWTHDIV2 * exp),
|
||||
1 + REVERSE_PQ_PREFIX + Math.sqrt(REVERSE_CONST + GROWTHDIV2 * exp)
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ const colors = {
|
||||
red: "#f38ba8",
|
||||
lavender: "#b4befe",
|
||||
green: "#a6e3a1",
|
||||
pink: "#f5c2e7",
|
||||
pink: "#f5c2e7"
|
||||
}
|
||||
|
||||
export default function color(text: string, type: keyof typeof colors) {
|
||||
|
||||
@@ -5,7 +5,7 @@ import {
|
||||
guildLogChannel,
|
||||
errorLogChannel,
|
||||
moderationLogChannel,
|
||||
devLogChannel,
|
||||
devLogChannel
|
||||
} from "config/options.json"
|
||||
import { Guild, MessageCreateOptions, TextChannel } from "discord.js"
|
||||
import Illegitimate from "utils/Illegitimate"
|
||||
@@ -16,14 +16,14 @@ const channels = {
|
||||
guild: guildLogChannel,
|
||||
error: errorLogChannel,
|
||||
mod: moderationLogChannel,
|
||||
dev: devLogChannel,
|
||||
dev: devLogChannel
|
||||
}
|
||||
|
||||
type Channel = keyof typeof channels
|
||||
|
||||
export default async function logToChannel(
|
||||
channel: Channel,
|
||||
message: MessageCreateOptions,
|
||||
message: MessageCreateOptions
|
||||
): Promise<void | null> {
|
||||
const guild = Illegitimate.client.guilds.cache.get(guildid) as Guild
|
||||
let logChannel: TextChannel
|
||||
@@ -36,7 +36,7 @@ export default async function logToChannel(
|
||||
|
||||
if (!logChannel) {
|
||||
console.log(
|
||||
`[ERROR] Could not find channel used for ${channel} logging.`,
|
||||
`[ERROR] Could not find channel used for ${channel} logging.`
|
||||
)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
member,
|
||||
guildStaff,
|
||||
guildRole,
|
||||
defaultMember,
|
||||
defaultMember
|
||||
} from "config/roles.json"
|
||||
const roles = [
|
||||
gm,
|
||||
@@ -17,7 +17,7 @@ const roles = [
|
||||
elite,
|
||||
member,
|
||||
guildStaff,
|
||||
guildRole,
|
||||
guildRole
|
||||
]
|
||||
|
||||
type RoleType =
|
||||
@@ -36,7 +36,7 @@ export default function roleManage(role: RoleType): {
|
||||
} {
|
||||
if (role === "gm") {
|
||||
const rolesToRemove = roles.filter(
|
||||
role => role !== gm && role !== guildStaff && role !== guildRole,
|
||||
role => role !== gm && role !== guildStaff && role !== guildRole
|
||||
)
|
||||
const rolesToAdd = [gm, guildStaff, guildRole]
|
||||
return { rolesToRemove, rolesToAdd }
|
||||
@@ -45,7 +45,7 @@ export default function roleManage(role: RoleType): {
|
||||
if (role === "manager") {
|
||||
const rolesToRemove = roles.filter(
|
||||
role =>
|
||||
role !== manager && role !== guildStaff && role !== guildRole,
|
||||
role !== manager && role !== guildStaff && role !== guildRole
|
||||
)
|
||||
const rolesToAdd = [manager, guildStaff, guildRole]
|
||||
return { rolesToRemove, rolesToAdd }
|
||||
@@ -54,7 +54,7 @@ export default function roleManage(role: RoleType): {
|
||||
if (role === "moderator") {
|
||||
const rolesToRemove = roles.filter(
|
||||
role =>
|
||||
role !== moderator && role !== guildStaff && role !== guildRole,
|
||||
role !== moderator && role !== guildStaff && role !== guildRole
|
||||
)
|
||||
const rolesToAdd = [moderator, guildStaff, guildRole]
|
||||
return { rolesToRemove, rolesToAdd }
|
||||
@@ -62,7 +62,7 @@ export default function roleManage(role: RoleType): {
|
||||
|
||||
if (role === "beast") {
|
||||
const rolesToRemove = roles.filter(
|
||||
role => role !== beast && role !== guildRole,
|
||||
role => role !== beast && role !== guildRole
|
||||
)
|
||||
const rolesToAdd = [beast, guildRole]
|
||||
return { rolesToRemove, rolesToAdd }
|
||||
@@ -70,7 +70,7 @@ export default function roleManage(role: RoleType): {
|
||||
|
||||
if (role === "elite") {
|
||||
const rolesToRemove = roles.filter(
|
||||
role => role !== elite && role !== guildRole,
|
||||
role => role !== elite && role !== guildRole
|
||||
)
|
||||
const rolesToAdd = [elite, guildRole]
|
||||
return { rolesToRemove, rolesToAdd }
|
||||
@@ -78,7 +78,7 @@ export default function roleManage(role: RoleType): {
|
||||
|
||||
if (role === "member") {
|
||||
const rolesToRemove = roles.filter(
|
||||
role => role !== member && role !== guildRole,
|
||||
role => role !== member && role !== guildRole
|
||||
)
|
||||
const rolesToAdd = [member, guildRole]
|
||||
return { rolesToRemove, rolesToAdd }
|
||||
|
||||
Reference in New Issue
Block a user