From dfef35dd955d4e1f3a0a550cc0f09e21b4ae6532 Mon Sep 17 00:00:00 2001 From: Skylar Grant Date: Sun, 19 Feb 2023 14:13:03 -0500 Subject: [PATCH] Confusion --- .DS_Store | Bin 6148 -> 6148 bytes .dockerignore | 0 .eslintrc.json | 0 .github/workflows/docker-image-dev.yml | 0 .github/workflows/docker-image-new.yml | 0 .gitignore | 0 Dockerfile | 2 +- README.md | 0 TODO.md | 0 data/config.json | 0 data/strings.json | 0 main.js | 0 modules/CustomClasses.js | 23 +++++++++++++++-------- modules/_clear-commands.js | 0 modules/_deploy-commands.js | 0 modules/_deploy-global.js | 0 modules/_prepareStrings.js | 0 modules/dbfn.js | 0 modules/functions.js | 16 ++++++++-------- modules/testing.js | 0 package.json | 0 slash-commands/.DS_Store | Bin slash-commands/commands.js | 0 slash-commands/compare.js | 0 slash-commands/help.js | 0 slash-commands/notifications.js | 0 slash-commands/optout.js | 0 slash-commands/reset.js | 0 slash-commands/rolemenu.js | 2 +- slash-commands/setup.js | 0 slash-commands/setupinfo.js | 0 slash-commands/template | 0 slash-commands/timetoheight.js | 0 slash-commands/watertime.js | 0 34 files changed, 25 insertions(+), 18 deletions(-) mode change 100644 => 100755 .DS_Store mode change 100644 => 100755 .dockerignore mode change 100644 => 100755 .eslintrc.json mode change 100644 => 100755 .github/workflows/docker-image-dev.yml mode change 100644 => 100755 .github/workflows/docker-image-new.yml mode change 100644 => 100755 .gitignore mode change 100644 => 100755 Dockerfile mode change 100644 => 100755 README.md mode change 100644 => 100755 TODO.md mode change 100644 => 100755 data/config.json mode change 100644 => 100755 data/strings.json mode change 100644 => 100755 main.js mode change 100644 => 100755 modules/CustomClasses.js mode change 100644 => 100755 modules/_clear-commands.js mode change 100644 => 100755 modules/_deploy-commands.js mode change 100644 => 100755 modules/_deploy-global.js mode change 100644 => 100755 modules/_prepareStrings.js mode change 100644 => 100755 modules/dbfn.js mode change 100644 => 100755 modules/functions.js mode change 100644 => 100755 modules/testing.js mode change 100644 => 100755 package.json mode change 100644 => 100755 slash-commands/.DS_Store mode change 100644 => 100755 slash-commands/commands.js mode change 100644 => 100755 slash-commands/compare.js mode change 100644 => 100755 slash-commands/help.js mode change 100644 => 100755 slash-commands/notifications.js mode change 100644 => 100755 slash-commands/optout.js mode change 100644 => 100755 slash-commands/reset.js mode change 100644 => 100755 slash-commands/rolemenu.js mode change 100644 => 100755 slash-commands/setup.js mode change 100644 => 100755 slash-commands/setupinfo.js mode change 100644 => 100755 slash-commands/template mode change 100644 => 100755 slash-commands/timetoheight.js mode change 100644 => 100755 slash-commands/watertime.js diff --git a/.DS_Store b/.DS_Store old mode 100644 new mode 100755 index 3eeca27b58624472d7e02ec43c9755997cfea4ca..5d17b2d520839049eec33588e76e7a8e8d2ce96f GIT binary patch literal 6148 zcmeHKOHRWu5PdF{`T?P`V}q0nP>CCaDqXNZm4E{@O-d=G4We|PJ$K*=91-5wR@J1b z#0nvpk?iM;=Z(iNQXB&?gLQfV^Z>Nk1REW8H74`YcC6t&U80d3S6QA+vV6j4NvQVw z6_9t=M2Z-%h%4{!l5_n}Yjz`DM97ig2~)h_9&==vRyZFOP74d>o@0qV9lRVG39$L7=h((R+N-`qfc3NSm zsRF9NKUIKdwpjbnq4uhPDxeB%6p-&jz$O@aEF9WT2RnNOAU5f?#5*^j}D~9nm2jl3R4}E;$(9vP+%FN?eHvWcU{KdlrHXJ5&sJ$wn3X~N%aF0DX z|A+hU|7DUssRF9NpHjdyquXe}E%~!`XLEAa25e(CF^MZ2ZYUhsqnNRB6rZwLqd$-V VG4xnCq=%+I0#*j?RDmB=;0upnk&XZW delta 96 zcmZoMXfc=|#>CJzu~2NHo}wrt0|NsP3otNbFz7NQGvqVmGUQGyRA*$IT)?a_`3y79 vW>F3ymdyezw#=K^Iruq%S~oMYd}p4_FQUr{(tQAk87ABCNN /logs/error.log 1> /logs/silvanus.log"] \ No newline at end of file diff --git a/README.md b/README.md old mode 100644 new mode 100755 diff --git a/TODO.md b/TODO.md old mode 100644 new mode 100755 diff --git a/data/config.json b/data/config.json old mode 100644 new mode 100755 diff --git a/data/strings.json b/data/strings.json old mode 100644 new mode 100755 diff --git a/main.js b/main.js old mode 100644 new mode 100755 diff --git a/modules/CustomClasses.js b/modules/CustomClasses.js old mode 100644 new mode 100755 index ff7d714..17abb1d --- a/modules/CustomClasses.js +++ b/modules/CustomClasses.js @@ -54,9 +54,9 @@ module.exports = { this.watchChannelId = watchChannelId; return this; } - setRoles(waterRoleId, fruitRoleId) { - this.waterRoleId = waterRoleId; - if (fruitRoleId) this.fruitRoleId = fruitRoleId; + setRoles(waterRole, fruitRole) { + this.waterRoleId = waterRole.id; + if (fruitRole) this.fruitRoleId = fruitRole.id; return this; } queryBuilder(query) { @@ -127,11 +127,18 @@ module.exports = { return queryParts.join(''); break; case "setRoles": - queryParts = [ - `UPDATE guild_info SET water_role_id = ${db.escape(this.waterRoleId)}, `, - `fruit_role_id = ${db.escape(this.fruitRoleId)} `, - `WHERE guild_id = ${db.escape(this.guildId)}` - ]; + if (this.fruitRoleId != "") { + queryParts = [ + `UPDATE guild_info SET water_role_id = ${db.escape(this.waterRoleId)}, `, + `fruit_role_id = ${db.escape(this.fruitRoleId)} `, + `WHERE guild_id = ${db.escape(this.guildId)}` + ]; + } else { + queryParts = [ + `UPDATE guild_info SET water_role_id = ${db.escape(this.waterRoleId)} `, + `WHERE guild_id = ${db.escape(this.guildId)}` + ]; + } return queryParts.join(''); break; default: diff --git a/modules/_clear-commands.js b/modules/_clear-commands.js old mode 100644 new mode 100755 diff --git a/modules/_deploy-commands.js b/modules/_deploy-commands.js old mode 100644 new mode 100755 diff --git a/modules/_deploy-global.js b/modules/_deploy-global.js old mode 100644 new mode 100755 diff --git a/modules/_prepareStrings.js b/modules/_prepareStrings.js old mode 100644 new mode 100755 diff --git a/modules/dbfn.js b/modules/dbfn.js old mode 100644 new mode 100755 diff --git a/modules/functions.js b/modules/functions.js old mode 100644 new mode 100755 index ef1f18d..4079141 --- a/modules/functions.js +++ b/modules/functions.js @@ -70,12 +70,12 @@ const functions = { ); return refreshActionRow; }, - treeRoleMenu() { - return new ActionRowBuilder() - .addComponents( - this.buttons.waterPing(), - this.buttons.fruitPing() - ); + treeRoleMenu(fruit) { + let actionRow = new ActionRowBuilder().addComponents(this.buttons.waterPing()); + if (fruit) { + actionRow.addComponents(this.buttons.fruitPing()); + } + return actionRow; }, buttons: { acceptRules() { @@ -100,10 +100,10 @@ const functions = { }, embeds: { treeRoleMenu(guildInfo) { - const actionRow = functions.builders.actionRows.treeRoleMenu(); + const actionRow = functions.builders.actionRows.treeRoleMenu(guildInfo.fruitRoleId == "" ? false : true); let tempStrings = strings.embeds.treeRoleMenu; let description = tempStrings[0] + tempStrings[1] + `<@&${guildInfo.waterRoleId}>` + tempStrings[2]; - if (guildInfo.fruitRoleId != undefined) { + if (guildInfo.fruitRoleId != "") { description += tempStrings[3] + `<@&${guildInfo.fruitRoleId}>` + tempStrings[4]; } const embed = new EmbedBuilder() diff --git a/modules/testing.js b/modules/testing.js old mode 100644 new mode 100755 diff --git a/package.json b/package.json old mode 100644 new mode 100755 diff --git a/slash-commands/.DS_Store b/slash-commands/.DS_Store old mode 100644 new mode 100755 diff --git a/slash-commands/commands.js b/slash-commands/commands.js old mode 100644 new mode 100755 diff --git a/slash-commands/compare.js b/slash-commands/compare.js old mode 100644 new mode 100755 diff --git a/slash-commands/help.js b/slash-commands/help.js old mode 100644 new mode 100755 diff --git a/slash-commands/notifications.js b/slash-commands/notifications.js old mode 100644 new mode 100755 diff --git a/slash-commands/optout.js b/slash-commands/optout.js old mode 100644 new mode 100755 diff --git a/slash-commands/reset.js b/slash-commands/reset.js old mode 100644 new mode 100755 diff --git a/slash-commands/rolemenu.js b/slash-commands/rolemenu.js old mode 100644 new mode 100755 index 4fe096d..d10f7c3 --- a/slash-commands/rolemenu.js +++ b/slash-commands/rolemenu.js @@ -19,7 +19,7 @@ module.exports = { await interaction.deferReply().catch(err => console.error(err)); if (interaction.client.guildInfos.has(interaction.guildId)) { let guildInfo = interaction.client.guildInfos.get(interaction.guildId); - guildInfo.setRoles(interaction.options.getRole('waterrole').id, interaction.options.getRole('fruitrole').id); + guildInfo.setRoles(interaction.options.getRole('waterrole'), interaction.options.getRole('fruitrole')); await dbfn.setGuildInfo(guildInfo.queryBuilder("setRoles")); await fn.collectionBuilders.guildInfos(interaction.client); await interaction.editReply(fn.builders.embeds.treeRoleMenu(guildInfo)).catch(err => console.error(err)); diff --git a/slash-commands/setup.js b/slash-commands/setup.js old mode 100644 new mode 100755 diff --git a/slash-commands/setupinfo.js b/slash-commands/setupinfo.js old mode 100644 new mode 100755 diff --git a/slash-commands/template b/slash-commands/template old mode 100644 new mode 100755 diff --git a/slash-commands/timetoheight.js b/slash-commands/timetoheight.js old mode 100644 new mode 100755 diff --git a/slash-commands/watertime.js b/slash-commands/watertime.js old mode 100644 new mode 100755