Updated imports and formating
Signed-off-by: Taken <taken@mairimashita.org>
This commit is contained in:
1
.prettierignore
Normal file
1
.prettierignore
Normal file
@@ -0,0 +1 @@
|
||||
src/config/
|
||||
@@ -1,4 +1,9 @@
|
||||
import { ApplicationCommandType, ContextMenuCommandBuilder, PermissionFlagsBits, userMention } from "discord.js"
|
||||
import {
|
||||
ApplicationCommandType,
|
||||
ContextMenuCommandBuilder,
|
||||
PermissionFlagsBits,
|
||||
userMention,
|
||||
} from "discord.js"
|
||||
import { color, devMessage, hypixelGuildID } from "config/options.json"
|
||||
import { ContextMenu } from "interfaces"
|
||||
import verifySchema from "schemas/verifySchema"
|
||||
@@ -74,13 +79,18 @@ export = {
|
||||
|
||||
if (responseGuildID !== hypixelGuildID) {
|
||||
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 interaction.editReply({
|
||||
embeds: [
|
||||
{
|
||||
description: usermentioned + " was given the the Default Member role.",
|
||||
description:
|
||||
usermentioned +
|
||||
" was given the the Default Member role.",
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: head!,
|
||||
@@ -97,50 +107,91 @@ export = {
|
||||
|
||||
if (responseGuildID === hypixelGuildID) {
|
||||
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
|
||||
|
||||
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") {
|
||||
const roles = roleManage("gm")
|
||||
await user.roles.remove(roles.rolesToRemove, "User was force updated.")
|
||||
await user.roles.add(roles.rolesToAdd, "User was force updated.")
|
||||
await user.roles.remove(
|
||||
roles.rolesToRemove,
|
||||
"User was force updated.",
|
||||
)
|
||||
await user.roles.add(
|
||||
roles.rolesToAdd,
|
||||
"User was force updated.",
|
||||
)
|
||||
replyRank = "Guild Master"
|
||||
}
|
||||
|
||||
if (guildRank === "Manager") {
|
||||
const roles = roleManage("manager")
|
||||
await user.roles.remove(roles.rolesToRemove, "User was force updated.")
|
||||
await user.roles.add(roles.rolesToAdd, "User was force updated.")
|
||||
await user.roles.remove(
|
||||
roles.rolesToRemove,
|
||||
"User was force updated.",
|
||||
)
|
||||
await user.roles.add(
|
||||
roles.rolesToAdd,
|
||||
"User was force updated.",
|
||||
)
|
||||
replyRank = "Manager"
|
||||
}
|
||||
|
||||
if (guildRank === "Moderator") {
|
||||
const roles = roleManage("moderator")
|
||||
await user.roles.remove(roles.rolesToRemove, "User was force updated.")
|
||||
await user.roles.add(roles.rolesToAdd, "User was force updated.")
|
||||
await user.roles.remove(
|
||||
roles.rolesToRemove,
|
||||
"User was force updated.",
|
||||
)
|
||||
await user.roles.add(
|
||||
roles.rolesToAdd,
|
||||
"User was force updated.",
|
||||
)
|
||||
replyRank = "Moderator"
|
||||
}
|
||||
|
||||
if (guildRank === "Beast") {
|
||||
const roles = roleManage("beast")
|
||||
await user.roles.remove(roles.rolesToRemove, "User was force updated.")
|
||||
await user.roles.add(roles.rolesToAdd, "User was force updated.")
|
||||
await user.roles.remove(
|
||||
roles.rolesToRemove,
|
||||
"User was force updated.",
|
||||
)
|
||||
await user.roles.add(
|
||||
roles.rolesToAdd,
|
||||
"User was force updated.",
|
||||
)
|
||||
replyRank = "Beast"
|
||||
}
|
||||
|
||||
if (guildRank === "Elite") {
|
||||
const roles = roleManage("elite")
|
||||
await user.roles.remove(roles.rolesToRemove, "User was force updated.")
|
||||
await user.roles.add(roles.rolesToAdd, "User was force updated.")
|
||||
await user.roles.remove(
|
||||
roles.rolesToRemove,
|
||||
"User was force updated.",
|
||||
)
|
||||
await user.roles.add(
|
||||
roles.rolesToAdd,
|
||||
"User was force updated.",
|
||||
)
|
||||
replyRank = "Elite"
|
||||
}
|
||||
|
||||
if (guildRank === "Member") {
|
||||
const roles = roleManage("member")
|
||||
await user.roles.remove(roles.rolesToRemove, "User was force updated.")
|
||||
await user.roles.add(roles.rolesToAdd, "User was force updated.")
|
||||
await user.roles.remove(
|
||||
roles.rolesToRemove,
|
||||
"User was force updated.",
|
||||
)
|
||||
await user.roles.add(
|
||||
roles.rolesToAdd,
|
||||
"User was force updated.",
|
||||
)
|
||||
replyRank = "Member"
|
||||
}
|
||||
|
||||
@@ -148,7 +199,10 @@ export = {
|
||||
embeds: [
|
||||
{
|
||||
description:
|
||||
usermentioned + " was given the " + replyRank + " role.",
|
||||
usermentioned +
|
||||
" was given the " +
|
||||
replyRank +
|
||||
" role.",
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: head!,
|
||||
@@ -161,5 +215,5 @@ export = {
|
||||
],
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
} as ContextMenu
|
||||
@@ -112,30 +112,30 @@ export = {
|
||||
})
|
||||
|
||||
await logToChannel("mod", {
|
||||
embeds: [{
|
||||
author: {
|
||||
name: mod.user.username,
|
||||
icon_url: mod.user.avatarURL() || undefined,
|
||||
},
|
||||
title: "Member Banned",
|
||||
description: `
|
||||
embeds: [
|
||||
{
|
||||
author: {
|
||||
name: mod.user.username,
|
||||
icon_url: mod.user.avatarURL() || undefined,
|
||||
},
|
||||
title: "Member Banned",
|
||||
description: `
|
||||
**User:** ${userMention(member.user.id)}
|
||||
**Mod:** ${userMention(mod.user.id)}
|
||||
**Reason:** ${reason}
|
||||
**Messages Deleted:** ${messageDeletionDays} days
|
||||
`,
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: mod.user.avatarURL() || "",
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: mod.user.avatarURL() || "",
|
||||
},
|
||||
footer: {
|
||||
text: "ID: " + member.user.id,
|
||||
icon_url: member.user.avatarURL() || undefined,
|
||||
},
|
||||
timestamp: new Date().toISOString(),
|
||||
},
|
||||
footer: {
|
||||
text: "ID: " + member.user.id,
|
||||
icon_url:
|
||||
member.user.avatarURL() ||
|
||||
undefined,
|
||||
},
|
||||
timestamp: new Date().toISOString(),
|
||||
}]
|
||||
],
|
||||
})
|
||||
|
||||
await interaction.editReply({
|
||||
@@ -143,9 +143,15 @@ export = {
|
||||
{
|
||||
title: "Member Banned",
|
||||
description:
|
||||
"**User:** " + userMention(member.user.id) + "\n" +
|
||||
"**Reason:** " + reason + "\n" +
|
||||
"**Messages Deleted:** " + messageDeletionDays + " days",
|
||||
"**User:** " +
|
||||
userMention(member.user.id) +
|
||||
"\n" +
|
||||
"**Reason:** " +
|
||||
reason +
|
||||
"\n" +
|
||||
"**Messages Deleted:** " +
|
||||
messageDeletionDays +
|
||||
" days",
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: member.user.avatarURL() || "",
|
||||
|
||||
@@ -60,27 +60,29 @@ export = {
|
||||
await channel.bulkDelete(messagesToDelete, true)
|
||||
|
||||
await logToChannel("mod", {
|
||||
embeds: [{
|
||||
author: {
|
||||
name: interaction.user.username,
|
||||
icon_url: interaction.user.avatarURL() || undefined,
|
||||
},
|
||||
title: "Messages Cleared",
|
||||
description: `
|
||||
embeds: [
|
||||
{
|
||||
author: {
|
||||
name: interaction.user.username,
|
||||
icon_url: interaction.user.avatarURL() || undefined,
|
||||
},
|
||||
title: "Messages Cleared",
|
||||
description: `
|
||||
**Channel:** ${channelMention(channel.id)}
|
||||
**Amount:** \`${messages.size}\` messages
|
||||
**Mod:** ${userMention(interaction.user.id)}
|
||||
`,
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: interaction.user.avatarURL() || "",
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: interaction.user.avatarURL() || "",
|
||||
},
|
||||
footer: {
|
||||
text: "ID: " + channel.id,
|
||||
icon_url: interaction.guild!.iconURL() || undefined,
|
||||
},
|
||||
timestamp: new Date().toISOString(),
|
||||
},
|
||||
footer: {
|
||||
text: "ID: " + channel.id,
|
||||
icon_url: interaction.guild!.iconURL() || undefined,
|
||||
},
|
||||
timestamp: new Date().toISOString()
|
||||
}]
|
||||
],
|
||||
})
|
||||
|
||||
await interaction.editReply({
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
import { ChannelType, PermissionFlagsBits, SlashCommandBuilder } from "discord.js"
|
||||
import {
|
||||
ChannelType,
|
||||
PermissionFlagsBits,
|
||||
SlashCommandBuilder,
|
||||
} from "discord.js"
|
||||
import { color, devMessage } from "config/options.json"
|
||||
import { Command } from "interfaces"
|
||||
import setup from "./counting/setup"
|
||||
@@ -25,7 +29,10 @@ export = {
|
||||
.setName("channel")
|
||||
.setDescription("The channel to setup counting in")
|
||||
.setRequired(true)
|
||||
.addChannelTypes(ChannelType.GuildText, ChannelType.GuildAnnouncement)
|
||||
.addChannelTypes(
|
||||
ChannelType.GuildText,
|
||||
ChannelType.GuildAnnouncement,
|
||||
),
|
||||
),
|
||||
)
|
||||
.addSubcommand(subcommand =>
|
||||
@@ -36,8 +43,8 @@ export = {
|
||||
option
|
||||
.setName("user")
|
||||
.setDescription("The user to ban")
|
||||
.setRequired(true)
|
||||
)
|
||||
.setRequired(true),
|
||||
),
|
||||
)
|
||||
.addSubcommand(subcommand =>
|
||||
subcommand
|
||||
@@ -47,8 +54,8 @@ export = {
|
||||
option
|
||||
.setName("user")
|
||||
.setDescription("The user to ban")
|
||||
.setRequired(true)
|
||||
)
|
||||
.setRequired(true),
|
||||
),
|
||||
)
|
||||
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
|
||||
.setDMPermission(false),
|
||||
@@ -79,8 +86,7 @@ export = {
|
||||
color: embedColor,
|
||||
footer: {
|
||||
text: interaction.guild!.name + " | " + devMessage,
|
||||
icon_url:
|
||||
interaction.guild!.iconURL() || undefined,
|
||||
icon_url: interaction.guild!.iconURL() || undefined,
|
||||
},
|
||||
},
|
||||
],
|
||||
|
||||
@@ -1,44 +1,61 @@
|
||||
import { ChatInputCommandInteraction, TextChannel, channelMention } from "discord.js"
|
||||
import {
|
||||
ChatInputCommandInteraction,
|
||||
TextChannel,
|
||||
channelMention,
|
||||
} from "discord.js"
|
||||
import settingsSchema from "schemas/settingsSchema"
|
||||
import { color, devMessage } from "config/options.json"
|
||||
import mongoose from "mongoose"
|
||||
|
||||
export default async function setup(interaction: ChatInputCommandInteraction): Promise<void> {
|
||||
export default async function setup(
|
||||
interaction: ChatInputCommandInteraction,
|
||||
): Promise<void> {
|
||||
await interaction.deferReply()
|
||||
|
||||
const channel = interaction.options.getChannel("channel") as TextChannel
|
||||
const embedColor = Number(color.replace("#", "0x"))
|
||||
|
||||
if (await settingsSchema.findOne({ name: "counting" })) {
|
||||
await settingsSchema.findOneAndUpdate({ name: "counting" }, { name: "counting", channel: channel.id })
|
||||
await settingsSchema.findOneAndUpdate(
|
||||
{ name: "counting" },
|
||||
{ name: "counting", channel: channel.id },
|
||||
)
|
||||
await interaction.editReply({
|
||||
embeds: [{
|
||||
description: "Counting channel has been updated to " + channelMention(channel.id),
|
||||
color: embedColor,
|
||||
footer: {
|
||||
icon_url: interaction.guild!.iconURL() || undefined,
|
||||
text: interaction.guild!.name + " | " + devMessage
|
||||
}
|
||||
}]
|
||||
embeds: [
|
||||
{
|
||||
description:
|
||||
"Counting channel has been updated to " +
|
||||
channelMention(channel.id),
|
||||
color: embedColor,
|
||||
footer: {
|
||||
icon_url: interaction.guild!.iconURL() || undefined,
|
||||
text: interaction.guild!.name + " | " + devMessage,
|
||||
},
|
||||
},
|
||||
],
|
||||
})
|
||||
} else {
|
||||
const counting = new settingsSchema({
|
||||
_id: new mongoose.Types.ObjectId(),
|
||||
name: "counting",
|
||||
value: channel.id
|
||||
value: channel.id,
|
||||
})
|
||||
|
||||
await counting.save()
|
||||
|
||||
await interaction.editReply({
|
||||
embeds: [{
|
||||
description: "Counting channel has been set to " + channelMention(channel.id),
|
||||
color: embedColor,
|
||||
footer: {
|
||||
icon_url: interaction.guild!.iconURL() || undefined,
|
||||
text: interaction.guild!.name + " | " + devMessage
|
||||
}
|
||||
}]
|
||||
embeds: [
|
||||
{
|
||||
description:
|
||||
"Counting channel has been set to " +
|
||||
channelMention(channel.id),
|
||||
color: embedColor,
|
||||
footer: {
|
||||
icon_url: interaction.guild!.iconURL() || undefined,
|
||||
text: interaction.guild!.name + " | " + devMessage,
|
||||
},
|
||||
},
|
||||
],
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -50,32 +50,36 @@ export = {
|
||||
const uuid = verifiedUser.uuid
|
||||
const ign = await getIGN(uuid)
|
||||
await verify.findOneAndDelete({ userID: member.user.id })
|
||||
await member.roles.remove(roleManage("all").rolesToRemove, "User force unverified by " + interaction.user.username)
|
||||
|
||||
await member.roles.remove(
|
||||
roleManage("all").rolesToRemove,
|
||||
"User force unverified by " + interaction.user.username,
|
||||
)
|
||||
|
||||
await logToChannel("mod", {
|
||||
embeds: [{
|
||||
title: "Force Unverified",
|
||||
author: {
|
||||
name: mod.username,
|
||||
icon_url: mod.avatarURL() || undefined,
|
||||
},
|
||||
description: `
|
||||
embeds: [
|
||||
{
|
||||
title: "Force Unverified",
|
||||
author: {
|
||||
name: mod.username,
|
||||
icon_url: mod.avatarURL() || undefined,
|
||||
},
|
||||
description: `
|
||||
**User:** ${userMention(member.user.id)}
|
||||
**Mod:** ${userMention(mod.id)}
|
||||
**IGN:** \`${ign}\`
|
||||
**UUID:** \`${uuid}\`
|
||||
`,
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: mod.avatarURL() || "",
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: mod.avatarURL() || "",
|
||||
},
|
||||
footer: {
|
||||
icon_url: member.user.avatarURL() || undefined,
|
||||
text: "ID: " + member.user.id,
|
||||
},
|
||||
timestamp: new Date().toISOString(),
|
||||
},
|
||||
footer: {
|
||||
icon_url: member.user.avatarURL() || undefined,
|
||||
text: "ID: " + member.user.id,
|
||||
},
|
||||
timestamp: new Date().toISOString(),
|
||||
}]
|
||||
],
|
||||
})
|
||||
|
||||
await interaction.reply({
|
||||
|
||||
@@ -85,7 +85,10 @@ export = {
|
||||
|
||||
if (responseGuildID !== hypixelGuildID) {
|
||||
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 interaction.editReply({
|
||||
@@ -110,50 +113,91 @@ export = {
|
||||
|
||||
if (responseGuildID === hypixelGuildID) {
|
||||
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
|
||||
|
||||
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") {
|
||||
const roles = roleManage("gm")
|
||||
await user.roles.remove(roles.rolesToRemove, "User was force updated.")
|
||||
await user.roles.add(roles.rolesToAdd, "User was force updated.")
|
||||
await user.roles.remove(
|
||||
roles.rolesToRemove,
|
||||
"User was force updated.",
|
||||
)
|
||||
await user.roles.add(
|
||||
roles.rolesToAdd,
|
||||
"User was force updated.",
|
||||
)
|
||||
replyRank = "Guild Master"
|
||||
}
|
||||
|
||||
if (guildRank === "Manager") {
|
||||
const roles = roleManage("manager")
|
||||
await user.roles.remove(roles.rolesToRemove, "User was force updated.")
|
||||
await user.roles.add(roles.rolesToAdd, "User was force updated.")
|
||||
await user.roles.remove(
|
||||
roles.rolesToRemove,
|
||||
"User was force updated.",
|
||||
)
|
||||
await user.roles.add(
|
||||
roles.rolesToAdd,
|
||||
"User was force updated.",
|
||||
)
|
||||
replyRank = "Manager"
|
||||
}
|
||||
|
||||
if (guildRank === "Moderator") {
|
||||
const roles = roleManage("moderator")
|
||||
await user.roles.remove(roles.rolesToRemove, "User was force updated.")
|
||||
await user.roles.add(roles.rolesToAdd, "User was force updated.")
|
||||
await user.roles.remove(
|
||||
roles.rolesToRemove,
|
||||
"User was force updated.",
|
||||
)
|
||||
await user.roles.add(
|
||||
roles.rolesToAdd,
|
||||
"User was force updated.",
|
||||
)
|
||||
replyRank = "Moderator"
|
||||
}
|
||||
|
||||
if (guildRank === "Beast") {
|
||||
const roles = roleManage("beast")
|
||||
await user.roles.remove(roles.rolesToRemove, "User was force updated.")
|
||||
await user.roles.add(roles.rolesToAdd, "User was force updated.")
|
||||
await user.roles.remove(
|
||||
roles.rolesToRemove,
|
||||
"User was force updated.",
|
||||
)
|
||||
await user.roles.add(
|
||||
roles.rolesToAdd,
|
||||
"User was force updated.",
|
||||
)
|
||||
replyRank = "Beast"
|
||||
}
|
||||
|
||||
if (guildRank === "Elite") {
|
||||
const roles = roleManage("elite")
|
||||
await user.roles.remove(roles.rolesToRemove, "User was force updated.")
|
||||
await user.roles.add(roles.rolesToAdd, "User was force updated.")
|
||||
await user.roles.remove(
|
||||
roles.rolesToRemove,
|
||||
"User was force updated.",
|
||||
)
|
||||
await user.roles.add(
|
||||
roles.rolesToAdd,
|
||||
"User was force updated.",
|
||||
)
|
||||
replyRank = "Elite"
|
||||
}
|
||||
|
||||
if (guildRank === "Member") {
|
||||
const roles = roleManage("member")
|
||||
await user.roles.remove(roles.rolesToRemove, "User was force updated.")
|
||||
await user.roles.add(roles.rolesToAdd, "User was force updated.")
|
||||
await user.roles.remove(
|
||||
roles.rolesToRemove,
|
||||
"User was force updated.",
|
||||
)
|
||||
await user.roles.add(
|
||||
roles.rolesToAdd,
|
||||
"User was force updated.",
|
||||
)
|
||||
replyRank = "Member"
|
||||
}
|
||||
|
||||
@@ -161,7 +205,10 @@ export = {
|
||||
embeds: [
|
||||
{
|
||||
description:
|
||||
usermentioned + " was given the the " + replyRank + " role.",
|
||||
usermentioned +
|
||||
" was given the the " +
|
||||
replyRank +
|
||||
" role.",
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: head!,
|
||||
|
||||
@@ -143,36 +143,57 @@ export = {
|
||||
|
||||
if (guildRank === "Guild Master") {
|
||||
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") {
|
||||
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") {
|
||||
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") {
|
||||
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") {
|
||||
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") {
|
||||
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,
|
||||
)
|
||||
|
||||
const newVerify = new verify({
|
||||
_id: new mongoose.Types.ObjectId(),
|
||||
@@ -183,28 +204,30 @@ export = {
|
||||
await newVerify.save()
|
||||
|
||||
await logToChannel("mod", {
|
||||
embeds: [{
|
||||
author: {
|
||||
name: modName,
|
||||
icon_url: mod.avatarURL() || undefined,
|
||||
},
|
||||
title: "Force Verified",
|
||||
description: `
|
||||
embeds: [
|
||||
{
|
||||
author: {
|
||||
name: modName,
|
||||
icon_url: mod.avatarURL() || undefined,
|
||||
},
|
||||
title: "Force Verified",
|
||||
description: `
|
||||
**User:** ${userMention(user.id)}
|
||||
**Mod:** ${userMention(mod.id)}
|
||||
**IGN:** \`${player.displayname}\`
|
||||
**UUID:** \`${uuid}\`
|
||||
`,
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: mod.avatarURL() || "",
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: mod.avatarURL() || "",
|
||||
},
|
||||
footer: {
|
||||
icon_url: user.user.avatarURL() || undefined,
|
||||
text: "ID: " + user.user.id,
|
||||
},
|
||||
timestamp: new Date().toISOString(),
|
||||
},
|
||||
footer: {
|
||||
icon_url: user.user.avatarURL() || undefined,
|
||||
text: "ID: " + user.user.id
|
||||
},
|
||||
timestamp: new Date().toISOString(),
|
||||
}]
|
||||
],
|
||||
})
|
||||
|
||||
await interaction.editReply({
|
||||
|
||||
@@ -108,8 +108,7 @@ export = {
|
||||
color: embedColor,
|
||||
footer: {
|
||||
text: interaction.guild!.name + " | " + devMessage,
|
||||
icon_url:
|
||||
interaction.guild!.iconURL() || undefined,
|
||||
icon_url: interaction.guild!.iconURL() || undefined,
|
||||
},
|
||||
},
|
||||
],
|
||||
|
||||
@@ -1,10 +1,4 @@
|
||||
import {
|
||||
getUUID,
|
||||
getIGN,
|
||||
getPlayer,
|
||||
getGuild,
|
||||
guildLevel,
|
||||
} from "utils/Hypixel"
|
||||
import { getUUID, getIGN, getPlayer, getGuild, guildLevel } from "utils/Hypixel"
|
||||
import { color, devMessage } from "config/options.json"
|
||||
import { ChatInputCommandInteraction } from "discord.js"
|
||||
import { GuildData } from "interfaces"
|
||||
@@ -234,9 +228,7 @@ export default async function guildInfo(
|
||||
color: embedColor,
|
||||
footer: {
|
||||
text: interaction.guild!.name + " | " + devMessage,
|
||||
icon_url:
|
||||
interaction.guild!.iconURL() ||
|
||||
undefined,
|
||||
icon_url: interaction.guild!.iconURL() || undefined,
|
||||
},
|
||||
},
|
||||
],
|
||||
|
||||
@@ -177,8 +177,8 @@ export default async function guildTop(
|
||||
amount = 1
|
||||
}
|
||||
|
||||
type GuildTopData = { ign: string, uuid: string }[]
|
||||
type NewList = { name: string, value: string; inline: boolean }[]
|
||||
type GuildTopData = { ign: string; uuid: string }[]
|
||||
type NewList = { name: string; value: string; inline: boolean }[]
|
||||
|
||||
let cacheStatus: boolean
|
||||
let guildData: GuildTopData = []
|
||||
@@ -243,7 +243,9 @@ export default async function guildTop(
|
||||
|
||||
for (let i = 0; i < amount; i++) {
|
||||
const gexp = new Intl.NumberFormat("en-US").format(topMembers[i].gexp)
|
||||
const ign = guildData.find(member => member.uuid === topMembers[i].uuid)?.ign
|
||||
const ign = guildData.find(
|
||||
member => member.uuid === topMembers[i].uuid,
|
||||
)?.ign
|
||||
|
||||
const position = i + 1
|
||||
|
||||
|
||||
@@ -36,8 +36,9 @@ export = {
|
||||
async execute(interaction) {
|
||||
await interaction.deferReply()
|
||||
|
||||
const member = interaction.options.getMember( "member",) as GuildMember
|
||||
const reason = interaction.options.getString("reason") ?? "No reason provided."
|
||||
const member = interaction.options.getMember("member") as GuildMember
|
||||
const reason =
|
||||
interaction.options.getString("reason") ?? "No reason provided."
|
||||
const embedColor = Number(color.replace("#", "0x"))
|
||||
|
||||
const mod = await interaction.guild!.members.fetch(interaction.user.id)
|
||||
@@ -79,36 +80,44 @@ export = {
|
||||
await member.kick(reason + ` - ${mod.user.username}`)
|
||||
|
||||
await logToChannel("mod", {
|
||||
embeds: [{
|
||||
author: {
|
||||
name: mod.user.username,
|
||||
icon_url: mod.user.avatarURL() || undefined,
|
||||
},
|
||||
title: "Member Kicked",
|
||||
description: `
|
||||
embeds: [
|
||||
{
|
||||
author: {
|
||||
name: mod.user.username,
|
||||
icon_url: mod.user.avatarURL() || undefined,
|
||||
},
|
||||
title: "Member Kicked",
|
||||
description: `
|
||||
**User:** ${userMention(member.user.id)}
|
||||
**Mod:** ${userMention(mod.user.id)}
|
||||
**Reason:** ${reason}
|
||||
`,
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: mod.user.avatarURL() || "",
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: mod.user.avatarURL() || "",
|
||||
},
|
||||
footer: {
|
||||
text: "ID: " + member.user.id,
|
||||
icon_url: member.user.avatarURL() || undefined,
|
||||
},
|
||||
timestamp: new Date().toISOString(),
|
||||
},
|
||||
footer: {
|
||||
text: "ID: " + member.user.id,
|
||||
icon_url: member.user.avatarURL() || undefined,
|
||||
},
|
||||
timestamp: new Date().toISOString(),
|
||||
}]
|
||||
],
|
||||
})
|
||||
|
||||
await interaction.editReply({
|
||||
embeds: [
|
||||
{
|
||||
title: "Member Kicked",
|
||||
description: "**User:** " + userMention(member.user.id) + "\n" +
|
||||
"**Reason:** " + reason + "\n" +
|
||||
"**Moderator:** " + mod.user.username,
|
||||
description:
|
||||
"**User:** " +
|
||||
userMention(member.user.id) +
|
||||
"\n" +
|
||||
"**Reason:** " +
|
||||
reason +
|
||||
"\n" +
|
||||
"**Moderator:** " +
|
||||
mod.user.username,
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: member.user.avatarURL() || "",
|
||||
@@ -116,7 +125,7 @@ export = {
|
||||
footer: {
|
||||
icon_url: interaction.guild!.iconURL() || undefined,
|
||||
text: interaction.guild!.name + " | " + devMessage,
|
||||
}
|
||||
},
|
||||
},
|
||||
],
|
||||
})
|
||||
|
||||
@@ -26,8 +26,7 @@ export = {
|
||||
color: embedColor,
|
||||
footer: {
|
||||
text: interaction.guild!.name + " | " + devMessage,
|
||||
icon_url:
|
||||
interaction.guild?.iconURL() || undefined,
|
||||
icon_url: interaction.guild?.iconURL() || undefined,
|
||||
},
|
||||
timestamp: new Date().toISOString(),
|
||||
},
|
||||
|
||||
@@ -61,27 +61,29 @@ export = {
|
||||
await waitinglistSchema.findOneAndDelete({ userID: user.id })
|
||||
|
||||
await logToChannel("mod", {
|
||||
embeds: [{
|
||||
author: {
|
||||
name: mod.username,
|
||||
icon_url: mod.avatarURL() || undefined,
|
||||
},
|
||||
title: "Waiting List - Remove User",
|
||||
description: `
|
||||
embeds: [
|
||||
{
|
||||
author: {
|
||||
name: mod.username,
|
||||
icon_url: mod.avatarURL() || undefined,
|
||||
},
|
||||
title: "Waiting List - Remove User",
|
||||
description: `
|
||||
**User:** ${userMention(user.id)}
|
||||
**Reason:** ${reason}
|
||||
**Mod:** ${userMention(mod.id)}
|
||||
`,
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: mod.avatarURL() || "",
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: mod.avatarURL() || "",
|
||||
},
|
||||
footer: {
|
||||
icon_url: user.avatarURL() || undefined,
|
||||
text: "ID: " + user.id,
|
||||
},
|
||||
timestamp: new Date().toISOString(),
|
||||
},
|
||||
footer: {
|
||||
icon_url: user.avatarURL() || undefined,
|
||||
text: "ID: " + user.id,
|
||||
},
|
||||
timestamp: new Date().toISOString()
|
||||
}]
|
||||
],
|
||||
})
|
||||
|
||||
await interaction.editReply({
|
||||
@@ -89,13 +91,17 @@ export = {
|
||||
{
|
||||
title: "Waiting List - Remove User",
|
||||
description:
|
||||
"**User:** " + userMention(user.id) + "\n" +
|
||||
"**Reason:** `" + reason + "`",
|
||||
"**User:** " +
|
||||
userMention(user.id) +
|
||||
"\n" +
|
||||
"**Reason:** `" +
|
||||
reason +
|
||||
"`",
|
||||
color: embedColor,
|
||||
footer: {
|
||||
text: interaction.guild!.name + " | " + devMessage,
|
||||
icon_url: interaction.guild!.iconURL() || undefined,
|
||||
}
|
||||
},
|
||||
},
|
||||
],
|
||||
})
|
||||
|
||||
@@ -34,8 +34,7 @@ export = {
|
||||
"**You must make 100k-150k weekly GEXP.\nAs well as onne of the game stats below**",
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url:
|
||||
interaction.guild!.iconURL() || "",
|
||||
url: interaction.guild!.iconURL() || "",
|
||||
},
|
||||
fields: [
|
||||
{
|
||||
|
||||
@@ -27,7 +27,10 @@ export = {
|
||||
option
|
||||
.setName("channel")
|
||||
.setDescription("The channel to send the message to.")
|
||||
.addChannelTypes(ChannelType.GuildText, ChannelType.GuildAnnouncement)
|
||||
.addChannelTypes(
|
||||
ChannelType.GuildText,
|
||||
ChannelType.GuildAnnouncement,
|
||||
),
|
||||
)
|
||||
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
|
||||
.setDMPermission(false),
|
||||
@@ -36,7 +39,8 @@ export = {
|
||||
await interaction.deferReply({ ephemeral: true })
|
||||
|
||||
const message = interaction.options.getString("message")!
|
||||
const channel = (interaction.options.getChannel("channel") || interaction.channel) as TextChannel
|
||||
const channel = (interaction.options.getChannel("channel") ||
|
||||
interaction.channel) as TextChannel
|
||||
const embedColor = Number(color.replace("#", "0x"))
|
||||
|
||||
channel.send({
|
||||
|
||||
@@ -49,38 +49,42 @@ export = {
|
||||
await member.setNickname(nickname, `Set by ${interaction.user.tag}`)
|
||||
|
||||
await logToChannel("mod", {
|
||||
embeds: [{
|
||||
author: {
|
||||
name: interaction.user.username,
|
||||
icon_url: interaction.user.avatarURL() || undefined,
|
||||
},
|
||||
title: "Nickname",
|
||||
description: `
|
||||
embeds: [
|
||||
{
|
||||
author: {
|
||||
name: interaction.user.username,
|
||||
icon_url: interaction.user.avatarURL() || undefined,
|
||||
},
|
||||
title: "Nickname",
|
||||
description: `
|
||||
**User:** ${userMention(member.id)}
|
||||
**Nickname:** ${nickname}
|
||||
**Moderator:** ${userMention(interaction.user.id)}
|
||||
`,
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: interaction.user.avatarURL() || "",
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: interaction.user.avatarURL() || "",
|
||||
},
|
||||
footer: {
|
||||
text: "ID: " + member.user.id,
|
||||
icon_url: member.user.avatarURL() || undefined,
|
||||
},
|
||||
timestamp: new Date().toISOString(),
|
||||
},
|
||||
footer: {
|
||||
text: "ID: " + member.user.id,
|
||||
icon_url: member.user.avatarURL() || undefined,
|
||||
},
|
||||
timestamp: new Date().toISOString()
|
||||
}]
|
||||
],
|
||||
})
|
||||
|
||||
await interaction.reply({
|
||||
embeds: [{
|
||||
description: `Successfully set the nickname of ${userMention(member.id)} to ${nickname}`,
|
||||
color: embedColor,
|
||||
footer: {
|
||||
text: interaction.guild!.name + " | " + devMessage,
|
||||
icon_url: interaction.guild!.iconURL() || undefined,
|
||||
}
|
||||
}],
|
||||
embeds: [
|
||||
{
|
||||
description: `Successfully set the nickname of ${userMention(member.id)} to ${nickname}`,
|
||||
color: embedColor,
|
||||
footer: {
|
||||
text: interaction.guild!.name + " | " + devMessage,
|
||||
icon_url: interaction.guild!.iconURL() || undefined,
|
||||
},
|
||||
},
|
||||
],
|
||||
ephemeral: true,
|
||||
})
|
||||
},
|
||||
|
||||
@@ -31,7 +31,10 @@ export = {
|
||||
.setDescription(
|
||||
"The channel to send the application to.",
|
||||
)
|
||||
.addChannelTypes(ChannelType.GuildText, ChannelType.GuildAnnouncement)
|
||||
.addChannelTypes(
|
||||
ChannelType.GuildText,
|
||||
ChannelType.GuildAnnouncement,
|
||||
)
|
||||
.setRequired(true),
|
||||
),
|
||||
)
|
||||
@@ -45,7 +48,10 @@ export = {
|
||||
.setDescription(
|
||||
"The channel to send the application to.",
|
||||
)
|
||||
.addChannelTypes(ChannelType.GuildText, ChannelType.GuildAnnouncement)
|
||||
.addChannelTypes(
|
||||
ChannelType.GuildText,
|
||||
ChannelType.GuildAnnouncement,
|
||||
)
|
||||
.setRequired(true),
|
||||
),
|
||||
)
|
||||
@@ -59,7 +65,10 @@ export = {
|
||||
.setDescription(
|
||||
"The channel to send the verfiy message to.",
|
||||
)
|
||||
.addChannelTypes(ChannelType.GuildText, ChannelType.GuildAnnouncement)
|
||||
.addChannelTypes(
|
||||
ChannelType.GuildText,
|
||||
ChannelType.GuildAnnouncement,
|
||||
)
|
||||
.setRequired(true),
|
||||
),
|
||||
)
|
||||
@@ -73,7 +82,10 @@ export = {
|
||||
.setDescription(
|
||||
"The channel to send the waiting list message to.",
|
||||
)
|
||||
.addChannelTypes(ChannelType.GuildText, ChannelType.GuildAnnouncement)
|
||||
.addChannelTypes(
|
||||
ChannelType.GuildText,
|
||||
ChannelType.GuildAnnouncement,
|
||||
)
|
||||
.setRequired(true),
|
||||
),
|
||||
)
|
||||
@@ -87,7 +99,10 @@ export = {
|
||||
.setDescription(
|
||||
"The channel to send the application to.",
|
||||
)
|
||||
.addChannelTypes(ChannelType.GuildText, ChannelType.GuildAnnouncement)
|
||||
.addChannelTypes(
|
||||
ChannelType.GuildText,
|
||||
ChannelType.GuildAnnouncement,
|
||||
)
|
||||
.setRequired(true),
|
||||
),
|
||||
)
|
||||
@@ -106,7 +121,8 @@ export = {
|
||||
|
||||
if (subcommand === "sendguildapplication") {
|
||||
title = "Guild Application"
|
||||
description = "You can apply for the guild by clicking the button below."
|
||||
description =
|
||||
"You can apply for the guild by clicking the button below."
|
||||
customId = "guildapply"
|
||||
label = "Apply"
|
||||
emoji = "✅"
|
||||
@@ -114,7 +130,8 @@ export = {
|
||||
|
||||
if (subcommand === "sendstaffapplication") {
|
||||
title = "Staff Application"
|
||||
description = "You can apply for the staff team by clicking the button below."
|
||||
description =
|
||||
"You can apply for the staff team by clicking the button below."
|
||||
customId = "staffapply"
|
||||
label = "Apply"
|
||||
emoji = "✅"
|
||||
@@ -122,7 +139,8 @@ export = {
|
||||
|
||||
if (subcommand === "sendinactivityapplication") {
|
||||
title = "Inactivity Log"
|
||||
description = "You can send an inactivity log by clicking the button below."
|
||||
description =
|
||||
"You can send an inactivity log by clicking the button below."
|
||||
customId = "guildinactivitylog"
|
||||
label = "Submit"
|
||||
emoji = "✅"
|
||||
@@ -138,34 +156,38 @@ export = {
|
||||
|
||||
if (subcommand === "sendwaitinglistmessage") {
|
||||
title = "Waiting List"
|
||||
description = "The people below were accepted into the guild\n" + "Try to invite them in order.",
|
||||
customId = "waitinglistupdate"
|
||||
;(description =
|
||||
"The people below were accepted into the guild\n" +
|
||||
"Try to invite them in order."),
|
||||
(customId = "waitinglistupdate")
|
||||
label = "Update"
|
||||
emoji = "🔄"
|
||||
}
|
||||
|
||||
await channel.send({
|
||||
embeds: [{
|
||||
title: title,
|
||||
description: description,
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: interaction.guild!.iconURL() || "",
|
||||
embeds: [
|
||||
{
|
||||
title: title,
|
||||
description: description,
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: interaction.guild!.iconURL() || "",
|
||||
},
|
||||
footer: {
|
||||
text: interaction.guild!.name + " | " + devMessage,
|
||||
icon_url: interaction.guild!.iconURL() || undefined,
|
||||
},
|
||||
},
|
||||
footer: {
|
||||
text: interaction.guild!.name + " | " + devMessage,
|
||||
icon_url: interaction.guild!.iconURL() || undefined,
|
||||
}
|
||||
}],
|
||||
],
|
||||
components: [
|
||||
new ActionRowBuilder<ButtonBuilder>().addComponents(
|
||||
new ButtonBuilder()
|
||||
.setCustomId(customId)
|
||||
.setLabel(label)
|
||||
.setStyle(ButtonStyle.Primary)
|
||||
.setEmoji({ name: emoji })
|
||||
)
|
||||
]
|
||||
.setEmoji({ name: emoji }),
|
||||
),
|
||||
],
|
||||
})
|
||||
|
||||
await interaction.reply({
|
||||
|
||||
@@ -31,7 +31,10 @@ export = {
|
||||
option
|
||||
.setName("channel")
|
||||
.setDescription("The channel to set the slowmode of.")
|
||||
.addChannelTypes(ChannelType.GuildText, ChannelType.GuildAnnouncement),
|
||||
.addChannelTypes(
|
||||
ChannelType.GuildText,
|
||||
ChannelType.GuildAnnouncement,
|
||||
),
|
||||
)
|
||||
.setDefaultMemberPermissions(PermissionFlagsBits.Administrator)
|
||||
.setDMPermission(false),
|
||||
@@ -40,7 +43,8 @@ export = {
|
||||
await interaction.deferReply({ ephemeral: true })
|
||||
|
||||
const seconds = interaction.options.getInteger("seconds") ?? 5
|
||||
const channel = (interaction.options.getChannel("channel") || interaction.channel) as TextChannel
|
||||
const channel = (interaction.options.getChannel("channel") ||
|
||||
interaction.channel) as TextChannel
|
||||
const embedColor = Number(color.replace("#", "0x"))
|
||||
|
||||
if (seconds > 21600) {
|
||||
@@ -52,8 +56,7 @@ export = {
|
||||
color: embedColor,
|
||||
footer: {
|
||||
text: interaction.guild!.name + " | " + devMessage,
|
||||
icon_url:
|
||||
interaction.guild!.iconURL() || undefined,
|
||||
icon_url: interaction.guild!.iconURL() || undefined,
|
||||
},
|
||||
},
|
||||
],
|
||||
@@ -62,27 +65,29 @@ export = {
|
||||
}
|
||||
|
||||
await logToChannel("mod", {
|
||||
embeds: [{
|
||||
author: {
|
||||
name: interaction.user.username,
|
||||
icon_url: interaction.user.avatarURL() || undefined,
|
||||
},
|
||||
title: "Slowmode Update",
|
||||
description: `
|
||||
embeds: [
|
||||
{
|
||||
author: {
|
||||
name: interaction.user.username,
|
||||
icon_url: interaction.user.avatarURL() || undefined,
|
||||
},
|
||||
title: "Slowmode Update",
|
||||
description: `
|
||||
**Channel:** ${channelMention(channel.id)}
|
||||
**Slowmode:** ${seconds} seconds
|
||||
**Mod:** ${userMention(interaction.user.id)}
|
||||
`,
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: interaction.user.avatarURL() || "",
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: interaction.user.avatarURL() || "",
|
||||
},
|
||||
footer: {
|
||||
icon_url: interaction.guild!.iconURL() || undefined,
|
||||
text: " ID: " + channel.id,
|
||||
},
|
||||
timestamp: new Date().toISOString(),
|
||||
},
|
||||
footer: {
|
||||
icon_url: interaction.guild!.iconURL() || undefined,
|
||||
text: " ID: " + channel.id
|
||||
},
|
||||
timestamp: new Date().toISOString()
|
||||
}]
|
||||
],
|
||||
})
|
||||
|
||||
await interaction.editReply({
|
||||
@@ -92,8 +97,7 @@ export = {
|
||||
color: embedColor,
|
||||
footer: {
|
||||
text: interaction.guild!.name + " | " + devMessage,
|
||||
icon_url:
|
||||
interaction.guild!.iconURL() || undefined,
|
||||
icon_url: interaction.guild!.iconURL() || undefined,
|
||||
},
|
||||
},
|
||||
],
|
||||
|
||||
@@ -18,7 +18,8 @@ export = {
|
||||
option
|
||||
.setName("user")
|
||||
.setDescription("The user to snipe")
|
||||
.setRequired(true))
|
||||
.setRequired(true),
|
||||
)
|
||||
.setDMPermission(false),
|
||||
|
||||
async execute(interaction) {
|
||||
@@ -26,17 +27,19 @@ export = {
|
||||
const member = interaction.options.getMember("user") as GuildMember
|
||||
const snipeCache = await snipeCacheSchema.find({
|
||||
userid: member.user.id,
|
||||
channelid: interaction.channel!.id
|
||||
channelid: interaction.channel!.id,
|
||||
})
|
||||
const embedColor = Number(color.replace("#", "0x"))
|
||||
const messages: string[] = []
|
||||
|
||||
if (!snipeCache.length) {
|
||||
await interaction.editReply({
|
||||
embeds: [{
|
||||
description: "No messages to snipe",
|
||||
color: embedColor
|
||||
}]
|
||||
embeds: [
|
||||
{
|
||||
description: "No messages to snipe",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
})
|
||||
return
|
||||
}
|
||||
@@ -48,28 +51,32 @@ export = {
|
||||
messages.push(`**Message #${i}:** ${data.content}\n`)
|
||||
} else {
|
||||
messages.push(`**Message #${i}:** ${data.content}`)
|
||||
messages.push(`**Attachments:** ${data.attachments.join(", ")}\n`)
|
||||
messages.push(
|
||||
`**Attachments:** ${data.attachments.join(", ")}\n`,
|
||||
)
|
||||
}
|
||||
i++
|
||||
}
|
||||
|
||||
await interaction.editReply({
|
||||
embeds: [{
|
||||
author: {
|
||||
name: member.user.username,
|
||||
icon_url: member.user.avatarURL() || undefined
|
||||
embeds: [
|
||||
{
|
||||
author: {
|
||||
name: member.user.username,
|
||||
icon_url: member.user.avatarURL() || undefined,
|
||||
},
|
||||
description: messages.join("\n"),
|
||||
thumbnail: {
|
||||
url: member.user.avatarURL() || "",
|
||||
},
|
||||
color: embedColor,
|
||||
footer: {
|
||||
text: "ID: " + member.user.id,
|
||||
icon_url: interaction.guild!.iconURL() || undefined,
|
||||
},
|
||||
timestamp: new Date().toISOString(),
|
||||
},
|
||||
description: messages.join("\n"),
|
||||
thumbnail: {
|
||||
url: member.user.avatarURL() || ""
|
||||
},
|
||||
color: embedColor,
|
||||
footer: {
|
||||
text: "ID: " + member.user.id,
|
||||
icon_url: interaction.guild!.iconURL() || undefined
|
||||
},
|
||||
timestamp: new Date().toISOString()
|
||||
}]
|
||||
],
|
||||
})
|
||||
}
|
||||
},
|
||||
} as Command
|
||||
@@ -124,44 +124,62 @@ export = {
|
||||
if (target.isCommunicationDisabled()) {
|
||||
if (time === 0) {
|
||||
title = "Timeout Removed"
|
||||
description = "Removed timeout of " + userMention(target.id) + " for " + reason,
|
||||
timeouttime = null
|
||||
;(description =
|
||||
"Removed timeout of " +
|
||||
userMention(target.id) +
|
||||
" for " +
|
||||
reason),
|
||||
(timeouttime = null)
|
||||
} else {
|
||||
title = "Timeout Updated"
|
||||
description = "Updated timeout of " + userMention(target.id) + " to " + prettyTime + " for " + reason,
|
||||
timeouttime = time
|
||||
;(description =
|
||||
"Updated timeout of " +
|
||||
userMention(target.id) +
|
||||
" to " +
|
||||
prettyTime +
|
||||
" for " +
|
||||
reason),
|
||||
(timeouttime = time)
|
||||
}
|
||||
} else {
|
||||
title = "Member Timed Out"
|
||||
description = "Timed out " + userMention(target.id) + " for " + prettyTime + " for " + reason,
|
||||
timeouttime = time
|
||||
;(description =
|
||||
"Timed out " +
|
||||
userMention(target.id) +
|
||||
" for " +
|
||||
prettyTime +
|
||||
" for " +
|
||||
reason),
|
||||
(timeouttime = time)
|
||||
}
|
||||
|
||||
await target.timeout(timeouttime, reason)
|
||||
|
||||
await logToChannel("mod", {
|
||||
embeds: [{
|
||||
author: {
|
||||
name: mod.user.username,
|
||||
icon_url: mod.user.avatarURL() || undefined,
|
||||
},
|
||||
title: title,
|
||||
description: `
|
||||
embeds: [
|
||||
{
|
||||
author: {
|
||||
name: mod.user.username,
|
||||
icon_url: mod.user.avatarURL() || undefined,
|
||||
},
|
||||
title: title,
|
||||
description: `
|
||||
**User:** ${userMention(target.id)}
|
||||
${timeouttime === null ? "**Time:** `None`" : "**Time:** `" + prettyTime + "`"}
|
||||
**Reason:** \`${reason}\`
|
||||
**Mod:** ${userMention(mod.id)}
|
||||
`,
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: mod.user.avatarURL() || "",
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: mod.user.avatarURL() || "",
|
||||
},
|
||||
footer: {
|
||||
text: "ID: " + target.id,
|
||||
icon_url: target.user.avatarURL() || undefined,
|
||||
},
|
||||
timestamp: new Date().toISOString(),
|
||||
},
|
||||
footer: {
|
||||
text: "ID: " + target.id,
|
||||
icon_url: target.user.avatarURL() || undefined,
|
||||
},
|
||||
timestamp: new Date().toISOString()
|
||||
}]
|
||||
],
|
||||
})
|
||||
|
||||
await interaction.editReply({
|
||||
|
||||
@@ -38,7 +38,8 @@ export = {
|
||||
await interaction.deferReply()
|
||||
|
||||
const userid = interaction.options.getString("user")!
|
||||
const reason = interaction.options.getString("reason") || "No reason provided"
|
||||
const reason =
|
||||
interaction.options.getString("reason") || "No reason provided"
|
||||
const mod = interaction.user
|
||||
const embedColor = Number(color.replace("#", "0x"))
|
||||
let user: User
|
||||
@@ -102,9 +103,14 @@ export = {
|
||||
{
|
||||
title: "User unbanned",
|
||||
description:
|
||||
"The user " + user!.username + " has been unbanned.\n" +
|
||||
"**Reason:** `" + reason + "`\n" +
|
||||
"**Moderator:** " + userMention(mod.id),
|
||||
"The user " +
|
||||
user!.username +
|
||||
" has been unbanned.\n" +
|
||||
"**Reason:** `" +
|
||||
reason +
|
||||
"`\n" +
|
||||
"**Moderator:** " +
|
||||
userMention(mod.id),
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: user!.avatarURL() || "",
|
||||
|
||||
@@ -62,8 +62,14 @@ export = {
|
||||
const head = await getHeadURL(ign)
|
||||
if (guildID !== hypixelGuildID) {
|
||||
const roles = roleManage("default")
|
||||
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.remove(
|
||||
roles.rolesToRemove,
|
||||
"User used the update command",
|
||||
)
|
||||
await user.roles.add(
|
||||
roles.rolesToAdd,
|
||||
"User used the update command",
|
||||
)
|
||||
|
||||
await interaction.editReply({
|
||||
embeds: [
|
||||
@@ -85,57 +91,99 @@ export = {
|
||||
|
||||
if (guildID === hypixelGuildID) {
|
||||
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
|
||||
|
||||
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") {
|
||||
const roles = roleManage("gm")
|
||||
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.remove(
|
||||
roles.rolesToRemove,
|
||||
"User used the update command",
|
||||
)
|
||||
await user.roles.add(
|
||||
roles.rolesToAdd,
|
||||
"User used the update command",
|
||||
)
|
||||
replyRank = "Guild Master"
|
||||
}
|
||||
|
||||
if (guildRank === "Manager") {
|
||||
const roles = roleManage("manager")
|
||||
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.remove(
|
||||
roles.rolesToRemove,
|
||||
"User used the update command",
|
||||
)
|
||||
await user.roles.add(
|
||||
roles.rolesToAdd,
|
||||
"User used the update command",
|
||||
)
|
||||
replyRank = "Manager"
|
||||
}
|
||||
|
||||
if (guildRank === "Moderator") {
|
||||
const roles = roleManage("moderator")
|
||||
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.remove(
|
||||
roles.rolesToRemove,
|
||||
"User used the update command",
|
||||
)
|
||||
await user.roles.add(
|
||||
roles.rolesToAdd,
|
||||
"User used the update command",
|
||||
)
|
||||
replyRank = "Moderator"
|
||||
}
|
||||
|
||||
if (guildRank === "Beast") {
|
||||
const roles = roleManage("beast")
|
||||
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.remove(
|
||||
roles.rolesToRemove,
|
||||
"User used the update command",
|
||||
)
|
||||
await user.roles.add(
|
||||
roles.rolesToAdd,
|
||||
"User used the update command",
|
||||
)
|
||||
replyRank = "Beast"
|
||||
}
|
||||
|
||||
if (guildRank === "Elite") {
|
||||
const roles = roleManage("elite")
|
||||
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.remove(
|
||||
roles.rolesToRemove,
|
||||
"User used the update command",
|
||||
)
|
||||
await user.roles.add(
|
||||
roles.rolesToAdd,
|
||||
"User used the update command",
|
||||
)
|
||||
replyRank = "Elite"
|
||||
}
|
||||
|
||||
if (guildRank === "Member") {
|
||||
const roles = roleManage("member")
|
||||
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.remove(
|
||||
roles.rolesToRemove,
|
||||
"User used the update command",
|
||||
)
|
||||
await user.roles.add(
|
||||
roles.rolesToAdd,
|
||||
"User used the update command",
|
||||
)
|
||||
replyRank = "Member"
|
||||
}
|
||||
|
||||
await interaction.editReply({
|
||||
embeds: [
|
||||
{
|
||||
description: "Updated your roles to `" + replyRank + "`",
|
||||
description:
|
||||
"Updated your roles to `" + replyRank + "`",
|
||||
color: embedColor,
|
||||
thumbnail: {
|
||||
url: head!,
|
||||
|
||||
@@ -59,8 +59,7 @@ export = {
|
||||
},
|
||||
footer: {
|
||||
text: interaction.guild!.name + " | " + devMessage,
|
||||
icon_url:
|
||||
interaction.guild!.iconURL() || undefined,
|
||||
icon_url: interaction.guild!.iconURL() || undefined,
|
||||
},
|
||||
},
|
||||
],
|
||||
|
||||
@@ -155,7 +155,9 @@ export = {
|
||||
],
|
||||
})
|
||||
} catch (err) {
|
||||
console.log(colorLog("Error while trying to update waiting list.", "red"))
|
||||
console.log(
|
||||
colorLog("Error while trying to update waiting list.", "red"),
|
||||
)
|
||||
}
|
||||
},
|
||||
} as Button
|
||||
|
||||
@@ -12,9 +12,7 @@ import { TextChannel } from "discord.js"
|
||||
const client = Illegitimate.client
|
||||
|
||||
async function guildWeekly() {
|
||||
const channel = client.channels.cache.get(
|
||||
guildLogChannel,
|
||||
) as TextChannel
|
||||
const channel = client.channels.cache.get(guildLogChannel) as TextChannel
|
||||
|
||||
if (!channel) {
|
||||
console.log(colorLog("Guild log channel not found", "red"))
|
||||
|
||||
@@ -11,32 +11,38 @@ export = {
|
||||
execute(interaction: ChatInputCommandInteraction | ButtonInteraction) {
|
||||
if (interaction.isCommand()) {
|
||||
try {
|
||||
console.log(color(
|
||||
interaction.user.username +
|
||||
" ran " +
|
||||
interaction.commandName +
|
||||
" " +
|
||||
interaction.options.getSubcommand(),
|
||||
"pink")
|
||||
console.log(
|
||||
color(
|
||||
interaction.user.username +
|
||||
" ran " +
|
||||
interaction.commandName +
|
||||
" " +
|
||||
interaction.options.getSubcommand(),
|
||||
"pink",
|
||||
),
|
||||
)
|
||||
} catch {
|
||||
console.log(color(
|
||||
interaction.user.username +
|
||||
" ran " +
|
||||
interaction.commandName,
|
||||
"pink")
|
||||
console.log(
|
||||
color(
|
||||
interaction.user.username +
|
||||
" ran " +
|
||||
interaction.commandName,
|
||||
"pink",
|
||||
),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
if (interaction.isButton()) {
|
||||
console.log(color(
|
||||
interaction.user.username +
|
||||
"#" +
|
||||
interaction.user.discriminator +
|
||||
" clicked " +
|
||||
interaction.customId,
|
||||
"pink")
|
||||
console.log(
|
||||
color(
|
||||
interaction.user.username +
|
||||
"#" +
|
||||
interaction.user.discriminator +
|
||||
" clicked " +
|
||||
interaction.customId,
|
||||
"pink",
|
||||
),
|
||||
)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -24,12 +24,12 @@ export = {
|
||||
}
|
||||
|
||||
const snipeCache = new snipeCacheSchema({
|
||||
_id: new mongoose.Types.ObjectId,
|
||||
_id: new mongoose.Types.ObjectId(),
|
||||
userid: message.author.id,
|
||||
channelid: message.channel.id,
|
||||
data: msg,
|
||||
})
|
||||
|
||||
await snipeCache.save()
|
||||
}
|
||||
},
|
||||
} as Event
|
||||
@@ -1,8 +1,4 @@
|
||||
import {
|
||||
userMention,
|
||||
channelMention,
|
||||
VoiceState,
|
||||
} from "discord.js"
|
||||
import { userMention, channelMention, VoiceState } from "discord.js"
|
||||
import { color } from "config/options.json"
|
||||
import { Event } from "interfaces"
|
||||
import logToChannel from "utils/functions/logtochannel"
|
||||
@@ -32,7 +28,8 @@ export = {
|
||||
color: embedColor,
|
||||
footer: {
|
||||
text: "ID: " + newState.member!.id,
|
||||
icon_url: newState.member!.user.avatarURL() || undefined,
|
||||
icon_url:
|
||||
newState.member!.user.avatarURL() || undefined,
|
||||
},
|
||||
timestamp: new Date().toISOString(),
|
||||
},
|
||||
@@ -50,7 +47,8 @@ export = {
|
||||
color: embedColor,
|
||||
footer: {
|
||||
text: "ID: " + oldState.member!.id,
|
||||
icon_url: oldState.member!.user.avatarURL() || undefined,
|
||||
icon_url:
|
||||
oldState.member!.user.avatarURL() || undefined,
|
||||
},
|
||||
timestamp: new Date().toISOString(),
|
||||
},
|
||||
@@ -72,7 +70,8 @@ export = {
|
||||
color: embedColor,
|
||||
footer: {
|
||||
text: "ID: " + oldState.member!.id,
|
||||
icon_url: oldState.member!.user.avatarURL() || undefined,
|
||||
icon_url:
|
||||
oldState.member!.user.avatarURL() || undefined,
|
||||
},
|
||||
timestamp: new Date().toISOString(),
|
||||
},
|
||||
|
||||
@@ -5,7 +5,7 @@ const snipeCacheSchema = new Schema({
|
||||
userid: { type: String, required: true },
|
||||
channelid: { type: String, required: true },
|
||||
data: { type: Object, required: true },
|
||||
date: { type: Date, default: Date.now(), expires: 600 }
|
||||
date: { type: Date, default: Date.now(), expires: 600 },
|
||||
})
|
||||
|
||||
export default model("snipeCache", snipeCacheSchema, "snipeCache")
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
RESTPutAPIApplicationGuildCommandsJSONBody,
|
||||
Routes,
|
||||
} from "discord.js"
|
||||
import fs = require("fs")
|
||||
import fs from "fs"
|
||||
type FileType = "js" | "ts"
|
||||
|
||||
export default async function autoDeployCommands(fileType: FileType) {
|
||||
@@ -17,10 +17,10 @@ export default async function autoDeployCommands(fileType: FileType) {
|
||||
|
||||
if (fileType === "js") {
|
||||
commandFiles = fs
|
||||
.readdirSync("./dist/src/commands/")
|
||||
.readdirSync("./dist/commands/")
|
||||
.filter(file => file.endsWith(fileType))
|
||||
contentMenuCommands = fs
|
||||
.readdirSync("./dist/src/commands-contextmenu/")
|
||||
.readdirSync("./dist/commands-contextmenu/")
|
||||
.filter(file => file.endsWith(fileType))
|
||||
} else if (fileType === "ts") {
|
||||
commandFiles = fs
|
||||
@@ -93,9 +93,7 @@ export default async function autoDeployCommands(fileType: FileType) {
|
||||
}
|
||||
|
||||
try {
|
||||
console.log(
|
||||
color("Commands are different, starting deploy.", "red"),
|
||||
)
|
||||
console.log(color("Commands are different, starting deploy.", "red"))
|
||||
console.log(color(currentCmds, "red"))
|
||||
console.log(
|
||||
`Started refreshing ${commands.length} application (/) commands.`,
|
||||
|
||||
@@ -34,7 +34,9 @@ export class ExtendedClient extends Client {
|
||||
async start() {
|
||||
let token: string
|
||||
if (process.env.NODE_ENV === "dev" && process.env.TYPESCRIPT) {
|
||||
console.log(color("Running in development mode. [ts-node]", "lavender"))
|
||||
console.log(
|
||||
color("Running in development mode. [ts-node]", "lavender"),
|
||||
)
|
||||
loadAllEvents(this, "ts")
|
||||
token = env.dev.devtoken!
|
||||
autoDeployCommands("ts")
|
||||
|
||||
@@ -3,8 +3,8 @@ import { color } from "config/options.json"
|
||||
import { Autocomplete } from "interfaces"
|
||||
import { Events } from "discord.js"
|
||||
import colorLog from "utils/functions/colors"
|
||||
import path = require("path")
|
||||
import fs = require("fs")
|
||||
import path from "path"
|
||||
import fs from "fs"
|
||||
import logToChannel from "utils/functions/logtochannel"
|
||||
type FileType = "js" | "ts"
|
||||
const embedColor = Number(color.replace("#", "0x"))
|
||||
@@ -32,10 +32,12 @@ export default function loadAutocompleteEvents(client: Client, ft: FileType) {
|
||||
) {
|
||||
client.autocomplete.set(autocomplete.name, autocomplete)
|
||||
} else {
|
||||
console.log(colorLog(
|
||||
`[WARNING] The autocomplete at ${filePath} is missing a required "name", "execute" or "type" property.`,
|
||||
"red"
|
||||
))
|
||||
console.log(
|
||||
colorLog(
|
||||
`[WARNING] The autocomplete at ${filePath} is missing a required "name", "execute" or "type" property.`,
|
||||
"red",
|
||||
),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,7 +57,6 @@ export default function loadAutocompleteEvents(client: Client, ft: FileType) {
|
||||
await autocomplete.execute(interaction)
|
||||
} catch (error) {
|
||||
if (process.env.NODE_ENV !== "dev") {
|
||||
|
||||
await logToChannel("error", {
|
||||
embeds: [
|
||||
{
|
||||
@@ -63,7 +64,8 @@ export default function loadAutocompleteEvents(client: Client, ft: FileType) {
|
||||
description: String(error),
|
||||
color: embedColor,
|
||||
footer: {
|
||||
icon_url: interaction.guild!.iconURL() || undefined,
|
||||
icon_url:
|
||||
interaction.guild!.iconURL() || undefined,
|
||||
text:
|
||||
interaction.user.username +
|
||||
" | " +
|
||||
|
||||
@@ -3,8 +3,8 @@ import colorLog from "utils/functions/colors"
|
||||
import { color } from "config/options.json"
|
||||
import { Button } from "interfaces"
|
||||
import { Events } from "discord.js"
|
||||
import path = require("path")
|
||||
import fs = require("fs")
|
||||
import path from "path"
|
||||
import fs from "fs"
|
||||
import logToChannel from "utils/functions/logtochannel"
|
||||
type FileType = "js" | "ts"
|
||||
const embedColor = Number(color.replace("#", "0x"))
|
||||
@@ -20,10 +20,12 @@ export default function loadButtonEvents(client: Client, ft: FileType) {
|
||||
if ("name" in btn && "execute" in btn && btn.type === "button") {
|
||||
client.buttons.set(btn.name, btn)
|
||||
} else {
|
||||
console.log(colorLog(
|
||||
`[WARNING] The button at ${filePath} is missing a required "name", "execute" or "type" property.`,
|
||||
"red"
|
||||
))
|
||||
console.log(
|
||||
colorLog(
|
||||
`[WARNING] The button at ${filePath} is missing a required "name", "execute" or "type" property.`,
|
||||
"red",
|
||||
),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,7 +52,8 @@ export default function loadButtonEvents(client: Client, ft: FileType) {
|
||||
description: "```" + error + "```",
|
||||
color: embedColor,
|
||||
footer: {
|
||||
icon_url: interaction.guild!.iconURL() || undefined,
|
||||
icon_url:
|
||||
interaction.guild!.iconURL() || undefined,
|
||||
text:
|
||||
interaction.user.username +
|
||||
" | " +
|
||||
@@ -64,18 +67,24 @@ export default function loadButtonEvents(client: Client, ft: FileType) {
|
||||
console.error(error)
|
||||
if (!interaction.deferred) {
|
||||
await interaction.reply({
|
||||
embeds: [{
|
||||
description: "There was an error while executing this button!",
|
||||
color: embedColor,
|
||||
}],
|
||||
embeds: [
|
||||
{
|
||||
description:
|
||||
"There was an error while executing this button!",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
ephemeral: true,
|
||||
})
|
||||
} else {
|
||||
await interaction.editReply({
|
||||
embeds: [{
|
||||
description: "There was an error while executing this button! 2",
|
||||
color: embedColor,
|
||||
}]
|
||||
embeds: [
|
||||
{
|
||||
description:
|
||||
"There was an error while executing this button! 2",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,8 +3,8 @@ import colorLog from "utils/functions/colors"
|
||||
import { color } from "config/options.json"
|
||||
import { Command } from "interfaces"
|
||||
import { Events } from "discord.js"
|
||||
import path = require("path")
|
||||
import fs = require("fs")
|
||||
import path from "path"
|
||||
import fs from "fs"
|
||||
import logToChannel from "utils/functions/logtochannel"
|
||||
type FileType = "js" | "ts"
|
||||
const embedColor = Number(color.replace("#", "0x"))
|
||||
@@ -20,10 +20,12 @@ export default function loadSlashCommandsEvents(client: Client, ft: FileType) {
|
||||
if ("data" in cmd && "execute" in cmd && cmd.type === "slash") {
|
||||
client.commands.set(cmd.data.name, cmd)
|
||||
} else {
|
||||
console.log(colorLog(
|
||||
`[WARNING] The command at ${filePath} is missing a required "data", "execute" or "type" property.`,
|
||||
"red"
|
||||
))
|
||||
console.log(
|
||||
colorLog(
|
||||
`[WARNING] The command at ${filePath} is missing a required "data", "execute" or "type" property.`,
|
||||
"red",
|
||||
),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,7 +53,8 @@ export default function loadSlashCommandsEvents(client: Client, ft: FileType) {
|
||||
description: "```" + error + "```",
|
||||
color: embedColor,
|
||||
footer: {
|
||||
icon_url: interaction.guild!.iconURL() || undefined,
|
||||
icon_url:
|
||||
interaction.guild!.iconURL() || undefined,
|
||||
text:
|
||||
interaction.user.username +
|
||||
" | " +
|
||||
@@ -65,18 +68,24 @@ export default function loadSlashCommandsEvents(client: Client, ft: FileType) {
|
||||
console.error(error)
|
||||
if (!interaction.deferred) {
|
||||
await interaction.reply({
|
||||
embeds: [{
|
||||
description: "There was an error while executing this command!",
|
||||
color: embedColor,
|
||||
}],
|
||||
embeds: [
|
||||
{
|
||||
description:
|
||||
"There was an error while executing this command!",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
ephemeral: true,
|
||||
})
|
||||
} else {
|
||||
await interaction.editReply({
|
||||
embeds: [{
|
||||
description: "There was an error while executing this command!",
|
||||
color: embedColor,
|
||||
}]
|
||||
embeds: [
|
||||
{
|
||||
description:
|
||||
"There was an error while executing this command!",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,8 +3,8 @@ import colorLog from "utils/functions/colors"
|
||||
import { ContextMenu } from "interfaces"
|
||||
import { color } from "config/options.json"
|
||||
import { Events } from "discord.js"
|
||||
import path = require("path")
|
||||
import fs = require("fs")
|
||||
import path from "path"
|
||||
import fs from "fs"
|
||||
import logToChannel from "utils/functions/logtochannel"
|
||||
type FileType = "js" | "ts"
|
||||
const embedColor = Number(color.replace("#", "0x"))
|
||||
@@ -27,10 +27,12 @@ export default function loadContextMenuEvents(client: Client, ft: FileType) {
|
||||
if ("data" in cmd && "execute" in cmd && cmd.type === "contextmenu") {
|
||||
client.contextmenus.set(cmd.data.name, cmd)
|
||||
} else {
|
||||
console.log(colorLog(
|
||||
`[WARNING] The command at ${filePath} is missing a required "data", "execute" or "type" property.`,
|
||||
"red"
|
||||
))
|
||||
console.log(
|
||||
colorLog(
|
||||
`[WARNING] The command at ${filePath} is missing a required "data", "execute" or "type" property.`,
|
||||
"red",
|
||||
),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,7 +60,8 @@ export default function loadContextMenuEvents(client: Client, ft: FileType) {
|
||||
description: "```" + error + "```",
|
||||
color: embedColor,
|
||||
footer: {
|
||||
icon_url: interaction.guild!.iconURL() || undefined,
|
||||
icon_url:
|
||||
interaction.guild!.iconURL() || undefined,
|
||||
text:
|
||||
interaction.user.username +
|
||||
" | " +
|
||||
@@ -72,18 +75,24 @@ export default function loadContextMenuEvents(client: Client, ft: FileType) {
|
||||
console.error(error)
|
||||
if (!interaction.deferred) {
|
||||
await interaction.reply({
|
||||
embeds: [{
|
||||
description: "There was an error while executing this contextmenu command!",
|
||||
color: embedColor,
|
||||
}],
|
||||
embeds: [
|
||||
{
|
||||
description:
|
||||
"There was an error while executing this contextmenu command!",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
ephemeral: true,
|
||||
})
|
||||
} else {
|
||||
await interaction.editReply({
|
||||
embeds: [{
|
||||
description: "There was an error while executing this contextmenu command!",
|
||||
color: embedColor,
|
||||
}]
|
||||
embeds: [
|
||||
{
|
||||
description:
|
||||
"There was an error while executing this contextmenu command!",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { ExtendedClient as Client } from "utils/Client"
|
||||
import { Event } from "interfaces"
|
||||
import path = require("path")
|
||||
import fs = require("fs")
|
||||
import path from "path"
|
||||
import fs from "fs"
|
||||
|
||||
export default function loadEvents(client: Client) {
|
||||
const serverDir = path.join(__dirname, "..", "..", "events", "server")
|
||||
|
||||
@@ -3,8 +3,8 @@ import colorLog from "utils/functions/colors"
|
||||
import { color } from "config/options.json"
|
||||
import { Modal } from "interfaces"
|
||||
import { Events } from "discord.js"
|
||||
import path = require("path")
|
||||
import fs = require("fs")
|
||||
import path from "path"
|
||||
import fs from "fs"
|
||||
import logToChannel from "utils/functions/logtochannel"
|
||||
type FileType = "js" | "ts"
|
||||
const embedColor = Number(color.replace("#", "0x"))
|
||||
@@ -22,10 +22,12 @@ export default function loadModalEvents(client: Client, ft: FileType) {
|
||||
if ("name" in modal && "execute" in modal && modal.type === "modal") {
|
||||
client.modals.set(modal.name, modal)
|
||||
} else {
|
||||
console.log(colorLog(
|
||||
`[WARNING] The modal at ${filePath} is missing a required "name", "execute" or "type" property.`,
|
||||
"red"
|
||||
))
|
||||
console.log(
|
||||
colorLog(
|
||||
`[WARNING] The modal at ${filePath} is missing a required "name", "execute" or "type" property.`,
|
||||
"red",
|
||||
),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,7 +54,8 @@ export default function loadModalEvents(client: Client, ft: FileType) {
|
||||
description: "```" + error + "```",
|
||||
color: embedColor,
|
||||
footer: {
|
||||
icon_url: interaction.guild!.iconURL() || undefined,
|
||||
icon_url:
|
||||
interaction.guild!.iconURL() || undefined,
|
||||
text:
|
||||
interaction.user.username +
|
||||
" | " +
|
||||
@@ -66,17 +69,23 @@ export default function loadModalEvents(client: Client, ft: FileType) {
|
||||
console.error(error)
|
||||
if (!interaction.deferred) {
|
||||
await interaction.reply({
|
||||
embeds: [{
|
||||
description: "There was an error while executing this modal!",
|
||||
color: embedColor
|
||||
}]
|
||||
embeds: [
|
||||
{
|
||||
description:
|
||||
"There was an error while executing this modal!",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
})
|
||||
} else {
|
||||
await interaction.editReply({
|
||||
embeds: [{
|
||||
description: "There was an error while executing this modal!",
|
||||
color: embedColor
|
||||
}]
|
||||
embeds: [
|
||||
{
|
||||
description:
|
||||
"There was an error while executing this modal!",
|
||||
color: embedColor,
|
||||
},
|
||||
],
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,14 +10,14 @@ function getExpForLevel(level: number): number {
|
||||
}
|
||||
|
||||
switch (respectedLevel) {
|
||||
case 1:
|
||||
return 500
|
||||
case 2:
|
||||
return 1000
|
||||
case 3:
|
||||
return 2000
|
||||
case 4:
|
||||
return 3500
|
||||
case 1:
|
||||
return 500
|
||||
case 2:
|
||||
return 1000
|
||||
case 3:
|
||||
return 2000
|
||||
case 4:
|
||||
return 3500
|
||||
}
|
||||
return 5000
|
||||
}
|
||||
|
||||
@@ -12,10 +12,10 @@ function getLevel(exp: number): number {
|
||||
return exp <= 1
|
||||
? 1
|
||||
: Math.floor(
|
||||
1 +
|
||||
1 +
|
||||
REVERSE_PQ_PREFIX +
|
||||
Math.sqrt(REVERSE_CONST + GROWTH_DIVIDES_2 * exp),
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
function hypixelLevel(exp: number): number {
|
||||
|
||||
@@ -3,10 +3,4 @@ export { bedwarsLevel } from "./bedwars"
|
||||
export { hypixelLevel } from "./hypixel"
|
||||
export { formatUuid } from "./uuid"
|
||||
export { guildLevel, scaledGEXP } from "./guild"
|
||||
export {
|
||||
getUUID,
|
||||
getIGN,
|
||||
getPlayer,
|
||||
getGuild,
|
||||
getHeadURL,
|
||||
} from "./account"
|
||||
export { getUUID, getIGN, getPlayer, getGuild, getHeadURL } from "./account"
|
||||
|
||||
@@ -4,7 +4,7 @@ const colors = {
|
||||
red: "#f38ba8",
|
||||
lavender: "#b4befe",
|
||||
green: "#a6e3a1",
|
||||
pink: "#f5c2e7"
|
||||
pink: "#f5c2e7",
|
||||
}
|
||||
|
||||
export default function color(text: string, type: keyof typeof colors) {
|
||||
|
||||
@@ -1,4 +1,12 @@
|
||||
import { guildid, onlineLogChannel, botLogChannel, guildLogChannel, errorLogChannel, moderationLogChannel, devLogChannel } from "config/options.json"
|
||||
import {
|
||||
guildid,
|
||||
onlineLogChannel,
|
||||
botLogChannel,
|
||||
guildLogChannel,
|
||||
errorLogChannel,
|
||||
moderationLogChannel,
|
||||
devLogChannel,
|
||||
} from "config/options.json"
|
||||
import { Guild, MessageCreateOptions, TextChannel } from "discord.js"
|
||||
import Illegitimate from "utils/Illegitimate"
|
||||
|
||||
@@ -8,12 +16,15 @@ const channels = {
|
||||
guild: guildLogChannel,
|
||||
error: errorLogChannel,
|
||||
mod: moderationLogChannel,
|
||||
dev: devLogChannel
|
||||
dev: devLogChannel,
|
||||
}
|
||||
|
||||
type Channel = keyof typeof channels
|
||||
|
||||
export default async function logToChannel(channel: Channel, message: MessageCreateOptions): Promise<void|null> {
|
||||
export default async function logToChannel(
|
||||
channel: Channel,
|
||||
message: MessageCreateOptions,
|
||||
): Promise<void | null> {
|
||||
const guild = Illegitimate.client.guilds.cache.get(guildid) as Guild
|
||||
let logChannel: TextChannel
|
||||
|
||||
@@ -24,7 +35,9 @@ export default async function logToChannel(channel: Channel, message: MessageCre
|
||||
}
|
||||
|
||||
if (!logChannel) {
|
||||
console.log(`[ERROR] Could not find channel used for ${channel} logging.`)
|
||||
console.log(
|
||||
`[ERROR] Could not find channel used for ${channel} logging.`,
|
||||
)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
member,
|
||||
guildStaff,
|
||||
guildRole,
|
||||
defaultMember
|
||||
defaultMember,
|
||||
} from "config/roles.json"
|
||||
const roles = [
|
||||
gm,
|
||||
|
||||
Reference in New Issue
Block a user