Updated imports and formating

Signed-off-by: Taken <taken@mairimashita.org>
This commit is contained in:
2024-01-16 17:05:15 +01:00
parent ee0250ed5e
commit 5661bc66bb
49 changed files with 819 additions and 491 deletions

View File

@@ -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() || "",

View File

@@ -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({

View File

@@ -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,
},
},
],

View File

@@ -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,
},
},
],
})
}
}
}

View File

@@ -33,4 +33,4 @@ export = {
await interaction.reply({ content: "Test command.", ephemeral: true })
},
} as Command
} as Command

View File

@@ -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({

View File

@@ -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!,

View File

@@ -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({

View File

@@ -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,
},
},
],

View File

@@ -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,11 +228,9 @@ 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,
},
},
],
})
}
}

View File

@@ -205,4 +205,4 @@ export default async function guildMember(
},
],
})
}
}

View File

@@ -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
@@ -291,4 +293,4 @@ export default async function guildTop(
},
],
})
}
}

View File

@@ -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,
}
},
},
],
})

View File

@@ -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(),
},

View File

@@ -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,
}
},
},
],
})

View File

@@ -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: [
{

View File

@@ -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({

View File

@@ -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,
})
},

View File

@@ -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({

View File

@@ -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,
},
},
],

View File

@@ -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
},
} as Command

View File

@@ -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({
@@ -177,4 +195,4 @@ export = {
],
})
},
} as Command
} as Command

View File

@@ -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() || "",

View File

@@ -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!,

View File

@@ -59,8 +59,7 @@ export = {
},
footer: {
text: interaction.guild!.name + " | " + devMessage,
icon_url:
interaction.guild!.iconURL() || undefined,
icon_url: interaction.guild!.iconURL() || undefined,
},
},
],