Merge branch 'dev' into 'main'

Dev

See merge request illegitimate/illegitimate-bot!151
This commit is contained in:
2023-12-31 12:31:58 +00:00
17 changed files with 117 additions and 20 deletions

View File

@@ -306,7 +306,9 @@ export = {
}, },
footer: { footer: {
text: interaction.guild!.name + " | " + devMessage, text: interaction.guild!.name + " | " + devMessage,
icon_url: interaction.guild!.iconURL({ forceStatic: true })!, icon_url: interaction.guild!.iconURL({
forceStatic: true,
})!,
}, },
fields: statsFields, fields: statsFields,
}, },

View File

@@ -108,7 +108,10 @@ export = {
color: embedColor, color: embedColor,
footer: { footer: {
text: interaction.guild!.name + " | " + devMessage, text: interaction.guild!.name + " | " + devMessage,
icon_url: interaction.guild!.iconURL({ forceStatic: false }) || undefined, icon_url:
interaction.guild!.iconURL({
forceStatic: false,
}) || undefined,
}, },
}, },
], ],

View File

@@ -234,7 +234,9 @@ async function guildInfo(
color: embedColor, color: embedColor,
footer: { footer: {
text: interaction.guild!.name + " | " + devMessage, text: interaction.guild!.name + " | " + devMessage,
icon_url: interaction.guild!.iconURL({ forceStatic: false }) || undefined, icon_url:
interaction.guild!.iconURL({ forceStatic: false }) ||
undefined,
}, },
}, },
], ],

View File

@@ -204,7 +204,9 @@ async function guildMember(
], ],
footer: { footer: {
text: interaction.guild!.name + " | " + devMessage, text: interaction.guild!.name + " | " + devMessage,
icon_url: interaction.guild!.iconURL({ forceStatic: false })!, icon_url: interaction.guild!.iconURL({
forceStatic: false,
})!,
}, },
}, },
], ],

View File

@@ -279,8 +279,14 @@ async function guildTop(
color: embedColor, color: embedColor,
fields: newList, fields: newList,
footer: { footer: {
text: interaction.guild!.name + " | " + devMessage + cacheStatusText, text:
icon_url: interaction.guild!.iconURL({ forceStatic: false })!, interaction.guild!.name +
" | " +
devMessage +
cacheStatusText,
icon_url: interaction.guild!.iconURL({
forceStatic: false,
})!,
}, },
}, },
], ],

View File

@@ -66,10 +66,12 @@ export = {
fields: commandList, fields: commandList,
color: embedColor, color: embedColor,
thumbnail: { thumbnail: {
url: interaction.guild!.iconURL({ forceStatic: true, })!, url: interaction.guild!.iconURL({ forceStatic: true })!,
}, },
footer: { footer: {
icon_url: interaction.guild!.iconURL({ forceStatic: false})!, icon_url: interaction.guild!.iconURL({
forceStatic: false,
})!,
text: interaction.guild!.name + " | " + devMessage, text: interaction.guild!.name + " | " + devMessage,
}, },
}, },

View File

@@ -26,7 +26,10 @@ export = {
color: embedColor, color: embedColor,
footer: { footer: {
text: interaction.guild!.name + " | " + devMessage, text: interaction.guild!.name + " | " + devMessage,
icon_url: interaction.guild?.iconURL({ forceStatic: false }) || undefined, icon_url:
interaction.guild?.iconURL({
forceStatic: false,
}) || undefined,
}, },
timestamp: new Date().toISOString(), timestamp: new Date().toISOString(),
}, },

View File

@@ -35,7 +35,9 @@ export = {
color: embedColor, color: embedColor,
thumbnail: { thumbnail: {
url: url:
interaction?.guild?.iconURL({ forceStatic: false, }) || "", interaction?.guild?.iconURL({
forceStatic: false,
}) || "",
}, },
fields: [ fields: [
{ {
@@ -70,7 +72,10 @@ export = {
], ],
footer: { footer: {
text: interaction.guild!.name + " | " + devMessage, text: interaction.guild!.name + " | " + devMessage,
icon_url: interaction.guild!.iconURL({ forceStatic: false }) || undefined, icon_url:
interaction.guild!.iconURL({
forceStatic: false,
}) || undefined,
}, },
}, },
], ],

View File

@@ -17,7 +17,8 @@ export async function updateDiscordRoles(
await interaction.editReply({ await interaction.editReply({
embeds: [ embeds: [
{ {
description: "You do not have permission to use this command.", description:
"You do not have permission to use this command.",
color: embedColor, color: embedColor,
}, },
], ],

View File

@@ -60,7 +60,10 @@ export = {
}, },
footer: { footer: {
text: interaction.guild!.name + " | " + devMessage, text: interaction.guild!.name + " | " + devMessage,
icon_url: interaction.guild?.iconURL({ forceStatic: false }) || undefined, icon_url:
interaction.guild?.iconURL({
forceStatic: false,
}) || undefined,
}, },
}, },
], ],

