From 94ae967201fb09e29a11c0e484f8bd32a4697b43 Mon Sep 17 00:00:00 2001 From: Skylar Grant Date: Sun, 9 Apr 2023 12:20:17 -0400 Subject: [PATCH] Who knows anymore --- Dockerfile | 6 +++--- .../_slashCommands}/commands.js | 0 {slash-commands => src/_slashCommands}/help.js | 0 {slash-commands => src/_slashCommands}/list.js | 0 {slash-commands => src/_slashCommands}/template | 0 {data => src/data}/config.json | 0 {data => src/data}/input.txt | 0 {data => src/data}/strings.json | 0 main.js => src/main.js | 0 {modules => src/modules}/CustomClasses.js | 0 {modules => src/modules}/_clearGlobal.js | 0 {modules => src/modules}/_deployGlobal.js | 0 {modules => src/modules}/_prepareStrings.js | 0 {modules => src/modules}/dbutils.js | 0 {modules => src/modules}/functions.js | 16 ++++++++++++++-- package.json => src/package.json | 0 16 files changed, 17 insertions(+), 5 deletions(-) rename {slash-commands => src/_slashCommands}/commands.js (100%) rename {slash-commands => src/_slashCommands}/help.js (100%) rename {slash-commands => src/_slashCommands}/list.js (100%) rename {slash-commands => src/_slashCommands}/template (100%) rename {data => src/data}/config.json (100%) rename {data => src/data}/input.txt (100%) rename {data => src/data}/strings.json (100%) rename main.js => src/main.js (100%) rename {modules => src/modules}/CustomClasses.js (100%) rename {modules => src/modules}/_clearGlobal.js (100%) rename {modules => src/modules}/_deployGlobal.js (100%) rename {modules => src/modules}/_prepareStrings.js (100%) rename {modules => src/modules}/dbutils.js (100%) rename {modules => src/modules}/functions.js (74%) rename package.json => src/package.json (100%) diff --git a/Dockerfile b/Dockerfile index a0b785a..ffc7cf8 100755 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,8 @@ -FROM node:16 +FROM node:18 RUN mkdir -p /usr/src/app WORKDIR /usr/src/app -COPY package.json ./ +COPY src/package.json ./ RUN npm install -COPY . . +COPY ./src . CMD [ "node", "main.js" ] \ No newline at end of file diff --git a/slash-commands/commands.js b/src/_slashCommands/commands.js similarity index 100% rename from slash-commands/commands.js rename to src/_slashCommands/commands.js diff --git a/slash-commands/help.js b/src/_slashCommands/help.js similarity index 100% rename from slash-commands/help.js rename to src/_slashCommands/help.js diff --git a/slash-commands/list.js b/src/_slashCommands/list.js similarity index 100% rename from slash-commands/list.js rename to src/_slashCommands/list.js diff --git a/slash-commands/template b/src/_slashCommands/template similarity index 100% rename from slash-commands/template rename to src/_slashCommands/template diff --git a/data/config.json b/src/data/config.json similarity index 100% rename from data/config.json rename to src/data/config.json diff --git a/data/input.txt b/src/data/input.txt similarity index 100% rename from data/input.txt rename to src/data/input.txt diff --git a/data/strings.json b/src/data/strings.json similarity index 100% rename from data/strings.json rename to src/data/strings.json diff --git a/main.js b/src/main.js similarity index 100% rename from main.js rename to src/main.js diff --git a/modules/CustomClasses.js b/src/modules/CustomClasses.js similarity index 100% rename from modules/CustomClasses.js rename to src/modules/CustomClasses.js diff --git a/modules/_clearGlobal.js b/src/modules/_clearGlobal.js similarity index 100% rename from modules/_clearGlobal.js rename to src/modules/_clearGlobal.js diff --git a/modules/_deployGlobal.js b/src/modules/_deployGlobal.js similarity index 100% rename from modules/_deployGlobal.js rename to src/modules/_deployGlobal.js diff --git a/modules/_prepareStrings.js b/src/modules/_prepareStrings.js similarity index 100% rename from modules/_prepareStrings.js rename to src/modules/_prepareStrings.js diff --git a/modules/dbutils.js b/src/modules/dbutils.js similarity index 100% rename from modules/dbutils.js rename to src/modules/dbutils.js diff --git a/modules/functions.js b/src/modules/functions.js similarity index 74% rename from modules/functions.js rename to src/modules/functions.js index 2e0ab4d..73c3cc9 100755 --- a/modules/functions.js +++ b/src/modules/functions.js @@ -12,22 +12,34 @@ const { EmbedBuilder, ActionRowBuilder, ButtonBuilder, ButtonStyle } = Discord; const debugMode = process.env.DEBUG; const config = require('../data/config.json'); const strings = require('../data/strings.json'); -const slashCommandFiles = fs.readdirSync('./slash-commands/').filter(file => file.endsWith('.js')); const functions = { // Functions for managing and creating Collections collectionBuilders: { // Create the collection of slash commands slashCommands(client) { + const slashCommandFiles = fs.readdirSync('./_slashCommands/').filter(file => (file.endsWith(".js") && !file.startsWith("_"))); if (!client.slashCommands) client.slashCommands = new Discord.Collection(); client.slashCommands.clear(); for (const file of slashCommandFiles) { - const slashCommand = require(`../slash-commands/${file}`); + const slashCommand = require(`../_slashCommands/${file}`); if (slashCommand.data != undefined) { client.slashCommands.set(slashCommand.data.name, slashCommand); } } if (debugMode) console.log('Slash Commands Collection Built'); + }, + dotCommands(client) { + const dotCommandFiles = fs.readdirSync('./_dotCommands/').filter(file => (file.endsWith(".js") && !file.startsWith("_"))); + if (!client.dotCommands) client.dotCommands = new Discord.Collection(); + client.dotCommands.clear(); + for (const file of dotCommandFiles) { + const dotCommand = require(`../_dotCommands/${file}`); + if (dotCommand.data != undefined) { + client.dotCommands.set(dotCommand.data.name, dotCommand); + } + } + if (debugMode) console.log('Slash Commands Collection Built'); } }, builders: { diff --git a/package.json b/src/package.json similarity index 100% rename from package.json rename to src/package.json