From d0b4a13a2e91267b62c91f7502e1afb0b9b5ad23 Mon Sep 17 00:00:00 2001 From: "Jonny_Bro (Nikita)" Date: Thu, 12 Dec 2024 21:05:23 +0500 Subject: [PATCH] refactor: move commands and events so we can start properly --- src/adapters/database/MongooseAdapter.js | 5 +- src/{base => base_OLD}/BaseCommand.js | 0 src/{base => base_OLD}/BaseEvent.js | 0 src/{base => base_OLD}/Client.js | 0 src/commands/Fun/8ball.js | 78 ++----------------- .../Administration/addemoji.js | 0 .../Administration/automod.js | 0 .../Administration/autorole.js | 0 .../Administration/config.js | 0 .../Administration/goodbye.js | 0 .../Administration/selectroles.js | 0 .../Administration/set.js | 0 .../Administration/setlang.js | 0 .../Administration/stealemoji.js | 0 .../Administration/welcome.js | 0 .../Beatrun/courses.js | 0 .../Economy/achievements.js | 0 .../Economy/bank.js | 0 .../Economy/birthdate.js | 0 .../Economy/divorce.js | 0 .../Economy/leaderboard.js | 0 .../Economy/marry.js | 0 .../Economy/money.js | 0 src/{commands => commands_OLD}/Economy/pay.js | 0 .../Economy/profile.js | 0 src/{commands => commands_OLD}/Economy/rep.js | 0 src/{commands => commands_OLD}/Economy/rob.js | 0 .../Economy/setbio.js | 0 .../Economy/slots.js | 0 .../Economy/transactions.js | 0 .../Economy/work.js | 0 src/commands_OLD/Fun/8ball.js | 72 +++++++++++++++++ src/{commands => commands_OLD}/Fun/cat.js | 0 src/{commands => commands_OLD}/Fun/dog.js | 0 src/{commands => commands_OLD}/Fun/lmgtfy.js | 0 .../Fun/lovecalc.js | 0 src/{commands => commands_OLD}/Fun/number.js | 0 .../Fun/tictactoe.js | 0 src/{commands => commands_OLD}/General/afk.js | 0 .../General/avatar.c.js | 0 .../General/avatar.js | 0 .../General/boosters.js | 0 .../General/emoji.js | 0 .../General/help.js | 0 .../General/info.js | 0 .../General/minecraft.js | 0 .../General/ping.js | 0 .../General/remindme.js | 0 .../General/reminds.js | 0 .../General/report.js | 0 .../General/shorturl.js | 0 .../General/stats.js | 0 .../General/suggest.js | 0 .../General/whois.js | 0 .../IAT/checkjar.js | 0 .../Moderation/clear.js | 0 .../Moderation/clearwarns.js | 0 .../Moderation/giveaway.js | 0 .../Moderation/unban.js | 0 .../Moderation/untimeout.js | 0 .../Moderation/warn.c.js | 0 .../Moderation/warns.js | 0 src/{commands => commands_OLD}/Music/back.js | 0 src/{commands => commands_OLD}/Music/clips.js | 0 src/{commands => commands_OLD}/Music/loop.js | 0 .../Music/nowplaying.js | 0 .../Music/play.c.js | 0 src/{commands => commands_OLD}/Music/play.js | 0 src/{commands => commands_OLD}/Music/queue.js | 0 src/{commands => commands_OLD}/Music/seek.js | 0 .../Music/shuffle.js | 0 src/{commands => commands_OLD}/Music/skip.js | 0 src/{commands => commands_OLD}/Music/stop.js | 0 .../Music/volume.js | 0 src/{commands => commands_OLD}/Owner/debug.js | 0 src/{commands => commands_OLD}/Owner/eval.js | 0 .../Owner/reload.js | 0 src/{commands => commands_OLD}/Owner/say.js | 0 .../Owner/servers.js | 0 .../Tickets/adduser.js | 0 .../Tickets/closeticket.js | 0 .../Tickets/createticketembed.js | 0 .../Tickets/removeuser.js | 0 src/events/Ready.js | 72 +++-------------- src/{events => events_OLD}/CommandHandler.js | 0 .../Guild/guildBanAdd.js | 0 .../Guild/guildCreate.js | 0 .../Guild/guildDelete.js | 0 .../Guild/guildMemberAdd.js | 0 .../Guild/guildMemberRemove.js | 0 .../Guild/guildMemberUpdate.js | 0 src/{events => events_OLD}/MessageHandler.js | 0 .../Monitoring/messageDelete.js | 0 .../Monitoring/messageUpdate.js | 0 src/events_OLD/Ready.js | 64 +++++++++++++++ src/{events => events_OLD}/TicketsButton.js | 0 src/newCommands/Fun/8ball.js | 8 -- src/newEvents/ready.js | 14 ---- 98 files changed, 157 insertions(+), 156 deletions(-) rename src/{base => base_OLD}/BaseCommand.js (100%) rename src/{base => base_OLD}/BaseEvent.js (100%) rename src/{base => base_OLD}/Client.js (100%) rename src/{commands => commands_OLD}/Administration/addemoji.js (100%) rename src/{commands => commands_OLD}/Administration/automod.js (100%) rename src/{commands => commands_OLD}/Administration/autorole.js (100%) rename src/{commands => commands_OLD}/Administration/config.js (100%) rename src/{commands => commands_OLD}/Administration/goodbye.js (100%) rename src/{commands => commands_OLD}/Administration/selectroles.js (100%) rename src/{commands => commands_OLD}/Administration/set.js (100%) rename src/{commands => commands_OLD}/Administration/setlang.js (100%) rename src/{commands => commands_OLD}/Administration/stealemoji.js (100%) rename src/{commands => commands_OLD}/Administration/welcome.js (100%) rename src/{commands => commands_OLD}/Beatrun/courses.js (100%) rename src/{commands => commands_OLD}/Economy/achievements.js (100%) rename src/{commands => commands_OLD}/Economy/bank.js (100%) rename src/{commands => commands_OLD}/Economy/birthdate.js (100%) rename src/{commands => commands_OLD}/Economy/divorce.js (100%) rename src/{commands => commands_OLD}/Economy/leaderboard.js (100%) rename src/{commands => commands_OLD}/Economy/marry.js (100%) rename src/{commands => commands_OLD}/Economy/money.js (100%) rename src/{commands => commands_OLD}/Economy/pay.js (100%) rename src/{commands => commands_OLD}/Economy/profile.js (100%) rename src/{commands => commands_OLD}/Economy/rep.js (100%) rename src/{commands => commands_OLD}/Economy/rob.js (100%) rename src/{commands => commands_OLD}/Economy/setbio.js (100%) rename src/{commands => commands_OLD}/Economy/slots.js (100%) rename src/{commands => commands_OLD}/Economy/transactions.js (100%) rename src/{commands => commands_OLD}/Economy/work.js (100%) create mode 100644 src/commands_OLD/Fun/8ball.js rename src/{commands => commands_OLD}/Fun/cat.js (100%) rename src/{commands => commands_OLD}/Fun/dog.js (100%) rename src/{commands => commands_OLD}/Fun/lmgtfy.js (100%) rename src/{commands => commands_OLD}/Fun/lovecalc.js (100%) rename src/{commands => commands_OLD}/Fun/number.js (100%) rename src/{commands => commands_OLD}/Fun/tictactoe.js (100%) rename src/{commands => commands_OLD}/General/afk.js (100%) rename src/{commands => commands_OLD}/General/avatar.c.js (100%) rename src/{commands => commands_OLD}/General/avatar.js (100%) rename src/{commands => commands_OLD}/General/boosters.js (100%) rename src/{commands => commands_OLD}/General/emoji.js (100%) rename src/{commands => commands_OLD}/General/help.js (100%) rename src/{commands => commands_OLD}/General/info.js (100%) rename src/{commands => commands_OLD}/General/minecraft.js (100%) rename src/{commands => commands_OLD}/General/ping.js (100%) rename src/{commands => commands_OLD}/General/remindme.js (100%) rename src/{commands => commands_OLD}/General/reminds.js (100%) rename src/{commands => commands_OLD}/General/report.js (100%) rename src/{commands => commands_OLD}/General/shorturl.js (100%) rename src/{commands => commands_OLD}/General/stats.js (100%) rename src/{commands => commands_OLD}/General/suggest.js (100%) rename src/{commands => commands_OLD}/General/whois.js (100%) rename src/{commands => commands_OLD}/IAT/checkjar.js (100%) rename src/{commands => commands_OLD}/Moderation/clear.js (100%) rename src/{commands => commands_OLD}/Moderation/clearwarns.js (100%) rename src/{commands => commands_OLD}/Moderation/giveaway.js (100%) rename src/{commands => commands_OLD}/Moderation/unban.js (100%) rename src/{commands => commands_OLD}/Moderation/untimeout.js (100%) rename src/{commands => commands_OLD}/Moderation/warn.c.js (100%) rename src/{commands => commands_OLD}/Moderation/warns.js (100%) rename src/{commands => commands_OLD}/Music/back.js (100%) rename src/{commands => commands_OLD}/Music/clips.js (100%) rename src/{commands => commands_OLD}/Music/loop.js (100%) rename src/{commands => commands_OLD}/Music/nowplaying.js (100%) rename src/{commands => commands_OLD}/Music/play.c.js (100%) rename src/{commands => commands_OLD}/Music/play.js (100%) rename src/{commands => commands_OLD}/Music/queue.js (100%) rename src/{commands => commands_OLD}/Music/seek.js (100%) rename src/{commands => commands_OLD}/Music/shuffle.js (100%) rename src/{commands => commands_OLD}/Music/skip.js (100%) rename src/{commands => commands_OLD}/Music/stop.js (100%) rename src/{commands => commands_OLD}/Music/volume.js (100%) rename src/{commands => commands_OLD}/Owner/debug.js (100%) rename src/{commands => commands_OLD}/Owner/eval.js (100%) rename src/{commands => commands_OLD}/Owner/reload.js (100%) rename src/{commands => commands_OLD}/Owner/say.js (100%) rename src/{commands => commands_OLD}/Owner/servers.js (100%) rename src/{commands => commands_OLD}/Tickets/adduser.js (100%) rename src/{commands => commands_OLD}/Tickets/closeticket.js (100%) rename src/{commands => commands_OLD}/Tickets/createticketembed.js (100%) rename src/{commands => commands_OLD}/Tickets/removeuser.js (100%) rename src/{events => events_OLD}/CommandHandler.js (100%) rename src/{events => events_OLD}/Guild/guildBanAdd.js (100%) rename src/{events => events_OLD}/Guild/guildCreate.js (100%) rename src/{events => events_OLD}/Guild/guildDelete.js (100%) rename src/{events => events_OLD}/Guild/guildMemberAdd.js (100%) rename src/{events => events_OLD}/Guild/guildMemberRemove.js (100%) rename src/{events => events_OLD}/Guild/guildMemberUpdate.js (100%) rename src/{events => events_OLD}/MessageHandler.js (100%) rename src/{events => events_OLD}/Monitoring/messageDelete.js (100%) rename src/{events => events_OLD}/Monitoring/messageUpdate.js (100%) create mode 100644 src/events_OLD/Ready.js rename src/{events => events_OLD}/TicketsButton.js (100%) delete mode 100644 src/newCommands/Fun/8ball.js delete mode 100644 src/newEvents/ready.js diff --git a/src/adapters/database/MongooseAdapter.js b/src/adapters/database/MongooseAdapter.js index f6d244c3..7bae112e 100644 --- a/src/adapters/database/MongooseAdapter.js +++ b/src/adapters/database/MongooseAdapter.js @@ -1,5 +1,6 @@ import mongoose from "mongoose"; import IDatabaseAdapter from "./IDatabaseAdapter.js"; +import logger from "../../helpers/logger.js"; export default class MongooseAdapter extends IDatabaseAdapter { /** @@ -21,11 +22,11 @@ export default class MongooseAdapter extends IDatabaseAdapter { async connect() { await mongoose.connect(this.uri, this.options); - console.log("Database connected."); + logger.log("Database connected."); } async disconnect() { await mongoose.disconnect(); - console.log("Database disconnected."); + console.warn("Database disconnected."); } } diff --git a/src/base/BaseCommand.js b/src/base_OLD/BaseCommand.js similarity index 100% rename from src/base/BaseCommand.js rename to src/base_OLD/BaseCommand.js diff --git a/src/base/BaseEvent.js b/src/base_OLD/BaseEvent.js similarity index 100% rename from src/base/BaseEvent.js rename to src/base_OLD/BaseEvent.js diff --git a/src/base/Client.js b/src/base_OLD/Client.js similarity index 100% rename from src/base/Client.js rename to src/base_OLD/Client.js diff --git a/src/commands/Fun/8ball.js b/src/commands/Fun/8ball.js index 006d3b10..7600c06c 100644 --- a/src/commands/Fun/8ball.js +++ b/src/commands/Fun/8ball.js @@ -1,72 +1,8 @@ -const { SlashCommandBuilder, InteractionContextType, ApplicationIntegrationType } = require("discord.js"); -const BaseCommand = require("../../base/BaseCommand"); +export const data = { + name: "8ball", + description: "8ball", +}; -class Eightball extends BaseCommand { - /** - * - * @param {import("../base/Client")} client - */ - constructor(client) { - super({ - command: new SlashCommandBuilder() - .setName("8ball") - .setDescription(client.translate("fun/8ball:DESCRIPTION")) - .setDescriptionLocalizations({ - uk: client.translate("fun/8ball:DESCRIPTION", null, "uk-UA"), - ru: client.translate("fun/8ball:DESCRIPTION", null, "ru-RU"), - }) - .setIntegrationTypes([ApplicationIntegrationType.GuildInstall, ApplicationIntegrationType.UserInstall]) - .setContexts([InteractionContextType.BotDM, InteractionContextType.PrivateChannel, InteractionContextType.Guild]) - .addStringOption(option => - option - .setName("question") - .setDescription(client.translate("fun/8ball:QUESTION")) - .setDescriptionLocalizations({ - uk: client.translate("fun/8ball:QUESTION", null, "uk-UA"), - ru: client.translate("fun/8ball:QUESTION", null, "ru-RU"), - }) - .setRequired(true), - ) - .addBooleanOption(option => - option - .setName("ephemeral") - .setDescription(client.translate("misc:EPHEMERAL_RESPONSE")) - .setDescriptionLocalizations({ - uk: client.translate("misc:EPHEMERAL_RESPONSE", null, "uk-UA"), - ru: client.translate("misc:EPHEMERAL_RESPONSE", null, "ru-RU"), - }), - ), - dirname: __dirname, - ownerOnly: false, - }); - } - - /** - * - * @param {import("../../base/Client")} client - * @param {import("discord.js").ChatInputCommandInteraction} interaction - */ - async execute(client, interaction) { - await interaction.deferReply({ ephemeral: interaction.options.getBoolean("ephemeral") || false }); - - const question = interaction.options.getString("question"); - const embed = client.embed({ - fields: [ - { - name: interaction.translate("fun/8ball:QUESTION"), - value: question, - }, - { - name: interaction.translate("fun/8ball:ANSWER"), - value: interaction.translate(`fun/8ball:RESPONSE_${client.functions.randomNum(1, 20)}`), - }, - ], - }); - - await client.wait(5000); - - interaction.editReply({ embeds: [embed] }); - } -} - -module.exports = Eightball; +export const run = () => { + console.log("8ball"); +}; diff --git a/src/commands/Administration/addemoji.js b/src/commands_OLD/Administration/addemoji.js similarity index 100% rename from src/commands/Administration/addemoji.js rename to src/commands_OLD/Administration/addemoji.js diff --git a/src/commands/Administration/automod.js b/src/commands_OLD/Administration/automod.js similarity index 100% rename from src/commands/Administration/automod.js rename to src/commands_OLD/Administration/automod.js diff --git a/src/commands/Administration/autorole.js b/src/commands_OLD/Administration/autorole.js similarity index 100% rename from src/commands/Administration/autorole.js rename to src/commands_OLD/Administration/autorole.js diff --git a/src/commands/Administration/config.js b/src/commands_OLD/Administration/config.js similarity index 100% rename from src/commands/Administration/config.js rename to src/commands_OLD/Administration/config.js diff --git a/src/commands/Administration/goodbye.js b/src/commands_OLD/Administration/goodbye.js similarity index 100% rename from src/commands/Administration/goodbye.js rename to src/commands_OLD/Administration/goodbye.js diff --git a/src/commands/Administration/selectroles.js b/src/commands_OLD/Administration/selectroles.js similarity index 100% rename from src/commands/Administration/selectroles.js rename to src/commands_OLD/Administration/selectroles.js diff --git a/src/commands/Administration/set.js b/src/commands_OLD/Administration/set.js similarity index 100% rename from src/commands/Administration/set.js rename to src/commands_OLD/Administration/set.js diff --git a/src/commands/Administration/setlang.js b/src/commands_OLD/Administration/setlang.js similarity index 100% rename from src/commands/Administration/setlang.js rename to src/commands_OLD/Administration/setlang.js diff --git a/src/commands/Administration/stealemoji.js b/src/commands_OLD/Administration/stealemoji.js similarity index 100% rename from src/commands/Administration/stealemoji.js rename to src/commands_OLD/Administration/stealemoji.js diff --git a/src/commands/Administration/welcome.js b/src/commands_OLD/Administration/welcome.js similarity index 100% rename from src/commands/Administration/welcome.js rename to src/commands_OLD/Administration/welcome.js diff --git a/src/commands/Beatrun/courses.js b/src/commands_OLD/Beatrun/courses.js similarity index 100% rename from src/commands/Beatrun/courses.js rename to src/commands_OLD/Beatrun/courses.js diff --git a/src/commands/Economy/achievements.js b/src/commands_OLD/Economy/achievements.js similarity index 100% rename from src/commands/Economy/achievements.js rename to src/commands_OLD/Economy/achievements.js diff --git a/src/commands/Economy/bank.js b/src/commands_OLD/Economy/bank.js similarity index 100% rename from src/commands/Economy/bank.js rename to src/commands_OLD/Economy/bank.js diff --git a/src/commands/Economy/birthdate.js b/src/commands_OLD/Economy/birthdate.js similarity index 100% rename from src/commands/Economy/birthdate.js rename to src/commands_OLD/Economy/birthdate.js diff --git a/src/commands/Economy/divorce.js b/src/commands_OLD/Economy/divorce.js similarity index 100% rename from src/commands/Economy/divorce.js rename to src/commands_OLD/Economy/divorce.js diff --git a/src/commands/Economy/leaderboard.js b/src/commands_OLD/Economy/leaderboard.js similarity index 100% rename from src/commands/Economy/leaderboard.js rename to src/commands_OLD/Economy/leaderboard.js diff --git a/src/commands/Economy/marry.js b/src/commands_OLD/Economy/marry.js similarity index 100% rename from src/commands/Economy/marry.js rename to src/commands_OLD/Economy/marry.js diff --git a/src/commands/Economy/money.js b/src/commands_OLD/Economy/money.js similarity index 100% rename from src/commands/Economy/money.js rename to src/commands_OLD/Economy/money.js diff --git a/src/commands/Economy/pay.js b/src/commands_OLD/Economy/pay.js similarity index 100% rename from src/commands/Economy/pay.js rename to src/commands_OLD/Economy/pay.js diff --git a/src/commands/Economy/profile.js b/src/commands_OLD/Economy/profile.js similarity index 100% rename from src/commands/Economy/profile.js rename to src/commands_OLD/Economy/profile.js diff --git a/src/commands/Economy/rep.js b/src/commands_OLD/Economy/rep.js similarity index 100% rename from src/commands/Economy/rep.js rename to src/commands_OLD/Economy/rep.js diff --git a/src/commands/Economy/rob.js b/src/commands_OLD/Economy/rob.js similarity index 100% rename from src/commands/Economy/rob.js rename to src/commands_OLD/Economy/rob.js diff --git a/src/commands/Economy/setbio.js b/src/commands_OLD/Economy/setbio.js similarity index 100% rename from src/commands/Economy/setbio.js rename to src/commands_OLD/Economy/setbio.js diff --git a/src/commands/Economy/slots.js b/src/commands_OLD/Economy/slots.js similarity index 100% rename from src/commands/Economy/slots.js rename to src/commands_OLD/Economy/slots.js diff --git a/src/commands/Economy/transactions.js b/src/commands_OLD/Economy/transactions.js similarity index 100% rename from src/commands/Economy/transactions.js rename to src/commands_OLD/Economy/transactions.js diff --git a/src/commands/Economy/work.js b/src/commands_OLD/Economy/work.js similarity index 100% rename from src/commands/Economy/work.js rename to src/commands_OLD/Economy/work.js diff --git a/src/commands_OLD/Fun/8ball.js b/src/commands_OLD/Fun/8ball.js new file mode 100644 index 00000000..006d3b10 --- /dev/null +++ b/src/commands_OLD/Fun/8ball.js @@ -0,0 +1,72 @@ +const { SlashCommandBuilder, InteractionContextType, ApplicationIntegrationType } = require("discord.js"); +const BaseCommand = require("../../base/BaseCommand"); + +class Eightball extends BaseCommand { + /** + * + * @param {import("../base/Client")} client + */ + constructor(client) { + super({ + command: new SlashCommandBuilder() + .setName("8ball") + .setDescription(client.translate("fun/8ball:DESCRIPTION")) + .setDescriptionLocalizations({ + uk: client.translate("fun/8ball:DESCRIPTION", null, "uk-UA"), + ru: client.translate("fun/8ball:DESCRIPTION", null, "ru-RU"), + }) + .setIntegrationTypes([ApplicationIntegrationType.GuildInstall, ApplicationIntegrationType.UserInstall]) + .setContexts([InteractionContextType.BotDM, InteractionContextType.PrivateChannel, InteractionContextType.Guild]) + .addStringOption(option => + option + .setName("question") + .setDescription(client.translate("fun/8ball:QUESTION")) + .setDescriptionLocalizations({ + uk: client.translate("fun/8ball:QUESTION", null, "uk-UA"), + ru: client.translate("fun/8ball:QUESTION", null, "ru-RU"), + }) + .setRequired(true), + ) + .addBooleanOption(option => + option + .setName("ephemeral") + .setDescription(client.translate("misc:EPHEMERAL_RESPONSE")) + .setDescriptionLocalizations({ + uk: client.translate("misc:EPHEMERAL_RESPONSE", null, "uk-UA"), + ru: client.translate("misc:EPHEMERAL_RESPONSE", null, "ru-RU"), + }), + ), + dirname: __dirname, + ownerOnly: false, + }); + } + + /** + * + * @param {import("../../base/Client")} client + * @param {import("discord.js").ChatInputCommandInteraction} interaction + */ + async execute(client, interaction) { + await interaction.deferReply({ ephemeral: interaction.options.getBoolean("ephemeral") || false }); + + const question = interaction.options.getString("question"); + const embed = client.embed({ + fields: [ + { + name: interaction.translate("fun/8ball:QUESTION"), + value: question, + }, + { + name: interaction.translate("fun/8ball:ANSWER"), + value: interaction.translate(`fun/8ball:RESPONSE_${client.functions.randomNum(1, 20)}`), + }, + ], + }); + + await client.wait(5000); + + interaction.editReply({ embeds: [embed] }); + } +} + +module.exports = Eightball; diff --git a/src/commands/Fun/cat.js b/src/commands_OLD/Fun/cat.js similarity index 100% rename from src/commands/Fun/cat.js rename to src/commands_OLD/Fun/cat.js diff --git a/src/commands/Fun/dog.js b/src/commands_OLD/Fun/dog.js similarity index 100% rename from src/commands/Fun/dog.js rename to src/commands_OLD/Fun/dog.js diff --git a/src/commands/Fun/lmgtfy.js b/src/commands_OLD/Fun/lmgtfy.js similarity index 100% rename from src/commands/Fun/lmgtfy.js rename to src/commands_OLD/Fun/lmgtfy.js diff --git a/src/commands/Fun/lovecalc.js b/src/commands_OLD/Fun/lovecalc.js similarity index 100% rename from src/commands/Fun/lovecalc.js rename to src/commands_OLD/Fun/lovecalc.js diff --git a/src/commands/Fun/number.js b/src/commands_OLD/Fun/number.js similarity index 100% rename from src/commands/Fun/number.js rename to src/commands_OLD/Fun/number.js diff --git a/src/commands/Fun/tictactoe.js b/src/commands_OLD/Fun/tictactoe.js similarity index 100% rename from src/commands/Fun/tictactoe.js rename to src/commands_OLD/Fun/tictactoe.js diff --git a/src/commands/General/afk.js b/src/commands_OLD/General/afk.js similarity index 100% rename from src/commands/General/afk.js rename to src/commands_OLD/General/afk.js diff --git a/src/commands/General/avatar.c.js b/src/commands_OLD/General/avatar.c.js similarity index 100% rename from src/commands/General/avatar.c.js rename to src/commands_OLD/General/avatar.c.js diff --git a/src/commands/General/avatar.js b/src/commands_OLD/General/avatar.js similarity index 100% rename from src/commands/General/avatar.js rename to src/commands_OLD/General/avatar.js diff --git a/src/commands/General/boosters.js b/src/commands_OLD/General/boosters.js similarity index 100% rename from src/commands/General/boosters.js rename to src/commands_OLD/General/boosters.js diff --git a/src/commands/General/emoji.js b/src/commands_OLD/General/emoji.js similarity index 100% rename from src/commands/General/emoji.js rename to src/commands_OLD/General/emoji.js diff --git a/src/commands/General/help.js b/src/commands_OLD/General/help.js similarity index 100% rename from src/commands/General/help.js rename to src/commands_OLD/General/help.js diff --git a/src/commands/General/info.js b/src/commands_OLD/General/info.js similarity index 100% rename from src/commands/General/info.js rename to src/commands_OLD/General/info.js diff --git a/src/commands/General/minecraft.js b/src/commands_OLD/General/minecraft.js similarity index 100% rename from src/commands/General/minecraft.js rename to src/commands_OLD/General/minecraft.js diff --git a/src/commands/General/ping.js b/src/commands_OLD/General/ping.js similarity index 100% rename from src/commands/General/ping.js rename to src/commands_OLD/General/ping.js diff --git a/src/commands/General/remindme.js b/src/commands_OLD/General/remindme.js similarity index 100% rename from src/commands/General/remindme.js rename to src/commands_OLD/General/remindme.js diff --git a/src/commands/General/reminds.js b/src/commands_OLD/General/reminds.js similarity index 100% rename from src/commands/General/reminds.js rename to src/commands_OLD/General/reminds.js diff --git a/src/commands/General/report.js b/src/commands_OLD/General/report.js similarity index 100% rename from src/commands/General/report.js rename to src/commands_OLD/General/report.js diff --git a/src/commands/General/shorturl.js b/src/commands_OLD/General/shorturl.js similarity index 100% rename from src/commands/General/shorturl.js rename to src/commands_OLD/General/shorturl.js diff --git a/src/commands/General/stats.js b/src/commands_OLD/General/stats.js similarity index 100% rename from src/commands/General/stats.js rename to src/commands_OLD/General/stats.js diff --git a/src/commands/General/suggest.js b/src/commands_OLD/General/suggest.js similarity index 100% rename from src/commands/General/suggest.js rename to src/commands_OLD/General/suggest.js diff --git a/src/commands/General/whois.js b/src/commands_OLD/General/whois.js similarity index 100% rename from src/commands/General/whois.js rename to src/commands_OLD/General/whois.js diff --git a/src/commands/IAT/checkjar.js b/src/commands_OLD/IAT/checkjar.js similarity index 100% rename from src/commands/IAT/checkjar.js rename to src/commands_OLD/IAT/checkjar.js diff --git a/src/commands/Moderation/clear.js b/src/commands_OLD/Moderation/clear.js similarity index 100% rename from src/commands/Moderation/clear.js rename to src/commands_OLD/Moderation/clear.js diff --git a/src/commands/Moderation/clearwarns.js b/src/commands_OLD/Moderation/clearwarns.js similarity index 100% rename from src/commands/Moderation/clearwarns.js rename to src/commands_OLD/Moderation/clearwarns.js diff --git a/src/commands/Moderation/giveaway.js b/src/commands_OLD/Moderation/giveaway.js similarity index 100% rename from src/commands/Moderation/giveaway.js rename to src/commands_OLD/Moderation/giveaway.js diff --git a/src/commands/Moderation/unban.js b/src/commands_OLD/Moderation/unban.js similarity index 100% rename from src/commands/Moderation/unban.js rename to src/commands_OLD/Moderation/unban.js diff --git a/src/commands/Moderation/untimeout.js b/src/commands_OLD/Moderation/untimeout.js similarity index 100% rename from src/commands/Moderation/untimeout.js rename to src/commands_OLD/Moderation/untimeout.js diff --git a/src/commands/Moderation/warn.c.js b/src/commands_OLD/Moderation/warn.c.js similarity index 100% rename from src/commands/Moderation/warn.c.js rename to src/commands_OLD/Moderation/warn.c.js diff --git a/src/commands/Moderation/warns.js b/src/commands_OLD/Moderation/warns.js similarity index 100% rename from src/commands/Moderation/warns.js rename to src/commands_OLD/Moderation/warns.js diff --git a/src/commands/Music/back.js b/src/commands_OLD/Music/back.js similarity index 100% rename from src/commands/Music/back.js rename to src/commands_OLD/Music/back.js diff --git a/src/commands/Music/clips.js b/src/commands_OLD/Music/clips.js similarity index 100% rename from src/commands/Music/clips.js rename to src/commands_OLD/Music/clips.js diff --git a/src/commands/Music/loop.js b/src/commands_OLD/Music/loop.js similarity index 100% rename from src/commands/Music/loop.js rename to src/commands_OLD/Music/loop.js diff --git a/src/commands/Music/nowplaying.js b/src/commands_OLD/Music/nowplaying.js similarity index 100% rename from src/commands/Music/nowplaying.js rename to src/commands_OLD/Music/nowplaying.js diff --git a/src/commands/Music/play.c.js b/src/commands_OLD/Music/play.c.js similarity index 100% rename from src/commands/Music/play.c.js rename to src/commands_OLD/Music/play.c.js diff --git a/src/commands/Music/play.js b/src/commands_OLD/Music/play.js similarity index 100% rename from src/commands/Music/play.js rename to src/commands_OLD/Music/play.js diff --git a/src/commands/Music/queue.js b/src/commands_OLD/Music/queue.js similarity index 100% rename from src/commands/Music/queue.js rename to src/commands_OLD/Music/queue.js diff --git a/src/commands/Music/seek.js b/src/commands_OLD/Music/seek.js similarity index 100% rename from src/commands/Music/seek.js rename to src/commands_OLD/Music/seek.js diff --git a/src/commands/Music/shuffle.js b/src/commands_OLD/Music/shuffle.js similarity index 100% rename from src/commands/Music/shuffle.js rename to src/commands_OLD/Music/shuffle.js diff --git a/src/commands/Music/skip.js b/src/commands_OLD/Music/skip.js similarity index 100% rename from src/commands/Music/skip.js rename to src/commands_OLD/Music/skip.js diff --git a/src/commands/Music/stop.js b/src/commands_OLD/Music/stop.js similarity index 100% rename from src/commands/Music/stop.js rename to src/commands_OLD/Music/stop.js diff --git a/src/commands/Music/volume.js b/src/commands_OLD/Music/volume.js similarity index 100% rename from src/commands/Music/volume.js rename to src/commands_OLD/Music/volume.js diff --git a/src/commands/Owner/debug.js b/src/commands_OLD/Owner/debug.js similarity index 100% rename from src/commands/Owner/debug.js rename to src/commands_OLD/Owner/debug.js diff --git a/src/commands/Owner/eval.js b/src/commands_OLD/Owner/eval.js similarity index 100% rename from src/commands/Owner/eval.js rename to src/commands_OLD/Owner/eval.js diff --git a/src/commands/Owner/reload.js b/src/commands_OLD/Owner/reload.js similarity index 100% rename from src/commands/Owner/reload.js rename to src/commands_OLD/Owner/reload.js diff --git a/src/commands/Owner/say.js b/src/commands_OLD/Owner/say.js similarity index 100% rename from src/commands/Owner/say.js rename to src/commands_OLD/Owner/say.js diff --git a/src/commands/Owner/servers.js b/src/commands_OLD/Owner/servers.js similarity index 100% rename from src/commands/Owner/servers.js rename to src/commands_OLD/Owner/servers.js diff --git a/src/commands/Tickets/adduser.js b/src/commands_OLD/Tickets/adduser.js similarity index 100% rename from src/commands/Tickets/adduser.js rename to src/commands_OLD/Tickets/adduser.js diff --git a/src/commands/Tickets/closeticket.js b/src/commands_OLD/Tickets/closeticket.js similarity index 100% rename from src/commands/Tickets/closeticket.js rename to src/commands_OLD/Tickets/closeticket.js diff --git a/src/commands/Tickets/createticketembed.js b/src/commands_OLD/Tickets/createticketembed.js similarity index 100% rename from src/commands/Tickets/createticketembed.js rename to src/commands_OLD/Tickets/createticketembed.js diff --git a/src/commands/Tickets/removeuser.js b/src/commands_OLD/Tickets/removeuser.js similarity index 100% rename from src/commands/Tickets/removeuser.js rename to src/commands_OLD/Tickets/removeuser.js diff --git a/src/events/Ready.js b/src/events/Ready.js index af7fe3cb..474bc760 100644 --- a/src/events/Ready.js +++ b/src/events/Ready.js @@ -1,64 +1,14 @@ -import { ActivityType } from "discord.js"; -import BaseEvent from "../base/BaseEvent"; +import logger from "../helpers/logger.js"; -class Ready extends BaseEvent { - constructor() { - super({ - name: "ready", - once: false, - }); - } +export const data = { + name: "ready", + once: true, +}; - /** - * - * @param {import("../base/Client")} client - */ - async execute(client) { - const commands = [...new Map(client.commands.map(v => [v.constructor.name, v])).values()]; - let servers = client.guilds.cache.size; - let users = 0; - - client.guilds.cache.forEach(g => { - users += g.memberCount; - }); - - const birthdays = require("../helpers/birthdays"); - birthdays.init(client); - - const checkReminds = require("../helpers/checkReminds"); - checkReminds.init(client); - - client.logger.ready(`Loaded a total of ${commands.length} command(s).`); - client.logger.ready(`${client.user.getUsername()}, ready to serve ${users} members in ${servers} servers.`); - console.timeEnd("botReady"); - - const version = require("../package.json").version; - const status = [ - `${commands.length} ${client.functions.getNoun(commands.length, client.translate("misc:NOUNS:COMMANDS:1"), client.translate("misc:NOUNS:COMMANDS:2"), client.translate("misc:NOUNS:COMMANDS:5"))} available!`, - `I'm in ${servers} ${client.functions.getNoun(servers, client.translate("misc:NOUNS:SERVER:1"), client.translate("misc:NOUNS:SERVER:2"), client.translate("misc:NOUNS:SERVER:5"))}!`, - `Cached ${users} ${client.functions.getNoun(users, client.translate("misc:NOUNS:USERS:1"), client.translate("misc:NOUNS:USERS:2"), client.translate("misc:NOUNS:USERS:5"))}.`, - "Use /help for commands list!", - "Did you know that I have a brother called JaBa IT? Yeah! Ask Jonny about him.", - ]; - - let i = 0; - setInterval(async () => { - servers = (await client.guilds.fetch()).size; - users = 0; - - client.guilds.cache.forEach(g => { - users += g.memberCount; - }); - - client.user.setActivity({ - type: ActivityType.Custom, - name: "custom", - state: `${status[i]} | v${version}`, - }); - - i = (i + 1) % status.length; // Wrap around to the start when reaching the end - }, 30 * 1000); // Every 30 seconds - } +/** + * + * @param {import("../structures/client.js").ExtendedClient} client + */ +export async function run(client) { + logger.ready(client.user.tag + " is online!"); } - -export default Ready; diff --git a/src/events/CommandHandler.js b/src/events_OLD/CommandHandler.js similarity index 100% rename from src/events/CommandHandler.js rename to src/events_OLD/CommandHandler.js diff --git a/src/events/Guild/guildBanAdd.js b/src/events_OLD/Guild/guildBanAdd.js similarity index 100% rename from src/events/Guild/guildBanAdd.js rename to src/events_OLD/Guild/guildBanAdd.js diff --git a/src/events/Guild/guildCreate.js b/src/events_OLD/Guild/guildCreate.js similarity index 100% rename from src/events/Guild/guildCreate.js rename to src/events_OLD/Guild/guildCreate.js diff --git a/src/events/Guild/guildDelete.js b/src/events_OLD/Guild/guildDelete.js similarity index 100% rename from src/events/Guild/guildDelete.js rename to src/events_OLD/Guild/guildDelete.js diff --git a/src/events/Guild/guildMemberAdd.js b/src/events_OLD/Guild/guildMemberAdd.js similarity index 100% rename from src/events/Guild/guildMemberAdd.js rename to src/events_OLD/Guild/guildMemberAdd.js diff --git a/src/events/Guild/guildMemberRemove.js b/src/events_OLD/Guild/guildMemberRemove.js similarity index 100% rename from src/events/Guild/guildMemberRemove.js rename to src/events_OLD/Guild/guildMemberRemove.js diff --git a/src/events/Guild/guildMemberUpdate.js b/src/events_OLD/Guild/guildMemberUpdate.js similarity index 100% rename from src/events/Guild/guildMemberUpdate.js rename to src/events_OLD/Guild/guildMemberUpdate.js diff --git a/src/events/MessageHandler.js b/src/events_OLD/MessageHandler.js similarity index 100% rename from src/events/MessageHandler.js rename to src/events_OLD/MessageHandler.js diff --git a/src/events/Monitoring/messageDelete.js b/src/events_OLD/Monitoring/messageDelete.js similarity index 100% rename from src/events/Monitoring/messageDelete.js rename to src/events_OLD/Monitoring/messageDelete.js diff --git a/src/events/Monitoring/messageUpdate.js b/src/events_OLD/Monitoring/messageUpdate.js similarity index 100% rename from src/events/Monitoring/messageUpdate.js rename to src/events_OLD/Monitoring/messageUpdate.js diff --git a/src/events_OLD/Ready.js b/src/events_OLD/Ready.js new file mode 100644 index 00000000..af7fe3cb --- /dev/null +++ b/src/events_OLD/Ready.js @@ -0,0 +1,64 @@ +import { ActivityType } from "discord.js"; +import BaseEvent from "../base/BaseEvent"; + +class Ready extends BaseEvent { + constructor() { + super({ + name: "ready", + once: false, + }); + } + + /** + * + * @param {import("../base/Client")} client + */ + async execute(client) { + const commands = [...new Map(client.commands.map(v => [v.constructor.name, v])).values()]; + let servers = client.guilds.cache.size; + let users = 0; + + client.guilds.cache.forEach(g => { + users += g.memberCount; + }); + + const birthdays = require("../helpers/birthdays"); + birthdays.init(client); + + const checkReminds = require("../helpers/checkReminds"); + checkReminds.init(client); + + client.logger.ready(`Loaded a total of ${commands.length} command(s).`); + client.logger.ready(`${client.user.getUsername()}, ready to serve ${users} members in ${servers} servers.`); + console.timeEnd("botReady"); + + const version = require("../package.json").version; + const status = [ + `${commands.length} ${client.functions.getNoun(commands.length, client.translate("misc:NOUNS:COMMANDS:1"), client.translate("misc:NOUNS:COMMANDS:2"), client.translate("misc:NOUNS:COMMANDS:5"))} available!`, + `I'm in ${servers} ${client.functions.getNoun(servers, client.translate("misc:NOUNS:SERVER:1"), client.translate("misc:NOUNS:SERVER:2"), client.translate("misc:NOUNS:SERVER:5"))}!`, + `Cached ${users} ${client.functions.getNoun(users, client.translate("misc:NOUNS:USERS:1"), client.translate("misc:NOUNS:USERS:2"), client.translate("misc:NOUNS:USERS:5"))}.`, + "Use /help for commands list!", + "Did you know that I have a brother called JaBa IT? Yeah! Ask Jonny about him.", + ]; + + let i = 0; + setInterval(async () => { + servers = (await client.guilds.fetch()).size; + users = 0; + + client.guilds.cache.forEach(g => { + users += g.memberCount; + }); + + client.user.setActivity({ + type: ActivityType.Custom, + name: "custom", + state: `${status[i]} | v${version}`, + }); + + i = (i + 1) % status.length; // Wrap around to the start when reaching the end + }, 30 * 1000); // Every 30 seconds + } +} + +export default Ready; diff --git a/src/events/TicketsButton.js b/src/events_OLD/TicketsButton.js similarity index 100% rename from src/events/TicketsButton.js rename to src/events_OLD/TicketsButton.js diff --git a/src/newCommands/Fun/8ball.js b/src/newCommands/Fun/8ball.js deleted file mode 100644 index 7600c06c..00000000 --- a/src/newCommands/Fun/8ball.js +++ /dev/null @@ -1,8 +0,0 @@ -export const data = { - name: "8ball", - description: "8ball", -}; - -export const run = () => { - console.log("8ball"); -}; diff --git a/src/newEvents/ready.js b/src/newEvents/ready.js deleted file mode 100644 index 0f698b5d..00000000 --- a/src/newEvents/ready.js +++ /dev/null @@ -1,14 +0,0 @@ -import logger from "../helpers/logger.js"; - -export const data = { - name: "ready", - once: true, -}; - -/** - * - * @param {import("../base/Client.JaBaClient")} client - */ -export async function run(client) { - logger.log(client.user.tag + " is online!"); -}