65
src/commands/whoami.ts Normal file
View File

@@ -0,0 +1,65 @@
import { SlashCommandBuilder, userMention } from "discord.js"
import { Command } from "../interfaces"
import { color, devMessage } from "../../config/options.json"
import verify from "../schemas/verifySchema"
import { getIGN, getHeadURL } from "../utils/Hypixel"
export = {
name: "whoami",
description: "Get your user info",
type: "slash",
public: true,
dev: true,
data: new SlashCommandBuilder()
.setName("whoami")
.setDescription("Get your user info")
.setDMPermission(false),
async execute(interaction) {
await interaction.deferReply()
const user = interaction.user
const verifyData = await verify.findOne({ userID: user.id })
const embedColor = Number(color.replace("#", "0x"))
if (!verifyData) {
await interaction.editReply({
embeds: [
{
description: "You are not verified!",
color: embedColor,
},
],
})
return
}
const ign = await getIGN(verifyData.uuid)
const head = await getHeadURL(ign!)
await interaction.editReply({
embeds: [
{
title: "User Info",
description:
"**User:** " +
userMention(user.id) +
"\n**IGN:** `" +
ign +
"`",
color: embedColor,
thumbnail: {
url: head!,
},
footer: {
text: interaction.guild!.name + " | " + devMessage,
icon_url: interaction.guild!.iconURL({
forceStatic: true,
})!,
},
},
],
})
},
} as Command

View File

@@ -1,9 +1,9 @@
/* eslint-disable no-unused-vars */
import { AutocompleteInteraction } from "discord.js" import { AutocompleteInteraction } from "discord.js"
export default interface Autocomplete { export default interface Autocomplete {
name: string name: string
description: string description: string
type: "autocomplete" type: "autocomplete"
// eslint-disable-next-line no-unused-vars
execute: (interacion: AutocompleteInteraction) => Promise<void> execute: (interacion: AutocompleteInteraction) => Promise<void>
} }

View File

@@ -1,9 +1,9 @@
/* eslint-disable no-unused-vars */
import { ButtonInteraction } from "discord.js" import { ButtonInteraction } from "discord.js"
export default interface Button { export default interface Button {
name: string name: string
description: string description: string
type: "button" type: "button"
// eslint-disable-next-line no-unused-vars
execute: (interaction: ButtonInteraction) => Promise<void> execute: (interaction: ButtonInteraction) => Promise<void>
} }

View File

@@ -1,3 +1,4 @@
/* eslint-disable no-unused-vars */
import { ChatInputCommandInteraction, SlashCommandBuilder } from "discord.js" import { ChatInputCommandInteraction, SlashCommandBuilder } from "discord.js"
import { ExtendedClient as Client } from "../utils/Client" import { ExtendedClient as Client } from "../utils/Client"
@@ -12,6 +13,8 @@ export default interface Command {
"addSubcommand" | "addSubcommandGroup" | "addIntegerOption" "addSubcommand" | "addSubcommandGroup" | "addIntegerOption"
> >
subcommands?: boolean subcommands?: boolean
// eslint-disable-next-line no-unused-vars execute: (
execute: ( interaction: ChatInputCommandInteraction, client: Client,) => Promise<void> interaction: ChatInputCommandInteraction,
client: Client,
) => Promise<void>
} }

View File

@@ -1,3 +1,4 @@
/* eslint-disable no-unused-vars */
import { import {
ContextMenuCommandInteraction, ContextMenuCommandInteraction,
ContextMenuCommandBuilder, ContextMenuCommandBuilder,
@@ -9,6 +10,5 @@ export default interface ContextMenu {
type: "contextmenu" type: "contextmenu"
dev?: boolean dev?: boolean
data: ContextMenuCommandBuilder data: ContextMenuCommandBuilder
// eslint-disable-next-line no-unused-vars
execute: (interaction: ContextMenuCommandInteraction) => Promise<void> execute: (interaction: ContextMenuCommandInteraction) => Promise<void>
} }

View File

@@ -1,3 +1,4 @@
/* eslint-disable no-unused-vars */
import { ClientEvents } from "discord.js" import { ClientEvents } from "discord.js"
export default interface Event { export default interface Event {
@@ -5,6 +6,5 @@ export default interface Event {
description: string description: string
type: "event" type: "event"
event: keyof ClientEvents event: keyof ClientEvents
// eslint-disable-next-line no-unused-vars
execute(...args: any[]): void execute(...args: any[]): void
} }

View File

@@ -1,9 +1,9 @@
/* eslint-disable no-unused-vars */
import { ModalSubmitInteraction } from "discord.js" import { ModalSubmitInteraction } from "discord.js"
export default interface Modal { export default interface Modal {
name: string name: string
description: string description: string
type: "modal" type: "modal"
// eslint-disable-next-line no-unused-vars
execute: (interaction: ModalSubmitInteraction) => Promise<void> execute: (interaction: ModalSubmitInteraction) => Promise<void>
} }