Merge branch 'dev' into 'main'
Dev See merge request illegitimate/illegitimate-bot!249
This commit is contained in:
@@ -1,14 +1,14 @@
|
|||||||
version: '3.7'
|
version: '3.7'
|
||||||
services:
|
services:
|
||||||
db:
|
db:
|
||||||
container_name: postgres
|
container_name: postgres
|
||||||
image: postgres
|
image: postgres
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
ports:
|
ports:
|
||||||
- 5432:5432
|
- 5432:5432
|
||||||
volumes:
|
volumes:
|
||||||
- ./data:/var/lib/postgresql/data
|
- ./data:/var/lib/postgresql/data
|
||||||
environment:
|
environment:
|
||||||
- POSTGRES_PASSWORD=dev
|
- POSTGRES_PASSWORD=dev
|
||||||
- POSTGRES_USER=dev
|
- POSTGRES_USER=dev
|
||||||
- POSTGRES_DB=illegitimate
|
- POSTGRES_DB=illegitimate
|
||||||
|
|||||||
@@ -1,64 +1,64 @@
|
|||||||
import { SlashCommandBuilder, PermissionFlagsBits } from "discord.js"
|
import { SlashCommandBuilder, PermissionFlagsBits } from "discord.js"
|
||||||
import { embedColor } from "config/options"
|
import { embedColor } from "config/options"
|
||||||
import { ICommand } from "interfaces"
|
import { ICommand } from "interfaces"
|
||||||
import settings from "schemas/settingsTag"
|
import settings from "schemas/settingsTag"
|
||||||
|
|
||||||
export = {
|
export = {
|
||||||
name: "config",
|
name: "config",
|
||||||
description: "Configure the bot",
|
description: "Configure the bot",
|
||||||
dev: true,
|
dev: false,
|
||||||
public: false,
|
public: false,
|
||||||
|
|
||||||
data: new SlashCommandBuilder()
|
data: new SlashCommandBuilder()
|
||||||
.setName("config")
|
.setName("config")
|
||||||
.setDescription("Configure the bot")
|
.setDescription("Configure the bot")
|
||||||
.addStringOption(option =>
|
.addStringOption(option =>
|
||||||
option
|
option
|
||||||
.setName("setting")
|
.setName("setting")
|
||||||
.setDescription("The setting to configure")
|
.setDescription("The setting to configure")
|
||||||
.setChoices({
|
.setChoices({
|
||||||
name: "Staff Application status",
|
name: "Staff Application status",
|
||||||
value: "staffAppStatus"
|
value: "staffAppStatus"
|
||||||
})
|
})
|
||||||
.setRequired(true)
|
.setRequired(true)
|
||||||
)
|
)
|
||||||
.addStringOption(option =>
|
.addStringOption(option =>
|
||||||
option
|
option
|
||||||
.setName("value")
|
.setName("value")
|
||||||
.setDescription("The value to set")
|
.setDescription("The value to set")
|
||||||
.setRequired(true)
|
.setRequired(true)
|
||||||
)
|
)
|
||||||
.setDMPermission(false)
|
.setDMPermission(false)
|
||||||
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator),
|
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator),
|
||||||
|
|
||||||
async execute({ interaction }) {
|
async execute({ interaction }) {
|
||||||
await interaction.deferReply()
|
await interaction.deferReply()
|
||||||
|
|
||||||
const setting = interaction.options.getString("setting")!
|
const setting = interaction.options.getString("setting")!
|
||||||
const value = interaction.options.getString("value")!
|
const value = interaction.options.getString("value")!
|
||||||
const settingsData = await settings.findOne({ where: { name: setting } })
|
const settingsData = await settings.findOne({ where: { name: setting } })
|
||||||
|
|
||||||
if (!settingsData) {
|
if (!settingsData) {
|
||||||
await settings.create({
|
await settings.create({
|
||||||
name: setting,
|
name: setting,
|
||||||
value: value
|
value: value
|
||||||
})
|
})
|
||||||
|
|
||||||
await interaction.editReply({
|
await interaction.editReply({
|
||||||
embeds: [{
|
embeds: [{
|
||||||
description: "Successfully created `" + setting + "` with value `" + value + "`.",
|
description: "Successfully created `" + setting + "` with value `" + value + "`.",
|
||||||
color: embedColor
|
color: embedColor
|
||||||
}]
|
}]
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
await settingsData.destroy()
|
await settingsData.destroy()
|
||||||
|
|
||||||
await interaction.editReply({
|
await interaction.editReply({
|
||||||
embeds: [{
|
embeds: [{
|
||||||
description: "Successfully updated `" + setting + "` to value `" + value + "`.",
|
description: "Successfully updated `" + setting + "` to value `" + value + "`.",
|
||||||
color: embedColor
|
color: embedColor
|
||||||
}]
|
}]
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} as ICommand
|
} as ICommand
|
||||||
|
|||||||
@@ -1,80 +1,80 @@
|
|||||||
import { devMessage, embedColor } from "config/options"
|
import { devMessage, embedColor } from "config/options"
|
||||||
import { PermissionFlagsBits, SlashCommandBuilder, userMention } from "discord.js"
|
import { PermissionFlagsBits, SlashCommandBuilder, userMention } from "discord.js"
|
||||||
import { ICommand } from "interfaces"
|
import { ICommand } from "interfaces"
|
||||||
import verify from "schemas/verifyTag"
|
import verify from "schemas/verifyTag"
|
||||||
import { getHeadURL, getIGN, getUUID } from "utils/Hypixel"
|
import { getHeadURL, getIGN, getUUID } from "utils/Hypixel"
|
||||||
|
|
||||||
export = {
|
export = {
|
||||||
name: "find",
|
name: "find",
|
||||||
description: "Find a person by the ign",
|
description: "Find a person by the ign",
|
||||||
dev: true,
|
dev: false,
|
||||||
public: false,
|
public: false,
|
||||||
|
|
||||||
data: new SlashCommandBuilder()
|
data: new SlashCommandBuilder()
|
||||||
.setName("find")
|
.setName("find")
|
||||||
.setDescription("Find a person by the ign")
|
.setDescription("Find a person by the ign")
|
||||||
.addStringOption(option =>
|
.addStringOption(option =>
|
||||||
option
|
option
|
||||||
.setName("ign")
|
.setName("ign")
|
||||||
.setDescription("The ign to lookup.")
|
.setDescription("The ign to lookup.")
|
||||||
.setRequired(true)
|
.setRequired(true)
|
||||||
)
|
)
|
||||||
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
|
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
|
||||||
.setDMPermission(false),
|
.setDMPermission(false),
|
||||||
|
|
||||||
async execute({ interaction }) {
|
async execute({ interaction }) {
|
||||||
await interaction.deferReply()
|
await interaction.deferReply()
|
||||||
|
|
||||||
const ign = interaction.options.getString("ign")!
|
const ign = interaction.options.getString("ign")!
|
||||||
const uuid = await getUUID(ign)
|
const uuid = await getUUID(ign)
|
||||||
if (!uuid) {
|
if (!uuid) {
|
||||||
await interaction.editReply({
|
await interaction.editReply({
|
||||||
embeds: [{
|
embeds: [{
|
||||||
description: "No minecraft account found with the ign " + ign,
|
description: "No minecraft account found with the ign " + ign,
|
||||||
color: embedColor
|
color: embedColor
|
||||||
}]
|
}]
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
const verifyData = await verify.findOne({ where: { uuid: uuid } })
|
const verifyData = await verify.findOne({ where: { uuid: uuid } })
|
||||||
if (!verifyData) {
|
if (!verifyData) {
|
||||||
await interaction.editReply({
|
await interaction.editReply({
|
||||||
embeds: [{
|
embeds: [{
|
||||||
description: "No user found with the ign " + ign,
|
description: "No user found with the ign " + ign,
|
||||||
color: embedColor
|
color: embedColor
|
||||||
}]
|
}]
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
const user = await interaction.guild?.members.fetch(verifyData.userID)
|
const user = await interaction.guild?.members.fetch(verifyData.userID)
|
||||||
if (!user) {
|
if (!user) {
|
||||||
await interaction.editReply({
|
await interaction.editReply({
|
||||||
embeds: [{
|
embeds: [{
|
||||||
description: "User is not in the server.",
|
description: "User is not in the server.",
|
||||||
color: embedColor
|
color: embedColor
|
||||||
}]
|
}]
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
const head = await getHeadURL(ign)
|
const head = await getHeadURL(ign)
|
||||||
const formattedIgn = await getIGN(uuid)
|
const formattedIgn = await getIGN(uuid)
|
||||||
await interaction.editReply({
|
await interaction.editReply({
|
||||||
embeds: [{
|
embeds: [{
|
||||||
title: interaction.guild!.name,
|
title: interaction.guild!.name,
|
||||||
description: "**User:** " + userMention(user.user.id) +
|
description: "**User:** " + userMention(user.user.id) +
|
||||||
"\n**IGN:** " + formattedIgn,
|
"\n**IGN:** " + formattedIgn,
|
||||||
color: embedColor,
|
color: embedColor,
|
||||||
thumbnail: {
|
thumbnail: {
|
||||||
url: head!
|
url: head!
|
||||||
},
|
},
|
||||||
footer: {
|
footer: {
|
||||||
text: interaction.guild!.name + " | " + devMessage,
|
text: interaction.guild!.name + " | " + devMessage,
|
||||||
icon_url: interaction.guild!.iconURL() || undefined
|
icon_url: interaction.guild!.iconURL() || undefined
|
||||||
}
|
}
|
||||||
}]
|
}]
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
} as ICommand
|
} as ICommand
|
||||||
|
|||||||
@@ -1,90 +1,90 @@
|
|||||||
import { SlashCommandBuilder, PermissionFlagsBits, userMention, GuildMember } from "discord.js"
|
import { SlashCommandBuilder, PermissionFlagsBits, userMention, GuildMember } from "discord.js"
|
||||||
import { embedColor, devMessage } from "config/options"
|
import { embedColor, devMessage } from "config/options"
|
||||||
import verify from "schemas/verifyTag"
|
import verify from "schemas/verifyTag"
|
||||||
import { ICommand } from "interfaces"
|
import { ICommand } from "interfaces"
|
||||||
import roleManage from "utils/functions/rolesmanage"
|
import roleManage from "utils/functions/rolesmanage"
|
||||||
import logToChannel from "utils/functions/logtochannel"
|
import logToChannel from "utils/functions/logtochannel"
|
||||||
import { getIGN } from "utils/Hypixel"
|
import { getIGN } from "utils/Hypixel"
|
||||||
import { removeIndents } from "utils/functions/funcs"
|
import { removeIndents } from "utils/functions/funcs"
|
||||||
|
|
||||||
export = {
|
export = {
|
||||||
name: "forceunverify",
|
name: "forceunverify",
|
||||||
description: "Force unverify a user",
|
description: "Force unverify a user",
|
||||||
dev: true,
|
dev: false,
|
||||||
public: false,
|
public: false,
|
||||||
|
|
||||||
data: new SlashCommandBuilder()
|
data: new SlashCommandBuilder()
|
||||||
.setName("forceunverify")
|
.setName("forceunverify")
|
||||||
.setDescription("Force unverify a user")
|
.setDescription("Force unverify a user")
|
||||||
.addUserOption(option =>
|
.addUserOption(option =>
|
||||||
option
|
option
|
||||||
.setName("user")
|
.setName("user")
|
||||||
.setDescription("The user to force unverify")
|
.setDescription("The user to force unverify")
|
||||||
.setRequired(true)
|
.setRequired(true)
|
||||||
)
|
)
|
||||||
.setDMPermission(false)
|
.setDMPermission(false)
|
||||||
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator),
|
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator),
|
||||||
|
|
||||||
async execute({ interaction }) {
|
async execute({ interaction }) {
|
||||||
const member = interaction.options.getMember("user") as GuildMember
|
const member = interaction.options.getMember("user") as GuildMember
|
||||||
const verifiedUser = await verify.findOne({ where: { userID: member.user.id } })
|
const verifiedUser = await verify.findOne({ where: { userID: member.user.id } })
|
||||||
const mod = interaction.user
|
const mod = interaction.user
|
||||||
|
|
||||||
if (!verifiedUser) {
|
if (!verifiedUser) {
|
||||||
interaction.reply({
|
interaction.reply({
|
||||||
embeds: [{
|
embeds: [{
|
||||||
description: "This user is not verified",
|
description: "This user is not verified",
|
||||||
color: embedColor
|
color: embedColor
|
||||||
}]
|
}]
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
const uuid = verifiedUser.uuid
|
const uuid = verifiedUser.uuid
|
||||||
const ign = await getIGN(uuid)
|
const ign = await getIGN(uuid)
|
||||||
await verifiedUser.destroy()
|
await verifiedUser.destroy()
|
||||||
await member.roles.remove(
|
await member.roles.remove(
|
||||||
roleManage("all").rolesToRemove,
|
roleManage("all").rolesToRemove,
|
||||||
"User force unverified by " + interaction.user.username
|
"User force unverified by " + interaction.user.username
|
||||||
)
|
)
|
||||||
await member.setNickname(null, "User force unverified by " + interaction.user.username).catch(() => {
|
await member.setNickname(null, "User force unverified by " + interaction.user.username).catch(() => {
|
||||||
// Do nothing
|
// Do nothing
|
||||||
})
|
})
|
||||||
|
|
||||||
await logToChannel("mod", {
|
await logToChannel("mod", {
|
||||||
embeds: [{
|
embeds: [{
|
||||||
title: "Force Unverified",
|
title: "Force Unverified",
|
||||||
author: {
|
author: {
|
||||||
name: mod.username,
|
name: mod.username,
|
||||||
icon_url: mod.avatarURL() || undefined
|
icon_url: mod.avatarURL() || undefined
|
||||||
},
|
},
|
||||||
description: removeIndents(`
|
description: removeIndents(`
|
||||||
**User:** ${userMention(member.user.id)}
|
**User:** ${userMention(member.user.id)}
|
||||||
**Mod:** ${userMention(mod.id)}
|
**Mod:** ${userMention(mod.id)}
|
||||||
**IGN:** \`${ign}\`
|
**IGN:** \`${ign}\`
|
||||||
**UUID:** \`${uuid}\`
|
**UUID:** \`${uuid}\`
|
||||||
`),
|
`),
|
||||||
color: embedColor,
|
color: embedColor,
|
||||||
thumbnail: {
|
thumbnail: {
|
||||||
url: mod.avatarURL() || ""
|
url: mod.avatarURL() || ""
|
||||||
},
|
},
|
||||||
footer: {
|
footer: {
|
||||||
icon_url: member.user.avatarURL() || undefined,
|
icon_url: member.user.avatarURL() || undefined,
|
||||||
text: "ID: " + member.user.id
|
text: "ID: " + member.user.id
|
||||||
},
|
},
|
||||||
timestamp: new Date().toISOString()
|
timestamp: new Date().toISOString()
|
||||||
}]
|
}]
|
||||||
})
|
})
|
||||||
|
|
||||||
await interaction.reply({
|
await interaction.reply({
|
||||||
embeds: [{
|
embeds: [{
|
||||||
description: "Successfully unverified " + userMention(member.user.id),
|
description: "Successfully unverified " + userMention(member.user.id),
|
||||||
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 ICommand
|
} as ICommand
|
||||||
|
|||||||
@@ -1,179 +1,179 @@
|
|||||||
import { SlashCommandBuilder, PermissionFlagsBits, userMention, GuildMember } from "discord.js"
|
import { SlashCommandBuilder, PermissionFlagsBits, userMention, GuildMember } from "discord.js"
|
||||||
import { getGuild, getHeadURL, getIGN } from "utils/Hypixel"
|
import { getGuild, getHeadURL, getIGN } from "utils/Hypixel"
|
||||||
import { hypixelGuildID, embedColor, devMessage } from "config/options"
|
import { hypixelGuildID, embedColor, devMessage } from "config/options"
|
||||||
import verify from "schemas/verifyTag"
|
import verify from "schemas/verifyTag"
|
||||||
import { ICommand } from "interfaces"
|
import { ICommand } from "interfaces"
|
||||||
import roleManage from "utils/functions/rolesmanage"
|
import roleManage from "utils/functions/rolesmanage"
|
||||||
import { waitingListRole } from "config/roles"
|
import { waitingListRole } from "config/roles"
|
||||||
import { removeIndents } from "utils/functions/funcs"
|
import { removeIndents } from "utils/functions/funcs"
|
||||||
|
|
||||||
export = {
|
export = {
|
||||||
name: "forceupdate",
|
name: "forceupdate",
|
||||||
description: "Force update the user",
|
description: "Force update the user",
|
||||||
dev: true,
|
dev: false,
|
||||||
public: false,
|
public: false,
|
||||||
|
|
||||||
data: new SlashCommandBuilder()
|
data: new SlashCommandBuilder()
|
||||||
.setName("forceupdate")
|
.setName("forceupdate")
|
||||||
.setDescription("Force update the user")
|
.setDescription("Force update the user")
|
||||||
.addUserOption(option =>
|
.addUserOption(option =>
|
||||||
option
|
option
|
||||||
.setName("user")
|
.setName("user")
|
||||||
.setDescription("The user to force update")
|
.setDescription("The user to force update")
|
||||||
.setRequired(true)
|
.setRequired(true)
|
||||||
)
|
)
|
||||||
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
|
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
|
||||||
.setDMPermission(false),
|
.setDMPermission(false),
|
||||||
|
|
||||||
async execute({ interaction }) {
|
async execute({ interaction }) {
|
||||||
await interaction.deferReply()
|
await interaction.deferReply()
|
||||||
|
|
||||||
const user = interaction.options.getMember("user") as GuildMember
|
const user = interaction.options.getMember("user") as GuildMember
|
||||||
const usermentioned = userMention(user.user.id)
|
const usermentioned = userMention(user.user.id)
|
||||||
const verifyData = await verify.findOne({ where: { userID: user.user.id } })
|
const verifyData = await verify.findOne({ where: { userID: user.user.id } })
|
||||||
|
|
||||||
if (!verifyData) {
|
if (!verifyData) {
|
||||||
await user.setNickname(`${user.user.username} (X)`, "User used the update command").catch(() => {
|
await user.setNickname(`${user.user.username} (X)`, "User used the update command").catch(() => {
|
||||||
// Do nothing
|
// Do nothing
|
||||||
})
|
})
|
||||||
await interaction.editReply({
|
await interaction.editReply({
|
||||||
embeds: [{
|
embeds: [{
|
||||||
description: "User is not verified.\n\n" + "Updating username to `Username (X)`",
|
description: "User is not verified.\n\n" + "Updating username to `Username (X)`",
|
||||||
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 ign...",
|
description: "Fetching ign...",
|
||||||
color: embedColor
|
color: embedColor
|
||||||
}]
|
}]
|
||||||
})
|
})
|
||||||
|
|
||||||
const ign = (await getIGN(verifyData.uuid)) as string
|
const ign = (await getIGN(verifyData.uuid)) as string
|
||||||
const head = await getHeadURL(ign)
|
const head = await getHeadURL(ign)
|
||||||
|
|
||||||
await interaction.editReply({
|
await interaction.editReply({
|
||||||
embeds: [{
|
embeds: [{
|
||||||
description: "Fetching guild data...",
|
description: "Fetching guild data...",
|
||||||
color: embedColor
|
color: embedColor
|
||||||
}]
|
}]
|
||||||
})
|
})
|
||||||
|
|
||||||
const guild = await getGuild(verifyData.uuid)
|
const guild = await getGuild(verifyData.uuid)
|
||||||
|
|
||||||
let responseGuildID: string | null
|
let responseGuildID: string | null
|
||||||
if (!guild) {
|
if (!guild) {
|
||||||
responseGuildID = null
|
responseGuildID = null
|
||||||
} else {
|
} else {
|
||||||
responseGuildID = guild._id
|
responseGuildID = guild._id
|
||||||
}
|
}
|
||||||
|
|
||||||
if (responseGuildID !== hypixelGuildID) {
|
if (responseGuildID !== hypixelGuildID) {
|
||||||
const roles = roleManage("default")
|
const roles = roleManage("default")
|
||||||
await user.roles.remove(roles.rolesToRemove, "User was force updated.")
|
await user.roles.remove(roles.rolesToRemove, "User was force updated.")
|
||||||
await user.roles.add(roles.rolesToAdd, "User was force updated.")
|
await user.roles.add(roles.rolesToAdd, "User was force updated.")
|
||||||
await user.setNickname(ign, "User was force updated.").catch(() => {
|
await user.setNickname(ign, "User was force updated.").catch(() => {
|
||||||
// Do nothing
|
// Do nothing
|
||||||
})
|
})
|
||||||
|
|
||||||
await interaction.editReply({
|
await interaction.editReply({
|
||||||
embeds: [{
|
embeds: [{
|
||||||
description: removeIndents(`
|
description: removeIndents(`
|
||||||
${usermentioned} was given the \`Default Member\` role.
|
${usermentioned} was given the \`Default Member\` role.
|
||||||
|
|
||||||
IGN: \`${ign}\`
|
IGN: \`${ign}\`
|
||||||
`),
|
`),
|
||||||
color: embedColor,
|
color: embedColor,
|
||||||
thumbnail: {
|
thumbnail: {
|
||||||
url: head!
|
url: head!
|
||||||
},
|
},
|
||||||
footer: {
|
footer: {
|
||||||
text: interaction.guild!.name + " | " + devMessage,
|
text: interaction.guild!.name + " | " + devMessage,
|
||||||
icon_url: interaction.guild!.iconURL() || undefined
|
icon_url: interaction.guild!.iconURL() || undefined
|
||||||
}
|
}
|
||||||
}]
|
}]
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if (responseGuildID === hypixelGuildID) {
|
if (responseGuildID === hypixelGuildID) {
|
||||||
const GuildMembers = guild!.members
|
const GuildMembers = guild!.members
|
||||||
const guildRank = GuildMembers.find(member => member.uuid === verifyData.uuid)!.rank
|
const guildRank = GuildMembers.find(member => member.uuid === verifyData.uuid)!.rank
|
||||||
let replyRank: string | null = null
|
let replyRank: string | null = null
|
||||||
|
|
||||||
await user.roles.add(roleManage("default").rolesToAdd, "User was force updated.")
|
await user.roles.add(roleManage("default").rolesToAdd, "User was force updated.")
|
||||||
|
|
||||||
if (guildRank === "Guild Master") {
|
if (guildRank === "Guild Master") {
|
||||||
const roles = roleManage("gm")
|
const roles = roleManage("gm")
|
||||||
await user.roles.remove(roles.rolesToRemove, "User was force updated.")
|
await user.roles.remove(roles.rolesToRemove, "User was force updated.")
|
||||||
await user.roles.add(roles.rolesToAdd, "User was force updated.")
|
await user.roles.add(roles.rolesToAdd, "User was force updated.")
|
||||||
replyRank = "Guild Master"
|
replyRank = "Guild Master"
|
||||||
}
|
}
|
||||||
|
|
||||||
if (guildRank === "Manager") {
|
if (guildRank === "Manager") {
|
||||||
const roles = roleManage("manager")
|
const roles = roleManage("manager")
|
||||||
await user.roles.remove(roles.rolesToRemove, "User was force updated.")
|
await user.roles.remove(roles.rolesToRemove, "User was force updated.")
|
||||||
await user.roles.add(roles.rolesToAdd, "User was force updated.")
|
await user.roles.add(roles.rolesToAdd, "User was force updated.")
|
||||||
replyRank = "Manager"
|
replyRank = "Manager"
|
||||||
}
|
}
|
||||||
|
|
||||||
if (guildRank === "Moderator") {
|
if (guildRank === "Moderator") {
|
||||||
const roles = roleManage("moderator")
|
const roles = roleManage("moderator")
|
||||||
await user.roles.remove(roles.rolesToRemove, "User was force updated.")
|
await user.roles.remove(roles.rolesToRemove, "User was force updated.")
|
||||||
await user.roles.add(roles.rolesToAdd, "User was force updated.")
|
await user.roles.add(roles.rolesToAdd, "User was force updated.")
|
||||||
replyRank = "Moderator"
|
replyRank = "Moderator"
|
||||||
}
|
}
|
||||||
|
|
||||||
if (guildRank === "Beast") {
|
if (guildRank === "Beast") {
|
||||||
const roles = roleManage("beast")
|
const roles = roleManage("beast")
|
||||||
await user.roles.remove(roles.rolesToRemove, "User was force updated.")
|
await user.roles.remove(roles.rolesToRemove, "User was force updated.")
|
||||||
await user.roles.add(roles.rolesToAdd, "User was force updated.")
|
await user.roles.add(roles.rolesToAdd, "User was force updated.")
|
||||||
replyRank = "Beast"
|
replyRank = "Beast"
|
||||||
}
|
}
|
||||||
|
|
||||||
if (guildRank === "Elite") {
|
if (guildRank === "Elite") {
|
||||||
const roles = roleManage("elite")
|
const roles = roleManage("elite")
|
||||||
await user.roles.remove(roles.rolesToRemove, "User was force updated.")
|
await user.roles.remove(roles.rolesToRemove, "User was force updated.")
|
||||||
await user.roles.add(roles.rolesToAdd, "User was force updated.")
|
await user.roles.add(roles.rolesToAdd, "User was force updated.")
|
||||||
replyRank = "Elite"
|
replyRank = "Elite"
|
||||||
}
|
}
|
||||||
|
|
||||||
if (guildRank === "Member") {
|
if (guildRank === "Member") {
|
||||||
const roles = roleManage("member")
|
const roles = roleManage("member")
|
||||||
await user.roles.remove(roles.rolesToRemove, "User was force updated.")
|
await user.roles.remove(roles.rolesToRemove, "User was force updated.")
|
||||||
await user.roles.add(roles.rolesToAdd, "User was force updated.")
|
await user.roles.add(roles.rolesToAdd, "User was force updated.")
|
||||||
replyRank = "Member"
|
replyRank = "Member"
|
||||||
}
|
}
|
||||||
|
|
||||||
await user.roles.remove(waitingListRole, "User was force updated.")
|
await user.roles.remove(waitingListRole, "User was force updated.")
|
||||||
await user.setNickname(ign, "User was force updated.").catch(() => {
|
await user.setNickname(ign, "User was force updated.").catch(() => {
|
||||||
// Do nothing
|
// Do nothing
|
||||||
})
|
})
|
||||||
|
|
||||||
await interaction.editReply({
|
await interaction.editReply({
|
||||||
embeds: [{
|
embeds: [{
|
||||||
description: removeIndents(`
|
description: removeIndents(`
|
||||||
${usermentioned} was given the \`${replyRank}\` role.
|
${usermentioned} was given the \`${replyRank}\` role.
|
||||||
|
|
||||||
IGN: \`${ign}\`
|
IGN: \`${ign}\`
|
||||||
`),
|
`),
|
||||||
color: embedColor,
|
color: embedColor,
|
||||||
thumbnail: {
|
thumbnail: {
|
||||||
url: head!
|
url: head!
|
||||||
},
|
},
|
||||||
footer: {
|
footer: {
|
||||||
text: interaction.guild!.name + " | " + devMessage,
|
text: interaction.guild!.name + " | " + devMessage,
|
||||||
icon_url: interaction.guild!.iconURL() || undefined
|
icon_url: interaction.guild!.iconURL() || undefined
|
||||||
}
|
}
|
||||||
}]
|
}]
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} as ICommand
|
} as ICommand
|
||||||
|
|||||||
@@ -1,207 +1,207 @@
|
|||||||
import { SlashCommandBuilder, PermissionFlagsBits, GuildMember, userMention } from "discord.js"
|
import { SlashCommandBuilder, PermissionFlagsBits, GuildMember, userMention } from "discord.js"
|
||||||
import { getUUID, getPlayer, getGuild, getHeadURL } from "utils/Hypixel"
|
import { getUUID, getPlayer, getGuild, getHeadURL } from "utils/Hypixel"
|
||||||
import { embedColor, hypixelGuildID, devMessage } from "config/options"
|
import { embedColor, hypixelGuildID, devMessage } from "config/options"
|
||||||
import verify from "schemas/verifyTag"
|
import verify from "schemas/verifyTag"
|
||||||
import roleManage from "utils/functions/rolesmanage"
|
import roleManage from "utils/functions/rolesmanage"
|
||||||
import { ICommand } from "interfaces"
|
import { ICommand } from "interfaces"
|
||||||
import logToChannel from "utils/functions/logtochannel"
|
import logToChannel from "utils/functions/logtochannel"
|
||||||
import { removeIndents } from "utils/functions/funcs"
|
import { removeIndents } from "utils/functions/funcs"
|
||||||
|
|
||||||
export = {
|
export = {
|
||||||
name: "forceverify",
|
name: "forceverify",
|
||||||
description: "Force verify a user.",
|
description: "Force verify a user.",
|
||||||
dev: true,
|
dev: false,
|
||||||
public: false,
|
public: false,
|
||||||
|
|
||||||
data: new SlashCommandBuilder()
|
data: new SlashCommandBuilder()
|
||||||
.setName("forceverify")
|
.setName("forceverify")
|
||||||
.setDescription("Force verify a user.")
|
.setDescription("Force verify a user.")
|
||||||
.addUserOption(option =>
|
.addUserOption(option =>
|
||||||
option
|
option
|
||||||
.setName("user")
|
.setName("user")
|
||||||
.setDescription("The user to force verify.")
|
.setDescription("The user to force verify.")
|
||||||
)
|
)
|
||||||
.addStringOption(option =>
|
.addStringOption(option =>
|
||||||
option
|
option
|
||||||
.setName("ign")
|
.setName("ign")
|
||||||
.setDescription("The user's in-game name.")
|
.setDescription("The user's in-game name.")
|
||||||
)
|
)
|
||||||
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
|
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
|
||||||
.setDMPermission(false),
|
.setDMPermission(false),
|
||||||
|
|
||||||
async execute({ interaction }) {
|
async execute({ interaction }) {
|
||||||
await interaction.deferReply()
|
await interaction.deferReply()
|
||||||
|
|
||||||
const user = interaction.options.getMember("user") as GuildMember
|
const user = interaction.options.getMember("user") as GuildMember
|
||||||
const ign = interaction.options.getString("ign")
|
const ign = interaction.options.getString("ign")
|
||||||
const mod = interaction.user
|
const mod = interaction.user
|
||||||
|
|
||||||
const verifyData = await verify.findOne({ where: { userID: user.user.id } })
|
const verifyData = await verify.findOne({ where: { userID: user.user.id } })
|
||||||
if (verifyData) {
|
if (verifyData) {
|
||||||
interaction.editReply("That user is already verified.")
|
interaction.editReply("That user is already verified.")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!user) {
|
if (!user) {
|
||||||
interaction.editReply("Please provide a user to force verify.\n" +
|
interaction.editReply("Please provide a user to force verify.\n" +
|
||||||
"This can also mean the user is not in the server.")
|
"This can also mean the user is not in the server.")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ign) {
|
if (!ign) {
|
||||||
interaction.editReply("Please provide a player's IGN.")
|
interaction.editReply("Please provide a player's IGN.")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
let username = ""
|
let username = ""
|
||||||
if (user.user.discriminator == "0") {
|
if (user.user.discriminator == "0") {
|
||||||
username = user.user.username
|
username = user.user.username
|
||||||
} else {
|
} else {
|
||||||
username = user.user.username + "#" + user.user.discriminator
|
username = user.user.username + "#" + user.user.discriminator
|
||||||
}
|
}
|
||||||
|
|
||||||
let modName = ""
|
let modName = ""
|
||||||
if (mod.discriminator == "0") {
|
if (mod.discriminator == "0") {
|
||||||
modName = mod.username
|
modName = mod.username
|
||||||
} else {
|
} else {
|
||||||
modName = mod.username + "#" + mod.discriminator
|
modName = mod.username + "#" + mod.discriminator
|
||||||
}
|
}
|
||||||
|
|
||||||
await interaction.editReply({
|
await interaction.editReply({
|
||||||
embeds: [{
|
embeds: [{
|
||||||
description: "Fetching their uuid...",
|
description: "Fetching their 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 doesn't exist.",
|
description: "<a:questionmark_pink:1130206038008803488> That player doesn't exist.",
|
||||||
color: embedColor
|
color: embedColor
|
||||||
}]
|
}]
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
await interaction.editReply({
|
await interaction.editReply({
|
||||||
embeds: [{
|
embeds: [{
|
||||||
description: "Fetching their player data...",
|
description: "Fetching their player data...",
|
||||||
color: embedColor
|
color: embedColor
|
||||||
}]
|
}]
|
||||||
})
|
})
|
||||||
|
|
||||||
const player = await getPlayer(uuid)
|
const player = await getPlayer(uuid)
|
||||||
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
|
||||||
}
|
}
|
||||||
|
|
||||||
await interaction.editReply({
|
await interaction.editReply({
|
||||||
embeds: [{
|
embeds: [{
|
||||||
description: "Fetching their guild data...",
|
description: "Fetching their guild data...",
|
||||||
color: embedColor
|
color: embedColor
|
||||||
}]
|
}]
|
||||||
})
|
})
|
||||||
|
|
||||||
const guild = await getGuild(uuid)
|
const guild = await getGuild(uuid)
|
||||||
let responseGuildID: string | null
|
let responseGuildID: string | null
|
||||||
if (!guild) {
|
if (!guild) {
|
||||||
responseGuildID = null
|
responseGuildID = null
|
||||||
} else {
|
} else {
|
||||||
responseGuildID = guild._id
|
responseGuildID = guild._id
|
||||||
}
|
}
|
||||||
|
|
||||||
const head = await getHeadURL(ign)
|
const head = await getHeadURL(ign)
|
||||||
if (responseGuildID === hypixelGuildID) {
|
if (responseGuildID === hypixelGuildID) {
|
||||||
const GuildMembers = guild!.members
|
const GuildMembers = guild!.members
|
||||||
const guildRank = GuildMembers.find(member => member.uuid === player.uuid)!.rank
|
const guildRank = GuildMembers.find(member => member.uuid === player.uuid)!.rank
|
||||||
|
|
||||||
if (guildRank === "Guild Master") {
|
if (guildRank === "Guild Master") {
|
||||||
const roles = roleManage("gm")
|
const roles = roleManage("gm")
|
||||||
await user.roles.add(roles.rolesToAdd, "User was force verified by " + modName)
|
await user.roles.add(roles.rolesToAdd, "User was force verified by " + modName)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (guildRank === "Manager") {
|
if (guildRank === "Manager") {
|
||||||
const roles = roleManage("manager")
|
const roles = roleManage("manager")
|
||||||
await user.roles.add(roles.rolesToAdd, "User was force verified by " + modName)
|
await user.roles.add(roles.rolesToAdd, "User was force verified by " + modName)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (guildRank === "Moderator") {
|
if (guildRank === "Moderator") {
|
||||||
const roles = roleManage("moderator")
|
const roles = roleManage("moderator")
|
||||||
await user.roles.add(roles.rolesToAdd, "User was force verified by " + modName)
|
await user.roles.add(roles.rolesToAdd, "User was force verified by " + modName)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (guildRank === "Beast") {
|
if (guildRank === "Beast") {
|
||||||
const roles = roleManage("beast")
|
const roles = roleManage("beast")
|
||||||
await user.roles.add(roles.rolesToAdd, "User was force verified by " + modName)
|
await user.roles.add(roles.rolesToAdd, "User was force verified by " + modName)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (guildRank === "Elite") {
|
if (guildRank === "Elite") {
|
||||||
const roles = roleManage("elite")
|
const roles = roleManage("elite")
|
||||||
await user.roles.add(roles.rolesToAdd, "User was force verified by " + modName)
|
await user.roles.add(roles.rolesToAdd, "User was force verified by " + modName)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (guildRank === "Member") {
|
if (guildRank === "Member") {
|
||||||
const roles = roleManage("member")
|
const roles = roleManage("member")
|
||||||
await user.roles.add(roles.rolesToAdd, "User was force verified by " + modName)
|
await user.roles.add(roles.rolesToAdd, "User was force verified by " + modName)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
await user.roles.add(roleManage("default").rolesToAdd, "User was force verified by " + modName)
|
await user.roles.add(roleManage("default").rolesToAdd, "User was force verified by " + modName)
|
||||||
await user.setNickname(player.displayname!, "User was force verified by " + modName).catch(() => {
|
await user.setNickname(player.displayname!, "User was force verified by " + modName).catch(() => {
|
||||||
// Do nothing
|
// Do nothing
|
||||||
})
|
})
|
||||||
|
|
||||||
await verify.create({
|
await verify.create({
|
||||||
userID: user.user.id,
|
userID: user.user.id,
|
||||||
uuid: uuid,
|
uuid: uuid,
|
||||||
})
|
})
|
||||||
|
|
||||||
await logToChannel("mod", {
|
await logToChannel("mod", {
|
||||||
embeds: [{
|
embeds: [{
|
||||||
author: {
|
author: {
|
||||||
name: modName,
|
name: modName,
|
||||||
icon_url: mod.avatarURL() || undefined
|
icon_url: mod.avatarURL() || undefined
|
||||||
},
|
},
|
||||||
title: "Force Verified",
|
title: "Force Verified",
|
||||||
description: removeIndents(`
|
description: removeIndents(`
|
||||||
**User:** ${userMention(user.id)}
|
**User:** ${userMention(user.id)}
|
||||||
**Mod:** ${userMention(mod.id)}
|
**Mod:** ${userMention(mod.id)}
|
||||||
**IGN:** \`${player.displayname}\`
|
**IGN:** \`${player.displayname}\`
|
||||||
**UUID:** \`${uuid}\`
|
**UUID:** \`${uuid}\`
|
||||||
`),
|
`),
|
||||||
color: embedColor,
|
color: embedColor,
|
||||||
thumbnail: {
|
thumbnail: {
|
||||||
url: mod.avatarURL() || ""
|
url: mod.avatarURL() || ""
|
||||||
},
|
},
|
||||||
footer: {
|
footer: {
|
||||||
icon_url: user.user.avatarURL() || undefined,
|
icon_url: user.user.avatarURL() || undefined,
|
||||||
text: "ID: " + user.user.id
|
text: "ID: " + user.user.id
|
||||||
},
|
},
|
||||||
timestamp: new Date().toISOString()
|
timestamp: new Date().toISOString()
|
||||||
}]
|
}]
|
||||||
})
|
})
|
||||||
|
|
||||||
await interaction.editReply({
|
await interaction.editReply({
|
||||||
embeds: [{
|
embeds: [{
|
||||||
title: interaction.guild!.name,
|
title: interaction.guild!.name,
|
||||||
description: "You have successfully force verified `" + username + "` with the account `" + player.displayname + "`.",
|
description: "You have successfully force verified `" + username + "` with the account `" + player.displayname + "`.",
|
||||||
color: embedColor,
|
color: embedColor,
|
||||||
thumbnail: {
|
thumbnail: {
|
||||||
url: head!
|
url: head!
|
||||||
},
|
},
|
||||||
footer: {
|
footer: {
|
||||||
icon_url: interaction.guild!.iconURL() || undefined,
|
icon_url: interaction.guild!.iconURL() || undefined,
|
||||||
text: interaction.guild!.name + " | " + devMessage
|
text: interaction.guild!.name + " | " + devMessage
|
||||||
}
|
}
|
||||||
}]
|
}]
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
} as ICommand
|
} as ICommand
|
||||||
|
|||||||
@@ -1,91 +1,91 @@
|
|||||||
import { SlashCommandBuilder, PermissionFlagsBits, userMention, GuildMember } from "discord.js"
|
import { SlashCommandBuilder, PermissionFlagsBits, userMention, GuildMember } from "discord.js"
|
||||||
import { embedColor, devMessage } from "config/options"
|
import { embedColor, devMessage } from "config/options"
|
||||||
import waitinglist from "schemas/waitinglistTag"
|
import waitinglist from "schemas/waitinglistTag"
|
||||||
import { ICommand } from "interfaces"
|
import { ICommand } from "interfaces"
|
||||||
import logToChannel from "utils/functions/logtochannel"
|
import logToChannel from "utils/functions/logtochannel"
|
||||||
import { waitingListRole } from "config/roles"
|
import { waitingListRole } from "config/roles"
|
||||||
import { removeIndents } from "utils/functions/funcs"
|
import { removeIndents } from "utils/functions/funcs"
|
||||||
|
|
||||||
export = {
|
export = {
|
||||||
name: "remove",
|
name: "remove",
|
||||||
description: "Remove a person on the waiting list.",
|
description: "Remove a person on the waiting list.",
|
||||||
dev: true,
|
dev: false,
|
||||||
public: false,
|
public: false,
|
||||||
|
|
||||||
data: new SlashCommandBuilder()
|
data: new SlashCommandBuilder()
|
||||||
.setName("remove")
|
.setName("remove")
|
||||||
.setDescription("Remove a person on the waiting list.")
|
.setDescription("Remove a person on the waiting list.")
|
||||||
.addUserOption(option =>
|
.addUserOption(option =>
|
||||||
option
|
option
|
||||||
.setName("user")
|
.setName("user")
|
||||||
.setDescription("The user to remove.")
|
.setDescription("The user to remove.")
|
||||||
.setRequired(true)
|
.setRequired(true)
|
||||||
)
|
)
|
||||||
.addStringOption(option =>
|
.addStringOption(option =>
|
||||||
option
|
option
|
||||||
.setName("reason")
|
.setName("reason")
|
||||||
.setDescription("The reason for removing the user.")
|
.setDescription("The reason for removing the user.")
|
||||||
.setRequired(false)
|
.setRequired(false)
|
||||||
)
|
)
|
||||||
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
|
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
|
||||||
.setDMPermission(false),
|
.setDMPermission(false),
|
||||||
|
|
||||||
async execute({ interaction }) {
|
async execute({ interaction }) {
|
||||||
await interaction.deferReply()
|
await interaction.deferReply()
|
||||||
|
|
||||||
const member = interaction.options.getMember("user") as GuildMember
|
const member = interaction.options.getMember("user") as GuildMember
|
||||||
const reason = interaction.options.getString("reason") ?? "No reason provided."
|
const reason = interaction.options.getString("reason") ?? "No reason provided."
|
||||||
const mod = interaction.user!
|
const mod = interaction.user!
|
||||||
const waiting = await waitinglist.findOne({ where: { userID: member.user.id } })
|
const waiting = await waitinglist.findOne({ where: { userID: member.user.id } })
|
||||||
|
|
||||||
if (!waitinglist) {
|
if (!waitinglist) {
|
||||||
await interaction.editReply({
|
await interaction.editReply({
|
||||||
embeds: [{
|
embeds: [{
|
||||||
description: userMention(member.user.id) + " is not on the waiting list.",
|
description: userMention(member.user.id) + " is not on the waiting list.",
|
||||||
color: embedColor
|
color: embedColor
|
||||||
}]
|
}]
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
await waiting?.destroy()
|
await waiting?.destroy()
|
||||||
await member.roles.remove(waitingListRole, "Removed from waiting list.")
|
await member.roles.remove(waitingListRole, "Removed from waiting list.")
|
||||||
|
|
||||||
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
|
||||||
},
|
},
|
||||||
title: "Waiting List - Remove User",
|
title: "Waiting List - Remove User",
|
||||||
description: removeIndents(`
|
description: removeIndents(`
|
||||||
**User:** ${userMention(member.user.id)}
|
**User:** ${userMention(member.user.id)}
|
||||||
**Reason:** ${reason}
|
**Reason:** ${reason}
|
||||||
**Mod:** ${userMention(mod.id)}
|
**Mod:** ${userMention(mod.id)}
|
||||||
`),
|
`),
|
||||||
color: embedColor,
|
color: embedColor,
|
||||||
thumbnail: {
|
thumbnail: {
|
||||||
url: mod.avatarURL() || ""
|
url: mod.avatarURL() || ""
|
||||||
},
|
},
|
||||||
footer: {
|
footer: {
|
||||||
icon_url: member.avatarURL() || undefined,
|
icon_url: member.avatarURL() || undefined,
|
||||||
text: "ID: " + member.user.id
|
text: "ID: " + member.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: "**User:** " + userMention(member.user.id) + "\n" +
|
description: "**User:** " + userMention(member.user.id) + "\n" +
|
||||||
"**Reason:** `" + reason + "`",
|
"**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 ICommand
|
} as ICommand
|
||||||
|
|||||||
@@ -1,163 +1,163 @@
|
|||||||
import { GuildMember, SlashCommandBuilder } from "discord.js"
|
import { GuildMember, SlashCommandBuilder } from "discord.js"
|
||||||
import { getGuild, getIGN, getHeadURL } from "utils/Hypixel"
|
import { getGuild, getIGN, getHeadURL } from "utils/Hypixel"
|
||||||
import verify from "schemas/verifyTag"
|
import verify from "schemas/verifyTag"
|
||||||
import { embedColor, hypixelGuildID, devMessage } from "config/options"
|
import { embedColor, hypixelGuildID, devMessage } from "config/options"
|
||||||
import roleManage from "utils/functions/rolesmanage"
|
import roleManage from "utils/functions/rolesmanage"
|
||||||
import { ICommand } from "interfaces"
|
import { ICommand } from "interfaces"
|
||||||
import { waitingListRole } from "config/roles"
|
import { waitingListRole } from "config/roles"
|
||||||
import { removeIndents } from "utils/functions/funcs"
|
import { removeIndents } from "utils/functions/funcs"
|
||||||
|
|
||||||
export = {
|
export = {
|
||||||
name: "update",
|
name: "update",
|
||||||
description: "Update your guild rank.",
|
description: "Update your guild rank.",
|
||||||
dev: true,
|
dev: false,
|
||||||
public: true,
|
public: true,
|
||||||
|
|
||||||
data: new SlashCommandBuilder()
|
data: new SlashCommandBuilder()
|
||||||
.setName("update")
|
.setName("update")
|
||||||
.setDescription("Update your discord roles.")
|
.setDescription("Update your discord roles.")
|
||||||
.setDMPermission(false),
|
.setDMPermission(false),
|
||||||
|
|
||||||
async execute({ interaction }) {
|
async execute({ interaction }) {
|
||||||
await interaction.deferReply()
|
await interaction.deferReply()
|
||||||
|
|
||||||
const user = interaction.member as GuildMember
|
const user = interaction.member as GuildMember
|
||||||
const verifyData = await verify.findOne({ where: { userID: user.user.id } })
|
const verifyData = await verify.findOne({ where: { userID: user.user.id } })
|
||||||
|
|
||||||
if (!verifyData) {
|
if (!verifyData) {
|
||||||
await user.setNickname(`${user.user.username} (X)`, "User used the update command").catch(() => {
|
await user.setNickname(`${user.user.username} (X)`, "User used the update command").catch(() => {
|
||||||
// Do nothing
|
// Do nothing
|
||||||
})
|
})
|
||||||
await interaction.editReply({
|
await interaction.editReply({
|
||||||
embeds: [{
|
embeds: [{
|
||||||
description: "You are not verified. Please run `/verify` to verify yourself\n\n" + "Updating username to `Username (X)`",
|
description: "You are not verified. Please run `/verify` to verify yourself\n\n" + "Updating username to `Username (X)`",
|
||||||
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)
|
||||||
let guildID: string | null
|
let guildID: string | null
|
||||||
if (!guild) {
|
if (!guild) {
|
||||||
guildID = null
|
guildID = null
|
||||||
} else {
|
} else {
|
||||||
guildID = guild._id
|
guildID = guild._id
|
||||||
}
|
}
|
||||||
|
|
||||||
const ign = (await getIGN(verifyData.uuid)) as string
|
const ign = (await getIGN(verifyData.uuid)) as string
|
||||||
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(roles.rolesToRemove, "User used the update command")
|
await user.roles.remove(roles.rolesToRemove, "User used the update command")
|
||||||
await user.roles.add(roles.rolesToAdd, "User used the update command")
|
await user.roles.add(roles.rolesToAdd, "User used the update command")
|
||||||
await user.setNickname(ign, "User used the update command").catch(() => {
|
await user.setNickname(ign, "User used the update command").catch(() => {
|
||||||
// Do nothing
|
// Do nothing
|
||||||
})
|
})
|
||||||
|
|
||||||
await interaction.editReply({
|
await interaction.editReply({
|
||||||
embeds: [{
|
embeds: [{
|
||||||
description: removeIndents(`
|
description: removeIndents(`
|
||||||
Updated your roles to \`Default Member\`
|
Updated your roles to \`Default Member\`
|
||||||
|
|
||||||
IGN: \`${ign}\`
|
IGN: \`${ign}\`
|
||||||
`),
|
`),
|
||||||
color: embedColor,
|
color: embedColor,
|
||||||
thumbnail: {
|
thumbnail: {
|
||||||
url: head!
|
url: head!
|
||||||
},
|
},
|
||||||
footer: {
|
footer: {
|
||||||
text: interaction.guild!.name + " | " + devMessage,
|
text: interaction.guild!.name + " | " + devMessage,
|
||||||
icon_url: interaction.guild!.iconURL() || undefined
|
icon_url: interaction.guild!.iconURL() || undefined
|
||||||
}
|
}
|
||||||
}]
|
}]
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if (guildID === hypixelGuildID) {
|
if (guildID === hypixelGuildID) {
|
||||||
const GuildMembers = guild!.members
|
const GuildMembers = guild!.members
|
||||||
const guildRank = GuildMembers.find(member => member.uuid === verifyData.uuid)!.rank
|
const guildRank = GuildMembers.find(member => member.uuid === verifyData.uuid)!.rank
|
||||||
let replyRank: string | null = null
|
let replyRank: string | null = null
|
||||||
|
|
||||||
await user.roles.add(roleManage("default").rolesToAdd, "User used the update command")
|
await user.roles.add(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(roles.rolesToRemove, "User used the update command")
|
await user.roles.remove(roles.rolesToRemove, "User used the update command")
|
||||||
await user.roles.add(roles.rolesToAdd, "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(roles.rolesToRemove, "User used the update command")
|
await user.roles.remove(roles.rolesToRemove, "User used the update command")
|
||||||
await user.roles.add(roles.rolesToAdd, "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(roles.rolesToRemove, "User used the update command")
|
await user.roles.remove(roles.rolesToRemove, "User used the update command")
|
||||||
await user.roles.add(roles.rolesToAdd, "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(roles.rolesToRemove, "User used the update command")
|
await user.roles.remove(roles.rolesToRemove, "User used the update command")
|
||||||
await user.roles.add(roles.rolesToAdd, "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(roles.rolesToRemove, "User used the update command")
|
await user.roles.remove(roles.rolesToRemove, "User used the update command")
|
||||||
await user.roles.add(roles.rolesToAdd, "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(roles.rolesToRemove, "User used the update command")
|
await user.roles.remove(roles.rolesToRemove, "User used the update command")
|
||||||
await user.roles.add(roles.rolesToAdd, "User used the update command")
|
await user.roles.add(roles.rolesToAdd, "User used the update command")
|
||||||
replyRank = "Member"
|
replyRank = "Member"
|
||||||
}
|
}
|
||||||
|
|
||||||
await user.roles.remove(waitingListRole, "User used the update command")
|
await user.roles.remove(waitingListRole, "User used the update command")
|
||||||
|
|
||||||
await user.setNickname(ign, "Verification").catch(() => {
|
await user.setNickname(ign, "Verification").catch(() => {
|
||||||
// Do nothing
|
// Do nothing
|
||||||
})
|
})
|
||||||
|
|
||||||
await interaction.editReply({
|
await interaction.editReply({
|
||||||
embeds: [{
|
embeds: [{
|
||||||
description: removeIndents(`
|
description: removeIndents(`
|
||||||
Updated your roles to \`${replyRank}\`
|
Updated your roles to \`${replyRank}\`
|
||||||
|
|
||||||
IGN: \`${ign}\`
|
IGN: \`${ign}\`
|
||||||
`),
|
`),
|
||||||
color: embedColor,
|
color: embedColor,
|
||||||
thumbnail: {
|
thumbnail: {
|
||||||
url: head!
|
url: head!
|
||||||
},
|
},
|
||||||
footer: {
|
footer: {
|
||||||
text: interaction.guild!.name + " | " + devMessage,
|
text: interaction.guild!.name + " | " + devMessage,
|
||||||
icon_url: interaction.guild!.iconURL() || undefined
|
icon_url: interaction.guild!.iconURL() || undefined
|
||||||
}
|
}
|
||||||
}]
|
}]
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} as ICommand
|
} as ICommand
|
||||||
|
|||||||
@@ -1,200 +1,200 @@
|
|||||||
import { GuildMember, SlashCommandBuilder } from "discord.js"
|
import { GuildMember, SlashCommandBuilder } from "discord.js"
|
||||||
import { getUUID, getPlayer, getGuild, getHeadURL } from "utils/Hypixel"
|
import { getUUID, getPlayer, getGuild, getHeadURL } from "utils/Hypixel"
|
||||||
import { embedColor, hypixelGuildID, devMessage } from "config/options"
|
import { embedColor, hypixelGuildID, devMessage } from "config/options"
|
||||||
import roleManage from "utils/functions/rolesmanage"
|
import roleManage from "utils/functions/rolesmanage"
|
||||||
import { ICommand } from "interfaces"
|
import { ICommand } from "interfaces"
|
||||||
import verify from "schemas/verifyTag"
|
import verify from "schemas/verifyTag"
|
||||||
import { IPlayerData } from "interfaces"
|
import { IPlayerData } from "interfaces"
|
||||||
import { IGuildData } from "interfaces"
|
import { IGuildData } from "interfaces"
|
||||||
|
|
||||||
export = {
|
export = {
|
||||||
name: "verify",
|
name: "verify",
|
||||||
description: "Verify yourself as a member of the server.",
|
description: "Verify yourself as a member of the server.",
|
||||||
dev: true,
|
dev: false,
|
||||||
public: true,
|
public: true,
|
||||||
|
|
||||||
data: new SlashCommandBuilder()
|
data: new SlashCommandBuilder()
|
||||||
.setName("verify")
|
.setName("verify")
|
||||||
.setDescription("Verify yourself as a member of the server.")
|
.setDescription("Verify yourself as a member of the server.")
|
||||||
.addStringOption(option =>
|
.addStringOption(option =>
|
||||||
option
|
option
|
||||||
.setName("ign")
|
.setName("ign")
|
||||||
.setDescription("Your in-game name.")
|
.setDescription("Your in-game name.")
|
||||||
.setMinLength(3)
|
.setMinLength(3)
|
||||||
.setMaxLength(16)
|
.setMaxLength(16)
|
||||||
.setRequired(true)
|
.setRequired(true)
|
||||||
)
|
)
|
||||||
.setDMPermission(false),
|
.setDMPermission(false),
|
||||||
|
|
||||||
async execute({ interaction }) {
|
async execute({ interaction }) {
|
||||||
await interaction.deferReply()
|
await interaction.deferReply()
|
||||||
|
|
||||||
const user = interaction.member! as GuildMember
|
const user = interaction.member! as GuildMember
|
||||||
const ign = interaction.options.getString("ign")!
|
const ign = interaction.options.getString("ign")!
|
||||||
|
|
||||||
const verifyData = await verify.findOne({ where: { userID: user.id } })
|
const verifyData = await verify.findOne({ where: { userID: user.id } })
|
||||||
if (verifyData) {
|
if (verifyData) {
|
||||||
interaction.editReply("You are already verified.\n" + "Try running /update to update your roles.")
|
interaction.editReply("You are already verified.\n" + "Try running /update to update your roles.")
|
||||||
return
|
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 IPlayerData
|
const player = (await getPlayer(uuid)) as IPlayerData
|
||||||
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
|
||||||
}
|
}
|
||||||
|
|
||||||
let username = ""
|
let username = ""
|
||||||
if (user.user.discriminator === "0") {
|
if (user.user.discriminator === "0") {
|
||||||
username = user.user.username
|
username = user.user.username
|
||||||
} else {
|
} else {
|
||||||
username = user.user.username + "#" + user.user.discriminator
|
username = user.user.username + "#" + user.user.discriminator
|
||||||
}
|
}
|
||||||
|
|
||||||
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: "<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.**",
|
"**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: "<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.**",
|
"**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 IGuildData | null
|
const guild = (await getGuild(uuid)) as IGuildData | null
|
||||||
let guildID: string | null
|
let guildID: string | null
|
||||||
if (!guild) {
|
if (!guild) {
|
||||||
guildID = null
|
guildID = null
|
||||||
} else {
|
} else {
|
||||||
guildID = guild._id
|
guildID = guild._id
|
||||||
}
|
}
|
||||||
|
|
||||||
if (guildID === hypixelGuildID) {
|
if (guildID === hypixelGuildID) {
|
||||||
const GuildMembers = guild!.members
|
const GuildMembers = guild!.members
|
||||||
const guildRank = GuildMembers.find(member => member.uuid === player.uuid)!.rank
|
const guildRank = GuildMembers.find(member => member.uuid === player.uuid)!.rank
|
||||||
|
|
||||||
if (guildRank === "Guild Master") {
|
if (guildRank === "Guild Master") {
|
||||||
const roles = roleManage("gm")
|
const roles = roleManage("gm")
|
||||||
await user.roles.add(roles.rolesToAdd, "Verification")
|
await user.roles.add(roles.rolesToAdd, "Verification")
|
||||||
}
|
}
|
||||||
|
|
||||||
if (guildRank === "Manager") {
|
if (guildRank === "Manager") {
|
||||||
const roles = roleManage("manager")
|
const roles = roleManage("manager")
|
||||||
await user.roles.add(roles.rolesToAdd, "Verification")
|
await user.roles.add(roles.rolesToAdd, "Verification")
|
||||||
}
|
}
|
||||||
|
|
||||||
if (guildRank === "Moderator") {
|
if (guildRank === "Moderator") {
|
||||||
const roles = roleManage("moderator")
|
const roles = roleManage("moderator")
|
||||||
await user.roles.add(roles.rolesToAdd, "Verification")
|
await user.roles.add(roles.rolesToAdd, "Verification")
|
||||||
}
|
}
|
||||||
|
|
||||||
if (guildRank === "Beast") {
|
if (guildRank === "Beast") {
|
||||||
const roles = roleManage("beast")
|
const roles = roleManage("beast")
|
||||||
await user.roles.add(roles.rolesToAdd, "Verification")
|
await user.roles.add(roles.rolesToAdd, "Verification")
|
||||||
}
|
}
|
||||||
|
|
||||||
if (guildRank === "Elite") {
|
if (guildRank === "Elite") {
|
||||||
const roles = roleManage("elite")
|
const roles = roleManage("elite")
|
||||||
await user.roles.add(roles.rolesToAdd, "Verification")
|
await user.roles.add(roles.rolesToAdd, "Verification")
|
||||||
}
|
}
|
||||||
|
|
||||||
if (guildRank === "Member") {
|
if (guildRank === "Member") {
|
||||||
const roles = roleManage("member")
|
const roles = roleManage("member")
|
||||||
await user.roles.add(roles.rolesToAdd, "Verification")
|
await user.roles.add(roles.rolesToAdd, "Verification")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
await user.roles.add(roleManage("default").rolesToAdd, "Verification")
|
await user.roles.add(roleManage("default").rolesToAdd, "Verification")
|
||||||
await user.setNickname(player.displayname!, "Verification").catch(() => {
|
await user.setNickname(player.displayname!, "Verification").catch(() => {
|
||||||
// Do nothing
|
// Do nothing
|
||||||
})
|
})
|
||||||
|
|
||||||
await verify.create({
|
await verify.create({
|
||||||
userID: user.id,
|
userID: user.id,
|
||||||
uuid: uuid
|
uuid: uuid
|
||||||
})
|
})
|
||||||
|
|
||||||
await interaction.editReply({
|
await interaction.editReply({
|
||||||
embeds: [{
|
embeds: [{
|
||||||
title: interaction.guild!.name,
|
title: interaction.guild!.name,
|
||||||
description: "You have successfully verified `" + username + "` with the account `" + player.displayname + "`.",
|
description: "You have successfully verified `" + username + "` with the account `" + player.displayname + "`.",
|
||||||
color: embedColor,
|
color: embedColor,
|
||||||
thumbnail: {
|
thumbnail: {
|
||||||
url: head!
|
url: head!
|
||||||
},
|
},
|
||||||
footer: {
|
footer: {
|
||||||
icon_url: interaction.guild!.iconURL() || undefined,
|
icon_url: interaction.guild!.iconURL() || undefined,
|
||||||
text: interaction.guild!.name + " | " + devMessage
|
text: interaction.guild!.name + " | " + devMessage
|
||||||
}
|
}
|
||||||
}]
|
}]
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
} as ICommand
|
} as ICommand
|
||||||
|
|||||||
@@ -1,53 +1,53 @@
|
|||||||
import { SlashCommandBuilder, userMention } from "discord.js"
|
import { SlashCommandBuilder, userMention } from "discord.js"
|
||||||
import { ICommand } from "interfaces"
|
import { ICommand } from "interfaces"
|
||||||
import { embedColor, devMessage } from "config/options"
|
import { embedColor, devMessage } from "config/options"
|
||||||
import verify from "schemas/verifyTag"
|
import verify from "schemas/verifyTag"
|
||||||
import { getIGN, getHeadURL } from "utils/Hypixel"
|
import { getIGN, getHeadURL } from "utils/Hypixel"
|
||||||
|
|
||||||
export = {
|
export = {
|
||||||
name: "whoami",
|
name: "whoami",
|
||||||
description: "Get your user info",
|
description: "Get your user info",
|
||||||
public: true,
|
public: true,
|
||||||
dev: true,
|
dev: false,
|
||||||
|
|
||||||
data: new SlashCommandBuilder()
|
data: new SlashCommandBuilder()
|
||||||
.setName("whoami")
|
.setName("whoami")
|
||||||
.setDescription("Get your user info")
|
.setDescription("Get your user info")
|
||||||
.setDMPermission(false),
|
.setDMPermission(false),
|
||||||
|
|
||||||
async execute({ interaction }) {
|
async execute({ interaction }) {
|
||||||
await interaction.deferReply()
|
await interaction.deferReply()
|
||||||
|
|
||||||
const user = interaction.user
|
const user = interaction.user
|
||||||
const verifyData = await verify.findOne({ where: { userID: user.id } })
|
const verifyData = await verify.findOne({ where: { userID: user.id } })
|
||||||
|
|
||||||
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
|
||||||
}
|
}
|
||||||
|
|
||||||
const ign = await getIGN(verifyData.uuid)
|
const ign = await getIGN(verifyData.uuid)
|
||||||
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: "**User:** " + userMention(user.id) +
|
description: "**User:** " + userMention(user.id) +
|
||||||
"\n**IGN:** `" + ign + "`",
|
"\n**IGN:** `" + ign + "`",
|
||||||
color: embedColor,
|
color: embedColor,
|
||||||
thumbnail: {
|
thumbnail: {
|
||||||
url: head!
|
url: head!
|
||||||
},
|
},
|
||||||
footer: {
|
footer: {
|
||||||
text: interaction.guild!.name + " | " + devMessage,
|
text: interaction.guild!.name + " | " + devMessage,
|
||||||
icon_url: interaction.guild!.iconURL() || undefined
|
icon_url: interaction.guild!.iconURL() || undefined
|
||||||
}
|
}
|
||||||
}]
|
}]
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
} as ICommand
|
} as ICommand
|
||||||
|
|||||||
@@ -1,59 +1,59 @@
|
|||||||
import { SlashCommandBuilder, PermissionFlagsBits, userMention } from "discord.js"
|
import { SlashCommandBuilder, PermissionFlagsBits, userMention } from "discord.js"
|
||||||
import { getIGN, getHeadURL } from "utils/Hypixel"
|
import { getIGN, getHeadURL } from "utils/Hypixel"
|
||||||
import { embedColor, devMessage } from "config/options"
|
import { embedColor, devMessage } from "config/options"
|
||||||
import verify from "schemas/verifyTag"
|
import verify from "schemas/verifyTag"
|
||||||
import { ICommand } from "interfaces"
|
import { ICommand } from "interfaces"
|
||||||
|
|
||||||
export = {
|
export = {
|
||||||
name: "whois",
|
name: "whois",
|
||||||
description: "Get's the ign of a user.",
|
description: "Get's the ign of a user.",
|
||||||
dev: true,
|
dev: false,
|
||||||
public: false,
|
public: false,
|
||||||
|
|
||||||
data: new SlashCommandBuilder()
|
data: new SlashCommandBuilder()
|
||||||
.setName("whois")
|
.setName("whois")
|
||||||
.setDescription("Get's the ign of a user.")
|
.setDescription("Get's the ign of a user.")
|
||||||
.addUserOption(option =>
|
.addUserOption(option =>
|
||||||
option
|
option
|
||||||
.setName("user")
|
.setName("user")
|
||||||
.setDescription("The user to get the ign of.")
|
.setDescription("The user to get the ign of.")
|
||||||
.setRequired(true)
|
.setRequired(true)
|
||||||
)
|
)
|
||||||
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
|
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
|
||||||
.setDMPermission(false),
|
.setDMPermission(false),
|
||||||
|
|
||||||
async execute({ interaction }) {
|
async execute({ interaction }) {
|
||||||
await interaction.deferReply()
|
await interaction.deferReply()
|
||||||
|
|
||||||
const user = interaction.options.getUser("user")!
|
const user = interaction.options.getUser("user")!
|
||||||
const verifiedUser = await verify.findOne({ where: { userID: user.id } })
|
const verifiedUser = await verify.findOne({ where: { userID: user.id } })
|
||||||
if (!verifiedUser) {
|
if (!verifiedUser) {
|
||||||
interaction.editReply({
|
interaction.editReply({
|
||||||
embeds: [{
|
embeds: [{
|
||||||
description: userMention(user.id) + " is not verified.",
|
description: userMention(user.id) + " is not verified.",
|
||||||
color: embedColor
|
color: embedColor
|
||||||
}]
|
}]
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
const ign = (await getIGN(verifiedUser.uuid)) as string
|
const ign = (await getIGN(verifiedUser.uuid)) as string
|
||||||
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: "**User:** " + userMention(user.id) +
|
description: "**User:** " + userMention(user.id) +
|
||||||
"\n**IGN:** " + ign,
|
"\n**IGN:** " + ign,
|
||||||
color: embedColor,
|
color: embedColor,
|
||||||
thumbnail: {
|
thumbnail: {
|
||||||
url: head!
|
url: head!
|
||||||
},
|
},
|
||||||
footer: {
|
footer: {
|
||||||
text: interaction.guild!.name + " | " + devMessage,
|
text: interaction.guild!.name + " | " + devMessage,
|
||||||
icon_url: interaction.guild!.iconURL() || undefined
|
icon_url: interaction.guild!.iconURL() || undefined
|
||||||
}
|
}
|
||||||
}]
|
}]
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
} as ICommand
|
} as ICommand
|
||||||
|
|||||||
Reference in New Issue
Block a user