Process of format fixing
This commit is contained in:
@@ -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
|
||||
}
|
||||
]
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user