From b99ade9270515f394fe1cdd429c1cae4447d2b67 Mon Sep 17 00:00:00 2001 From: Evorp <3vorpgaming@gmail.com> Date: Sun, 29 Oct 2023 14:05:42 -0700 Subject: [PATCH] remove interface module thingy --- .vscode/templates.code-snippets | 6 ++--- src/client/client.ts | 20 +++++++++------- src/client/index.ts | 1 - src/commands/bot/botban.ts | 2 +- src/commands/bot/embed.ts | 2 +- src/commands/bot/feedback.ts | 2 +- src/commands/bot/info.ts | 2 +- src/commands/bot/logs.ts | 2 +- src/commands/bot/ping.ts | 2 +- src/commands/bot/poll.ts | 2 +- src/commands/bot/stats.ts | 2 +- src/commands/developer/eval.ts | 2 +- src/commands/developer/restart.ts | 2 +- src/commands/developer/shutdown.ts | 2 +- src/commands/developer/status.ts | 2 +- src/commands/faithful/about.ts | 4 ++-- src/commands/faithful/discords.ts | 2 +- src/commands/faithful/faq.ts | 2 +- src/commands/faithful/guidelines.ts | 2 +- src/commands/faithful/license.ts | 2 +- src/commands/faithful/media.ts | 2 +- src/commands/faithful/missing.ts | 3 ++- src/commands/faithful/rule.ts | 2 +- src/commands/faithful/texture.ts | 3 ++- src/commands/faithful/todo.ts | 2 +- src/commands/fun/coin.ts | 2 +- src/commands/fun/order.ts | 2 +- src/commands/fun/reply.ts | 2 +- src/commands/fun/say.ts | 2 +- src/commands/images/animate.ts | 2 +- src/commands/images/compare.ts | 2 +- src/commands/images/cycle.ts | 2 +- src/commands/images/magnify.ts | 2 +- src/commands/images/palette.ts | 2 +- src/commands/images/tile.ts | 2 +- src/commands/images/tint.ts | 2 +- .../buttons/general/deleteInteraction.ts | 2 +- .../buttons/general/deleteMessage.ts | 2 +- src/components/buttons/image/compare.ts | 2 +- .../buttons/image/comparisonTemplate.ts | 2 +- src/components/buttons/image/magnify.ts | 2 +- src/components/buttons/image/palette.ts | 2 +- src/components/buttons/image/tile.ts | 2 +- src/components/buttons/poll/pollDelete.ts | 2 +- src/components/buttons/poll/pollVote.ts | 2 +- src/components/menus/compareSelect.ts | 2 +- src/components/menus/cycleSelect.ts | 2 +- src/components/menus/textureSelect.ts | 3 ++- src/components/modals/bugTicket.ts | 2 +- src/components/modals/suggestionTicket.ts | 2 +- src/events/buttonUsed.ts | 3 ++- src/events/guildCreate.ts | 2 +- src/events/interactionCreate.ts | 2 +- src/events/messageCreate.ts | 4 ++-- src/events/modalSubmit.ts | 2 +- src/events/ready.ts | 2 +- src/events/selectMenuUsed.ts | 2 +- src/events/slashCommandUsed.ts | 5 ++-- src/events/threadCreate.ts | 2 +- src/helpers/choiceEmbed.ts | 2 +- src/{client => helpers}/emittingCollection.ts | 0 src/helpers/functions/cycleComparison.ts | 2 +- src/helpers/functions/getTexture.ts | 10 ++++++-- src/helpers/functions/missing.ts | 2 +- src/helpers/functions/parseTextureName.ts | 2 +- src/helpers/functions/textureComparison.ts | 2 +- src/helpers/utility/formatName.ts | 2 +- src/helpers/utility/handleJSON.ts | 24 +++++++++---------- src/interfaces/{event.ts => events.ts} | 0 src/interfaces/firestorm.ts | 24 +++++++++++++++++-- src/interfaces/index.ts | 6 ----- src/interfaces/submission.ts | 21 ---------------- tsconfig.json | 2 +- 73 files changed, 128 insertions(+), 121 deletions(-) rename src/{client => helpers}/emittingCollection.ts (100%) rename src/interfaces/{event.ts => events.ts} (100%) delete mode 100644 src/interfaces/index.ts delete mode 100644 src/interfaces/submission.ts diff --git a/.vscode/templates.code-snippets b/.vscode/templates.code-snippets index 1252ecd70..c46fa3fd8 100644 --- a/.vscode/templates.code-snippets +++ b/.vscode/templates.code-snippets @@ -3,7 +3,7 @@ "prefix": "net", "description": "Client-emitted event template.", "body": [ - "import { Event } from \"@interfaces\";", + "import { Event } from \"@interfaces/events\";", "import { Client } from \"@client\"", "\nexport default {", "\tname: \"${1:Name}\",", @@ -17,7 +17,7 @@ "prefix": "nact", "description": "For non-static slash command data.", "body": [ - "import { SlashCommand, SyncSlashCommandBuilder } from \"@interfaces\";", + "import { SlashCommand, SyncSlashCommandBuilder } from \"@interfaces/commands\";", "import { Client, ChatInputCommandInteraction, EmbedBuilder } from \"@client\";", "import { SlashCommandBuilder } from \"discord.js\";", "\nexport const command: SlashCommand = {", @@ -39,7 +39,7 @@ "prefix": "nct", "description": "Regular slash command template.", "body": [ - "import { SlashCommand } from \"@interfaces\";", + "import { SlashCommand } from \"@interfaces/commands\";", "import { Client, ChatInputCommandInteraction, EmbedBuilder } from \"@client\";", "import { SlashCommandBuilder } from \"discord.js\";", "\nexport const command: SlashCommand = {", diff --git a/src/client/client.ts b/src/client/client.ts index 9d645052b..e591c4efc 100644 --- a/src/client/client.ts +++ b/src/client/client.ts @@ -12,8 +12,12 @@ import { Routes, REST, } from "discord.js"; -import { Message, EmittingCollection, Automation } from "@client"; -import { Tokens, Component, SlashCommand, Event } from "@interfaces"; +import { Message, Automation } from "@client"; +import { Tokens } from "@interfaces/tokens"; +import { Component } from "@interfaces/components"; +import { SlashCommand } from "@interfaces/commands"; +import { Event } from "@interfaces/events"; +import { EmittingCollection } from "@helpers/emittingCollection"; import { setData, getData } from "@utility/handleJSON"; import { errorHandler } from "@functions/errorHandler"; import { err, info, success } from "@helpers/logger"; @@ -172,12 +176,12 @@ export class ExtendedClient extends Client { collection.set(key, obj[key]); }); - collection.events.on("dataSet", (key: string, value: any) => { - this.saveEmittingCollection(collection, filename, relative_path); - }); - collection.events.on("dataDeleted", (key: string) => { - this.saveEmittingCollection(collection, filename, relative_path); - }); + collection.events.on("dataSet", (key: string, value: any) => + this.saveEmittingCollection(collection, filename, relative_path), + ); + collection.events.on("dataDeleted", (key: string) => + this.saveEmittingCollection(collection, filename, relative_path), + ); } /** diff --git a/src/client/index.ts b/src/client/index.ts index c05fee48c..f27b3dcd0 100644 --- a/src/client/index.ts +++ b/src/client/index.ts @@ -3,4 +3,3 @@ export { ExtendedEmbedBuilder as EmbedBuilder } from "./embed"; export * from "./message"; export * from "./automation"; export * from "./interaction"; -export * from "./emittingCollection"; diff --git a/src/commands/bot/botban.ts b/src/commands/bot/botban.ts index dffb2b2a4..14d8dc33f 100644 --- a/src/commands/bot/botban.ts +++ b/src/commands/bot/botban.ts @@ -1,4 +1,4 @@ -import { SlashCommand, SlashCommandI } from "@interfaces"; +import { SlashCommand, SlashCommandI } from "@interfaces/commands"; import { EmbedBuilder, ChatInputCommandInteraction } from "@client"; import { Collection, diff --git a/src/commands/bot/embed.ts b/src/commands/bot/embed.ts index 19bdf45aa..d6cc983bd 100644 --- a/src/commands/bot/embed.ts +++ b/src/commands/bot/embed.ts @@ -1,4 +1,4 @@ -import { SlashCommand } from "@interfaces"; +import { SlashCommand } from "@interfaces/commands"; import { ChatInputCommandInteraction, EmbedBuilder, Message } from "@client"; import { ColorResolvable, PermissionFlagsBits, SlashCommandBuilder } from "discord.js"; import { colors } from "@utility/colors"; diff --git a/src/commands/bot/feedback.ts b/src/commands/bot/feedback.ts index 18498413a..dddeca8e0 100644 --- a/src/commands/bot/feedback.ts +++ b/src/commands/bot/feedback.ts @@ -1,4 +1,4 @@ -import { SlashCommand } from "@interfaces"; +import { SlashCommand } from "@interfaces/commands"; import { ActionRowBuilder, SlashCommandBuilder, diff --git a/src/commands/bot/info.ts b/src/commands/bot/info.ts index bead12131..bfa3852cb 100644 --- a/src/commands/bot/info.ts +++ b/src/commands/bot/info.ts @@ -1,4 +1,4 @@ -import { SlashCommand } from "@interfaces"; +import { SlashCommand } from "@interfaces/commands"; import { SlashCommandBuilder } from "discord.js"; import { ChatInputCommandInteraction, EmbedBuilder } from "@client"; import axios from "axios"; diff --git a/src/commands/bot/logs.ts b/src/commands/bot/logs.ts index 422e0fd04..a077b236f 100644 --- a/src/commands/bot/logs.ts +++ b/src/commands/bot/logs.ts @@ -1,4 +1,4 @@ -import { SlashCommand } from "@interfaces"; +import { SlashCommand } from "@interfaces/commands"; import { SlashCommandBuilder, PermissionFlagsBits } from "discord.js"; import { ChatInputCommandInteraction } from "@client"; import { logConstructor } from "@functions/errorHandler"; diff --git a/src/commands/bot/ping.ts b/src/commands/bot/ping.ts index 4a14f9f5c..1a2cd9672 100644 --- a/src/commands/bot/ping.ts +++ b/src/commands/bot/ping.ts @@ -1,4 +1,4 @@ -import { SlashCommand } from "@interfaces"; +import { SlashCommand } from "@interfaces/commands"; import { SlashCommandBuilder } from "discord.js"; import { EmbedBuilder, ChatInputCommandInteraction, Message } from "@client"; import { ping } from "@json/quotes.json"; diff --git a/src/commands/bot/poll.ts b/src/commands/bot/poll.ts index 422e68318..4f35877ac 100644 --- a/src/commands/bot/poll.ts +++ b/src/commands/bot/poll.ts @@ -1,5 +1,5 @@ import { SlashCommandBuilder, EmbedField } from "discord.js"; -import { SlashCommand } from "@interfaces"; +import { SlashCommand } from "@interfaces/commands"; import { Poll } from "@helpers/poll"; import { addSeconds, parseDate } from "@utility/dates"; import { ids, parseId } from "@utility/emojis"; diff --git a/src/commands/bot/stats.ts b/src/commands/bot/stats.ts index 11bc3549d..ed89cbf0d 100644 --- a/src/commands/bot/stats.ts +++ b/src/commands/bot/stats.ts @@ -1,4 +1,4 @@ -import { SlashCommand, SlashCommandI } from "@interfaces"; +import { SlashCommand, SlashCommandI } from "@interfaces/commands"; import { SlashCommandBuilder, Collection, Guild, version as djsVersion } from "discord.js"; import { EmbedBuilder, ChatInputCommandInteraction, Message } from "@client"; import axios from "axios"; diff --git a/src/commands/developer/eval.ts b/src/commands/developer/eval.ts index d2ee7cd7f..7dcc284b9 100644 --- a/src/commands/developer/eval.ts +++ b/src/commands/developer/eval.ts @@ -1,4 +1,4 @@ -import { SlashCommand } from "@interfaces"; +import { SlashCommand } from "@interfaces/commands"; import { SlashCommandBuilder, PermissionFlagsBits } from "discord.js"; import { Client, ChatInputCommandInteraction, EmbedBuilder } from "@client"; diff --git a/src/commands/developer/restart.ts b/src/commands/developer/restart.ts index 8aa05a0f7..64244853a 100644 --- a/src/commands/developer/restart.ts +++ b/src/commands/developer/restart.ts @@ -1,4 +1,4 @@ -import { SlashCommand } from "@interfaces"; +import { SlashCommand } from "@interfaces/commands"; import { SlashCommandBuilder, PermissionFlagsBits } from "discord.js"; import { ChatInputCommandInteraction } from "@client"; diff --git a/src/commands/developer/shutdown.ts b/src/commands/developer/shutdown.ts index 2cd310fcc..46c3871d5 100644 --- a/src/commands/developer/shutdown.ts +++ b/src/commands/developer/shutdown.ts @@ -1,4 +1,4 @@ -import { SlashCommand } from "@interfaces"; +import { SlashCommand } from "@interfaces/commands"; import { SlashCommandBuilder, PermissionFlagsBits } from "discord.js"; import { ChatInputCommandInteraction, EmbedBuilder } from "@client"; diff --git a/src/commands/developer/status.ts b/src/commands/developer/status.ts index 80f56172c..7395e1477 100644 --- a/src/commands/developer/status.ts +++ b/src/commands/developer/status.ts @@ -5,7 +5,7 @@ import { PresenceStatusData, } from "discord.js"; import { EmbedBuilder, ChatInputCommandInteraction } from "@client"; -import { SlashCommand } from "@interfaces"; +import { SlashCommand } from "@interfaces/commands"; export const command: SlashCommand = { data: new SlashCommandBuilder() diff --git a/src/commands/faithful/about.ts b/src/commands/faithful/about.ts index 8dc2ac4ae..5a46bb6d4 100644 --- a/src/commands/faithful/about.ts +++ b/src/commands/faithful/about.ts @@ -1,9 +1,9 @@ -import { SlashCommand } from "@interfaces"; +import { SlashCommand } from "@interfaces/commands"; import { Message, EmbedBuilder, ChatInputCommandInteraction } from "@client"; import { SlashCommandBuilder, AttachmentBuilder } from "discord.js"; import axios from "axios"; import formatName from "@utility/formatName"; -import { Contribution, Texture } from "@interfaces"; +import { Contribution, Texture } from "@interfaces/firestorm"; export const command: SlashCommand = { data: new SlashCommandBuilder() diff --git a/src/commands/faithful/discords.ts b/src/commands/faithful/discords.ts index 0585b5e16..6ec979760 100644 --- a/src/commands/faithful/discords.ts +++ b/src/commands/faithful/discords.ts @@ -1,4 +1,4 @@ -import { SlashCommand } from "@interfaces"; +import { SlashCommand } from "@interfaces/commands"; import { SlashCommandBuilder } from "discord.js"; import { ChatInputCommandInteraction, Message } from "@client"; diff --git a/src/commands/faithful/faq.ts b/src/commands/faithful/faq.ts index 51cc3e9a5..f72257166 100644 --- a/src/commands/faithful/faq.ts +++ b/src/commands/faithful/faq.ts @@ -1,4 +1,4 @@ -import { SlashCommand } from "@interfaces"; +import { SlashCommand } from "@interfaces/commands"; import { SlashCommandBuilder } from "discord.js"; import { ChatInputCommandInteraction, Message, EmbedBuilder } from "@client"; import { colors } from "@utility/colors"; diff --git a/src/commands/faithful/guidelines.ts b/src/commands/faithful/guidelines.ts index 370ca4d9d..c9a48f93b 100644 --- a/src/commands/faithful/guidelines.ts +++ b/src/commands/faithful/guidelines.ts @@ -1,4 +1,4 @@ -import { SlashCommand } from "@interfaces"; +import { SlashCommand } from "@interfaces/commands"; import { SlashCommandBuilder } from "discord.js"; import { ChatInputCommandInteraction, Message, EmbedBuilder } from "@client"; import guidelineJSON from "@json/guidelines.json"; diff --git a/src/commands/faithful/license.ts b/src/commands/faithful/license.ts index 24f7a074c..ac450ad9f 100644 --- a/src/commands/faithful/license.ts +++ b/src/commands/faithful/license.ts @@ -1,4 +1,4 @@ -import { SlashCommand } from "@interfaces"; +import { SlashCommand } from "@interfaces/commands"; import { SlashCommandBuilder } from "discord.js"; import { ChatInputCommandInteraction, Message } from "@client"; diff --git a/src/commands/faithful/media.ts b/src/commands/faithful/media.ts index 445011031..fcb720c11 100644 --- a/src/commands/faithful/media.ts +++ b/src/commands/faithful/media.ts @@ -1,4 +1,4 @@ -import { SlashCommand } from "@interfaces"; +import { SlashCommand } from "@interfaces/commands"; import { SlashCommandBuilder } from "discord.js"; import { media } from "@utility/infoembed"; import { Message, EmbedBuilder, ChatInputCommandInteraction } from "@client"; diff --git a/src/commands/faithful/missing.ts b/src/commands/faithful/missing.ts index b4747467b..76a610c77 100644 --- a/src/commands/faithful/missing.ts +++ b/src/commands/faithful/missing.ts @@ -1,4 +1,5 @@ -import { FaithfulPack, SlashCommand, SyncSlashCommandBuilder } from "@interfaces"; +import { SlashCommand, SyncSlashCommandBuilder } from "@interfaces/commands"; +import { FaithfulPack } from "@interfaces/firestorm"; import { Client, ChatInputCommandInteraction, EmbedBuilder } from "@client"; import { SlashCommandBuilder, Message, AttachmentBuilder } from "discord.js"; import { diff --git a/src/commands/faithful/rule.ts b/src/commands/faithful/rule.ts index e9defd229..7be212323 100644 --- a/src/commands/faithful/rule.ts +++ b/src/commands/faithful/rule.ts @@ -1,4 +1,4 @@ -import { SlashCommand } from "@interfaces"; +import { SlashCommand } from "@interfaces/commands"; import { SlashCommandBuilder } from "discord.js"; import { ChatInputCommandInteraction, Message, EmbedBuilder } from "@client"; import { colors } from "@utility/colors"; diff --git a/src/commands/faithful/texture.ts b/src/commands/faithful/texture.ts index b8dae3584..300a6e69d 100644 --- a/src/commands/faithful/texture.ts +++ b/src/commands/faithful/texture.ts @@ -1,4 +1,5 @@ -import { FaithfulPack, SlashCommand } from "@interfaces"; +import { SlashCommand } from "@interfaces/commands"; +import { FaithfulPack } from "@interfaces/firestorm"; import { SlashCommandBuilder } from "discord.js"; import { ChatInputCommandInteraction, Message } from "@client"; import { getTexture } from "@functions/getTexture"; diff --git a/src/commands/faithful/todo.ts b/src/commands/faithful/todo.ts index 6e050b6d4..f262eb027 100644 --- a/src/commands/faithful/todo.ts +++ b/src/commands/faithful/todo.ts @@ -1,4 +1,4 @@ -import { SlashCommand } from "@interfaces"; +import { SlashCommand } from "@interfaces/commands"; import { SlashCommandBuilder } from "discord.js"; import { ChatInputCommandInteraction, Message } from "@client"; diff --git a/src/commands/fun/coin.ts b/src/commands/fun/coin.ts index 5545de447..ab224210b 100644 --- a/src/commands/fun/coin.ts +++ b/src/commands/fun/coin.ts @@ -1,4 +1,4 @@ -import { SlashCommand } from "@interfaces"; +import { SlashCommand } from "@interfaces/commands"; import { SlashCommandBuilder } from "discord.js"; import { ChatInputCommandInteraction, Message, EmbedBuilder } from "@client"; import { colors } from "@utility/colors"; diff --git a/src/commands/fun/order.ts b/src/commands/fun/order.ts index 60d4bef4f..dacade6f3 100644 --- a/src/commands/fun/order.ts +++ b/src/commands/fun/order.ts @@ -1,4 +1,4 @@ -import { SlashCommand } from "@interfaces"; +import { SlashCommand } from "@interfaces/commands"; import { SlashCommandBuilder, AttachmentBuilder } from "discord.js"; import { Message, ChatInputCommandInteraction } from "@client"; diff --git a/src/commands/fun/reply.ts b/src/commands/fun/reply.ts index 2da694db3..d42859739 100644 --- a/src/commands/fun/reply.ts +++ b/src/commands/fun/reply.ts @@ -1,4 +1,4 @@ -import { SlashCommand } from "@interfaces"; +import { SlashCommand } from "@interfaces/commands"; import { SlashCommandBuilder, PermissionFlagsBits } from "discord.js"; import { ChatInputCommandInteraction, Message } from "@client"; diff --git a/src/commands/fun/say.ts b/src/commands/fun/say.ts index b93b21010..09cd3b6f8 100644 --- a/src/commands/fun/say.ts +++ b/src/commands/fun/say.ts @@ -1,4 +1,4 @@ -import { SlashCommand } from "@interfaces"; +import { SlashCommand } from "@interfaces/commands"; import { SlashCommandBuilder, PermissionFlagsBits } from "discord.js"; import { ChatInputCommandInteraction, Message } from "@client"; diff --git a/src/commands/images/animate.ts b/src/commands/images/animate.ts index 4f2a4ded5..64901eb48 100644 --- a/src/commands/images/animate.ts +++ b/src/commands/images/animate.ts @@ -1,4 +1,4 @@ -import { SlashCommand } from "@interfaces"; +import { SlashCommand } from "@interfaces/commands"; import { SlashCommandBuilder } from "discord.js"; import { ChatInputCommandInteraction, EmbedBuilder, Message } from "@client"; import getImage, { imageNotFound } from "@helpers/getImage"; diff --git a/src/commands/images/compare.ts b/src/commands/images/compare.ts index 183a52be0..ba7f716b4 100644 --- a/src/commands/images/compare.ts +++ b/src/commands/images/compare.ts @@ -1,4 +1,4 @@ -import { SlashCommand } from "@interfaces"; +import { SlashCommand } from "@interfaces/commands"; import { SlashCommandBuilder } from "discord.js"; import { ChatInputCommandInteraction, Message } from "@client"; import textureComparison from "@functions/textureComparison"; diff --git a/src/commands/images/cycle.ts b/src/commands/images/cycle.ts index 8133c6f5b..c914238e4 100644 --- a/src/commands/images/cycle.ts +++ b/src/commands/images/cycle.ts @@ -1,4 +1,4 @@ -import { SlashCommand } from "@interfaces"; +import { SlashCommand } from "@interfaces/commands"; import { SlashCommandBuilder } from "discord.js"; import { ChatInputCommandInteraction, Message } from "@client"; import { cycleComparison } from "@functions/cycleComparison"; diff --git a/src/commands/images/magnify.ts b/src/commands/images/magnify.ts index 4af4baf9f..1142a7ebe 100644 --- a/src/commands/images/magnify.ts +++ b/src/commands/images/magnify.ts @@ -1,4 +1,4 @@ -import { SlashCommand } from "@interfaces"; +import { SlashCommand } from "@interfaces/commands"; import { SlashCommandBuilder } from "discord.js"; import { ChatInputCommandInteraction, Message } from "@client"; import { magnifyToAttachment } from "@images/magnify"; diff --git a/src/commands/images/palette.ts b/src/commands/images/palette.ts index 55aae6304..f5110dc60 100644 --- a/src/commands/images/palette.ts +++ b/src/commands/images/palette.ts @@ -1,4 +1,4 @@ -import { SlashCommand } from "@interfaces"; +import { SlashCommand } from "@interfaces/commands"; import { SlashCommandBuilder } from "discord.js"; import { ChatInputCommandInteraction, Message } from "@client"; import { paletteToAttachment } from "@images/palette"; diff --git a/src/commands/images/tile.ts b/src/commands/images/tile.ts index bd8570be7..394f89729 100644 --- a/src/commands/images/tile.ts +++ b/src/commands/images/tile.ts @@ -1,4 +1,4 @@ -import { SlashCommand } from "@interfaces"; +import { SlashCommand } from "@interfaces/commands"; import { SlashCommandBuilder } from "discord.js"; import { ChatInputCommandInteraction, Message } from "@client"; import { tileToAttachment, TileShape, TileRandom } from "@images/tile"; diff --git a/src/commands/images/tint.ts b/src/commands/images/tint.ts index 783989c3d..1b6497e98 100644 --- a/src/commands/images/tint.ts +++ b/src/commands/images/tint.ts @@ -1,4 +1,4 @@ -import { SlashCommand } from "@interfaces"; +import { SlashCommand } from "@interfaces/commands"; import { ChatInputCommandInteraction, Message } from "@client"; import { SlashCommandBuilder } from "discord.js"; import { mcColorsOptions, multiplyToAttachment } from "@images/multiply"; diff --git a/src/components/buttons/general/deleteInteraction.ts b/src/components/buttons/general/deleteInteraction.ts index 039b680ff..32b43e7c0 100644 --- a/src/components/buttons/general/deleteInteraction.ts +++ b/src/components/buttons/general/deleteInteraction.ts @@ -1,4 +1,4 @@ -import { Component } from "@interfaces"; +import { Component } from "@interfaces/components"; import { info } from "@helpers/logger"; import { Client, ButtonInteraction } from "@client"; diff --git a/src/components/buttons/general/deleteMessage.ts b/src/components/buttons/general/deleteMessage.ts index c62e271bb..856d2ca8f 100644 --- a/src/components/buttons/general/deleteMessage.ts +++ b/src/components/buttons/general/deleteMessage.ts @@ -1,6 +1,6 @@ import { info } from "@helpers/logger"; import { Client, ButtonInteraction } from "@client"; -import { Component } from "@interfaces"; +import { Component } from "@interfaces/components"; export default { id: "deleteMessage", diff --git a/src/components/buttons/image/compare.ts b/src/components/buttons/image/compare.ts index 6a6bac5c1..4cae74c59 100644 --- a/src/components/buttons/image/compare.ts +++ b/src/components/buttons/image/compare.ts @@ -1,4 +1,4 @@ -import { Component } from "@interfaces"; +import { Component } from "@interfaces/components"; import { info } from "@helpers/logger"; import { Client, Message, ButtonInteraction, EmbedBuilder } from "@client"; import textureComparison from "@functions/textureComparison"; diff --git a/src/components/buttons/image/comparisonTemplate.ts b/src/components/buttons/image/comparisonTemplate.ts index eb2b78ab6..14b6c6a19 100644 --- a/src/components/buttons/image/comparisonTemplate.ts +++ b/src/components/buttons/image/comparisonTemplate.ts @@ -1,4 +1,4 @@ -import { Component } from "@interfaces"; +import { Component } from "@interfaces/components"; import { info } from "@helpers/logger"; import { Client, ButtonInteraction, EmbedBuilder } from "@client"; import { magnifyToAttachment } from "@images/magnify"; diff --git a/src/components/buttons/image/magnify.ts b/src/components/buttons/image/magnify.ts index 66621c976..e29ea3871 100644 --- a/src/components/buttons/image/magnify.ts +++ b/src/components/buttons/image/magnify.ts @@ -1,4 +1,4 @@ -import { Component } from "@interfaces"; +import { Component } from "@interfaces/components"; import { info } from "@helpers/logger"; import { Client, Message, ButtonInteraction, EmbedBuilder } from "@client"; import { magnifyToAttachment } from "@images/magnify"; diff --git a/src/components/buttons/image/palette.ts b/src/components/buttons/image/palette.ts index e88e75252..410d0ec66 100644 --- a/src/components/buttons/image/palette.ts +++ b/src/components/buttons/image/palette.ts @@ -1,4 +1,4 @@ -import { Component } from "@interfaces"; +import { Component } from "@interfaces/components"; import { info } from "@helpers/logger"; import { Client, Message, ButtonInteraction } from "@client"; import { paletteToAttachment } from "@images/palette"; diff --git a/src/components/buttons/image/tile.ts b/src/components/buttons/image/tile.ts index 99fecde45..5187e6bd5 100644 --- a/src/components/buttons/image/tile.ts +++ b/src/components/buttons/image/tile.ts @@ -1,4 +1,4 @@ -import { Component } from "@interfaces"; +import { Component } from "@interfaces/components"; import { info } from "@helpers/logger"; import { Client, Message, ButtonInteraction, EmbedBuilder } from "@client"; import { tileToAttachment } from "@images/tile"; diff --git a/src/components/buttons/poll/pollDelete.ts b/src/components/buttons/poll/pollDelete.ts index 4946f437b..5652ccd09 100644 --- a/src/components/buttons/poll/pollDelete.ts +++ b/src/components/buttons/poll/pollDelete.ts @@ -1,4 +1,4 @@ -import { Component } from "@interfaces"; +import { Component } from "@interfaces/components"; import { info } from "@helpers/logger"; import { Client, ButtonInteraction } from "@client"; diff --git a/src/components/buttons/poll/pollVote.ts b/src/components/buttons/poll/pollVote.ts index 8604e1884..f9d3841ce 100644 --- a/src/components/buttons/poll/pollVote.ts +++ b/src/components/buttons/poll/pollVote.ts @@ -1,4 +1,4 @@ -import { Component } from "@interfaces"; +import { Component } from "@interfaces/components"; import { Client, ButtonInteraction } from "@client"; import { Poll } from "@helpers/poll"; diff --git a/src/components/menus/compareSelect.ts b/src/components/menus/compareSelect.ts index b82256d13..ccb968ef8 100644 --- a/src/components/menus/compareSelect.ts +++ b/src/components/menus/compareSelect.ts @@ -1,5 +1,5 @@ import { Client, Message, StringSelectMenuInteraction } from "@client"; -import { Component } from "@interfaces"; +import { Component } from "@interfaces/components"; import { info } from "@helpers/logger"; import { MessageEditOptions } from "discord.js"; import textureComparison from "@functions/textureComparison"; diff --git a/src/components/menus/cycleSelect.ts b/src/components/menus/cycleSelect.ts index 3bda25dc4..f67745ac8 100644 --- a/src/components/menus/cycleSelect.ts +++ b/src/components/menus/cycleSelect.ts @@ -1,5 +1,5 @@ import { Client, Message, StringSelectMenuInteraction } from "@client"; -import { Component } from "@interfaces"; +import { Component } from "@interfaces/components"; import { info } from "@helpers/logger"; import { cycleComparison } from "@functions/cycleComparison"; diff --git a/src/components/menus/textureSelect.ts b/src/components/menus/textureSelect.ts index 24790bd19..7a08fac99 100644 --- a/src/components/menus/textureSelect.ts +++ b/src/components/menus/textureSelect.ts @@ -1,5 +1,6 @@ import { Client, Message, StringSelectMenuInteraction } from "@client"; -import { Component, FaithfulPack } from "@interfaces"; +import { Component } from "@interfaces/components"; +import { FaithfulPack } from "@interfaces/firestorm"; import { info } from "@helpers/logger"; import { getTexture } from "@functions/getTexture"; import axios from "axios"; diff --git a/src/components/modals/bugTicket.ts b/src/components/modals/bugTicket.ts index 1aede8532..3fb177d65 100644 --- a/src/components/modals/bugTicket.ts +++ b/src/components/modals/bugTicket.ts @@ -1,4 +1,4 @@ -import { Component } from "@interfaces"; +import { Component } from "@interfaces/components"; import { info } from "@helpers/logger"; import { Client, EmbedBuilder, ModalSubmitInteraction } from "@client"; import sendFeedback from "@functions/feedback"; diff --git a/src/components/modals/suggestionTicket.ts b/src/components/modals/suggestionTicket.ts index 242d2097d..17f19ecf2 100644 --- a/src/components/modals/suggestionTicket.ts +++ b/src/components/modals/suggestionTicket.ts @@ -1,4 +1,4 @@ -import { Component } from "@interfaces"; +import { Component } from "@interfaces/components"; import { info } from "@helpers/logger"; import { Client, EmbedBuilder, ModalSubmitInteraction } from "@client"; import sendFeedback from "@functions/feedback"; diff --git a/src/events/buttonUsed.ts b/src/events/buttonUsed.ts index 056a931af..9fcefe000 100644 --- a/src/events/buttonUsed.ts +++ b/src/events/buttonUsed.ts @@ -1,4 +1,5 @@ -import { Event, Component } from "@interfaces"; +import { Component } from "@interfaces/components"; +import { Event } from "@interfaces/events"; import { Client, ButtonInteraction } from "@client"; import { info } from "@helpers/logger"; diff --git a/src/events/guildCreate.ts b/src/events/guildCreate.ts index e04559022..a1ba9de3b 100644 --- a/src/events/guildCreate.ts +++ b/src/events/guildCreate.ts @@ -1,6 +1,6 @@ import { Guild } from "discord.js"; import { EmbedBuilder } from "@client"; -import { Event } from "@interfaces"; +import { Event } from "@interfaces/events"; import { info } from "@helpers/logger"; export default { diff --git a/src/events/interactionCreate.ts b/src/events/interactionCreate.ts index 85eccb28c..78b6e8eca 100644 --- a/src/events/interactionCreate.ts +++ b/src/events/interactionCreate.ts @@ -1,4 +1,4 @@ -import { Event } from "@interfaces"; +import { Event } from "@interfaces/events"; import { Client, ChatInputCommandInteraction, diff --git a/src/events/messageCreate.ts b/src/events/messageCreate.ts index c3f99c456..4fbb8f3db 100644 --- a/src/events/messageCreate.ts +++ b/src/events/messageCreate.ts @@ -1,6 +1,6 @@ -import { Event } from "@interfaces"; +import { Event } from "@interfaces/events"; import { Client, Message, EmbedBuilder } from "@client"; -import { Submissions } from "@interfaces"; +import { Submissions } from "@interfaces/firestorm"; import { colors } from "@utility/colors"; import axios from "axios"; import * as Random from "@utility/random"; diff --git a/src/events/modalSubmit.ts b/src/events/modalSubmit.ts index 9ed728e44..f9efd0a26 100644 --- a/src/events/modalSubmit.ts +++ b/src/events/modalSubmit.ts @@ -1,4 +1,4 @@ -import { Event } from "@interfaces"; +import { Event } from "@interfaces/events"; import { Client, ModalSubmitInteraction } from "@client"; export default { diff --git a/src/events/ready.ts b/src/events/ready.ts index e100f09ac..b2f72b7f7 100644 --- a/src/events/ready.ts +++ b/src/events/ready.ts @@ -1,4 +1,4 @@ -import { Event } from "@interfaces"; +import { Event } from "@interfaces/events"; import { success } from "@helpers/logger"; import { ActivityType } from "discord.js"; diff --git a/src/events/selectMenuUsed.ts b/src/events/selectMenuUsed.ts index 7e79f3ab5..5ab5cdc23 100644 --- a/src/events/selectMenuUsed.ts +++ b/src/events/selectMenuUsed.ts @@ -1,4 +1,4 @@ -import { Event } from "@interfaces"; +import { Event } from "@interfaces/events"; import { Client, StringSelectMenuInteraction } from "@client"; export default { diff --git a/src/events/slashCommandUsed.ts b/src/events/slashCommandUsed.ts index f3c299a8b..6946419f2 100644 --- a/src/events/slashCommandUsed.ts +++ b/src/events/slashCommandUsed.ts @@ -1,6 +1,7 @@ -import { SlashCommandI, Submissions } from "@interfaces"; +import { SlashCommandI } from "@interfaces/commands"; +import { Submissions } from "@interfaces/firestorm"; import { Collection } from "discord.js"; -import { Event } from "@interfaces"; +import { Event } from "@interfaces/events"; import { Client, ChatInputCommandInteraction, EmbedBuilder } from "@client"; import { colors } from "@utility/colors"; import axios from "axios"; diff --git a/src/events/threadCreate.ts b/src/events/threadCreate.ts index 06de3503a..f637de8ce 100644 --- a/src/events/threadCreate.ts +++ b/src/events/threadCreate.ts @@ -1,6 +1,6 @@ import { ThreadChannel } from "discord.js"; import { Client } from "@client"; -import { Event } from "@interfaces"; +import { Event } from "@interfaces/events"; export default { name: "threadCreate", diff --git a/src/helpers/choiceEmbed.ts b/src/helpers/choiceEmbed.ts index 4a524a8fc..71bfb3f01 100644 --- a/src/helpers/choiceEmbed.ts +++ b/src/helpers/choiceEmbed.ts @@ -4,7 +4,7 @@ import { SelectMenuComponentOptionData, StringSelectMenuBuilder, } from "discord.js"; -import { Texture } from "@interfaces"; +import { Texture } from "@interfaces/firestorm"; import minecraftSorter from "@utility/minecraftSorter"; import axios from "axios"; diff --git a/src/client/emittingCollection.ts b/src/helpers/emittingCollection.ts similarity index 100% rename from src/client/emittingCollection.ts rename to src/helpers/emittingCollection.ts diff --git a/src/helpers/functions/cycleComparison.ts b/src/helpers/functions/cycleComparison.ts index c21b7934b..8ed57f0e2 100644 --- a/src/helpers/functions/cycleComparison.ts +++ b/src/helpers/functions/cycleComparison.ts @@ -4,7 +4,7 @@ import GIFEncoder from "@images/GIFEncoder"; import { Client, EmbedBuilder } from "@client"; import { addPathsToEmbed } from "@functions/getTexture"; import axios from "axios"; -import { Texture } from "@interfaces"; +import { Texture } from "@interfaces/firestorm"; /** * Turn array of canvas images into a gif diff --git a/src/helpers/functions/getTexture.ts b/src/helpers/functions/getTexture.ts index 5ce202be4..0ac7f6c4b 100644 --- a/src/helpers/functions/getTexture.ts +++ b/src/helpers/functions/getTexture.ts @@ -1,11 +1,17 @@ import { EmbedBuilder } from "@client"; import TokenJson from "@json/tokens.json"; -import { Contributor, FaithfulPack, GalleryTexture, Tokens } from "@interfaces"; +import { Tokens } from "@interfaces/tokens"; import axios from "axios"; import { APIEmbedField, AttachmentBuilder, Interaction } from "discord.js"; import { magnify, magnifyToAttachment } from "@images/magnify"; import { colors } from "@utility/colors"; -import { Texture, Contribution } from "@interfaces"; +import { + Texture, + Contribution, + FaithfulPack, + Contributor, + GalleryTexture, +} from "@interfaces/firestorm"; import { animateToAttachment } from "@images/animate"; import minecraftSorter from "@utility/minecraftSorter"; import formatName from "@utility/formatName"; diff --git a/src/helpers/functions/missing.ts b/src/helpers/functions/missing.ts index 934fe1fab..c678472c6 100644 --- a/src/helpers/functions/missing.ts +++ b/src/helpers/functions/missing.ts @@ -9,7 +9,7 @@ import { join, normalize } from "path"; import os from "os"; import blacklistedTextures from "@json/blacklisted_textures.json"; import axios from "axios"; -import { FaithfulPack } from "@interfaces"; +import { FaithfulPack } from "@interfaces/firestorm"; // return value for the compute function export interface MissingOptions { diff --git a/src/helpers/functions/parseTextureName.ts b/src/helpers/functions/parseTextureName.ts index 16673a5c3..830fe435d 100644 --- a/src/helpers/functions/parseTextureName.ts +++ b/src/helpers/functions/parseTextureName.ts @@ -1,7 +1,7 @@ import axios from "axios"; import { ChatInputCommandInteraction, EmbedBuilder } from "@client"; import { colors } from "@utility/colors"; -import { Texture } from "@interfaces"; +import { Texture } from "@interfaces/firestorm"; /** * Validate and parse a texture name into a series of texture objects diff --git a/src/helpers/functions/textureComparison.ts b/src/helpers/functions/textureComparison.ts index a73e8bb2b..82167ad5e 100644 --- a/src/helpers/functions/textureComparison.ts +++ b/src/helpers/functions/textureComparison.ts @@ -3,7 +3,7 @@ import { magnifyToAttachment } from "@images/magnify"; import { Image, loadImage } from "@napi-rs/canvas"; import { Client, EmbedBuilder } from "@client"; import { addPathsToEmbed } from "@functions/getTexture"; -import { AnyPack, GalleryTexture } from "@interfaces"; +import { AnyPack, GalleryTexture } from "@interfaces/firestorm"; import axios from "axios"; import { ActionRowBuilder, ButtonBuilder } from "discord.js"; import { template } from "@utility/buttons"; diff --git a/src/helpers/utility/formatName.ts b/src/helpers/utility/formatName.ts index 1dc28fece..8ff54a069 100644 --- a/src/helpers/utility/formatName.ts +++ b/src/helpers/utility/formatName.ts @@ -1,4 +1,4 @@ -import { AnyPack } from "@interfaces"; +import { AnyPack } from "@interfaces/firestorm"; /** * Format a pack ID into a displayable name and icon diff --git a/src/helpers/utility/handleJSON.ts b/src/helpers/utility/handleJSON.ts index 7c2973f2c..0772cc60e 100644 --- a/src/helpers/utility/handleJSON.ts +++ b/src/helpers/utility/handleJSON.ts @@ -1,5 +1,5 @@ -import fs from "fs"; -import path from "path"; +import { readFileSync, existsSync, mkdirSync, writeFileSync } from "fs"; +import { resolve } from "path"; interface GetOptions { relative_path: string; @@ -21,16 +21,16 @@ interface SetOptions { */ export function getData(options: GetOptions) { let data: JSON; - const folder = path.resolve(__dirname, options.relative_path); - const file = path.resolve(folder, options.filename); + const folder = resolve(__dirname, options.relative_path); + const file = resolve(folder, options.filename); try { - data = JSON.parse(fs.readFileSync(file).toString()); + data = JSON.parse(readFileSync(file).toString()); } catch (_err) { // file/folder isn't valid - if (!fs.existsSync(folder)) fs.mkdirSync(folder, { recursive: true }); + if (!existsSync(folder)) mkdirSync(folder, { recursive: true }); - fs.writeFileSync(file, options.default_value || "{}"); + writeFileSync(file, options.default_value || "{}"); return getData(options); // check another time } @@ -43,15 +43,15 @@ export function getData(options: GetOptions) { * @param options data to set */ export function setData(options: SetOptions) { - const folder = path.resolve(__dirname, options.relative_path); - const file = path.resolve(folder, options.filename); + const folder = resolve(__dirname, options.relative_path); + const file = resolve(folder, options.filename); try { - fs.writeFileSync(file, JSON.stringify(options.data)); + writeFileSync(file, JSON.stringify(options.data)); } catch (_err) { // file/folder isn't valid - if (!fs.existsSync(folder)) fs.mkdirSync(folder, { recursive: true }); + if (!existsSync(folder)) mkdirSync(folder, { recursive: true }); - fs.writeFileSync(file, JSON.stringify(options.data)); + writeFileSync(file, JSON.stringify(options.data)); } } diff --git a/src/interfaces/event.ts b/src/interfaces/events.ts similarity index 100% rename from src/interfaces/event.ts rename to src/interfaces/events.ts diff --git a/src/interfaces/firestorm.ts b/src/interfaces/firestorm.ts index 61d44d95a..6f065d71a 100644 --- a/src/interfaces/firestorm.ts +++ b/src/interfaces/firestorm.ts @@ -1,4 +1,4 @@ -export type Edition = "java" | "bedrock"; +export type MinecraftEdition = "java" | "bedrock"; export type FaithfulPack = | "faithful_32x" @@ -38,7 +38,7 @@ export interface Path { export interface Use { id: string; name: string; - edition: Edition; + edition: MinecraftEdition; } // when you don't add the "all" flag when searching on the API @@ -60,3 +60,23 @@ export interface GalleryTexture extends Omit { texture: BaseTexture; urls: Record; } + +// settings.submission.packs +export type Submissions = Record; + +// one specific pack instance +export interface SubmissionPack { + channels: Channels; + council_enabled: boolean; + time_to_results: number; + time_to_council?: number; // not used if council disabled + contributor_role?: string; + github: Record; +} + +// just the channels +export interface Channels { + submit: string; + council?: string; // not used if council disabled + results: string; +} diff --git a/src/interfaces/index.ts b/src/interfaces/index.ts deleted file mode 100644 index e57aee4a8..000000000 --- a/src/interfaces/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -export * from "./event"; -export * from "./firestorm"; -export * from "./components"; -export * from "./submission"; -export * from "./tokens"; -export * from "./commands"; diff --git a/src/interfaces/submission.ts b/src/interfaces/submission.ts deleted file mode 100644 index 8b893e810..000000000 --- a/src/interfaces/submission.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { Edition } from "./firestorm"; - -// settings.submission.packs -export type Submissions = Record; - -// one specific pack instance -export interface SubmissionPack { - channels: Channels; - council_enabled: boolean; - time_to_results: number; - time_to_council?: number; // not used if council disabled - contributor_role?: string; - github: Record; -} - -// just the channels -export interface Channels { - submit: string; - council?: string; // not used if council disabled - results: string; -} diff --git a/tsconfig.json b/tsconfig.json index 5c235e76a..c11a49659 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -25,7 +25,7 @@ "@functions/*": ["helpers/functions/*"], "@utility/*": ["helpers/utility/*"], "@helpers/*": ["helpers/*"], - "@interfaces": ["interfaces"], + "@interfaces/*": ["interfaces/*"], "@json/*": ["../json/*"], "@images/*": ["helpers/images/*"] }