From 6dfd72bb23f14f5cfad5a9640e9c7fed322dae10 Mon Sep 17 00:00:00 2001 From: Taken Date: Sat, 6 Jan 2024 15:56:45 +0100 Subject: [PATCH] Removed useless type files --- src/typings/Types.ts | 17 ----------------- src/typings/index.ts | 3 --- src/utils/Autodeploy.ts | 2 +- src/utils/Events.ts | 2 +- src/utils/eventHandlers/autocomplete.ts | 2 +- src/utils/eventHandlers/button.ts | 2 +- src/utils/eventHandlers/command.ts | 2 +- src/utils/eventHandlers/contextmenu.ts | 2 +- src/utils/eventHandlers/modal.ts | 2 +- src/utils/functions/account.ts | 17 ++++++++++++++++- 10 files changed, 23 insertions(+), 28 deletions(-) delete mode 100644 src/typings/Types.ts delete mode 100644 src/typings/index.ts diff --git a/src/typings/Types.ts b/src/typings/Types.ts deleted file mode 100644 index abdf3b8..0000000 --- a/src/typings/Types.ts +++ /dev/null @@ -1,17 +0,0 @@ -export type Profile = { - data: { - id: string - name: string - } -} - -export type Profile2 = { - data: { - id: string - name: string - properties: { name: string; value: string }[] - profileActions: [] - } -} - -export type FileType = "js" | "ts" diff --git a/src/typings/index.ts b/src/typings/index.ts deleted file mode 100644 index 269797c..0000000 --- a/src/typings/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { Profile, Profile2, FileType } from "./Types" - -export { Profile, Profile2, FileType } diff --git a/src/utils/Autodeploy.ts b/src/utils/Autodeploy.ts index 36bd2e6..3e4848b 100644 --- a/src/utils/Autodeploy.ts +++ b/src/utils/Autodeploy.ts @@ -8,7 +8,7 @@ import { Routes, } from "discord.js" import fs = require("fs") -import { FileType } from "../typings" +type FileType = "js" | "ts" async function autoDeployCommands(fileType: FileType) { const commands = [] diff --git a/src/utils/Events.ts b/src/utils/Events.ts index be1f569..d32e6bd 100644 --- a/src/utils/Events.ts +++ b/src/utils/Events.ts @@ -5,7 +5,7 @@ import { loadContextMenuEvents } from "./eventHandlers" import { loadModalEvents } from "./eventHandlers" import { loadEvents } from "./eventHandlers" import { loadAutocompleteEvents } from "./eventHandlers" -import { FileType } from "../typings" +type FileType = "js" | "ts" export function loadAllEvents(client: Client, ft: FileType) { loadEvents(client) diff --git a/src/utils/eventHandlers/autocomplete.ts b/src/utils/eventHandlers/autocomplete.ts index 44f0b88..d6b790c 100644 --- a/src/utils/eventHandlers/autocomplete.ts +++ b/src/utils/eventHandlers/autocomplete.ts @@ -4,7 +4,7 @@ import { Autocomplete } from "../../interfaces" import { Events, GuildTextBasedChannel } from "discord.js" import path = require("path") import fs = require("fs") -import { FileType } from "../../typings" +type FileType = "js" | "ts" const embedColor = Number(color.replace("#", "0x")) export default function loadAutocompleteEvents(client: Client, ft: FileType) { diff --git a/src/utils/eventHandlers/button.ts b/src/utils/eventHandlers/button.ts index ec8a9dd..549a6cf 100644 --- a/src/utils/eventHandlers/button.ts +++ b/src/utils/eventHandlers/button.ts @@ -4,7 +4,7 @@ import { Button } from "../../interfaces" import { Events, GuildTextBasedChannel } from "discord.js" import path = require("path") import fs = require("fs") -import { FileType } from "../../typings" +type FileType = "js" | "ts" const embedColor = Number(color.replace("#", "0x")) export default function loadButtonEvents(client: Client, ft: FileType) { diff --git a/src/utils/eventHandlers/command.ts b/src/utils/eventHandlers/command.ts index 758cbd7..d8fa090 100644 --- a/src/utils/eventHandlers/command.ts +++ b/src/utils/eventHandlers/command.ts @@ -4,7 +4,7 @@ import { Command } from "../../interfaces" import { Events, GuildTextBasedChannel } from "discord.js" import path = require("path") import fs = require("fs") -import { FileType } from "../../typings" +type FileType = "js" | "ts" const embedColor = Number(color.replace("#", "0x")) export default function loadSlashCommandsEvents(client: Client, ft: FileType) { diff --git a/src/utils/eventHandlers/contextmenu.ts b/src/utils/eventHandlers/contextmenu.ts index 5c17690..86e08e9 100644 --- a/src/utils/eventHandlers/contextmenu.ts +++ b/src/utils/eventHandlers/contextmenu.ts @@ -4,7 +4,7 @@ import { errorLogChannel, color } from "../../../config/options.json" import { Events, GuildTextBasedChannel } from "discord.js" import path = require("path") import fs = require("fs") -import { FileType } from "../../typings" +type FileType = "js" | "ts" const embedColor = Number(color.replace("#", "0x")) export default function loadContextMenuEvents(client: Client, ft: FileType) { diff --git a/src/utils/eventHandlers/modal.ts b/src/utils/eventHandlers/modal.ts index 6dc356f..feaf5e2 100644 --- a/src/utils/eventHandlers/modal.ts +++ b/src/utils/eventHandlers/modal.ts @@ -4,7 +4,7 @@ import { Modal } from "../../interfaces" import { Events, GuildTextBasedChannel } from "discord.js" import path = require("path") import fs = require("fs") -import { FileType } from "../../typings" +type FileType = "js" | "ts" const embedColor = Number(color.replace("#", "0x")) export default function loadModalEvents(client: Client, ft: FileType) { diff --git a/src/utils/functions/account.ts b/src/utils/functions/account.ts index 0a0f815..ab2f28f 100644 --- a/src/utils/functions/account.ts +++ b/src/utils/functions/account.ts @@ -1,6 +1,5 @@ import fetch from "axios" import env from "../Env" -import { Profile, Profile2 } from "../../typings" import { Player, PlayerData } from "../../interfaces" import { Guild, GuildData } from "../../interfaces" const apikey = env.prod.hypixelapikey @@ -11,6 +10,22 @@ const guild = "https://api.hypixel.net/guild" const minotar = "https://minotar.net/helm/" type GuildQuerqType = "player" | "name" | "id" +type Profile = { + data: { + id: string + name: string + } +} + +type Profile2 = { + data: { + id: string + name: string + properties: { name: string; value: string }[] + profileActions: [] + } +} + async function getUUID(ign: string): Promise { try { const req: Profile = await fetch(mojang + ign)