From 847a8663d819bf22b4b91c084241c921adc7ed25 Mon Sep 17 00:00:00 2001 From: Taken Date: Thu, 18 Jan 2024 15:34:55 +0100 Subject: [PATCH 1/3] Updated interfacecs --- src/commands-contextmenu/congratsmessage.ts | 1 - src/commands-contextmenu/resetnick.ts | 1 - src/commands-contextmenu/updateuser.ts | 1 - src/commands/ban.ts | 1 - src/commands/check.ts | 1 - src/commands/clear.ts | 1 - src/commands/config.ts | 1 - src/commands/counting.ts | 1 - src/commands/dev-info.ts | 1 - src/commands/devel.ts | 1 - src/commands/forceunverify.ts | 1 - src/commands/forceupdate.ts | 1 - src/commands/forceverify.ts | 1 - src/commands/guild.ts | 1 - src/commands/help.ts | 1 - src/commands/instructions.ts | 1 - src/commands/kick.ts | 1 - src/commands/ping.ts | 1 - src/commands/pp.ts | 1 - src/commands/remove.ts | 1 - src/commands/reqs.ts | 1 - src/commands/send.ts | 1 - src/commands/setnick.ts | 1 - src/commands/setup.ts | 7 +- src/commands/slowmode.ts | 1 - src/commands/snipe.ts | 1 - src/commands/staff.ts | 1 - src/commands/timeout.ts | 1 - src/commands/unban.ts | 1 - src/commands/update.ts | 1 - src/commands/uuid.ts | 1 - src/commands/verify.ts | 1 - src/commands/whoami.ts | 1 - src/commands/whois.ts | 1 - src/components/autocomplete/unban.ts | 5 +- src/components/buttons/checkstats.ts | 1 - .../buttons/guildapplicationaccept.ts | 1 - .../buttons/guildapplicationdeny.ts | 1 - src/components/buttons/guildapply.ts | 1 - src/components/buttons/guildinactivitylog.ts | 1 - .../buttons/inactiveapplicationaccept.ts | 1 - .../buttons/inactiveapplicationdeny.ts | 1 - .../buttons/staffapplicationaccept.ts | 1 - .../buttons/staffapplicationdeny.ts | 1 - src/components/buttons/staffapply.ts | 1 - src/components/buttons/verify.ts | 1 - src/components/buttons/waitingListUpdate.ts | 1 - src/components/modals/denyreasonbox.ts | 1 - src/components/modals/staffdenyreasonbox.ts | 1 - src/components/modals/verifyModal.ts | 1 - .../server/guildMemberAdd/logNewJoins.ts | 1 - src/events/server/interactions/logBtnsCmds.ts | 1 - src/events/server/messages/eval.ts | 1 - src/events/server/messages/react.ts | 1 - src/events/server/messages/snipecache.ts | 1 - src/events/server/ready/consolelog.ts | 1 - src/events/server/ready/sendOnlineMessage.ts | 1 - src/events/server/ready/status.ts | 1 - .../server/voiceStateUpdate/vcJoinLeave.ts | 1 - src/interfaces/Autocomplete.ts | 1 - src/interfaces/Button.ts | 1 - src/interfaces/Command.ts | 4 +- src/interfaces/ContextMenu.ts | 1 - src/interfaces/Event.ts | 1 - src/interfaces/Modal.ts | 1 - src/utils/Events/autocomplete.ts | 3 +- src/utils/Events/button.ts | 2 +- src/utils/Events/command.ts | 2 +- src/utils/Events/contextmenu.ts | 2 +- src/utils/Events/modal.ts | 2 +- đ | 197 ++++++++++++++++++ 71 files changed, 207 insertions(+), 79 deletions(-) create mode 100644 đ diff --git a/src/commands-contextmenu/congratsmessage.ts b/src/commands-contextmenu/congratsmessage.ts index f62ea58..9f67033 100644 --- a/src/commands-contextmenu/congratsmessage.ts +++ b/src/commands-contextmenu/congratsmessage.ts @@ -9,7 +9,6 @@ import { ContextMenu } from "interfaces" export = { name: "congratsmessage", description: "Congratulate a user.", - type: "contextmenu", dev: false, data: new ContextMenuCommandBuilder() diff --git a/src/commands-contextmenu/resetnick.ts b/src/commands-contextmenu/resetnick.ts index efced60..edaeb32 100644 --- a/src/commands-contextmenu/resetnick.ts +++ b/src/commands-contextmenu/resetnick.ts @@ -8,7 +8,6 @@ import { ContextMenu } from "interfaces" export = { name: "resetnick", description: "Reset your nickname.", - type: "contextmenu", dev: false, data: new ContextMenuCommandBuilder() diff --git a/src/commands-contextmenu/updateuser.ts b/src/commands-contextmenu/updateuser.ts index 6c1ffd0..9f38f33 100644 --- a/src/commands-contextmenu/updateuser.ts +++ b/src/commands-contextmenu/updateuser.ts @@ -13,7 +13,6 @@ import roleManage from "utils/functions/rolesmanage" export = { name: "Update User", description: "Updates a user's roles", - type: "contextmenu", dev: false, data: new ContextMenuCommandBuilder() diff --git a/src/commands/ban.ts b/src/commands/ban.ts index 89b7bd5..c5de59b 100644 --- a/src/commands/ban.ts +++ b/src/commands/ban.ts @@ -12,7 +12,6 @@ import logToChannel from "utils/functions/logtochannel" export = { name: "ban", description: "Ban a user", - type: "slash", dev: false, public: false, diff --git a/src/commands/check.ts b/src/commands/check.ts index 00f472a..07162ed 100644 --- a/src/commands/check.ts +++ b/src/commands/check.ts @@ -23,7 +23,6 @@ import { Command } from "interfaces" export = { name: "check", description: "Check a player's stats.", - type: "slash", dev: false, public: true, diff --git a/src/commands/clear.ts b/src/commands/clear.ts index 8364c3b..499bdad 100644 --- a/src/commands/clear.ts +++ b/src/commands/clear.ts @@ -12,7 +12,6 @@ import logToChannel from "utils/functions/logtochannel" export = { name: "clear", description: "Clears messages", - type: "slash", dev: false, public: false, diff --git a/src/commands/config.ts b/src/commands/config.ts index de9fe18..5a1a45d 100644 --- a/src/commands/config.ts +++ b/src/commands/config.ts @@ -7,7 +7,6 @@ import { Command } from "interfaces" export = { name: "config", description: "Configure the bot", - type: "slash", dev: true, public: false, diff --git a/src/commands/counting.ts b/src/commands/counting.ts index 72cc6e7..156f2f3 100644 --- a/src/commands/counting.ts +++ b/src/commands/counting.ts @@ -12,7 +12,6 @@ import unban from "./counting/unban" export = { name: "counting", description: "counting subcommands", - type: "slash", dev: false, public: true, subcommands: true, diff --git a/src/commands/dev-info.ts b/src/commands/dev-info.ts index 72a5356..8318c1d 100644 --- a/src/commands/dev-info.ts +++ b/src/commands/dev-info.ts @@ -8,7 +8,6 @@ import { Command } from "interfaces" export = { name: "dev-info", description: "Test command for the bot.", - type: "slash", dev: true, public: false, diff --git a/src/commands/devel.ts b/src/commands/devel.ts index 9c6befe..a09f498 100644 --- a/src/commands/devel.ts +++ b/src/commands/devel.ts @@ -4,7 +4,6 @@ import { Command } from "interfaces" export = { name: "devel", description: "Admin command.", - type: "slash", dev: false, public: false, diff --git a/src/commands/forceunverify.ts b/src/commands/forceunverify.ts index a484fac..7897ae5 100644 --- a/src/commands/forceunverify.ts +++ b/src/commands/forceunverify.ts @@ -14,7 +14,6 @@ import { getIGN } from "utils/Hypixel" export = { name: "forceunverify", description: "Force unverify a user", - type: "slash", dev: false, public: false, diff --git a/src/commands/forceupdate.ts b/src/commands/forceupdate.ts index 4f8d064..f757862 100644 --- a/src/commands/forceupdate.ts +++ b/src/commands/forceupdate.ts @@ -13,7 +13,6 @@ import roleManage from "utils/functions/rolesmanage" export = { name: "forceupdate", description: "Force update the user", - type: "slash", dev: false, public: false, diff --git a/src/commands/forceverify.ts b/src/commands/forceverify.ts index 14bd1b0..6d23822 100644 --- a/src/commands/forceverify.ts +++ b/src/commands/forceverify.ts @@ -15,7 +15,6 @@ import logToChannel from "utils/functions/logtochannel" export = { name: "forceverify", description: "Force verify a user.", - type: "slash", dev: false, public: false, diff --git a/src/commands/guild.ts b/src/commands/guild.ts index 2f70801..dc3b939 100644 --- a/src/commands/guild.ts +++ b/src/commands/guild.ts @@ -8,7 +8,6 @@ import guildTop from "./guild/top" export = { name: "guild", description: "Subcommands for guilds", - type: "slash", dev: false, public: true, subcommands: true, diff --git a/src/commands/help.ts b/src/commands/help.ts index d9c256e..bacb1b5 100644 --- a/src/commands/help.ts +++ b/src/commands/help.ts @@ -5,7 +5,6 @@ import { Command } from "interfaces" export = { name: "help", description: "Help command", - type: "slash", dev: false, public: true, diff --git a/src/commands/instructions.ts b/src/commands/instructions.ts index 99d857f..7ecc3c6 100644 --- a/src/commands/instructions.ts +++ b/src/commands/instructions.ts @@ -5,7 +5,6 @@ import { Command } from "interfaces" export = { name: "instructions", description: "Instructions for verification", - type: "slash", dev: false, public: false, diff --git a/src/commands/kick.ts b/src/commands/kick.ts index 3b6ad20..bf2c4fa 100644 --- a/src/commands/kick.ts +++ b/src/commands/kick.ts @@ -12,7 +12,6 @@ import logToChannel from "utils/functions/logtochannel" export = { name: "kick", description: "Kick a member from the server.", - type: "slash", dev: false, public: false, diff --git a/src/commands/ping.ts b/src/commands/ping.ts index 6838fe4..b660850 100644 --- a/src/commands/ping.ts +++ b/src/commands/ping.ts @@ -5,7 +5,6 @@ import { Command } from "interfaces" export = { name: "ping", description: "Get the bot's ping.", - type: "slash", dev: false, public: true, diff --git a/src/commands/pp.ts b/src/commands/pp.ts index 96ca7a1..7f4e0d6 100644 --- a/src/commands/pp.ts +++ b/src/commands/pp.ts @@ -6,7 +6,6 @@ import env from "utils/Env" export = { name: "pp", description: "Shows pp size", - type: "slash", public: true, dev: true, diff --git a/src/commands/remove.ts b/src/commands/remove.ts index fd8a8c0..9a1f3c8 100644 --- a/src/commands/remove.ts +++ b/src/commands/remove.ts @@ -11,7 +11,6 @@ import logToChannel from "utils/functions/logtochannel" export = { name: "remove", description: "Remove a person on the waiting list.", - type: "slash", false: true, public: false, diff --git a/src/commands/reqs.ts b/src/commands/reqs.ts index eb6656f..600780a 100644 --- a/src/commands/reqs.ts +++ b/src/commands/reqs.ts @@ -14,7 +14,6 @@ import { Command } from "interfaces" export = { name: "reqs", description: "Displays the requirements for the guild.", - type: "slash", dev: false, public: true, diff --git a/src/commands/send.ts b/src/commands/send.ts index 78aa5f3..5e36d14 100644 --- a/src/commands/send.ts +++ b/src/commands/send.ts @@ -10,7 +10,6 @@ import { Command } from "interfaces" export = { name: "send", description: "Send a message to a channel.", - type: "slash", dev: false, public: false, diff --git a/src/commands/setnick.ts b/src/commands/setnick.ts index 1cec5c9..839144c 100644 --- a/src/commands/setnick.ts +++ b/src/commands/setnick.ts @@ -11,7 +11,6 @@ import logToChannel from "utils/functions/logtochannel" export = { name: "setnick", description: "Set your nickname", - type: "slash", dev: false, public: false, diff --git a/src/commands/setup.ts b/src/commands/setup.ts index 1ac402d..d22412a 100644 --- a/src/commands/setup.ts +++ b/src/commands/setup.ts @@ -13,7 +13,6 @@ import { Command } from "interfaces" export = { name: "setup", description: "Used for setup of the bot.", - type: "slash", dev: true, public: false, subcommands: true, @@ -156,10 +155,8 @@ 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 on the waiting list" + customId = "waitinglistupdate" label = "Update" emoji = "🔄" } diff --git a/src/commands/slowmode.ts b/src/commands/slowmode.ts index 4e57169..78c1015 100644 --- a/src/commands/slowmode.ts +++ b/src/commands/slowmode.ts @@ -13,7 +13,6 @@ import logToChannel from "utils/functions/logtochannel" export = { name: "slowmode", description: "Set the slowmode of a channel.", - type: "slash", dev: false, public: false, diff --git a/src/commands/snipe.ts b/src/commands/snipe.ts index a8dda75..aa55175 100644 --- a/src/commands/snipe.ts +++ b/src/commands/snipe.ts @@ -7,7 +7,6 @@ import { SnipeCache } from "typings" export = { name: "snipe", description: "Snipes the last deleted message of a user", - type: "slash", public: true, dev: true, diff --git a/src/commands/staff.ts b/src/commands/staff.ts index 19a05e4..cabc336 100644 --- a/src/commands/staff.ts +++ b/src/commands/staff.ts @@ -8,7 +8,6 @@ import updateDiscordRoles from "./staff/updatediscordroles" export = { name: "staff", description: "Subcommands for staff", - type: "slash", dev: false, public: false, subcommands: true, diff --git a/src/commands/timeout.ts b/src/commands/timeout.ts index 2f630e3..4c1ae18 100644 --- a/src/commands/timeout.ts +++ b/src/commands/timeout.ts @@ -13,7 +13,6 @@ import logToChannel from "utils/functions/logtochannel" export = { name: "timeout", description: "Times out a memeber", - type: "slash", dev: false, public: false, diff --git a/src/commands/unban.ts b/src/commands/unban.ts index 214383f..ef567db 100644 --- a/src/commands/unban.ts +++ b/src/commands/unban.ts @@ -11,7 +11,6 @@ import logToChannel from "utils/functions/logtochannel" export = { name: "unban", description: "Unban a user from the server", - type: "slash", dev: false, public: false, diff --git a/src/commands/update.ts b/src/commands/update.ts index 9b416d0..11da935 100644 --- a/src/commands/update.ts +++ b/src/commands/update.ts @@ -8,7 +8,6 @@ import { Command } from "interfaces" export = { name: "update", description: "Update your guild rank.", - type: "slash", dev: false, public: true, diff --git a/src/commands/uuid.ts b/src/commands/uuid.ts index a05ec4c..edac880 100644 --- a/src/commands/uuid.ts +++ b/src/commands/uuid.ts @@ -6,7 +6,6 @@ import { Command } from "interfaces" export = { name: "uuid", description: "Get a player's UUID", - type: "slash", dev: false, public: true, diff --git a/src/commands/verify.ts b/src/commands/verify.ts index fa36b6b..761bed2 100644 --- a/src/commands/verify.ts +++ b/src/commands/verify.ts @@ -11,7 +11,6 @@ import { GuildData } from "interfaces" export = { name: "verify", description: "Verify yourself as a member of the server.", - type: "slash", dev: false, public: true, diff --git a/src/commands/whoami.ts b/src/commands/whoami.ts index 6803384..c96c40d 100644 --- a/src/commands/whoami.ts +++ b/src/commands/whoami.ts @@ -7,7 +7,6 @@ import { getIGN, getHeadURL } from "utils/Hypixel" export = { name: "whoami", description: "Get your user info", - type: "slash", public: true, dev: false, diff --git a/src/commands/whois.ts b/src/commands/whois.ts index 1c506da..a540f70 100644 --- a/src/commands/whois.ts +++ b/src/commands/whois.ts @@ -11,7 +11,6 @@ import { Command } from "interfaces" export = { name: "whois", description: "Get's the ign of a user.", - type: "slash", dev: false, public: false, diff --git a/src/components/autocomplete/unban.ts b/src/components/autocomplete/unban.ts index 51ded62..a4dc180 100644 --- a/src/components/autocomplete/unban.ts +++ b/src/components/autocomplete/unban.ts @@ -3,13 +3,10 @@ import { Autocomplete } from "interfaces" export = { name: "unban", description: "Unban a user from the server", - type: "autocomplete", async execute(interaction) { const focusedOption = interaction.options.getFocused(true) - if (focusedOption.name !== "user") { - return - } + if (focusedOption.name !== "user") return if (focusedOption.value === "") { await interaction.respond([ diff --git a/src/components/buttons/checkstats.ts b/src/components/buttons/checkstats.ts index 010252c..d297312 100644 --- a/src/components/buttons/checkstats.ts +++ b/src/components/buttons/checkstats.ts @@ -22,7 +22,6 @@ import { Button } from "interfaces" export = { name: "checkstats", description: "Check your stats.", - type: "button", async execute(interaction) { await interaction.deferReply() diff --git a/src/components/buttons/guildapplicationaccept.ts b/src/components/buttons/guildapplicationaccept.ts index ea73815..1f0cbb0 100644 --- a/src/components/buttons/guildapplicationaccept.ts +++ b/src/components/buttons/guildapplicationaccept.ts @@ -21,7 +21,6 @@ import { getGuild } from "utils/Hypixel" export = { name: "guildapplicationaccept", description: "Accept a guild application.", - type: "button", async execute(interaction) { await interaction.deferReply() diff --git a/src/components/buttons/guildapplicationdeny.ts b/src/components/buttons/guildapplicationdeny.ts index 922291d..9a1b453 100644 --- a/src/components/buttons/guildapplicationdeny.ts +++ b/src/components/buttons/guildapplicationdeny.ts @@ -9,7 +9,6 @@ import { Button } from "interfaces" export = { name: "guildapplicationdeny", description: "Deny a guild application.", - type: "button", async execute(interaction) { const modal = new ModalBuilder() diff --git a/src/components/buttons/guildapply.ts b/src/components/buttons/guildapply.ts index ff0b662..5c0f062 100644 --- a/src/components/buttons/guildapply.ts +++ b/src/components/buttons/guildapply.ts @@ -19,7 +19,6 @@ import { Button } from "interfaces" export = { name: "guildapply", description: "Guild application button.", - type: "button", async execute(interaction) { const user = interaction.member as GuildMember diff --git a/src/components/buttons/guildinactivitylog.ts b/src/components/buttons/guildinactivitylog.ts index 9d45a92..2fb873a 100644 --- a/src/components/buttons/guildinactivitylog.ts +++ b/src/components/buttons/guildinactivitylog.ts @@ -32,7 +32,6 @@ const guildRoles = [ module.exports = { name: "guildinactivitylog", description: "Configure the bot.", - type: "button", async execute(interaction) { const guild = interaction.guild! diff --git a/src/components/buttons/inactiveapplicationaccept.ts b/src/components/buttons/inactiveapplicationaccept.ts index eaee5b2..f644b52 100644 --- a/src/components/buttons/inactiveapplicationaccept.ts +++ b/src/components/buttons/inactiveapplicationaccept.ts @@ -3,7 +3,6 @@ import { Button } from "interfaces" export = { name: "inactiveapplicationaccept", description: "Accept an inactivity application.", - type: "button", async execute(interaction) { await interaction.reply({ diff --git a/src/components/buttons/inactiveapplicationdeny.ts b/src/components/buttons/inactiveapplicationdeny.ts index 1c12a60..b3f184f 100644 --- a/src/components/buttons/inactiveapplicationdeny.ts +++ b/src/components/buttons/inactiveapplicationdeny.ts @@ -3,7 +3,6 @@ import { Button } from "interfaces" export = { name: "inactiveapplicationdeny", description: "Denies an inactivity application.", - type: "button", async execute(interaction) { await interaction.reply({ diff --git a/src/components/buttons/staffapplicationaccept.ts b/src/components/buttons/staffapplicationaccept.ts index 13b11ba..516e45d 100644 --- a/src/components/buttons/staffapplicationaccept.ts +++ b/src/components/buttons/staffapplicationaccept.ts @@ -6,7 +6,6 @@ import { Button } from "interfaces" export = { name: "staffapplicationaccept", description: "Accept a staff application.", - type: "button", async execute(interaction) { await interaction.deferReply() diff --git a/src/components/buttons/staffapplicationdeny.ts b/src/components/buttons/staffapplicationdeny.ts index 1034b16..5a00433 100644 --- a/src/components/buttons/staffapplicationdeny.ts +++ b/src/components/buttons/staffapplicationdeny.ts @@ -9,7 +9,6 @@ import { Button } from "interfaces" export = { name: "staffapplicationdeny", description: "Deny a guild application.", - type: "button", async execute(interaction) { const modal = new ModalBuilder() diff --git a/src/components/buttons/staffapply.ts b/src/components/buttons/staffapply.ts index b92a33f..a57338b 100644 --- a/src/components/buttons/staffapply.ts +++ b/src/components/buttons/staffapply.ts @@ -20,7 +20,6 @@ import env from "utils/Env" export = { name: "staffapply", description: "Apply for the staff team.", - type: "button", async execute(interaction) { const user = interaction.member as GuildMember diff --git a/src/components/buttons/verify.ts b/src/components/buttons/verify.ts index 1625b8a..ddb3ed8 100644 --- a/src/components/buttons/verify.ts +++ b/src/components/buttons/verify.ts @@ -9,7 +9,6 @@ import { Button } from "interfaces" export = { name: "verify", description: "Configure the bot.", - type: "button", async execute(interaction) { const modal = new ModalBuilder() diff --git a/src/components/buttons/waitingListUpdate.ts b/src/components/buttons/waitingListUpdate.ts index 79d2b11..a17a28e 100644 --- a/src/components/buttons/waitingListUpdate.ts +++ b/src/components/buttons/waitingListUpdate.ts @@ -6,7 +6,6 @@ import { Button } from "interfaces" export = { name: "waitinglistupdate", description: "Update the waiting list.", - type: "button", async execute(interaction) { await interaction.deferReply({ ephemeral: true }) diff --git a/src/components/modals/denyreasonbox.ts b/src/components/modals/denyreasonbox.ts index 5524f46..66574ad 100644 --- a/src/components/modals/denyreasonbox.ts +++ b/src/components/modals/denyreasonbox.ts @@ -13,7 +13,6 @@ import { Modal } from "interfaces" export = { name: "denyreasonbox", description: "Deny reason box.", - type: "modal", async execute(interaction) { await interaction.deferReply() diff --git a/src/components/modals/staffdenyreasonbox.ts b/src/components/modals/staffdenyreasonbox.ts index b3f7379..5135d5a 100644 --- a/src/components/modals/staffdenyreasonbox.ts +++ b/src/components/modals/staffdenyreasonbox.ts @@ -11,7 +11,6 @@ import { Modal } from "interfaces" export = { name: "staffdenyreasonbox", description: "Deny reason box.", - type: "modal", async execute(interaction) { await interaction.deferReply() diff --git a/src/components/modals/verifyModal.ts b/src/components/modals/verifyModal.ts index 6622d42..12b2500 100644 --- a/src/components/modals/verifyModal.ts +++ b/src/components/modals/verifyModal.ts @@ -19,7 +19,6 @@ import { GuildMember } from "discord.js" export = { name: "verifybox", description: "Verify box.", - type: "modal", async execute(interaction) { await interaction.deferReply({ ephemeral: true }) diff --git a/src/events/server/guildMemberAdd/logNewJoins.ts b/src/events/server/guildMemberAdd/logNewJoins.ts index a73d41f..b6876e0 100644 --- a/src/events/server/guildMemberAdd/logNewJoins.ts +++ b/src/events/server/guildMemberAdd/logNewJoins.ts @@ -6,7 +6,6 @@ import logToChannel from "utils/functions/logtochannel" export = { name: "logNewJoins", description: "Logs new joins", - type: "event", event: "guildMemberAdd", execute(member: GuildMember) { diff --git a/src/events/server/interactions/logBtnsCmds.ts b/src/events/server/interactions/logBtnsCmds.ts index 2569cc1..c16176b 100644 --- a/src/events/server/interactions/logBtnsCmds.ts +++ b/src/events/server/interactions/logBtnsCmds.ts @@ -5,7 +5,6 @@ import { Event } from "interfaces" export = { name: "logBtnsCmds", description: "Logs all button and command interactions", - type: "event", event: "interactionCreate", execute(interaction: ChatInputCommandInteraction | ButtonInteraction) { diff --git a/src/events/server/messages/eval.ts b/src/events/server/messages/eval.ts index 24bcc42..b51d8f6 100644 --- a/src/events/server/messages/eval.ts +++ b/src/events/server/messages/eval.ts @@ -5,7 +5,6 @@ import env from "utils/Env" export = { name: "eval", description: "Evaluate a JavaScript expression", - type: "event", event: "messageCreate", disabled: true, diff --git a/src/events/server/messages/react.ts b/src/events/server/messages/react.ts index f6fb27e..45913f6 100644 --- a/src/events/server/messages/react.ts +++ b/src/events/server/messages/react.ts @@ -4,7 +4,6 @@ import { Message } from "discord.js" export = { name: "ur mom", description: "ur moms someone", - type: "event", event: "messageCreate", async execute(message: Message) { diff --git a/src/events/server/messages/snipecache.ts b/src/events/server/messages/snipecache.ts index 754afed..53c882a 100644 --- a/src/events/server/messages/snipecache.ts +++ b/src/events/server/messages/snipecache.ts @@ -7,7 +7,6 @@ import { SnipeCache } from "typings" export = { name: "snipecache", description: "Logs messages for the snipe command", - type: "event", event: "messageDelete", disabled: true, diff --git a/src/events/server/ready/consolelog.ts b/src/events/server/ready/consolelog.ts index b4cf936..520c494 100644 --- a/src/events/server/ready/consolelog.ts +++ b/src/events/server/ready/consolelog.ts @@ -5,7 +5,6 @@ import color from "utils/functions/colors" export = { name: "conolelog", description: "console log", - type: "event", event: "ready", execute(client: Client) { diff --git a/src/events/server/ready/sendOnlineMessage.ts b/src/events/server/ready/sendOnlineMessage.ts index 4d7d7c4..c813454 100644 --- a/src/events/server/ready/sendOnlineMessage.ts +++ b/src/events/server/ready/sendOnlineMessage.ts @@ -5,7 +5,6 @@ import { color } from "config/options.json" export = { name: "sendonlinemessage", description: "send an online message", - type: "event", event: "ready", execute() { diff --git a/src/events/server/ready/status.ts b/src/events/server/ready/status.ts index ee1782a..6f4f509 100644 --- a/src/events/server/ready/status.ts +++ b/src/events/server/ready/status.ts @@ -5,7 +5,6 @@ import { ExtendedClient as Client } from "utils/Client" export = { name: "status", description: "Sets the status of the bot", - type: "event", event: "ready", execute(client: Client) { diff --git a/src/events/server/voiceStateUpdate/vcJoinLeave.ts b/src/events/server/voiceStateUpdate/vcJoinLeave.ts index 11b5556..360f222 100644 --- a/src/events/server/voiceStateUpdate/vcJoinLeave.ts +++ b/src/events/server/voiceStateUpdate/vcJoinLeave.ts @@ -6,7 +6,6 @@ import logToChannel from "utils/functions/logtochannel" export = { name: "vcJoinLeave", description: "Logs when a user joins or leaves a voice channel.", - type: "event", event: "voiceStateUpdate", execute(oldState: VoiceState, newState: VoiceState) { diff --git a/src/interfaces/Autocomplete.ts b/src/interfaces/Autocomplete.ts index 919a1ea..e20e4a3 100644 --- a/src/interfaces/Autocomplete.ts +++ b/src/interfaces/Autocomplete.ts @@ -4,6 +4,5 @@ import { AutocompleteInteraction } from "discord.js" export default interface Autocomplete { name: string description: string - type: "autocomplete" execute: (interacion: AutocompleteInteraction) => Promise } diff --git a/src/interfaces/Button.ts b/src/interfaces/Button.ts index b7d332b..49cf822 100644 --- a/src/interfaces/Button.ts +++ b/src/interfaces/Button.ts @@ -4,6 +4,5 @@ import { ButtonInteraction } from "discord.js" export default interface Button { name: string description: string - type: "button" execute: (interaction: ButtonInteraction) => Promise } diff --git a/src/interfaces/Command.ts b/src/interfaces/Command.ts index 77be96e..3d319b7 100644 --- a/src/interfaces/Command.ts +++ b/src/interfaces/Command.ts @@ -5,11 +5,11 @@ import { ExtendedClient as Client } from "utils/Client" export default interface Command { name: string description: string - type: "slash" dev?: boolean public: boolean - data: SlashCommandBuilder + disabled?: boolean subcommands?: boolean + data: SlashCommandBuilder execute: ( interaction: ChatInputCommandInteraction, client: Client, diff --git a/src/interfaces/ContextMenu.ts b/src/interfaces/ContextMenu.ts index 50612e9..8cc1d66 100644 --- a/src/interfaces/ContextMenu.ts +++ b/src/interfaces/ContextMenu.ts @@ -7,7 +7,6 @@ import { export default interface ContextMenu { name: string description: string - type: "contextmenu" dev?: boolean data: ContextMenuCommandBuilder execute: (interaction: ContextMenuCommandInteraction) => Promise diff --git a/src/interfaces/Event.ts b/src/interfaces/Event.ts index bcd0494..9b9efb7 100644 --- a/src/interfaces/Event.ts +++ b/src/interfaces/Event.ts @@ -4,7 +4,6 @@ import { ClientEvents } from "discord.js" export default interface Event { name: string description: string - type: "event" event: keyof ClientEvents disabled?: boolean execute(...args: any[]): void diff --git a/src/interfaces/Modal.ts b/src/interfaces/Modal.ts index 6fe3cb5..9737e9c 100644 --- a/src/interfaces/Modal.ts +++ b/src/interfaces/Modal.ts @@ -4,6 +4,5 @@ import { ModalSubmitInteraction } from "discord.js" export default interface Modal { name: string description: string - type: "modal" execute: (interaction: ModalSubmitInteraction) => Promise } diff --git a/src/utils/Events/autocomplete.ts b/src/utils/Events/autocomplete.ts index db71862..4851ef8 100644 --- a/src/utils/Events/autocomplete.ts +++ b/src/utils/Events/autocomplete.ts @@ -27,8 +27,7 @@ export default function loadAutocompleteEvents(client: Client, ft: FileType) { if ( "name" in autocomplete && - "execute" in autocomplete && - autocomplete.type === "autocomplete" + "execute" in autocomplete ) { client.autocomplete.set(autocomplete.name, autocomplete) } else { diff --git a/src/utils/Events/button.ts b/src/utils/Events/button.ts index 49736be..435953e 100644 --- a/src/utils/Events/button.ts +++ b/src/utils/Events/button.ts @@ -17,7 +17,7 @@ export default function loadButtonEvents(client: Client, ft: FileType) { const filePath = path.join(btnPath, file) const btn: Button = require(filePath) - if ("name" in btn && "execute" in btn && btn.type === "button") { + if ("name" in btn && "execute" in btn) { client.buttons.set(btn.name, btn) } else { console.log( diff --git a/src/utils/Events/command.ts b/src/utils/Events/command.ts index 9df7d03..a3a7ae1 100644 --- a/src/utils/Events/command.ts +++ b/src/utils/Events/command.ts @@ -17,7 +17,7 @@ export default function loadSlashCommandsEvents(client: Client, ft: FileType) { const filePath = path.join(cmdPath, file) const cmd: Command = require(filePath) - if ("data" in cmd && "execute" in cmd && cmd.type === "slash") { + if ("data" in cmd && "execute" in cmd) { client.commands.set(cmd.data.name, cmd) } else { console.log( diff --git a/src/utils/Events/contextmenu.ts b/src/utils/Events/contextmenu.ts index 36a6c0b..d2edc23 100644 --- a/src/utils/Events/contextmenu.ts +++ b/src/utils/Events/contextmenu.ts @@ -24,7 +24,7 @@ export default function loadContextMenuEvents(client: Client, ft: FileType) { const filePath = path.join(contextMenuPath, file) const cmd: ContextMenu = require(filePath) - if ("data" in cmd && "execute" in cmd && cmd.type === "contextmenu") { + if ("data" in cmd && "execute" in cmd) { client.contextmenus.set(cmd.data.name, cmd) } else { console.log( diff --git a/src/utils/Events/modal.ts b/src/utils/Events/modal.ts index d578667..bd405cf 100644 --- a/src/utils/Events/modal.ts +++ b/src/utils/Events/modal.ts @@ -19,7 +19,7 @@ export default function loadModalEvents(client: Client, ft: FileType) { const filePath = path.join(modalPath, file) const modal: Modal = require(filePath) - if ("name" in modal && "execute" in modal && modal.type === "modal") { + if ("name" in modal && "execute" in modal) { client.modals.set(modal.name, modal) } else { console.log( diff --git a/đ b/đ new file mode 100644 index 0000000..187a107 --- /dev/null +++ b/đ @@ -0,0 +1,197 @@ +import { + SlashCommandBuilder, + PermissionFlagsBits, + ButtonBuilder, + ActionRowBuilder, + ButtonStyle, + ChannelType, + TextChannel, +} from "discord.js" +import { color, devMessage } from "config/options.json" +import { Command } from "interfaces" + +export = { + name: "setup", + description: "Used for setup of the bot.", + type: "slash", + dev: true, + public: false, + subcommands: true, + + data: new SlashCommandBuilder() + .setName("setup") + .setDescription("Configure the bot.") + .addSubcommand(subcommand => + subcommand + .setName("sendguildapplication") + .setDescription("Send the application message to a channel.") + .addChannelOption(option => + option + .setName("channel") + .setDescription( + "The channel to send the application to.", + ) + .addChannelTypes( + ChannelType.GuildText, + ChannelType.GuildAnnouncement, + ) + .setRequired(true), + ), + ) + .addSubcommand(subcommand => + subcommand + .setName("sendstaffapplication") + .setDescription("Send the application message to a channel.") + .addChannelOption(option => + option + .setName("channel") + .setDescription( + "The channel to send the application to.", + ) + .addChannelTypes( + ChannelType.GuildText, + ChannelType.GuildAnnouncement, + ) + .setRequired(true), + ), + ) + .addSubcommand(subcommand => + subcommand + .setName("sendverfiymessage") + .setDescription("Send the verfiy message to a channel.") + .addChannelOption(option => + option + .setName("channel") + .setDescription( + "The channel to send the verfiy message to.", + ) + .addChannelTypes( + ChannelType.GuildText, + ChannelType.GuildAnnouncement, + ) + .setRequired(true), + ), + ) + .addSubcommand(subcommand => + subcommand + .setName("sendwaitinglistmessage") + .setDescription("Send the waiting list message to a channel.") + .addChannelOption(option => + option + .setName("channel") + .setDescription( + "The channel to send the waiting list message to.", + ) + .addChannelTypes( + ChannelType.GuildText, + ChannelType.GuildAnnouncement, + ) + .setRequired(true), + ), + ) + .addSubcommand(subcommand => + subcommand + .setName("sendinactivityapplication") + .setDescription("Send the application message to a channel.") + .addChannelOption(option => + option + .setName("channel") + .setDescription( + "The channel to send the application to.", + ) + .addChannelTypes( + ChannelType.GuildText, + ChannelType.GuildAnnouncement, + ) + .setRequired(true), + ), + ) + .setDefaultMemberPermissions(PermissionFlagsBits.Administrator) + .setDMPermission(false), + + async execute(interaction) { + const subcommand = interaction.options.getSubcommand() + const channel = interaction.options.getChannel("channel") as TextChannel + const embedColor = Number(color.replace("#", "0x")) + let title: string = "" + let description: string = "" + let customId: string = "" + let label: string = "" + let emoji: string = "" + + if (subcommand === "sendguildapplication") { + title = "Guild Application" + description = + "You can apply for the guild by clicking the button below." + customId = "guildapply" + label = "Apply" + emoji = "✅" + } + + if (subcommand === "sendstaffapplication") { + title = "Staff Application" + description = + "You can apply for the staff team by clicking the button below." + customId = "staffapply" + label = "Apply" + emoji = "✅" + } + + if (subcommand === "sendinactivityapplication") { + title = "Inactivity Log" + description = + "You can send an inactivity log by clicking the button below." + customId = "guildinactivitylog" + label = "Submit" + emoji = "✅" + } + + if (subcommand === "sendverfiymessage") { + title = "Verification" + description = "You can verify by clicking the button below." + customId = "verify" + label = "Verify" + emoji = "✅" + } + + if (subcommand === "sendwaitinglistmessage") { + title = "Waiting List" + description = "The people on the waiting list" + customId = "waitinglistupdate" + label = "Update" + emoji = "🔄" + } + + await channel.send({ + embeds: [ + { + title: title, + description: description, + color: embedColor, + thumbnail: { + url: interaction.guild!.iconURL() || "", + }, + footer: { + text: interaction.guild!.name + " | " + devMessage, + icon_url: interaction.guild!.iconURL() || undefined, + }, + }, + ], + components: [ + new ActionRowBuilder().addComponents( + new ButtonBuilder() + .setCustomId(customId) + .setLabel(label) + .setStyle(ButtonStyle.Primary) + .setEmoji({ name: emoji }), + ), + ], + }) + + await interaction.reply({ + content: "Message sent", + ephemeral: true, + }) + }, +} as Command + From 13ada314f3aa8e745f0df180c7230abdc40e1a54 Mon Sep 17 00:00:00 2001 From: Taken Date: Thu, 18 Jan 2024 15:37:17 +0100 Subject: [PATCH 2/3] Format and lint --- src/commands/pp.ts | 30 ++++++++++++++++-------------- src/commands/timeout.ts | 6 +++--- src/events/server/messages/eval.ts | 20 ++++++++++++-------- src/utils/Events/autocomplete.ts | 5 +---- src/utils/Hypixel/bedwars.ts | 16 ++++++++-------- src/utils/Hypixel/hypixel.ts | 4 ++-- 6 files changed, 42 insertions(+), 39 deletions(-) diff --git a/src/commands/pp.ts b/src/commands/pp.ts index 7f4e0d6..9b9acab 100644 --- a/src/commands/pp.ts +++ b/src/commands/pp.ts @@ -12,17 +12,17 @@ export = { data: new SlashCommandBuilder() .setName("pp") .setDescription("Shows pp size") - .addUserOption( - option => - option - .setName("user") - .setDescription("User to show pp size") - .setRequired(false) + .addUserOption(option => + option + .setName("user") + .setDescription("User to show pp size") + .setRequired(false), ) .setDMPermission(false), async execute(interaction) { - const user = (interaction.options.getUser("user") || interaction.user) as User + const user = (interaction.options.getUser("user") || + interaction.user) as User const embedColor = Number(color.replace("#", "0x")) let size: number @@ -33,11 +33,13 @@ export = { } await interaction.reply({ - embeds: [{ - title: `${user.username}'s pp size`, - description: `8${"=".repeat(size)}D`, - color: embedColor - }] + embeds: [ + { + title: `${user.username}'s pp size`, + description: `8${"=".repeat(size)}D`, + color: embedColor, + }, + ], }) - } -} as Command \ No newline at end of file + }, +} as Command diff --git a/src/commands/timeout.ts b/src/commands/timeout.ts index 4c1ae18..1f589ee 100644 --- a/src/commands/timeout.ts +++ b/src/commands/timeout.ts @@ -128,7 +128,7 @@ export = { userMention(target.id) + " for " + reason), - (timeouttime = null) + (timeouttime = null) } else { title = "Timeout Updated" ;(description = @@ -138,7 +138,7 @@ export = { prettyTime + " for " + reason), - (timeouttime = time) + (timeouttime = time) } } else { title = "Member Timed Out" @@ -149,7 +149,7 @@ export = { prettyTime + " for " + reason), - (timeouttime = time) + (timeouttime = time) } await target.timeout(timeouttime, reason) diff --git a/src/events/server/messages/eval.ts b/src/events/server/messages/eval.ts index b51d8f6..866baae 100644 --- a/src/events/server/messages/eval.ts +++ b/src/events/server/messages/eval.ts @@ -19,16 +19,20 @@ export = { const output = eval(code) const outputString = String(output) await message.channel.send({ - embeds: [{ - description: `\`\`\`js\n${outputString}\`\`\`` - }] + embeds: [ + { + description: `\`\`\`js\n${outputString}\`\`\``, + }, + ], }) } catch (error) { await message.channel.send({ - embeds: [{ - description: `\`\`\`js\n${error}\`\`\`` - }] + embeds: [ + { + description: `\`\`\`js\n${error}\`\`\``, + }, + ], }) } - } -} as Event \ No newline at end of file + }, +} as Event diff --git a/src/utils/Events/autocomplete.ts b/src/utils/Events/autocomplete.ts index 4851ef8..7842875 100644 --- a/src/utils/Events/autocomplete.ts +++ b/src/utils/Events/autocomplete.ts @@ -25,10 +25,7 @@ export default function loadAutocompleteEvents(client: Client, ft: FileType) { const filePath = path.join(autocompletePath, file) const autocomplete: Autocomplete = require(filePath) - if ( - "name" in autocomplete && - "execute" in autocomplete - ) { + if ("name" in autocomplete && "execute" in autocomplete) { client.autocomplete.set(autocomplete.name, autocomplete) } else { console.log( diff --git a/src/utils/Hypixel/bedwars.ts b/src/utils/Hypixel/bedwars.ts index c8ba341..03d5657 100644 --- a/src/utils/Hypixel/bedwars.ts +++ b/src/utils/Hypixel/bedwars.ts @@ -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 } diff --git a/src/utils/Hypixel/hypixel.ts b/src/utils/Hypixel/hypixel.ts index 6a20240..93465d3 100644 --- a/src/utils/Hypixel/hypixel.ts +++ b/src/utils/Hypixel/hypixel.ts @@ -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 { From 2180e203849e783c31a76afa9a2aff829a4e1e6c Mon Sep 17 00:00:00 2001 From: Taken Date: Thu, 18 Jan 2024 15:37:57 +0100 Subject: [PATCH 3/3] why --- đ | 197 -------------------------------------------------------------- 1 file changed, 197 deletions(-) delete mode 100644 đ diff --git a/đ b/đ deleted file mode 100644 index 187a107..0000000 --- a/đ +++ /dev/null @@ -1,197 +0,0 @@ -import { - SlashCommandBuilder, - PermissionFlagsBits, - ButtonBuilder, - ActionRowBuilder, - ButtonStyle, - ChannelType, - TextChannel, -} from "discord.js" -import { color, devMessage } from "config/options.json" -import { Command } from "interfaces" - -export = { - name: "setup", - description: "Used for setup of the bot.", - type: "slash", - dev: true, - public: false, - subcommands: true, - - data: new SlashCommandBuilder() - .setName("setup") - .setDescription("Configure the bot.") - .addSubcommand(subcommand => - subcommand - .setName("sendguildapplication") - .setDescription("Send the application message to a channel.") - .addChannelOption(option => - option - .setName("channel") - .setDescription( - "The channel to send the application to.", - ) - .addChannelTypes( - ChannelType.GuildText, - ChannelType.GuildAnnouncement, - ) - .setRequired(true), - ), - ) - .addSubcommand(subcommand => - subcommand - .setName("sendstaffapplication") - .setDescription("Send the application message to a channel.") - .addChannelOption(option => - option - .setName("channel") - .setDescription( - "The channel to send the application to.", - ) - .addChannelTypes( - ChannelType.GuildText, - ChannelType.GuildAnnouncement, - ) - .setRequired(true), - ), - ) - .addSubcommand(subcommand => - subcommand - .setName("sendverfiymessage") - .setDescription("Send the verfiy message to a channel.") - .addChannelOption(option => - option - .setName("channel") - .setDescription( - "The channel to send the verfiy message to.", - ) - .addChannelTypes( - ChannelType.GuildText, - ChannelType.GuildAnnouncement, - ) - .setRequired(true), - ), - ) - .addSubcommand(subcommand => - subcommand - .setName("sendwaitinglistmessage") - .setDescription("Send the waiting list message to a channel.") - .addChannelOption(option => - option - .setName("channel") - .setDescription( - "The channel to send the waiting list message to.", - ) - .addChannelTypes( - ChannelType.GuildText, - ChannelType.GuildAnnouncement, - ) - .setRequired(true), - ), - ) - .addSubcommand(subcommand => - subcommand - .setName("sendinactivityapplication") - .setDescription("Send the application message to a channel.") - .addChannelOption(option => - option - .setName("channel") - .setDescription( - "The channel to send the application to.", - ) - .addChannelTypes( - ChannelType.GuildText, - ChannelType.GuildAnnouncement, - ) - .setRequired(true), - ), - ) - .setDefaultMemberPermissions(PermissionFlagsBits.Administrator) - .setDMPermission(false), - - async execute(interaction) { - const subcommand = interaction.options.getSubcommand() - const channel = interaction.options.getChannel("channel") as TextChannel - const embedColor = Number(color.replace("#", "0x")) - let title: string = "" - let description: string = "" - let customId: string = "" - let label: string = "" - let emoji: string = "" - - if (subcommand === "sendguildapplication") { - title = "Guild Application" - description = - "You can apply for the guild by clicking the button below." - customId = "guildapply" - label = "Apply" - emoji = "✅" - } - - if (subcommand === "sendstaffapplication") { - title = "Staff Application" - description = - "You can apply for the staff team by clicking the button below." - customId = "staffapply" - label = "Apply" - emoji = "✅" - } - - if (subcommand === "sendinactivityapplication") { - title = "Inactivity Log" - description = - "You can send an inactivity log by clicking the button below." - customId = "guildinactivitylog" - label = "Submit" - emoji = "✅" - } - - if (subcommand === "sendverfiymessage") { - title = "Verification" - description = "You can verify by clicking the button below." - customId = "verify" - label = "Verify" - emoji = "✅" - } - - if (subcommand === "sendwaitinglistmessage") { - title = "Waiting List" - description = "The people on the waiting list" - customId = "waitinglistupdate" - label = "Update" - emoji = "🔄" - } - - await channel.send({ - embeds: [ - { - title: title, - description: description, - color: embedColor, - thumbnail: { - url: interaction.guild!.iconURL() || "", - }, - footer: { - text: interaction.guild!.name + " | " + devMessage, - icon_url: interaction.guild!.iconURL() || undefined, - }, - }, - ], - components: [ - new ActionRowBuilder().addComponents( - new ButtonBuilder() - .setCustomId(customId) - .setLabel(label) - .setStyle(ButtonStyle.Primary) - .setEmoji({ name: emoji }), - ), - ], - }) - - await interaction.reply({ - content: "Message sent", - ephemeral: true, - }) - }, -} as Command -