Fixed formatting on all command files
This commit is contained in:
@@ -120,10 +120,10 @@ export = {
|
|||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
if (player.stats.Bedwars) {
|
if (player.stats.Bedwars) {
|
||||||
const hsbwexp = player.stats?.Bedwars?.Experience || 0
|
const hsbwexp = player.stats.Bedwars?.Experience || 0
|
||||||
const hsbwfk = player.stats?.Bedwars?.final_kills_bedwars || 0
|
const hsbwfk = player.stats.Bedwars?.final_kills_bedwars || 0
|
||||||
const hsbwfd = player.stats?.Bedwars?.final_deaths_bedwars || 0
|
const hsbwfd = player.stats.Bedwars?.final_deaths_bedwars || 0
|
||||||
const hsbwwins = player.stats?.Bedwars?.wins_bedwars || 0
|
const hsbwwins = player.stats.Bedwars?.wins_bedwars || 0
|
||||||
const hsbwstars = bedwarsLevel(hsbwexp)
|
const hsbwstars = bedwarsLevel(hsbwexp)
|
||||||
const hsbwfkdr = hsbwfk / hsbwfd || 0
|
const hsbwfkdr = hsbwfk / hsbwfd || 0
|
||||||
|
|
||||||
@@ -151,10 +151,10 @@ export = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (player.stats.SkyWars) {
|
if (player.stats.SkyWars) {
|
||||||
const hsswexp = player.stats?.SkyWars?.skywars_experience || 0
|
const hsswexp = player.stats.SkyWars?.skywars_experience || 0
|
||||||
const hsswkills = player.stats?.SkyWars?.kills || 0
|
const hsswkills = player.stats.SkyWars?.kills || 0
|
||||||
const hsswdeaths = player.stats?.SkyWars?.deaths || 0
|
const hsswdeaths = player.stats.SkyWars?.deaths || 0
|
||||||
const hsswwins = player.stats?.SkyWars?.wins || 0
|
const hsswwins = player.stats.SkyWars?.wins || 0
|
||||||
const hsswstars = skywarsLevel(hsswexp)
|
const hsswstars = skywarsLevel(hsswexp)
|
||||||
const hsswkd = hsswkills / hsswdeaths || 0
|
const hsswkd = hsswkills / hsswdeaths || 0
|
||||||
|
|
||||||
@@ -181,10 +181,10 @@ export = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (player.stats.Duels) {
|
if (player.stats.Duels) {
|
||||||
const hsduelskills = player.stats?.Duels?.kills || 0
|
const hsduelskills = player.stats.Duels?.kills || 0
|
||||||
const hsduelsdeaths = player.stats?.Duels?.deaths || 0
|
const hsduelsdeaths = player.stats.Duels?.deaths || 0
|
||||||
const hsduelswins = player.stats?.Duels?.wins || 0
|
const hsduelswins = player.stats.Duels?.wins || 0
|
||||||
const hsduelslosses = player.stats?.Duels?.losses || 0
|
const hsduelslosses = player.stats.Duels?.losses || 0
|
||||||
const hsduelskd = hsduelskills / hsduelsdeaths || 0
|
const hsduelskd = hsduelskills / hsduelsdeaths || 0
|
||||||
const hsduelswlr = hsduelswins / hsduelslosses || 0
|
const hsduelswlr = hsduelswins / hsduelslosses || 0
|
||||||
|
|
||||||
@@ -212,7 +212,7 @@ export = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// network level
|
// network level
|
||||||
const hypixelExp = player.networkExp || 0
|
const hypixelExp = player?.networkExp || 0
|
||||||
const level = hypixelLevel(hypixelExp)
|
const level = hypixelLevel(hypixelExp)
|
||||||
|
|
||||||
await interaction.editReply({
|
await interaction.editReply({
|
||||||
|
|||||||
@@ -58,8 +58,7 @@ export = {
|
|||||||
const embedColor = Number(color.replace("#", "0x"))
|
const embedColor = Number(color.replace("#", "0x"))
|
||||||
|
|
||||||
await interaction.editReply({
|
await interaction.editReply({
|
||||||
embeds: [
|
embeds: [{
|
||||||
{
|
|
||||||
title: "Commands",
|
title: "Commands",
|
||||||
description: "List of commands",
|
description: "List of commands",
|
||||||
fields: commandList,
|
fields: commandList,
|
||||||
@@ -71,8 +70,7 @@ export = {
|
|||||||
icon_url: interaction.guild!.iconURL() || undefined,
|
icon_url: interaction.guild!.iconURL() || undefined,
|
||||||
text: interaction.guild!.name + " | " + devMessage
|
text: interaction.guild!.name + " | " + devMessage
|
||||||
}
|
}
|
||||||
}
|
}]
|
||||||
]
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
} as Command
|
} as Command
|
||||||
|
|||||||
@@ -18,11 +18,9 @@ export = {
|
|||||||
const embedColor = Number(color.replace("#", "0x"))
|
const embedColor = Number(color.replace("#", "0x"))
|
||||||
|
|
||||||
await interaction.reply({
|
await interaction.reply({
|
||||||
embeds: [
|
embeds: [{
|
||||||
{
|
|
||||||
title: "Verification",
|
title: "Verification",
|
||||||
description:
|
description: "1. Log onto hypixel.\n" +
|
||||||
"1. Log onto hypixel.\n" +
|
|
||||||
"2. Right click with the head in your hotbar.\n" +
|
"2. Right click with the head in your hotbar.\n" +
|
||||||
"3. Click on the social media icon.\n" +
|
"3. Click on the social media icon.\n" +
|
||||||
"4. Click on the discord icon.\n" +
|
"4. Click on the discord icon.\n" +
|
||||||
@@ -37,8 +35,7 @@ export = {
|
|||||||
url: instructionsgif,
|
url: instructionsgif,
|
||||||
proxy_url: instructionsgif
|
proxy_url: instructionsgif
|
||||||
}
|
}
|
||||||
}
|
}]
|
||||||
]
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
} as Command
|
} as Command
|
||||||
|
|||||||
@@ -1,9 +1,4 @@
|
|||||||
import {
|
import { SlashCommandBuilder, PermissionFlagsBits, userMention, GuildMember } from "discord.js"
|
||||||
SlashCommandBuilder,
|
|
||||||
PermissionFlagsBits,
|
|
||||||
userMention,
|
|
||||||
GuildMember
|
|
||||||
} from "discord.js"
|
|
||||||
import { admin, helper } from "config/roles.json"
|
import { admin, helper } from "config/roles.json"
|
||||||
import { color, devMessage } from "config/options.json"
|
import { color, devMessage } from "config/options.json"
|
||||||
import { Command } from "interfaces"
|
import { Command } from "interfaces"
|
||||||
@@ -36,8 +31,7 @@ export = {
|
|||||||
await interaction.deferReply()
|
await interaction.deferReply()
|
||||||
|
|
||||||
const member = interaction.options.getMember("member") as GuildMember
|
const member = interaction.options.getMember("member") as GuildMember
|
||||||
const reason =
|
const reason = interaction.options.getString("reason") ?? "No reason provided."
|
||||||
interaction.options.getString("reason") ?? "No reason provided."
|
|
||||||
const embedColor = Number(color.replace("#", "0x"))
|
const embedColor = Number(color.replace("#", "0x"))
|
||||||
|
|
||||||
const mod = await interaction.guild!.members.fetch(interaction.user.id)
|
const mod = await interaction.guild!.members.fetch(interaction.user.id)
|
||||||
@@ -45,9 +39,7 @@ export = {
|
|||||||
const modRoles = mod.roles.cache.map(role => role.id)
|
const modRoles = mod.roles.cache.map(role => role.id)
|
||||||
|
|
||||||
if (!modRoles.includes(helper) && !modRoles.includes(admin)) {
|
if (!modRoles.includes(helper) && !modRoles.includes(admin)) {
|
||||||
await interaction.editReply(
|
await interaction.editReply("You do not have permission to use this command.")
|
||||||
"You do not have permission to use this command."
|
|
||||||
)
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -79,8 +71,7 @@ export = {
|
|||||||
await member.kick(reason + ` - ${mod.user.username}`)
|
await member.kick(reason + ` - ${mod.user.username}`)
|
||||||
|
|
||||||
await logToChannel("mod", {
|
await logToChannel("mod", {
|
||||||
embeds: [
|
embeds: [{
|
||||||
{
|
|
||||||
author: {
|
author: {
|
||||||
name: mod.user.username,
|
name: mod.user.username,
|
||||||
icon_url: mod.user.avatarURL() || undefined
|
icon_url: mod.user.avatarURL() || undefined
|
||||||
@@ -100,23 +91,15 @@ export = {
|
|||||||
icon_url: member.user.avatarURL() || undefined
|
icon_url: member.user.avatarURL() || undefined
|
||||||
},
|
},
|
||||||
timestamp: new Date().toISOString()
|
timestamp: new Date().toISOString()
|
||||||
}
|
}]
|
||||||
]
|
|
||||||
})
|
})
|
||||||
|
|
||||||
await interaction.editReply({
|
await interaction.editReply({
|
||||||
embeds: [
|
embeds: [{
|
||||||
{
|
|
||||||
title: "Member Kicked",
|
title: "Member Kicked",
|
||||||
description:
|
description: "**User:** " + userMention(member.user.id) + "\n" +
|
||||||
"**User:** " +
|
"**Reason:** " + reason + "\n" +
|
||||||
userMention(member.user.id) +
|
"**Moderator:** " + mod.user.username,
|
||||||
"\n" +
|
|
||||||
"**Reason:** " +
|
|
||||||
reason +
|
|
||||||
"\n" +
|
|
||||||
"**Moderator:** " +
|
|
||||||
mod.user.username,
|
|
||||||
color: embedColor,
|
color: embedColor,
|
||||||
thumbnail: {
|
thumbnail: {
|
||||||
url: member.user.avatarURL() || ""
|
url: member.user.avatarURL() || ""
|
||||||
@@ -125,8 +108,7 @@ export = {
|
|||||||
icon_url: interaction.guild!.iconURL() || undefined,
|
icon_url: interaction.guild!.iconURL() || undefined,
|
||||||
text: interaction.guild!.name + " | " + devMessage
|
text: interaction.guild!.name + " | " + devMessage
|
||||||
}
|
}
|
||||||
}
|
}]
|
||||||
]
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
} as Command
|
} as Command
|
||||||
|
|||||||
@@ -19,8 +19,7 @@ export = {
|
|||||||
const embedColor = Number(color.replace("#", "0x"))
|
const embedColor = Number(color.replace("#", "0x"))
|
||||||
|
|
||||||
await interaction.editReply({
|
await interaction.editReply({
|
||||||
embeds: [
|
embeds: [{
|
||||||
{
|
|
||||||
description: "Ping of the bot is " + client.ws.ping + "ms.",
|
description: "Ping of the bot is " + client.ws.ping + "ms.",
|
||||||
color: embedColor,
|
color: embedColor,
|
||||||
footer: {
|
footer: {
|
||||||
@@ -28,8 +27,7 @@ export = {
|
|||||||
icon_url: interaction.guild?.iconURL() || undefined
|
icon_url: interaction.guild?.iconURL() || undefined
|
||||||
},
|
},
|
||||||
timestamp: new Date().toISOString()
|
timestamp: new Date().toISOString()
|
||||||
}
|
}]
|
||||||
]
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
} as Command
|
} as Command
|
||||||
|
|||||||
@@ -21,8 +21,7 @@ export = {
|
|||||||
.setDMPermission(false),
|
.setDMPermission(false),
|
||||||
|
|
||||||
async execute(interaction) {
|
async execute(interaction) {
|
||||||
const user = (interaction.options.getUser("user") ||
|
const user = (interaction.options.getUser("user") || interaction.user) as User
|
||||||
interaction.user) as User
|
|
||||||
const embedColor = Number(color.replace("#", "0x"))
|
const embedColor = Number(color.replace("#", "0x"))
|
||||||
let size: number
|
let size: number
|
||||||
|
|
||||||
@@ -33,13 +32,11 @@ export = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
await interaction.reply({
|
await interaction.reply({
|
||||||
embeds: [
|
embeds: [{
|
||||||
{
|
|
||||||
title: `${user.username}'s pp size`,
|
title: `${user.username}'s pp size`,
|
||||||
description: `8${"=".repeat(size)}D`,
|
description: `8${"=".repeat(size)}D`,
|
||||||
color: embedColor
|
color: embedColor
|
||||||
}
|
}]
|
||||||
]
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
} as Command
|
} as Command
|
||||||
|
|||||||
@@ -1,8 +1,4 @@
|
|||||||
import {
|
import { SlashCommandBuilder, PermissionFlagsBits, userMention } from "discord.js"
|
||||||
SlashCommandBuilder,
|
|
||||||
PermissionFlagsBits,
|
|
||||||
userMention
|
|
||||||
} from "discord.js"
|
|
||||||
import { color, devMessage } from "config/options.json"
|
import { color, devMessage } from "config/options.json"
|
||||||
import waitinglistSchema from "schemas/waitinglistSchema"
|
import waitinglistSchema from "schemas/waitinglistSchema"
|
||||||
import { Command } from "interfaces"
|
import { Command } from "interfaces"
|
||||||
@@ -36,8 +32,7 @@ export = {
|
|||||||
await interaction.deferReply()
|
await interaction.deferReply()
|
||||||
|
|
||||||
const user = interaction.options.getUser("user")!
|
const user = interaction.options.getUser("user")!
|
||||||
const reason =
|
const reason = interaction.options.getString("reason") ?? "No reason provided."
|
||||||
interaction.options.getString("reason") ?? "No reason provided."
|
|
||||||
const mod = interaction.user!
|
const mod = interaction.user!
|
||||||
const embedColor = Number(color.replace("#", "0x"))
|
const embedColor = Number(color.replace("#", "0x"))
|
||||||
|
|
||||||
@@ -45,14 +40,10 @@ export = {
|
|||||||
|
|
||||||
if (!waitinglist) {
|
if (!waitinglist) {
|
||||||
await interaction.editReply({
|
await interaction.editReply({
|
||||||
embeds: [
|
embeds: [{
|
||||||
{
|
description: userMention(user.id) + " is not on the waiting list.",
|
||||||
description:
|
|
||||||
userMention(user.id) +
|
|
||||||
" is not on the waiting list.",
|
|
||||||
color: embedColor
|
color: embedColor
|
||||||
}
|
}]
|
||||||
]
|
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -60,8 +51,7 @@ export = {
|
|||||||
await waitinglistSchema.findOneAndDelete({ userID: user.id })
|
await waitinglistSchema.findOneAndDelete({ userID: user.id })
|
||||||
|
|
||||||
await logToChannel("mod", {
|
await logToChannel("mod", {
|
||||||
embeds: [
|
embeds: [{
|
||||||
{
|
|
||||||
author: {
|
author: {
|
||||||
name: mod.username,
|
name: mod.username,
|
||||||
icon_url: mod.avatarURL() || undefined
|
icon_url: mod.avatarURL() || undefined
|
||||||
@@ -81,28 +71,20 @@ export = {
|
|||||||
text: "ID: " + user.id
|
text: "ID: " + user.id
|
||||||
},
|
},
|
||||||
timestamp: new Date().toISOString()
|
timestamp: new Date().toISOString()
|
||||||
}
|
}]
|
||||||
]
|
|
||||||
})
|
})
|
||||||
|
|
||||||
await interaction.editReply({
|
await interaction.editReply({
|
||||||
embeds: [
|
embeds: [{
|
||||||
{
|
|
||||||
title: "Waiting List - Remove User",
|
title: "Waiting List - Remove User",
|
||||||
description:
|
description: "**User:** " + userMention(user.id) + "\n" +
|
||||||
"**User:** " +
|
"**Reason:** `" + reason + "`",
|
||||||
userMention(user.id) +
|
|
||||||
"\n" +
|
|
||||||
"**Reason:** `" +
|
|
||||||
reason +
|
|
||||||
"`",
|
|
||||||
color: embedColor,
|
color: embedColor,
|
||||||
footer: {
|
footer: {
|
||||||
text: interaction.guild!.name + " | " + devMessage,
|
text: interaction.guild!.name + " | " + devMessage,
|
||||||
icon_url: interaction.guild!.iconURL() || undefined
|
icon_url: interaction.guild!.iconURL() || undefined
|
||||||
}
|
}
|
||||||
}
|
}]
|
||||||
]
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
} as Command
|
} as Command
|
||||||
|
|||||||
@@ -1,14 +1,6 @@
|
|||||||
import { SlashCommandBuilder } from "discord.js"
|
import { SlashCommandBuilder } from "discord.js"
|
||||||
import { color, devMessage } from "config/options.json"
|
import { color, devMessage } from "config/options.json"
|
||||||
import {
|
import { bwfkdr, bwstars, bwwins, swstars, swkdr, duelswins, duelswlr } from "config/reqs.json"
|
||||||
bwfkdr,
|
|
||||||
bwstars,
|
|
||||||
bwwins,
|
|
||||||
swstars,
|
|
||||||
swkdr,
|
|
||||||
duelswins,
|
|
||||||
duelswlr
|
|
||||||
} from "config/reqs.json"
|
|
||||||
import { Command } from "interfaces"
|
import { Command } from "interfaces"
|
||||||
|
|
||||||
export = {
|
export = {
|
||||||
@@ -26,11 +18,9 @@ export = {
|
|||||||
const embedColor = Number(color.replace("#", "0x"))
|
const embedColor = Number(color.replace("#", "0x"))
|
||||||
|
|
||||||
await interaction.reply({
|
await interaction.reply({
|
||||||
embeds: [
|
embeds: [{
|
||||||
{
|
|
||||||
title: "Requirements",
|
title: "Requirements",
|
||||||
description:
|
description: "**You must make 100k-150k weekly GEXP.\nAs well as onne of the game stats below**",
|
||||||
"**You must make 100k-150k weekly GEXP.\nAs well as onne of the game stats below**",
|
|
||||||
color: embedColor,
|
color: embedColor,
|
||||||
thumbnail: {
|
thumbnail: {
|
||||||
url: interaction.guild!.iconURL() || ""
|
url: interaction.guild!.iconURL() || ""
|
||||||
@@ -38,40 +28,26 @@ export = {
|
|||||||
fields: [
|
fields: [
|
||||||
{
|
{
|
||||||
name: "**Bedwars**",
|
name: "**Bedwars**",
|
||||||
value:
|
value: "**Stars:** `" + bwstars.toString() +
|
||||||
"**Stars:** `" +
|
"`\n**Wins:** `" + bwwins.toString() +
|
||||||
bwstars.toString() +
|
"`\n**FKDR:** `" + bwfkdr.toString() + "`"
|
||||||
"`\n**Wins:** `" +
|
|
||||||
bwwins.toString() +
|
|
||||||
"`\n**FKDR:** `" +
|
|
||||||
bwfkdr.toString() +
|
|
||||||
"`"
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "**Skywars**",
|
name: "**Skywars**",
|
||||||
value:
|
value: "**Stars:** `" + swstars.toString() +
|
||||||
"**Stars:** `" +
|
"`\n**KDR:** `" + swkdr.toString() + "`"
|
||||||
swstars.toString() +
|
|
||||||
"`\n**KDR:** `" +
|
|
||||||
swkdr.toString() +
|
|
||||||
"`"
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "**Duels**",
|
name: "**Duels**",
|
||||||
value:
|
value: "**Wins:** `" + duelswins.toString() +
|
||||||
"**Wins:** `" +
|
"`\n**WLR:** `" + duelswlr.toString() + "`"
|
||||||
duelswins.toString() +
|
|
||||||
"`\n**WLR:** `" +
|
|
||||||
duelswlr.toString() +
|
|
||||||
"`"
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
footer: {
|
footer: {
|
||||||
text: interaction.guild!.name + " | " + devMessage,
|
text: interaction.guild!.name + " | " + devMessage,
|
||||||
icon_url: interaction.guild!.iconURL() || undefined
|
icon_url: interaction.guild!.iconURL() || undefined
|
||||||
}
|
}
|
||||||
}
|
}]
|
||||||
]
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
} as Command
|
} as Command
|
||||||
|
|||||||
@@ -1,9 +1,4 @@
|
|||||||
import {
|
import { SlashCommandBuilder, PermissionFlagsBits, ChannelType, TextChannel } from "discord.js"
|
||||||
SlashCommandBuilder,
|
|
||||||
PermissionFlagsBits,
|
|
||||||
ChannelType,
|
|
||||||
TextChannel
|
|
||||||
} from "discord.js"
|
|
||||||
import { color, devMessage } from "config/options.json"
|
import { color, devMessage } from "config/options.json"
|
||||||
import { Command } from "interfaces"
|
import { Command } from "interfaces"
|
||||||
|
|
||||||
@@ -26,10 +21,7 @@ export = {
|
|||||||
option
|
option
|
||||||
.setName("channel")
|
.setName("channel")
|
||||||
.setDescription("The channel to send the message to.")
|
.setDescription("The channel to send the message to.")
|
||||||
.addChannelTypes(
|
.addChannelTypes(ChannelType.GuildText, ChannelType.GuildAnnouncement)
|
||||||
ChannelType.GuildText,
|
|
||||||
ChannelType.GuildAnnouncement
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
|
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
|
||||||
.setDMPermission(false),
|
.setDMPermission(false),
|
||||||
@@ -38,13 +30,11 @@ export = {
|
|||||||
await interaction.deferReply({ ephemeral: true })
|
await interaction.deferReply({ ephemeral: true })
|
||||||
|
|
||||||
const message = interaction.options.getString("message")!
|
const message = interaction.options.getString("message")!
|
||||||
const channel = (interaction.options.getChannel("channel") ||
|
const channel = (interaction.options.getChannel("channel") || interaction.channel) as TextChannel
|
||||||
interaction.channel) as TextChannel
|
|
||||||
const embedColor = Number(color.replace("#", "0x"))
|
const embedColor = Number(color.replace("#", "0x"))
|
||||||
|
|
||||||
channel.send({
|
channel.send({
|
||||||
embeds: [
|
embeds: [{
|
||||||
{
|
|
||||||
title: interaction.guild!.name,
|
title: interaction.guild!.name,
|
||||||
description: message,
|
description: message,
|
||||||
color: embedColor,
|
color: embedColor,
|
||||||
@@ -55,21 +45,18 @@ export = {
|
|||||||
text: interaction.guild!.id + " | " + devMessage,
|
text: interaction.guild!.id + " | " + devMessage,
|
||||||
icon_url: interaction.guild!.iconURL() || undefined
|
icon_url: interaction.guild!.iconURL() || undefined
|
||||||
}
|
}
|
||||||
}
|
}]
|
||||||
]
|
|
||||||
})
|
})
|
||||||
|
|
||||||
await interaction.editReply({
|
await interaction.editReply({
|
||||||
embeds: [
|
embeds: [{
|
||||||
{
|
|
||||||
description: "Message sent.",
|
description: "Message sent.",
|
||||||
color: embedColor,
|
color: embedColor,
|
||||||
footer: {
|
footer: {
|
||||||
text: interaction.guild!.name + " | " + devMessage,
|
text: interaction.guild!.name + " | " + devMessage,
|
||||||
icon_url: interaction.guild!.iconURL() || undefined
|
icon_url: interaction.guild!.iconURL() || undefined
|
||||||
}
|
}
|
||||||
}
|
}]
|
||||||
]
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
} as Command
|
} as Command
|
||||||
|
|||||||
@@ -1,9 +1,4 @@
|
|||||||
import {
|
import { SlashCommandBuilder, PermissionFlagsBits, userMention, GuildMember } from "discord.js"
|
||||||
SlashCommandBuilder,
|
|
||||||
PermissionFlagsBits,
|
|
||||||
userMention,
|
|
||||||
GuildMember
|
|
||||||
} from "discord.js"
|
|
||||||
import { color, devMessage } from "config/options.json"
|
import { color, devMessage } from "config/options.json"
|
||||||
import { Command } from "interfaces"
|
import { Command } from "interfaces"
|
||||||
import logToChannel from "utils/functions/logtochannel"
|
import logToChannel from "utils/functions/logtochannel"
|
||||||
@@ -48,8 +43,7 @@ export = {
|
|||||||
await member.setNickname(nickname, `Set by ${interaction.user.tag}`)
|
await member.setNickname(nickname, `Set by ${interaction.user.tag}`)
|
||||||
|
|
||||||
await logToChannel("mod", {
|
await logToChannel("mod", {
|
||||||
embeds: [
|
embeds: [{
|
||||||
{
|
|
||||||
author: {
|
author: {
|
||||||
name: interaction.user.username,
|
name: interaction.user.username,
|
||||||
icon_url: interaction.user.avatarURL() || undefined
|
icon_url: interaction.user.avatarURL() || undefined
|
||||||
@@ -69,21 +63,18 @@ export = {
|
|||||||
icon_url: member.user.avatarURL() || undefined
|
icon_url: member.user.avatarURL() || undefined
|
||||||
},
|
},
|
||||||
timestamp: new Date().toISOString()
|
timestamp: new Date().toISOString()
|
||||||
}
|
}]
|
||||||
]
|
|
||||||
})
|
})
|
||||||
|
|
||||||
await interaction.reply({
|
await interaction.reply({
|
||||||
embeds: [
|
embeds: [{
|
||||||
{
|
|
||||||
description: `Successfully set the nickname of ${userMention(member.id)} to ${nickname}`,
|
description: `Successfully set the nickname of ${userMention(member.id)} to ${nickname}`,
|
||||||
color: embedColor,
|
color: embedColor,
|
||||||
footer: {
|
footer: {
|
||||||
text: interaction.guild!.name + " | " + devMessage,
|
text: interaction.guild!.name + " | " + devMessage,
|
||||||
icon_url: interaction.guild!.iconURL() || undefined
|
icon_url: interaction.guild!.iconURL() || undefined
|
||||||
}
|
}
|
||||||
}
|
}],
|
||||||
],
|
|
||||||
ephemeral: true
|
ephemeral: true
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,4 @@
|
|||||||
import {
|
import { SlashCommandBuilder, PermissionFlagsBits, ButtonBuilder, ActionRowBuilder, ButtonStyle, ChannelType, TextChannel } from "discord.js"
|
||||||
SlashCommandBuilder,
|
|
||||||
PermissionFlagsBits,
|
|
||||||
ButtonBuilder,
|
|
||||||
ActionRowBuilder,
|
|
||||||
ButtonStyle,
|
|
||||||
ChannelType,
|
|
||||||
TextChannel
|
|
||||||
} from "discord.js"
|
|
||||||
import { color, devMessage } from "config/options.json"
|
import { color, devMessage } from "config/options.json"
|
||||||
import { Command } from "interfaces"
|
import { Command } from "interfaces"
|
||||||
|
|
||||||
@@ -27,13 +19,8 @@ export = {
|
|||||||
.addChannelOption(option =>
|
.addChannelOption(option =>
|
||||||
option
|
option
|
||||||
.setName("channel")
|
.setName("channel")
|
||||||
.setDescription(
|
.setDescription("The channel to send the application to.")
|
||||||
"The channel to send the application to."
|
.addChannelTypes(ChannelType.GuildText, ChannelType.GuildAnnouncement)
|
||||||
)
|
|
||||||
.addChannelTypes(
|
|
||||||
ChannelType.GuildText,
|
|
||||||
ChannelType.GuildAnnouncement
|
|
||||||
)
|
|
||||||
.setRequired(true)
|
.setRequired(true)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@@ -44,13 +31,8 @@ export = {
|
|||||||
.addChannelOption(option =>
|
.addChannelOption(option =>
|
||||||
option
|
option
|
||||||
.setName("channel")
|
.setName("channel")
|
||||||
.setDescription(
|
.setDescription("The channel to send the application to.")
|
||||||
"The channel to send the application to."
|
.addChannelTypes(ChannelType.GuildText, ChannelType.GuildAnnouncement)
|
||||||
)
|
|
||||||
.addChannelTypes(
|
|
||||||
ChannelType.GuildText,
|
|
||||||
ChannelType.GuildAnnouncement
|
|
||||||
)
|
|
||||||
.setRequired(true)
|
.setRequired(true)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@@ -61,13 +43,8 @@ export = {
|
|||||||
.addChannelOption(option =>
|
.addChannelOption(option =>
|
||||||
option
|
option
|
||||||
.setName("channel")
|
.setName("channel")
|
||||||
.setDescription(
|
.setDescription("The channel to send the verfiy message to.")
|
||||||
"The channel to send the verfiy message to."
|
.addChannelTypes(ChannelType.GuildText, ChannelType.GuildAnnouncement)
|
||||||
)
|
|
||||||
.addChannelTypes(
|
|
||||||
ChannelType.GuildText,
|
|
||||||
ChannelType.GuildAnnouncement
|
|
||||||
)
|
|
||||||
.setRequired(true)
|
.setRequired(true)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@@ -78,13 +55,8 @@ export = {
|
|||||||
.addChannelOption(option =>
|
.addChannelOption(option =>
|
||||||
option
|
option
|
||||||
.setName("channel")
|
.setName("channel")
|
||||||
.setDescription(
|
.setDescription("The channel to send the waiting list message to.")
|
||||||
"The channel to send the waiting list message to."
|
.addChannelTypes(ChannelType.GuildText, ChannelType.GuildAnnouncement)
|
||||||
)
|
|
||||||
.addChannelTypes(
|
|
||||||
ChannelType.GuildText,
|
|
||||||
ChannelType.GuildAnnouncement
|
|
||||||
)
|
|
||||||
.setRequired(true)
|
.setRequired(true)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@@ -95,13 +67,8 @@ export = {
|
|||||||
.addChannelOption(option =>
|
.addChannelOption(option =>
|
||||||
option
|
option
|
||||||
.setName("channel")
|
.setName("channel")
|
||||||
.setDescription(
|
.setDescription("The channel to send the application to.")
|
||||||
"The channel to send the application to."
|
.addChannelTypes(ChannelType.GuildText, ChannelType.GuildAnnouncement)
|
||||||
)
|
|
||||||
.addChannelTypes(
|
|
||||||
ChannelType.GuildText,
|
|
||||||
ChannelType.GuildAnnouncement
|
|
||||||
)
|
|
||||||
.setRequired(true)
|
.setRequired(true)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@@ -120,8 +87,7 @@ export = {
|
|||||||
|
|
||||||
if (subcommand === "sendguildapplication") {
|
if (subcommand === "sendguildapplication") {
|
||||||
title = "Guild Application"
|
title = "Guild Application"
|
||||||
description =
|
description = "You can apply for the guild by clicking the button below."
|
||||||
"You can apply for the guild by clicking the button below."
|
|
||||||
customId = "guildapply"
|
customId = "guildapply"
|
||||||
label = "Apply"
|
label = "Apply"
|
||||||
emoji = "✅"
|
emoji = "✅"
|
||||||
@@ -129,8 +95,7 @@ export = {
|
|||||||
|
|
||||||
if (subcommand === "sendstaffapplication") {
|
if (subcommand === "sendstaffapplication") {
|
||||||
title = "Staff Application"
|
title = "Staff Application"
|
||||||
description =
|
description = "You can apply for the staff team by clicking the button below."
|
||||||
"You can apply for the staff team by clicking the button below."
|
|
||||||
customId = "staffapply"
|
customId = "staffapply"
|
||||||
label = "Apply"
|
label = "Apply"
|
||||||
emoji = "✅"
|
emoji = "✅"
|
||||||
@@ -138,8 +103,7 @@ export = {
|
|||||||
|
|
||||||
if (subcommand === "sendinactivityapplication") {
|
if (subcommand === "sendinactivityapplication") {
|
||||||
title = "Inactivity Log"
|
title = "Inactivity Log"
|
||||||
description =
|
description = "You can send an inactivity log by clicking the button below."
|
||||||
"You can send an inactivity log by clicking the button below."
|
|
||||||
customId = "guildinactivitylog"
|
customId = "guildinactivitylog"
|
||||||
label = "Submit"
|
label = "Submit"
|
||||||
emoji = "✅"
|
emoji = "✅"
|
||||||
@@ -162,8 +126,7 @@ export = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
await channel.send({
|
await channel.send({
|
||||||
embeds: [
|
embeds: [{
|
||||||
{
|
|
||||||
title: title,
|
title: title,
|
||||||
description: description,
|
description: description,
|
||||||
color: embedColor,
|
color: embedColor,
|
||||||
@@ -174,8 +137,7 @@ export = {
|
|||||||
text: interaction.guild!.name + " | " + devMessage,
|
text: interaction.guild!.name + " | " + devMessage,
|
||||||
icon_url: interaction.guild!.iconURL() || undefined
|
icon_url: interaction.guild!.iconURL() || undefined
|
||||||
}
|
}
|
||||||
}
|
}],
|
||||||
],
|
|
||||||
components: [
|
components: [
|
||||||
new ActionRowBuilder<ButtonBuilder>().addComponents(
|
new ActionRowBuilder<ButtonBuilder>().addComponents(
|
||||||
new ButtonBuilder()
|
new ButtonBuilder()
|
||||||
|
|||||||
@@ -1,11 +1,4 @@
|
|||||||
import {
|
import { SlashCommandBuilder, PermissionFlagsBits, ChannelType, TextChannel, channelMention, userMention } from "discord.js"
|
||||||
SlashCommandBuilder,
|
|
||||||
PermissionFlagsBits,
|
|
||||||
ChannelType,
|
|
||||||
TextChannel,
|
|
||||||
channelMention,
|
|
||||||
userMention
|
|
||||||
} from "discord.js"
|
|
||||||
import { color, devMessage } from "config/options.json"
|
import { color, devMessage } from "config/options.json"
|
||||||
import { Command } from "interfaces"
|
import { Command } from "interfaces"
|
||||||
import logToChannel from "utils/functions/logtochannel"
|
import logToChannel from "utils/functions/logtochannel"
|
||||||
@@ -28,10 +21,7 @@ export = {
|
|||||||
option
|
option
|
||||||
.setName("channel")
|
.setName("channel")
|
||||||
.setDescription("The channel to set the slowmode of.")
|
.setDescription("The channel to set the slowmode of.")
|
||||||
.addChannelTypes(
|
.addChannelTypes(ChannelType.GuildText, ChannelType.GuildAnnouncement)
|
||||||
ChannelType.GuildText,
|
|
||||||
ChannelType.GuildAnnouncement
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
|
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
|
||||||
.setDMPermission(false),
|
.setDMPermission(false),
|
||||||
@@ -40,30 +30,26 @@ export = {
|
|||||||
await interaction.deferReply({ ephemeral: true })
|
await interaction.deferReply({ ephemeral: true })
|
||||||
|
|
||||||
const seconds = interaction.options.getInteger("seconds") ?? 5
|
const seconds = interaction.options.getInteger("seconds") ?? 5
|
||||||
const channel = (interaction.options.getChannel("channel") ||
|
const channel = (interaction.options.getChannel("channel") || interaction.channel) as TextChannel
|
||||||
interaction.channel) as TextChannel
|
|
||||||
const embedColor = Number(color.replace("#", "0x"))
|
const embedColor = Number(color.replace("#", "0x"))
|
||||||
|
|
||||||
if (seconds > 21600) {
|
if (seconds > 21600) {
|
||||||
await channel.setRateLimitPerUser(21600)
|
await channel.setRateLimitPerUser(21600)
|
||||||
await interaction.editReply({
|
await interaction.editReply({
|
||||||
embeds: [
|
embeds: [{
|
||||||
{
|
|
||||||
description: `Set the slowmode of ${channel} to 21600 seconds.`,
|
description: `Set the slowmode of ${channel} to 21600 seconds.`,
|
||||||
color: embedColor,
|
color: embedColor,
|
||||||
footer: {
|
footer: {
|
||||||
text: interaction.guild!.name + " | " + devMessage,
|
text: interaction.guild!.name + " | " + devMessage,
|
||||||
icon_url: interaction.guild!.iconURL() || undefined
|
icon_url: interaction.guild!.iconURL() || undefined
|
||||||
}
|
}
|
||||||
}
|
}]
|
||||||
]
|
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
await logToChannel("mod", {
|
await logToChannel("mod", {
|
||||||
embeds: [
|
embeds: [{
|
||||||
{
|
|
||||||
author: {
|
author: {
|
||||||
name: interaction.user.username,
|
name: interaction.user.username,
|
||||||
icon_url: interaction.user.avatarURL() || undefined
|
icon_url: interaction.user.avatarURL() || undefined
|
||||||
@@ -83,21 +69,18 @@ export = {
|
|||||||
text: " ID: " + channel.id
|
text: " ID: " + channel.id
|
||||||
},
|
},
|
||||||
timestamp: new Date().toISOString()
|
timestamp: new Date().toISOString()
|
||||||
}
|
}]
|
||||||
]
|
|
||||||
})
|
})
|
||||||
|
|
||||||
await interaction.editReply({
|
await interaction.editReply({
|
||||||
embeds: [
|
embeds: [{
|
||||||
{
|
|
||||||
description: `Set the slowmode of ${channel} to ${seconds} seconds.`,
|
description: `Set the slowmode of ${channel} to ${seconds} seconds.`,
|
||||||
color: embedColor,
|
color: embedColor,
|
||||||
footer: {
|
footer: {
|
||||||
text: interaction.guild!.name + " | " + devMessage,
|
text: interaction.guild!.name + " | " + devMessage,
|
||||||
icon_url: interaction.guild!.iconURL() || undefined
|
icon_url: interaction.guild!.iconURL() || undefined
|
||||||
}
|
}
|
||||||
}
|
}]
|
||||||
]
|
|
||||||
})
|
})
|
||||||
await channel.setRateLimitPerUser(seconds)
|
await channel.setRateLimitPerUser(seconds)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,12 +33,10 @@ export = {
|
|||||||
|
|
||||||
if (!snipeCache.length) {
|
if (!snipeCache.length) {
|
||||||
await interaction.editReply({
|
await interaction.editReply({
|
||||||
embeds: [
|
embeds: [{
|
||||||
{
|
|
||||||
description: "No messages to snipe",
|
description: "No messages to snipe",
|
||||||
color: embedColor
|
color: embedColor
|
||||||
}
|
}]
|
||||||
]
|
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -50,16 +48,13 @@ export = {
|
|||||||
messages.push(`**Message #${i}:** ${data.content}\n`)
|
messages.push(`**Message #${i}:** ${data.content}\n`)
|
||||||
} else {
|
} else {
|
||||||
messages.push(`**Message #${i}:** ${data.content}`)
|
messages.push(`**Message #${i}:** ${data.content}`)
|
||||||
messages.push(
|
messages.push(`**Attachments:** ${data.attachments.join(", ")}\n`)
|
||||||
`**Attachments:** ${data.attachments.join(", ")}\n`
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
i++
|
i++
|
||||||
}
|
}
|
||||||
|
|
||||||
await interaction.editReply({
|
await interaction.editReply({
|
||||||
embeds: [
|
embeds: [{
|
||||||
{
|
|
||||||
author: {
|
author: {
|
||||||
name: member.user.username,
|
name: member.user.username,
|
||||||
icon_url: member.user.avatarURL() || undefined
|
icon_url: member.user.avatarURL() || undefined
|
||||||
@@ -74,8 +69,7 @@ export = {
|
|||||||
icon_url: interaction.guild!.iconURL() || undefined
|
icon_url: interaction.guild!.iconURL() || undefined
|
||||||
},
|
},
|
||||||
timestamp: new Date().toISOString()
|
timestamp: new Date().toISOString()
|
||||||
}
|
}]
|
||||||
]
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
} as Command
|
} as Command
|
||||||
|
|||||||
@@ -59,16 +59,14 @@ export = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
await interaction.reply({
|
await interaction.reply({
|
||||||
embeds: [
|
embeds: [{
|
||||||
{
|
|
||||||
description: "This command is currently under development",
|
description: "This command is currently under development",
|
||||||
color: embedColor,
|
color: embedColor,
|
||||||
footer: {
|
footer: {
|
||||||
text: interaction.guild!.name + " | " + devMessage,
|
text: interaction.guild!.name + " | " + devMessage,
|
||||||
icon_url: interaction.guild!.iconURL() || undefined
|
icon_url: interaction.guild!.iconURL() || undefined
|
||||||
}
|
}
|
||||||
}
|
}]
|
||||||
]
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
} as Command
|
} as Command
|
||||||
|
|||||||
@@ -1,27 +1,9 @@
|
|||||||
import {
|
import { bwwins, beastbwfkdr, beastbwstars, beastswkdr, beastswstars, beastduelswins, duelswlr } from "config/reqs.json"
|
||||||
bwwins,
|
|
||||||
beastbwfkdr,
|
|
||||||
beastbwstars,
|
|
||||||
beastswkdr,
|
|
||||||
beastswstars,
|
|
||||||
beastduelswins,
|
|
||||||
duelswlr
|
|
||||||
} from "config/reqs.json"
|
|
||||||
import { color, devMessage } from "config/options.json"
|
import { color, devMessage } from "config/options.json"
|
||||||
import {
|
import { hypixelLevel, bedwarsLevel, skywarsLevel, getUUID, getPlayer, getGuild, getHeadURL } from "utils/Hypixel"
|
||||||
hypixelLevel,
|
|
||||||
bedwarsLevel,
|
|
||||||
skywarsLevel,
|
|
||||||
getUUID,
|
|
||||||
getPlayer,
|
|
||||||
getGuild,
|
|
||||||
getHeadURL
|
|
||||||
} from "utils/Hypixel"
|
|
||||||
import { ChatInputCommandInteraction } from "discord.js"
|
import { ChatInputCommandInteraction } from "discord.js"
|
||||||
|
|
||||||
export default async function beast(
|
export default async function beast(interaction: ChatInputCommandInteraction): Promise<void> {
|
||||||
interaction: ChatInputCommandInteraction
|
|
||||||
): Promise<void> {
|
|
||||||
await interaction.deferReply()
|
await interaction.deferReply()
|
||||||
|
|
||||||
const ign = interaction.options.getString("ign")!
|
const ign = interaction.options.getString("ign")!
|
||||||
@@ -33,46 +15,38 @@ export default async function beast(
|
|||||||
}
|
}
|
||||||
|
|
||||||
await interaction.editReply({
|
await interaction.editReply({
|
||||||
embeds: [
|
embeds: [{
|
||||||
{
|
|
||||||
description: "Fetching your uuid...",
|
description: "Fetching your uuid...",
|
||||||
color: embedColor
|
color: embedColor
|
||||||
}
|
}]
|
||||||
]
|
|
||||||
})
|
})
|
||||||
|
|
||||||
const uuid = await getUUID(ign)
|
const uuid = await getUUID(ign)
|
||||||
if (!uuid) {
|
if (!uuid) {
|
||||||
interaction.editReply({
|
interaction.editReply({
|
||||||
embeds: [
|
embeds: [{
|
||||||
{
|
|
||||||
description: "That player doesn't exist.",
|
description: "That player doesn't exist.",
|
||||||
color: embedColor
|
color: embedColor
|
||||||
}
|
}]
|
||||||
]
|
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
await interaction.editReply({
|
await interaction.editReply({
|
||||||
embeds: [
|
embeds: [{
|
||||||
{
|
|
||||||
description: "Fetching your player data...",
|
description: "Fetching your player data...",
|
||||||
color: embedColor
|
color: embedColor
|
||||||
}
|
}]
|
||||||
]
|
|
||||||
})
|
})
|
||||||
|
|
||||||
const head = await getHeadURL(ign)
|
const head = await getHeadURL(ign)
|
||||||
const player = await getPlayer(uuid)
|
const player = await getPlayer(uuid)
|
||||||
if (!player) {
|
if (!player) {
|
||||||
interaction.editReply({
|
interaction.editReply({
|
||||||
embeds: [
|
embeds: [{
|
||||||
{
|
|
||||||
description: "That player hasn't played Hypixel before.",
|
description: "That player hasn't played Hypixel before.",
|
||||||
color: embedColor
|
color: embedColor
|
||||||
}
|
}]
|
||||||
]
|
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -94,12 +68,10 @@ export default async function beast(
|
|||||||
}
|
}
|
||||||
|
|
||||||
await interaction.editReply({
|
await interaction.editReply({
|
||||||
embeds: [
|
embeds: [{
|
||||||
{
|
|
||||||
description: "Fetching your guild data...",
|
description: "Fetching your guild data...",
|
||||||
color: embedColor
|
color: embedColor
|
||||||
}
|
}]
|
||||||
]
|
|
||||||
})
|
})
|
||||||
|
|
||||||
const guild = await getGuild(uuid)
|
const guild = await getGuild(uuid)
|
||||||
@@ -128,44 +100,28 @@ export default async function beast(
|
|||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
if (player.stats.Bedwars) {
|
if (player.stats.Bedwars) {
|
||||||
const hsbwexp = player.stats.Bedwars.Experience || 0
|
const hsbwexp = player.stats.Bedwars?.Experience || 0
|
||||||
|
const hsbwfk = player.stats.Bedwars?.final_kills_bedwars || 0
|
||||||
|
const hsbwfd = player.stats.Bedwars?.final_deaths_bedwars || 0
|
||||||
|
const hsbwwins = player.stats.Bedwars?.wins_bedwars || 0
|
||||||
const hsbwstars = bedwarsLevel(hsbwexp)
|
const hsbwstars = bedwarsLevel(hsbwexp)
|
||||||
const hsbwfk = player.stats?.Bedwars?.final_kills_bedwars || 0
|
|
||||||
const hsbwfd = player.stats?.Bedwars?.final_deaths_bedwars || 0
|
|
||||||
const hsbwfkdr = hsbwfk / hsbwfd || 0
|
const hsbwfkdr = hsbwfk / hsbwfd || 0
|
||||||
const hsbwwins = player.stats.Bedwars.wins_bedwars || 0
|
|
||||||
|
|
||||||
let bwtitle = ""
|
let bwtitle = ""
|
||||||
if (
|
if (hsbwstars < beastbwstars || hsbwfkdr < beastbwfkdr || hsbwwins < bwwins) {
|
||||||
hsbwstars < beastbwstars ||
|
bwtitle = "<a:cross_a:1087808606897983539> This player does not meet the BedWars requirements."
|
||||||
hsbwfkdr < beastbwfkdr ||
|
|
||||||
hsbwwins < bwwins
|
|
||||||
) {
|
|
||||||
bwtitle =
|
|
||||||
"<a:cross_a:1087808606897983539> This player does not meet the BedWars requirements."
|
|
||||||
} else {
|
} else {
|
||||||
bwtitle =
|
bwtitle = "<a:check_a:1087808632172847134> This player meets the BedWars requirements."
|
||||||
"<a:check_a:1087808632172847134> This player meets the BedWars requirements."
|
|
||||||
}
|
}
|
||||||
|
|
||||||
statsFields.push({
|
statsFields.push({
|
||||||
name: bwtitle,
|
name: bwtitle,
|
||||||
value:
|
value: "**➺ Stars:** `" + hsbwstars.toFixed(2).toString() +
|
||||||
"**➺ Stars:** `" +
|
" / " + beastbwstars.toString() + "`\n" +
|
||||||
hsbwstars.toFixed(2).toString() +
|
"**➺ FKDR:** `" + hsbwfkdr.toFixed(2).toString() +
|
||||||
" / " +
|
" / " + beastbwfkdr.toString() + "`\n" +
|
||||||
beastbwstars.toString() +
|
"**➺ Wins:** `" + hsbwwins.toString() +
|
||||||
"`\n" +
|
" / " + bwwins.toString() + "`"
|
||||||
"**➺ FKDR:** `" +
|
|
||||||
hsbwfkdr.toFixed(2).toString() +
|
|
||||||
" / " +
|
|
||||||
beastbwfkdr.toString() +
|
|
||||||
"`\n" +
|
|
||||||
"**➺ Wins:** `" +
|
|
||||||
hsbwwins.toString() +
|
|
||||||
" / " +
|
|
||||||
bwwins.toString() +
|
|
||||||
"`"
|
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
statsFields.push({
|
statsFields.push({
|
||||||
@@ -175,38 +131,27 @@ export default async function beast(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (player.stats.SkyWars) {
|
if (player.stats.SkyWars) {
|
||||||
const hsswexp = player.stats?.SkyWars?.skywars_experience || 0
|
const hsswexp = player.stats.SkyWars?.skywars_experience || 0
|
||||||
|
const hsswkills = player.stats.SkyWars?.kills || 0
|
||||||
|
const hsswdeaths = player.stats.SkyWars?.deaths || 0
|
||||||
|
const hsswwins = player.stats.SkyWars?.wins || 0
|
||||||
const hsswstars = skywarsLevel(hsswexp)
|
const hsswstars = skywarsLevel(hsswexp)
|
||||||
const hsswkills = player.stats?.SkyWars?.kills || 0
|
|
||||||
const hsswdeaths = player.stats?.SkyWars?.deaths || 0
|
|
||||||
const hsswkd = hsswkills / hsswdeaths || 0
|
const hsswkd = hsswkills / hsswdeaths || 0
|
||||||
const hsswwins = player.stats?.SkyWars?.wins || 0
|
|
||||||
|
|
||||||
let swtitle = ""
|
let swtitle = ""
|
||||||
if (hsswstars < beastswstars || hsswkd < beastswkdr) {
|
if (hsswstars < beastswstars || hsswkd < beastswkdr) {
|
||||||
swtitle =
|
swtitle = "<a:cross_a:1087808606897983539> This player does not meet the SkyWars requirements."
|
||||||
"<a:cross_a:1087808606897983539> This player does not meet the SkyWars requirements."
|
|
||||||
} else {
|
} else {
|
||||||
swtitle =
|
swtitle = "<a:check_a:1087808632172847134> This player meets the SkyWars requirements."
|
||||||
"<a:check_a:1087808632172847134> This player meets the SkyWars requirements."
|
|
||||||
}
|
}
|
||||||
|
|
||||||
statsFields.push({
|
statsFields.push({
|
||||||
name: swtitle,
|
name: swtitle,
|
||||||
value:
|
value: "**➺ Stars:** `" + hsswstars.toFixed(2).toString() +
|
||||||
"**➺ Stars:** `" +
|
" / " + beastswstars.toString() + "`\n" +
|
||||||
hsswstars.toFixed(2).toString() +
|
"**➺ KDR:** `" + hsswkd.toFixed(2).toString() +
|
||||||
" / " +
|
" / " + beastswkdr.toString() + "`\n" +
|
||||||
beastswstars.toString() +
|
"**➺ Wins:** `" + hsswwins.toString() + "`"
|
||||||
"`\n" +
|
|
||||||
"**➺ KDR:** `" +
|
|
||||||
hsswkd.toFixed(2).toString() +
|
|
||||||
" / " +
|
|
||||||
beastswkdr.toString() +
|
|
||||||
"`\n" +
|
|
||||||
"**➺ Wins:** `" +
|
|
||||||
hsswwins.toString() +
|
|
||||||
"`"
|
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
statsFields.push({
|
statsFields.push({
|
||||||
@@ -216,38 +161,27 @@ export default async function beast(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (player.stats.Duels) {
|
if (player.stats.Duels) {
|
||||||
const hsduelskills = player.stats?.Duels?.kills || 0
|
const hsduelskills = player.stats.Duels?.kills || 0
|
||||||
const hsduelsdeaths = player.stats?.Duels?.deaths || 0
|
const hsduelsdeaths = player.stats.Duels?.deaths || 0
|
||||||
const hsduelskd = hsduelskills / hsduelsdeaths || 0
|
const hsduelswins = player.stats.Duels?.wins || 0
|
||||||
const hsduelswins = player.stats?.Duels?.wins || 0
|
const hsduelslosses = player.stats.Duels?.losses || 0
|
||||||
const hsduelslosses = player.stats?.Duels?.losses || 0
|
const hsduelskd = hsduelskills / hsduelsdeaths
|
||||||
const hsduelswlr = hsduelswins / hsduelslosses || 0
|
const hsduelswlr = hsduelswins / hsduelslosses
|
||||||
|
|
||||||
let duelstitle = ""
|
let duelstitle = ""
|
||||||
if (hsduelswins < beastduelswins || hsduelswlr < duelswlr) {
|
if (hsduelswins < beastduelswins || hsduelswlr < duelswlr) {
|
||||||
duelstitle =
|
duelstitle = "<a:cross_a:1087808606897983539> This player does not meet the Duels requirements."
|
||||||
"<a:cross_a:1087808606897983539> This player does not meet the Duels requirements."
|
|
||||||
} else {
|
} else {
|
||||||
duelstitle =
|
duelstitle = "<a:check_a:1087808632172847134> This player meets the Duels requirements."
|
||||||
"<a:check_a:1087808632172847134> This player meets the Duels requirements."
|
|
||||||
}
|
}
|
||||||
|
|
||||||
statsFields.push({
|
statsFields.push({
|
||||||
name: duelstitle,
|
name: duelstitle,
|
||||||
value:
|
value: "**➺ Wins:** `" + hsduelswins.toString() +
|
||||||
"**➺ Wins:** `" +
|
" / " + beastduelswins.toString() + "`\n" +
|
||||||
hsduelswins.toString() +
|
"**➺ WLR:** `" + hsduelswlr.toFixed(2).toString() +
|
||||||
" / " +
|
" / " + duelswlr.toString() + "`\n" +
|
||||||
beastduelswins.toString() +
|
"**➺ KDR:** `" + hsduelskd.toFixed(2).toString() + "`"
|
||||||
"`\n" +
|
|
||||||
"**➺ WLR:** `" +
|
|
||||||
hsduelswlr.toFixed(2).toString() +
|
|
||||||
" / " +
|
|
||||||
duelswlr.toString() +
|
|
||||||
"`\n" +
|
|
||||||
"**➺ KDR:** `" +
|
|
||||||
hsduelskd.toFixed(2).toString() +
|
|
||||||
"`\n"
|
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
statsFields.push({
|
statsFields.push({
|
||||||
@@ -258,20 +192,14 @@ export default async function beast(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// network level
|
// network level
|
||||||
const hypixelExp = player.networkExp || 0
|
const hypixelExp = player?.networkExp || 0
|
||||||
const level = hypixelLevel(hypixelExp)
|
const level = hypixelLevel(hypixelExp)
|
||||||
|
|
||||||
await interaction.editReply({
|
await interaction.editReply({
|
||||||
embeds: [
|
embeds: [{
|
||||||
{
|
|
||||||
title: rank + player.displayname + guildTag,
|
title: rank + player.displayname + guildTag,
|
||||||
description:
|
description: "**Network Level:** `" + level.toFixed(2).toString() + "`\n" +
|
||||||
"**Network Level:** `" +
|
"**Current Guild:** `" + guildName + "`",
|
||||||
level.toFixed(2).toString() +
|
|
||||||
"`\n" +
|
|
||||||
"**Current Guild:** `" +
|
|
||||||
guildName +
|
|
||||||
"`",
|
|
||||||
color: embedColor,
|
color: embedColor,
|
||||||
thumbnail: {
|
thumbnail: {
|
||||||
url: head!
|
url: head!
|
||||||
@@ -281,7 +209,6 @@ export default async function beast(
|
|||||||
icon_url: interaction.guild!.iconURL() || undefined
|
icon_url: interaction.guild!.iconURL() || undefined
|
||||||
},
|
},
|
||||||
fields: statsFields
|
fields: statsFields
|
||||||
}
|
}]
|
||||||
]
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,10 +2,7 @@ import { ChatInputCommandInteraction } from "discord.js"
|
|||||||
import { color, devMessage } from "config/options.json"
|
import { color, devMessage } from "config/options.json"
|
||||||
import { ExtendedClient as Client } from "utils/Client"
|
import { ExtendedClient as Client } from "utils/Client"
|
||||||
|
|
||||||
export default async function help(
|
export default async function help(interaction: ChatInputCommandInteraction, client: Client): Promise<void> {
|
||||||
interaction: ChatInputCommandInteraction,
|
|
||||||
client: Client
|
|
||||||
): Promise<void> {
|
|
||||||
await interaction.deferReply({ ephemeral: true })
|
await interaction.deferReply({ ephemeral: true })
|
||||||
|
|
||||||
type CommandList = {
|
type CommandList = {
|
||||||
@@ -48,8 +45,7 @@ export default async function help(
|
|||||||
const embedColor = Number(color.replace("#", "0x"))
|
const embedColor = Number(color.replace("#", "0x"))
|
||||||
|
|
||||||
await interaction.editReply({
|
await interaction.editReply({
|
||||||
embeds: [
|
embeds: [{
|
||||||
{
|
|
||||||
title: "Commands",
|
title: "Commands",
|
||||||
description: "List of commands",
|
description: "List of commands",
|
||||||
fields: commandList,
|
fields: commandList,
|
||||||
@@ -61,7 +57,6 @@ export default async function help(
|
|||||||
icon_url: interaction.guild!.iconURL() || undefined,
|
icon_url: interaction.guild!.iconURL() || undefined,
|
||||||
text: interaction.guild?.name + " | " + devMessage
|
text: interaction.guild?.name + " | " + devMessage
|
||||||
}
|
}
|
||||||
}
|
}]
|
||||||
]
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,30 +6,23 @@ import env from "utils/Env"
|
|||||||
import { getGuild } from "utils/Hypixel"
|
import { getGuild } from "utils/Hypixel"
|
||||||
import { GuildData } from "interfaces"
|
import { GuildData } from "interfaces"
|
||||||
|
|
||||||
export default async function updateDiscordRoles(
|
export default async function updateDiscordRoles(interaction: ChatInputCommandInteraction): Promise<void> {
|
||||||
interaction: ChatInputCommandInteraction
|
|
||||||
): Promise<void> {
|
|
||||||
const discordMember = interaction.member as GuildMember
|
const discordMember = interaction.member as GuildMember
|
||||||
const embedColor = Number(color.replace("#", "0x"))
|
const embedColor = Number(color.replace("#", "0x"))
|
||||||
await interaction.deferReply()
|
await interaction.deferReply()
|
||||||
|
|
||||||
if (discordMember.user.id !== env.prod.dev) {
|
if (discordMember.user.id !== env.prod.dev) {
|
||||||
await interaction.editReply({
|
await interaction.editReply({
|
||||||
embeds: [
|
embeds: [{
|
||||||
{
|
description: "You do not have permission to use this command.",
|
||||||
description:
|
|
||||||
"You do not have permission to use this command.",
|
|
||||||
color: embedColor
|
color: embedColor
|
||||||
}
|
}]
|
||||||
]
|
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
const guildMembers = await interaction
|
const guildMembers = await interaction.guild!.members.fetch().then(
|
||||||
.guild!.members.fetch()
|
members => members.map(member => {
|
||||||
.then(members =>
|
|
||||||
members.map(member => {
|
|
||||||
return {
|
return {
|
||||||
id: member.id,
|
id: member.id,
|
||||||
member: member
|
member: member
|
||||||
@@ -59,133 +52,58 @@ export default async function updateDiscordRoles(
|
|||||||
})
|
})
|
||||||
|
|
||||||
await interaction.editReply({
|
await interaction.editReply({
|
||||||
embeds: [
|
embeds: [{
|
||||||
{
|
|
||||||
description: `Updating roles for ${guildMembers.length} members...`,
|
description: `Updating roles for ${guildMembers.length} members...`,
|
||||||
color: embedColor
|
color: embedColor
|
||||||
}
|
}]
|
||||||
]
|
|
||||||
})
|
})
|
||||||
|
|
||||||
for (const gmember of guildMembers) {
|
for (const gmember of guildMembers) {
|
||||||
const memberData = verifiedUsers.find(
|
const memberData = verifiedUsers.find(user => user.userID === gmember.id)
|
||||||
user => user.userID === gmember.id
|
|
||||||
)
|
|
||||||
|
|
||||||
if (!memberData) {
|
if (!memberData) {
|
||||||
const rolesToremove = roleManage("default").rolesToRemove
|
const rolesToremove = roleManage("default").rolesToRemove
|
||||||
await gmember.member.roles.remove(
|
await gmember.member.roles.remove(rolesToremove, "Updating all discord members")
|
||||||
rolesToremove,
|
|
||||||
"Updating all discord members"
|
|
||||||
)
|
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!guildMemberIDs.includes(memberData?.uuid || "none")) {
|
if (!guildMemberIDs.includes(memberData?.uuid || "none")) {
|
||||||
const rolesToremove = roleManage("default").rolesToRemove
|
const rolesToremove = roleManage("default").rolesToRemove
|
||||||
await gmember.member.roles.remove(
|
await gmember.member.roles.remove(rolesToremove, "Updating all discord members")
|
||||||
rolesToremove,
|
|
||||||
"Updating all discord members"
|
|
||||||
)
|
|
||||||
continue
|
continue
|
||||||
} else if (guildMemberIDs.includes(memberData!.uuid)) {
|
} else if (guildMemberIDs.includes(memberData!.uuid)) {
|
||||||
const guildMemberRank = hypixelGuildMembers.find(
|
const guildMemberRank = hypixelGuildMembers.find(gmember => gmember.uuid === memberData!.uuid)!.rank
|
||||||
gmember => gmember.uuid === memberData!.uuid
|
|
||||||
)!.rank
|
|
||||||
console.log("Updating roles for " + gmember.member.user.username)
|
console.log("Updating roles for " + gmember.member.user.username)
|
||||||
|
|
||||||
if (guildMemberRank === "Guild Master") {
|
if (guildMemberRank === "Guild Master") {
|
||||||
// const rolesToRemove = removeThese.filter(role => role !== gm && role !== guildStaff && role !== guildRole)
|
|
||||||
// await gmember.member.roles.remove(rolesToRemove, "Updating all discord members")
|
|
||||||
// await gmember.member.roles.add( gm, "Updating all discord members",)
|
|
||||||
// await gmember.member.roles.add( guildStaff, "Updating all discord members",)
|
|
||||||
// await gmember.member.roles.add( guildRole, "Updating all discord members",)
|
|
||||||
const rolesmanage = roleManage("gm")
|
const rolesmanage = roleManage("gm")
|
||||||
gmember.member.roles.remove(
|
gmember.member.roles.remove(rolesmanage.rolesToRemove, "Updating all discord members")
|
||||||
rolesmanage.rolesToRemove,
|
gmember.member.roles.add(rolesmanage.rolesToAdd, "Updating all discord members")
|
||||||
"Updating all discord members"
|
|
||||||
)
|
|
||||||
gmember.member.roles.add(
|
|
||||||
rolesmanage.rolesToAdd,
|
|
||||||
"Updating all discord members"
|
|
||||||
)
|
|
||||||
continue
|
continue
|
||||||
} else if (guildMemberRank === "Manager") {
|
} else if (guildMemberRank === "Manager") {
|
||||||
// const rolesToRemove = removeThese.filter(role => role !== manager && role !== guildStaff && role !== guildRole)
|
|
||||||
// await gmember.member.roles.remove( rolesToRemove, "Updating all discord members",)
|
|
||||||
// await gmember.member.roles.add( manager, "Updating all discord members",)
|
|
||||||
// await gmember.member.roles.add( guildStaff, "Updating all discord members",)
|
|
||||||
// await gmember.member.roles.add( guildRole, "Updating all discord members",)
|
|
||||||
const rolesmanage = roleManage("manager")
|
const rolesmanage = roleManage("manager")
|
||||||
gmember.member.roles.remove(
|
gmember.member.roles.remove(rolesmanage.rolesToRemove, "Updating all discord members")
|
||||||
rolesmanage.rolesToRemove,
|
gmember.member.roles.add(rolesmanage.rolesToAdd, "Updating all discord members")
|
||||||
"Updating all discord members"
|
|
||||||
)
|
|
||||||
gmember.member.roles.add(
|
|
||||||
rolesmanage.rolesToAdd,
|
|
||||||
"Updating all discord members"
|
|
||||||
)
|
|
||||||
continue
|
continue
|
||||||
} else if (guildMemberRank === "Moderator") {
|
} else if (guildMemberRank === "Moderator") {
|
||||||
// const rolesToRemove = removeThese.filter(role => role !== moderator && role !== guildStaff && role !== guildRole)
|
|
||||||
// await gmember.member.roles.remove( rolesToRemove, "Updating all discord members",)
|
|
||||||
// await gmember.member.roles.add( moderator, "Updating all discord members",)
|
|
||||||
// await gmember.member.roles.add( guildStaff, "Updating all discord members",)
|
|
||||||
// await gmember.member.roles.add( guildRole, "Updating all discord members",)
|
|
||||||
const rolesmanage = roleManage("moderator")
|
const rolesmanage = roleManage("moderator")
|
||||||
gmember.member.roles.remove(
|
gmember.member.roles.remove(rolesmanage.rolesToRemove, "Updating all discord members")
|
||||||
rolesmanage.rolesToRemove,
|
gmember.member.roles.add(rolesmanage.rolesToAdd, "Updating all discord members")
|
||||||
"Updating all discord members"
|
|
||||||
)
|
|
||||||
gmember.member.roles.add(
|
|
||||||
rolesmanage.rolesToAdd,
|
|
||||||
"Updating all discord members"
|
|
||||||
)
|
|
||||||
continue
|
continue
|
||||||
} else if (guildMemberRank === "Beast") {
|
} else if (guildMemberRank === "Beast") {
|
||||||
// const rolesToRemove = removeThese.filter(role => role !== beast && role !== guildRole)
|
|
||||||
// await gmember.member.roles.remove( rolesToRemove, "Updating all discord members",)
|
|
||||||
// await gmember.member.roles.add( beast, "Updating all discord members",)
|
|
||||||
// await gmember.member.roles.add( guildRole, "Updating all discord members",)
|
|
||||||
const rolesmanage = roleManage("beast")
|
const rolesmanage = roleManage("beast")
|
||||||
gmember.member.roles.remove(
|
gmember.member.roles.remove(rolesmanage.rolesToRemove, "Updating all discord members")
|
||||||
rolesmanage.rolesToRemove,
|
gmember.member.roles.add(rolesmanage.rolesToAdd, "Updating all discord members")
|
||||||
"Updating all discord members"
|
|
||||||
)
|
|
||||||
gmember.member.roles.add(
|
|
||||||
rolesmanage.rolesToAdd,
|
|
||||||
"Updating all discord members"
|
|
||||||
)
|
|
||||||
continue
|
continue
|
||||||
} else if (guildMemberRank === "Elite") {
|
} else if (guildMemberRank === "Elite") {
|
||||||
// const rolesToRemove = removeThese.filter(role => role !== elite && role !== guildRole)
|
|
||||||
// await gmember.member.roles.remove( rolesToRemove, "Updating all discord members",)
|
|
||||||
// await gmember.member.roles.add( elite, "Updating all discord members",)
|
|
||||||
// await gmember.member.roles.add( guildRole, "Updating all discord members",)
|
|
||||||
const rolesmanage = roleManage("elite")
|
const rolesmanage = roleManage("elite")
|
||||||
gmember.member.roles.remove(
|
gmember.member.roles.remove(rolesmanage.rolesToRemove, "Updating all discord members")
|
||||||
rolesmanage.rolesToRemove,
|
gmember.member.roles.add(rolesmanage.rolesToAdd, "Updating all discord members")
|
||||||
"Updating all discord members"
|
|
||||||
)
|
|
||||||
gmember.member.roles.add(
|
|
||||||
rolesmanage.rolesToAdd,
|
|
||||||
"Updating all discord members"
|
|
||||||
)
|
|
||||||
continue
|
continue
|
||||||
} else if (guildMemberRank === "Member") {
|
} else if (guildMemberRank === "Member") {
|
||||||
// const rolesToRemove = removeThese.filter(role => role !== member && role !== guildRole)
|
|
||||||
// await gmember.member.roles.remove( rolesToRemove, "Updating all discord members",)
|
|
||||||
// await gmember.member.roles.add( member, "Updating all discord members",)
|
|
||||||
// await gmember.member.roles.add( guildRole, "Updating all discord members",)
|
|
||||||
const rolesmanage = roleManage("member")
|
const rolesmanage = roleManage("member")
|
||||||
gmember.member.roles.remove(
|
gmember.member.roles.remove(rolesmanage.rolesToRemove, "Updating all discord members")
|
||||||
rolesmanage.rolesToRemove,
|
gmember.member.roles.add(rolesmanage.rolesToAdd, "Updating all discord members")
|
||||||
"Updating all discord members"
|
|
||||||
)
|
|
||||||
gmember.member.roles.add(
|
|
||||||
rolesmanage.rolesToAdd,
|
|
||||||
"Updating all discord members"
|
|
||||||
)
|
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
continue
|
continue
|
||||||
@@ -195,11 +113,9 @@ export default async function updateDiscordRoles(
|
|||||||
console.log("Successfully updated all roles.")
|
console.log("Successfully updated all roles.")
|
||||||
|
|
||||||
await interaction.editReply({
|
await interaction.editReply({
|
||||||
embeds: [
|
embeds: [{
|
||||||
{
|
|
||||||
description: "Successfully updated all roles.",
|
description: "Successfully updated all roles.",
|
||||||
color: embedColor
|
color: embedColor
|
||||||
}
|
}]
|
||||||
]
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,4 @@
|
|||||||
import {
|
import { SlashCommandBuilder, PermissionFlagsBits, userMention, ChatInputCommandInteraction, GuildMember } from "discord.js"
|
||||||
SlashCommandBuilder,
|
|
||||||
PermissionFlagsBits,
|
|
||||||
userMention,
|
|
||||||
ChatInputCommandInteraction,
|
|
||||||
GuildMember
|
|
||||||
} from "discord.js"
|
|
||||||
import { color, devMessage } from "config/options.json"
|
import { color, devMessage } from "config/options.json"
|
||||||
import { Command } from "interfaces"
|
import { Command } from "interfaces"
|
||||||
import ms from "ms"
|
import ms from "ms"
|
||||||
@@ -44,8 +38,7 @@ export = {
|
|||||||
|
|
||||||
const target = interaction.options.getMember("user")! as GuildMember
|
const target = interaction.options.getMember("user")! as GuildMember
|
||||||
const timeString = interaction.options.getString("time")!
|
const timeString = interaction.options.getString("time")!
|
||||||
const reason =
|
const reason = interaction.options.getString("reason") || "No reason provided"
|
||||||
interaction.options.getString("reason") || "No reason provided"
|
|
||||||
const mod = interaction.member! as GuildMember
|
const mod = interaction.member! as GuildMember
|
||||||
const embedColor = Number(color.replace("#", "0x"))
|
const embedColor = Number(color.replace("#", "0x"))
|
||||||
const time = ms(timeString)
|
const time = ms(timeString)
|
||||||
@@ -54,65 +47,50 @@ export = {
|
|||||||
|
|
||||||
if (target.user.bot) {
|
if (target.user.bot) {
|
||||||
interaction.editReply({
|
interaction.editReply({
|
||||||
embeds: [
|
embeds: [{
|
||||||
{
|
|
||||||
description: "You cannot timeout a bot.",
|
description: "You cannot timeout a bot.",
|
||||||
color: embedColor
|
color: embedColor
|
||||||
}
|
}]
|
||||||
]
|
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if (target.id == interaction.guild!.ownerId) {
|
if (target.id == interaction.guild!.ownerId) {
|
||||||
await interaction.editReply({
|
await interaction.editReply({
|
||||||
embeds: [
|
embeds: [{
|
||||||
{
|
|
||||||
description: "You cannot timeout the server owner.",
|
description: "You cannot timeout the server owner.",
|
||||||
color: embedColor
|
color: embedColor
|
||||||
}
|
}]
|
||||||
]
|
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (interaction.guild!.members.me!.roles.highest.position <= target.roles.highest.position) {
|
||||||
interaction.guild!.members.me!.roles.highest.position <=
|
|
||||||
target.roles.highest.position
|
|
||||||
) {
|
|
||||||
interaction.editReply({
|
interaction.editReply({
|
||||||
embeds: [
|
embeds: [{
|
||||||
{
|
description: "I cannot timeout this user because their role is higher than mine.",
|
||||||
description:
|
|
||||||
"I cannot timeout this user because their role is higher than mine.",
|
|
||||||
color: embedColor
|
color: embedColor
|
||||||
}
|
}]
|
||||||
]
|
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mod.roles.highest.position <= target.roles.highest.position) {
|
if (mod.roles.highest.position <= target.roles.highest.position) {
|
||||||
await interaction.editReply({
|
await interaction.editReply({
|
||||||
embeds: [
|
embeds: [{
|
||||||
{
|
description: "You cannot timeout this user because their role is higher than yours.",
|
||||||
description:
|
|
||||||
"You cannot timeout this user because their role is higher than yours.",
|
|
||||||
color: embedColor
|
color: embedColor
|
||||||
}
|
}]
|
||||||
]
|
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if (target.id == interaction.user.id) {
|
if (target.id == interaction.user.id) {
|
||||||
interaction.editReply({
|
interaction.editReply({
|
||||||
embeds: [
|
embeds: [{
|
||||||
{
|
|
||||||
description: "You cannot timeout yourself.",
|
description: "You cannot timeout yourself.",
|
||||||
color: embedColor
|
color: embedColor
|
||||||
}
|
}]
|
||||||
]
|
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -123,40 +101,23 @@ export = {
|
|||||||
if (target.isCommunicationDisabled()) {
|
if (target.isCommunicationDisabled()) {
|
||||||
if (time === 0) {
|
if (time === 0) {
|
||||||
title = "Timeout Removed"
|
title = "Timeout Removed"
|
||||||
description =
|
description = "Removed timeout of " + userMention(target.id) + " for " + reason
|
||||||
"Removed timeout of " +
|
|
||||||
userMention(target.id) +
|
|
||||||
" for " +
|
|
||||||
reason
|
|
||||||
timeouttime = null
|
timeouttime = null
|
||||||
} else {
|
} else {
|
||||||
title = "Timeout Updated"
|
title = "Timeout Updated"
|
||||||
description =
|
description = "Updated timeout of " + userMention(target.id) + " to " + prettyTime + " for " + reason
|
||||||
"Updated timeout of " +
|
|
||||||
userMention(target.id) +
|
|
||||||
" to " +
|
|
||||||
prettyTime +
|
|
||||||
" for " +
|
|
||||||
reason
|
|
||||||
timeouttime = time
|
timeouttime = time
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
title = "Member Timed Out"
|
title = "Member Timed Out"
|
||||||
description =
|
description = "Timed out " + userMention(target.id) + " for " + prettyTime + " for " + reason
|
||||||
"Timed out " +
|
|
||||||
userMention(target.id) +
|
|
||||||
" for " +
|
|
||||||
prettyTime +
|
|
||||||
" for " +
|
|
||||||
reason
|
|
||||||
timeouttime = time
|
timeouttime = time
|
||||||
}
|
}
|
||||||
|
|
||||||
await target.timeout(timeouttime, reason)
|
await target.timeout(timeouttime, reason)
|
||||||
|
|
||||||
await logToChannel("mod", {
|
await logToChannel("mod", {
|
||||||
embeds: [
|
embeds: [{
|
||||||
{
|
|
||||||
author: {
|
author: {
|
||||||
name: mod.user.username,
|
name: mod.user.username,
|
||||||
icon_url: mod.user.avatarURL() || undefined
|
icon_url: mod.user.avatarURL() || undefined
|
||||||
@@ -177,21 +138,18 @@ export = {
|
|||||||
icon_url: target.user.avatarURL() || undefined
|
icon_url: target.user.avatarURL() || undefined
|
||||||
},
|
},
|
||||||
timestamp: new Date().toISOString()
|
timestamp: new Date().toISOString()
|
||||||
}
|
}]
|
||||||
]
|
|
||||||
})
|
})
|
||||||
|
|
||||||
await interaction.editReply({
|
await interaction.editReply({
|
||||||
embeds: [
|
embeds: [{
|
||||||
{
|
|
||||||
description: description,
|
description: description,
|
||||||
color: embedColor,
|
color: embedColor,
|
||||||
footer: {
|
footer: {
|
||||||
text: interaction.guild!.name + " | " + devMessage,
|
text: interaction.guild!.name + " | " + devMessage,
|
||||||
icon_url: interaction.guild!.iconURL() || undefined
|
icon_url: interaction.guild!.iconURL() || undefined
|
||||||
}
|
}
|
||||||
}
|
}]
|
||||||
]
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
} as Command
|
} as Command
|
||||||
|
|||||||
@@ -1,9 +1,4 @@
|
|||||||
import {
|
import { SlashCommandBuilder, PermissionFlagsBits, userMention, User } from "discord.js"
|
||||||
SlashCommandBuilder,
|
|
||||||
PermissionFlagsBits,
|
|
||||||
userMention,
|
|
||||||
User
|
|
||||||
} from "discord.js"
|
|
||||||
import { color, devMessage } from "config/options.json"
|
import { color, devMessage } from "config/options.json"
|
||||||
import { Command } from "interfaces"
|
import { Command } from "interfaces"
|
||||||
import logToChannel from "utils/functions/logtochannel"
|
import logToChannel from "utils/functions/logtochannel"
|
||||||
@@ -37,20 +32,17 @@ export = {
|
|||||||
await interaction.deferReply()
|
await interaction.deferReply()
|
||||||
|
|
||||||
const userid = interaction.options.getString("user")!
|
const userid = interaction.options.getString("user")!
|
||||||
const reason =
|
const reason = interaction.options.getString("reason") || "No reason provided"
|
||||||
interaction.options.getString("reason") || "No reason provided"
|
|
||||||
const mod = interaction.user
|
const mod = interaction.user
|
||||||
const embedColor = Number(color.replace("#", "0x"))
|
const embedColor = Number(color.replace("#", "0x"))
|
||||||
let user: User
|
let user: User
|
||||||
|
|
||||||
if (userid === "none") {
|
if (userid === "none") {
|
||||||
await interaction.editReply({
|
await interaction.editReply({
|
||||||
embeds: [
|
embeds: [{
|
||||||
{
|
|
||||||
description: "You haven't specified a user to unban",
|
description: "You haven't specified a user to unban",
|
||||||
color: embedColor
|
color: embedColor
|
||||||
}
|
}]
|
||||||
]
|
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -59,12 +51,10 @@ export = {
|
|||||||
user = await interaction.client.users.fetch(userid)
|
user = await interaction.client.users.fetch(userid)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
await interaction.editReply({
|
await interaction.editReply({
|
||||||
embeds: [
|
embeds: [{
|
||||||
{
|
|
||||||
description: "The user you specified is not valid",
|
description: "The user you specified is not valid",
|
||||||
color: embedColor
|
color: embedColor
|
||||||
}
|
}]
|
||||||
]
|
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -72,8 +62,7 @@ export = {
|
|||||||
await interaction.guild!.members.unban(user.id, reason)
|
await interaction.guild!.members.unban(user.id, reason)
|
||||||
|
|
||||||
await logToChannel("mod", {
|
await logToChannel("mod", {
|
||||||
embeds: [
|
embeds: [{
|
||||||
{
|
|
||||||
author: {
|
author: {
|
||||||
name: mod.username,
|
name: mod.username,
|
||||||
icon_url: mod.avatarURL() || undefined
|
icon_url: mod.avatarURL() || undefined
|
||||||
@@ -93,23 +82,15 @@ export = {
|
|||||||
icon_url: user.avatarURL() || undefined
|
icon_url: user.avatarURL() || undefined
|
||||||
},
|
},
|
||||||
timestamp: new Date().toISOString()
|
timestamp: new Date().toISOString()
|
||||||
}
|
}]
|
||||||
]
|
|
||||||
})
|
})
|
||||||
|
|
||||||
await interaction.editReply({
|
await interaction.editReply({
|
||||||
embeds: [
|
embeds: [{
|
||||||
{
|
|
||||||
title: "User unbanned",
|
title: "User unbanned",
|
||||||
description:
|
description: "The user " + user!.username + " has been unbanned.\n" +
|
||||||
"The user " +
|
"**Reason:** `" + reason + "`\n" +
|
||||||
user!.username +
|
"**Moderator:** " + userMention(mod.id),
|
||||||
" has been unbanned.\n" +
|
|
||||||
"**Reason:** `" +
|
|
||||||
reason +
|
|
||||||
"`\n" +
|
|
||||||
"**Moderator:** " +
|
|
||||||
userMention(mod.id),
|
|
||||||
color: embedColor,
|
color: embedColor,
|
||||||
thumbnail: {
|
thumbnail: {
|
||||||
url: user!.avatarURL() || ""
|
url: user!.avatarURL() || ""
|
||||||
@@ -118,8 +99,7 @@ export = {
|
|||||||
icon_url: interaction.guild!.iconURL() || undefined,
|
icon_url: interaction.guild!.iconURL() || undefined,
|
||||||
text: interaction.guild!.name + " | " + devMessage
|
text: interaction.guild!.name + " | " + devMessage
|
||||||
}
|
}
|
||||||
}
|
}]
|
||||||
]
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
} as Command
|
} as Command
|
||||||
|
|||||||
@@ -25,28 +25,23 @@ export = {
|
|||||||
|
|
||||||
if (!verifyData) {
|
if (!verifyData) {
|
||||||
await interaction.editReply({
|
await interaction.editReply({
|
||||||
embeds: [
|
embeds: [{
|
||||||
{
|
description: "You are not verified. Please run `/verify` to verify yourself",
|
||||||
description:
|
|
||||||
"You are not verified. Please run `/verify` to verify yourself",
|
|
||||||
color: embedColor,
|
color: embedColor,
|
||||||
footer: {
|
footer: {
|
||||||
text: interaction.guild!.name + " | " + devMessage,
|
text: interaction.guild!.name + " | " + devMessage,
|
||||||
icon_url: interaction.guild!.iconURL() || undefined
|
icon_url: interaction.guild!.iconURL() || undefined
|
||||||
}
|
}
|
||||||
}
|
}]
|
||||||
]
|
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
await interaction.editReply({
|
await interaction.editReply({
|
||||||
embeds: [
|
embeds: [{
|
||||||
{
|
|
||||||
description: "Fetching your guild data...",
|
description: "Fetching your guild data...",
|
||||||
color: embedColor
|
color: embedColor
|
||||||
}
|
}]
|
||||||
]
|
|
||||||
})
|
})
|
||||||
|
|
||||||
const guild = await getGuild(verifyData.uuid)
|
const guild = await getGuild(verifyData.uuid)
|
||||||
@@ -61,18 +56,11 @@ export = {
|
|||||||
const head = await getHeadURL(ign)
|
const head = await getHeadURL(ign)
|
||||||
if (guildID !== hypixelGuildID) {
|
if (guildID !== hypixelGuildID) {
|
||||||
const roles = roleManage("default")
|
const roles = roleManage("default")
|
||||||
await user.roles.remove(
|
await user.roles.remove(roles.rolesToRemove, "User used the update command")
|
||||||
roles.rolesToRemove,
|
await user.roles.add(roles.rolesToAdd, "User used the update command")
|
||||||
"User used the update command"
|
|
||||||
)
|
|
||||||
await user.roles.add(
|
|
||||||
roles.rolesToAdd,
|
|
||||||
"User used the update command"
|
|
||||||
)
|
|
||||||
|
|
||||||
await interaction.editReply({
|
await interaction.editReply({
|
||||||
embeds: [
|
embeds: [{
|
||||||
{
|
|
||||||
description: "Updated your roles to `Default Member`",
|
description: "Updated your roles to `Default Member`",
|
||||||
color: embedColor,
|
color: embedColor,
|
||||||
thumbnail: {
|
thumbnail: {
|
||||||
@@ -82,105 +70,62 @@ export = {
|
|||||||
text: interaction.guild!.name + " | " + devMessage,
|
text: interaction.guild!.name + " | " + devMessage,
|
||||||
icon_url: interaction.guild!.iconURL() || undefined
|
icon_url: interaction.guild!.iconURL() || undefined
|
||||||
}
|
}
|
||||||
}
|
}]
|
||||||
]
|
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if (guildID === hypixelGuildID) {
|
if (guildID === hypixelGuildID) {
|
||||||
const GuildMembers = guild!.members
|
const GuildMembers = guild!.members
|
||||||
const guildRank = GuildMembers.find(
|
const guildRank = GuildMembers.find(member => member.uuid === verifyData.uuid)!.rank
|
||||||
member => member.uuid === verifyData.uuid
|
|
||||||
)!.rank
|
|
||||||
let replyRank: string | null = null
|
let replyRank: string | null = null
|
||||||
|
|
||||||
await user.roles.add(
|
await user.roles.add(roleManage("default").rolesToAdd, "User used the update command")
|
||||||
roleManage("default").rolesToAdd,
|
|
||||||
"User used the update command"
|
|
||||||
)
|
|
||||||
|
|
||||||
if (guildRank === "Guild Master") {
|
if (guildRank === "Guild Master") {
|
||||||
const roles = roleManage("gm")
|
const roles = roleManage("gm")
|
||||||
await user.roles.remove(
|
await user.roles.remove(roles.rolesToRemove, "User used the update command")
|
||||||
roles.rolesToRemove,
|
await user.roles.add(roles.rolesToAdd, "User used the update command")
|
||||||
"User used the update command"
|
|
||||||
)
|
|
||||||
await user.roles.add(
|
|
||||||
roles.rolesToAdd,
|
|
||||||
"User used the update command"
|
|
||||||
)
|
|
||||||
replyRank = "Guild Master"
|
replyRank = "Guild Master"
|
||||||
}
|
}
|
||||||
|
|
||||||
if (guildRank === "Manager") {
|
if (guildRank === "Manager") {
|
||||||
const roles = roleManage("manager")
|
const roles = roleManage("manager")
|
||||||
await user.roles.remove(
|
await user.roles.remove(roles.rolesToRemove, "User used the update command")
|
||||||
roles.rolesToRemove,
|
await user.roles.add(roles.rolesToAdd, "User used the update command")
|
||||||
"User used the update command"
|
|
||||||
)
|
|
||||||
await user.roles.add(
|
|
||||||
roles.rolesToAdd,
|
|
||||||
"User used the update command"
|
|
||||||
)
|
|
||||||
replyRank = "Manager"
|
replyRank = "Manager"
|
||||||
}
|
}
|
||||||
|
|
||||||
if (guildRank === "Moderator") {
|
if (guildRank === "Moderator") {
|
||||||
const roles = roleManage("moderator")
|
const roles = roleManage("moderator")
|
||||||
await user.roles.remove(
|
await user.roles.remove(roles.rolesToRemove, "User used the update command")
|
||||||
roles.rolesToRemove,
|
await user.roles.add(roles.rolesToAdd, "User used the update command")
|
||||||
"User used the update command"
|
|
||||||
)
|
|
||||||
await user.roles.add(
|
|
||||||
roles.rolesToAdd,
|
|
||||||
"User used the update command"
|
|
||||||
)
|
|
||||||
replyRank = "Moderator"
|
replyRank = "Moderator"
|
||||||
}
|
}
|
||||||
|
|
||||||
if (guildRank === "Beast") {
|
if (guildRank === "Beast") {
|
||||||
const roles = roleManage("beast")
|
const roles = roleManage("beast")
|
||||||
await user.roles.remove(
|
await user.roles.remove(roles.rolesToRemove, "User used the update command")
|
||||||
roles.rolesToRemove,
|
await user.roles.add(roles.rolesToAdd, "User used the update command")
|
||||||
"User used the update command"
|
|
||||||
)
|
|
||||||
await user.roles.add(
|
|
||||||
roles.rolesToAdd,
|
|
||||||
"User used the update command"
|
|
||||||
)
|
|
||||||
replyRank = "Beast"
|
replyRank = "Beast"
|
||||||
}
|
}
|
||||||
|
|
||||||
if (guildRank === "Elite") {
|
if (guildRank === "Elite") {
|
||||||
const roles = roleManage("elite")
|
const roles = roleManage("elite")
|
||||||
await user.roles.remove(
|
await user.roles.remove(roles.rolesToRemove, "User used the update command")
|
||||||
roles.rolesToRemove,
|
await user.roles.add(roles.rolesToAdd, "User used the update command")
|
||||||
"User used the update command"
|
|
||||||
)
|
|
||||||
await user.roles.add(
|
|
||||||
roles.rolesToAdd,
|
|
||||||
"User used the update command"
|
|
||||||
)
|
|
||||||
replyRank = "Elite"
|
replyRank = "Elite"
|
||||||
}
|
}
|
||||||
|
|
||||||
if (guildRank === "Member") {
|
if (guildRank === "Member") {
|
||||||
const roles = roleManage("member")
|
const roles = roleManage("member")
|
||||||
await user.roles.remove(
|
await user.roles.remove(roles.rolesToRemove, "User used the update command")
|
||||||
roles.rolesToRemove,
|
await user.roles.add(roles.rolesToAdd, "User used the update command")
|
||||||
"User used the update command"
|
|
||||||
)
|
|
||||||
await user.roles.add(
|
|
||||||
roles.rolesToAdd,
|
|
||||||
"User used the update command"
|
|
||||||
)
|
|
||||||
replyRank = "Member"
|
replyRank = "Member"
|
||||||
}
|
}
|
||||||
|
|
||||||
await interaction.editReply({
|
await interaction.editReply({
|
||||||
embeds: [
|
embeds: [{
|
||||||
{
|
|
||||||
description:
|
description:
|
||||||
"Updated your roles to `" + replyRank + "`",
|
"Updated your roles to `" + replyRank + "`",
|
||||||
color: embedColor,
|
color: embedColor,
|
||||||
@@ -191,8 +136,7 @@ export = {
|
|||||||
text: interaction.guild!.name + " | " + devMessage,
|
text: interaction.guild!.name + " | " + devMessage,
|
||||||
icon_url: interaction.guild!.iconURL() || undefined
|
icon_url: interaction.guild!.iconURL() || undefined
|
||||||
}
|
}
|
||||||
}
|
}]
|
||||||
]
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,27 +32,19 @@ export = {
|
|||||||
|
|
||||||
if (!uuid) {
|
if (!uuid) {
|
||||||
interaction.editReply({
|
interaction.editReply({
|
||||||
embeds: [
|
embeds: [{
|
||||||
{
|
|
||||||
description: "That player doesn't exist!",
|
description: "That player doesn't exist!",
|
||||||
color: embedColor
|
color: embedColor
|
||||||
}
|
}]
|
||||||
]
|
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
await interaction.editReply({
|
await interaction.editReply({
|
||||||
embeds: [
|
embeds: [{
|
||||||
{
|
|
||||||
title: newIgn,
|
title: newIgn,
|
||||||
description:
|
description: "**UUID:** `" + uuid + "`\n" +
|
||||||
"**UUID:** `" +
|
"**Formatted UUID:** `" + formattedUuid + "`",
|
||||||
uuid +
|
|
||||||
"`\n" +
|
|
||||||
"**Formatted UUID:** `" +
|
|
||||||
formattedUuid +
|
|
||||||
"`",
|
|
||||||
color: embedColor,
|
color: embedColor,
|
||||||
thumbnail: {
|
thumbnail: {
|
||||||
url: head!
|
url: head!
|
||||||
@@ -61,8 +53,7 @@ export = {
|
|||||||
text: interaction.guild!.name + " | " + devMessage,
|
text: interaction.guild!.name + " | " + devMessage,
|
||||||
icon_url: interaction.guild!.iconURL() || undefined
|
icon_url: interaction.guild!.iconURL() || undefined
|
||||||
}
|
}
|
||||||
}
|
}]
|
||||||
]
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
} as Command
|
} as Command
|
||||||
|
|||||||
@@ -34,69 +34,53 @@ export = {
|
|||||||
|
|
||||||
const verifyData = await verify.findOne({ userID: user.id })
|
const verifyData = await verify.findOne({ userID: user.id })
|
||||||
if (verifyData) {
|
if (verifyData) {
|
||||||
interaction.editReply(
|
interaction.editReply("You are already verified.\n" + "Try running /update to update your roles.")
|
||||||
"You are already verified.\n" +
|
|
||||||
"Try running /update to update your roles."
|
|
||||||
)
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ign) {
|
if (!ign) {
|
||||||
interaction.editReply({
|
interaction.editReply({
|
||||||
embeds: [
|
embeds: [{
|
||||||
{
|
description: "<a:cross_a:1087808606897983539> Please provide your in-game name.",
|
||||||
description:
|
|
||||||
"<a:cross_a:1087808606897983539> Please provide your in-game name.",
|
|
||||||
color: embedColor
|
color: embedColor
|
||||||
}
|
}]
|
||||||
]
|
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
await interaction.editReply({
|
await interaction.editReply({
|
||||||
embeds: [
|
embeds: [{
|
||||||
{
|
|
||||||
description: "Fetching your uuid...",
|
description: "Fetching your uuid...",
|
||||||
color: embedColor
|
color: embedColor
|
||||||
}
|
}]
|
||||||
]
|
|
||||||
})
|
})
|
||||||
|
|
||||||
const uuid = await getUUID(ign)
|
const uuid = await getUUID(ign)
|
||||||
if (!uuid) {
|
if (!uuid) {
|
||||||
interaction.editReply({
|
interaction.editReply({
|
||||||
embeds: [
|
embeds: [{
|
||||||
{
|
description: "<a:questionmark_pink:1130206038008803488> That player does not exist.",
|
||||||
description:
|
|
||||||
"<a:questionmark_pink:1130206038008803488> That player does not exist.",
|
|
||||||
color: embedColor
|
color: embedColor
|
||||||
}
|
}]
|
||||||
]
|
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
await interaction.editReply({
|
await interaction.editReply({
|
||||||
embeds: [
|
embeds: [{
|
||||||
{
|
|
||||||
description: "Fetching your player data...",
|
description: "Fetching your player data...",
|
||||||
color: embedColor
|
color: embedColor
|
||||||
}
|
}]
|
||||||
]
|
|
||||||
})
|
})
|
||||||
|
|
||||||
const head = await getHeadURL(ign)
|
const head = await getHeadURL(ign)
|
||||||
const player = (await getPlayer(uuid)) as PlayerData
|
const player = (await getPlayer(uuid)) as PlayerData
|
||||||
if (!player) {
|
if (!player) {
|
||||||
interaction.editReply({
|
interaction.editReply({
|
||||||
embeds: [
|
embeds: [{
|
||||||
{
|
description: "<a:questionmark_pink:1130206038008803488> That player hasn't played Hypixel before.",
|
||||||
description:
|
|
||||||
"<a:questionmark_pink:1130206038008803488> That player hasn't played Hypixel before.",
|
|
||||||
color: embedColor
|
color: embedColor
|
||||||
}
|
}]
|
||||||
]
|
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -109,60 +93,40 @@ export = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
await interaction.editReply({
|
await interaction.editReply({
|
||||||
embeds: [
|
embeds: [{
|
||||||
{
|
|
||||||
description: "Checking your Discord tag...",
|
description: "Checking your Discord tag...",
|
||||||
color: embedColor
|
color: embedColor
|
||||||
}
|
}]
|
||||||
]
|
|
||||||
})
|
})
|
||||||
|
|
||||||
const linkedDiscord = player?.socialMedia?.links?.DISCORD || null
|
const linkedDiscord = player?.socialMedia?.links?.DISCORD || null
|
||||||
if (!linkedDiscord) {
|
if (!linkedDiscord) {
|
||||||
interaction.editReply({
|
interaction.editReply({
|
||||||
embeds: [
|
embeds: [{
|
||||||
{
|
description: "<a:cross_a:1087808606897983539> There is no Discord account linked to `" + player.displayname + "`.\n\n" +
|
||||||
description:
|
"**Please set your Discord tag on hypixel to `" + username + "` and try again.**",
|
||||||
"<a:cross_a:1087808606897983539> There is no Discord account linked to `" +
|
|
||||||
player.displayname +
|
|
||||||
"`.\n\n" +
|
|
||||||
"**Please set your Discord tag on hypixel to `" +
|
|
||||||
username +
|
|
||||||
"` and try again.**",
|
|
||||||
color: embedColor
|
color: embedColor
|
||||||
}
|
}]
|
||||||
]
|
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if (linkedDiscord !== username) {
|
if (linkedDiscord !== username) {
|
||||||
interaction.editReply({
|
interaction.editReply({
|
||||||
embeds: [
|
embeds: [{
|
||||||
{
|
description: "<a:cross_a:1087808606897983539> The Discord account linked to `" + player.displayname + "` is currently `" + linkedDiscord + "`\n\n" +
|
||||||
description:
|
"**Please set your Discord tag on hypixel to `" + username + "` and try again.**",
|
||||||
"<a:cross_a:1087808606897983539> The Discord account linked to `" +
|
|
||||||
player.displayname +
|
|
||||||
"` is currently `" +
|
|
||||||
linkedDiscord +
|
|
||||||
"`\n\n" +
|
|
||||||
"**Please set your Discord tag on hypixel to `" +
|
|
||||||
username +
|
|
||||||
"` and try again.**",
|
|
||||||
color: embedColor
|
color: embedColor
|
||||||
}
|
}]
|
||||||
]
|
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
await interaction.editReply({
|
await interaction.editReply({
|
||||||
embeds: [
|
embeds: [{
|
||||||
{
|
|
||||||
description: "Fetching your guild data...",
|
description: "Fetching your guild data...",
|
||||||
color: embedColor
|
color: embedColor
|
||||||
}
|
}]
|
||||||
]
|
|
||||||
})
|
})
|
||||||
|
|
||||||
const guild = (await getGuild(uuid)) as GuildData | null
|
const guild = (await getGuild(uuid)) as GuildData | null
|
||||||
@@ -175,9 +139,7 @@ export = {
|
|||||||
|
|
||||||
if (guildID === hypixelGuildID) {
|
if (guildID === hypixelGuildID) {
|
||||||
const GuildMembers = guild!.members
|
const GuildMembers = guild!.members
|
||||||
const guildRank = GuildMembers.find(
|
const guildRank = GuildMembers.find(member => member.uuid === player.uuid)!.rank
|
||||||
member => member.uuid === player.uuid
|
|
||||||
)!.rank
|
|
||||||
|
|
||||||
if (guildRank === "Guild Master") {
|
if (guildRank === "Guild Master") {
|
||||||
const roles = roleManage("gm")
|
const roles = roleManage("gm")
|
||||||
@@ -221,15 +183,9 @@ export = {
|
|||||||
await newVerify.save()
|
await newVerify.save()
|
||||||
|
|
||||||
await interaction.editReply({
|
await interaction.editReply({
|
||||||
embeds: [
|
embeds: [{
|
||||||
{
|
|
||||||
title: interaction.guild!.name,
|
title: interaction.guild!.name,
|
||||||
description:
|
description: "You have successfully verified `" + username + "` with the account `" + player.displayname + "`.",
|
||||||
"You have successfully verified `" +
|
|
||||||
username +
|
|
||||||
"` with the account `" +
|
|
||||||
player.displayname +
|
|
||||||
"`.",
|
|
||||||
color: embedColor,
|
color: embedColor,
|
||||||
thumbnail: {
|
thumbnail: {
|
||||||
url: head!
|
url: head!
|
||||||
@@ -238,8 +194,7 @@ export = {
|
|||||||
icon_url: interaction.guild!.iconURL() || undefined,
|
icon_url: interaction.guild!.iconURL() || undefined,
|
||||||
text: interaction.guild!.name + " | " + devMessage
|
text: interaction.guild!.name + " | " + devMessage
|
||||||
}
|
}
|
||||||
}
|
}]
|
||||||
]
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
} as Command
|
} as Command
|
||||||
|
|||||||
@@ -24,12 +24,10 @@ export = {
|
|||||||
|
|
||||||
if (!verifyData) {
|
if (!verifyData) {
|
||||||
await interaction.editReply({
|
await interaction.editReply({
|
||||||
embeds: [
|
embeds: [{
|
||||||
{
|
|
||||||
description: "You are not verified!",
|
description: "You are not verified!",
|
||||||
color: embedColor
|
color: embedColor
|
||||||
}
|
}]
|
||||||
]
|
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -38,15 +36,10 @@ export = {
|
|||||||
const head = await getHeadURL(ign!)
|
const head = await getHeadURL(ign!)
|
||||||
|
|
||||||
await interaction.editReply({
|
await interaction.editReply({
|
||||||
embeds: [
|
embeds: [{
|
||||||
{
|
|
||||||
title: "User Info",
|
title: "User Info",
|
||||||
description:
|
description: "**User:** " + userMention(user.id) +
|
||||||
"**User:** " +
|
"\n**IGN:** `" + ign + "`",
|
||||||
userMention(user.id) +
|
|
||||||
"\n**IGN:** `" +
|
|
||||||
ign +
|
|
||||||
"`",
|
|
||||||
color: embedColor,
|
color: embedColor,
|
||||||
thumbnail: {
|
thumbnail: {
|
||||||
url: head!
|
url: head!
|
||||||
@@ -55,8 +48,7 @@ export = {
|
|||||||
text: interaction.guild!.name + " | " + devMessage,
|
text: interaction.guild!.name + " | " + devMessage,
|
||||||
icon_url: interaction.guild!.iconURL() || undefined
|
icon_url: interaction.guild!.iconURL() || undefined
|
||||||
}
|
}
|
||||||
}
|
}]
|
||||||
]
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
} as Command
|
} as Command
|
||||||
|
|||||||
@@ -1,8 +1,4 @@
|
|||||||
import {
|
import { SlashCommandBuilder, PermissionFlagsBits, userMention } from "discord.js"
|
||||||
SlashCommandBuilder,
|
|
||||||
PermissionFlagsBits,
|
|
||||||
userMention
|
|
||||||
} from "discord.js"
|
|
||||||
import { getIGN, getHeadURL } from "utils/Hypixel"
|
import { getIGN, getHeadURL } from "utils/Hypixel"
|
||||||
import { color, devMessage } from "config/options.json"
|
import { color, devMessage } from "config/options.json"
|
||||||
import verify from "schemas/verifySchema"
|
import verify from "schemas/verifySchema"
|
||||||
@@ -34,9 +30,7 @@ export = {
|
|||||||
|
|
||||||
const verifiedUser = await verify.findOne({ userID: user.id })
|
const verifiedUser = await verify.findOne({ userID: user.id })
|
||||||
if (!verifiedUser) {
|
if (!verifiedUser) {
|
||||||
interaction.editReply({
|
interaction.editReply("You are not verified!")
|
||||||
content: "This user has not verified their account."
|
|
||||||
})
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -44,14 +38,10 @@ export = {
|
|||||||
const head = await getHeadURL(ign)
|
const head = await getHeadURL(ign)
|
||||||
|
|
||||||
await interaction.editReply({
|
await interaction.editReply({
|
||||||
embeds: [
|
embeds: [{
|
||||||
{
|
|
||||||
title: interaction.guild!.name,
|
title: interaction.guild!.name,
|
||||||
description:
|
description: "**User:** " + userMention(user.id) +
|
||||||
"**User:** " +
|
"\n**IGN:** " + ign,
|
||||||
userMention(user.id) +
|
|
||||||
"\n**IGN:** " +
|
|
||||||
ign,
|
|
||||||
color: embedColor,
|
color: embedColor,
|
||||||
thumbnail: {
|
thumbnail: {
|
||||||
url: head!
|
url: head!
|
||||||
@@ -60,8 +50,7 @@ export = {
|
|||||||
text: interaction.guild!.name + " | " + devMessage,
|
text: interaction.guild!.name + " | " + devMessage,
|
||||||
icon_url: interaction.guild!.iconURL() || undefined
|
icon_url: interaction.guild!.iconURL() || undefined
|
||||||
}
|
}
|
||||||
}
|
}]
|
||||||
]
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
} as Command
|
} as Command
|
||||||
|
|||||||
@@ -1195,11 +1195,6 @@ prelude-ls@^1.2.1:
|
|||||||
resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396"
|
resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396"
|
||||||
integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==
|
integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==
|
||||||
|
|
||||||
prettier@^3.2.1:
|
|
||||||
version "3.2.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.2.1.tgz#babf33580e16c796a9740b9fae551624f7bfeaab"
|
|
||||||
integrity sha512-qSUWshj1IobVbKc226Gw2pync27t0Kf0EdufZa9j7uBSJay1CC+B3K5lAAZoqgX3ASiKuWsk6OmzKRetXNObWg==
|
|
||||||
|
|
||||||
pretty-ms@^8.0.0:
|
pretty-ms@^8.0.0:
|
||||||
version "8.0.0"
|
version "8.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/pretty-ms/-/pretty-ms-8.0.0.tgz#a35563b2a02df01e595538f86d7de54ca23194a3"
|
resolved "https://registry.yarnpkg.com/pretty-ms/-/pretty-ms-8.0.0.tgz#a35563b2a02df01e595538f86d7de54ca23194a3"
|
||||||
|
|||||||
Reference in New Issue
Block a user