Confusion

This commit is contained in:
Skylar Grant 2023-02-19 14:13:03 -05:00
parent 15d78e6650
commit dfef35dd95
34 changed files with 25 additions and 18 deletions

BIN
.DS_Store vendored Normal file → Executable file

Binary file not shown.

0
.dockerignore Normal file → Executable file
View File

0
.eslintrc.json Normal file → Executable file
View File

0
.github/workflows/docker-image-dev.yml vendored Normal file → Executable file
View File

0
.github/workflows/docker-image-new.yml vendored Normal file → Executable file
View File

0
.gitignore vendored Normal file → Executable file
View File

2
Dockerfile Normal file → Executable file
View File

@ -5,4 +5,4 @@ WORKDIR /usr/src/app
COPY package.json ./ COPY package.json ./
RUN npm install RUN npm install
COPY . . COPY . .
CMD [ "node", "main.js" ] CMD ["/bin/sh", "-c", "node main.js 2> /logs/error.log 1> /logs/silvanus.log"]

0
README.md Normal file → Executable file
View File

0
TODO.md Normal file → Executable file
View File

0
data/config.json Normal file → Executable file
View File

0
data/strings.json Normal file → Executable file
View File

0
main.js Normal file → Executable file
View File

23
modules/CustomClasses.js Normal file → Executable file
View File

@ -54,9 +54,9 @@ module.exports = {
this.watchChannelId = watchChannelId; this.watchChannelId = watchChannelId;
return this; return this;
} }
setRoles(waterRoleId, fruitRoleId) { setRoles(waterRole, fruitRole) {
this.waterRoleId = waterRoleId; this.waterRoleId = waterRole.id;
if (fruitRoleId) this.fruitRoleId = fruitRoleId; if (fruitRole) this.fruitRoleId = fruitRole.id;
return this; return this;
} }
queryBuilder(query) { queryBuilder(query) {
@ -127,11 +127,18 @@ module.exports = {
return queryParts.join(''); return queryParts.join('');
break; break;
case "setRoles": case "setRoles":
queryParts = [ if (this.fruitRoleId != "") {
`UPDATE guild_info SET water_role_id = ${db.escape(this.waterRoleId)}, `, queryParts = [
`fruit_role_id = ${db.escape(this.fruitRoleId)} `, `UPDATE guild_info SET water_role_id = ${db.escape(this.waterRoleId)}, `,
`WHERE guild_id = ${db.escape(this.guildId)}` `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(''); return queryParts.join('');
break; break;
default: default:

0
modules/_clear-commands.js Normal file → Executable file
View File

0
modules/_deploy-commands.js Normal file → Executable file
View File

0
modules/_deploy-global.js Normal file → Executable file
View File

0
modules/_prepareStrings.js Normal file → Executable file
View File

0
modules/dbfn.js Normal file → Executable file
View File

16
modules/functions.js Normal file → Executable file
View File

@ -70,12 +70,12 @@ const functions = {
); );
return refreshActionRow; return refreshActionRow;
}, },
treeRoleMenu() { treeRoleMenu(fruit) {
return new ActionRowBuilder() let actionRow = new ActionRowBuilder().addComponents(this.buttons.waterPing());
.addComponents( if (fruit) {
this.buttons.waterPing(), actionRow.addComponents(this.buttons.fruitPing());
this.buttons.fruitPing() }
); return actionRow;
}, },
buttons: { buttons: {
acceptRules() { acceptRules() {
@ -100,10 +100,10 @@ const functions = {
}, },
embeds: { embeds: {
treeRoleMenu(guildInfo) { treeRoleMenu(guildInfo) {
const actionRow = functions.builders.actionRows.treeRoleMenu(); const actionRow = functions.builders.actionRows.treeRoleMenu(guildInfo.fruitRoleId == "" ? false : true);
let tempStrings = strings.embeds.treeRoleMenu; let tempStrings = strings.embeds.treeRoleMenu;
let description = tempStrings[0] + tempStrings[1] + `<@&${guildInfo.waterRoleId}>` + tempStrings[2]; let description = tempStrings[0] + tempStrings[1] + `<@&${guildInfo.waterRoleId}>` + tempStrings[2];
if (guildInfo.fruitRoleId != undefined) { if (guildInfo.fruitRoleId != "") {
description += tempStrings[3] + `<@&${guildInfo.fruitRoleId}>` + tempStrings[4]; description += tempStrings[3] + `<@&${guildInfo.fruitRoleId}>` + tempStrings[4];
} }
const embed = new EmbedBuilder() const embed = new EmbedBuilder()

0
modules/testing.js Normal file → Executable file
View File

0
package.json Normal file → Executable file
View File

0
slash-commands/.DS_Store vendored Normal file → Executable file
View File

0
slash-commands/commands.js Normal file → Executable file
View File

0
slash-commands/compare.js Normal file → Executable file
View File

0
slash-commands/help.js Normal file → Executable file
View File

0
slash-commands/notifications.js Normal file → Executable file
View File

0
slash-commands/optout.js Normal file → Executable file
View File

0
slash-commands/reset.js Normal file → Executable file
View File

2
slash-commands/rolemenu.js Normal file → Executable file
View File

@ -19,7 +19,7 @@ module.exports = {
await interaction.deferReply().catch(err => console.error(err)); await interaction.deferReply().catch(err => console.error(err));
if (interaction.client.guildInfos.has(interaction.guildId)) { if (interaction.client.guildInfos.has(interaction.guildId)) {
let guildInfo = interaction.client.guildInfos.get(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 dbfn.setGuildInfo(guildInfo.queryBuilder("setRoles"));
await fn.collectionBuilders.guildInfos(interaction.client); await fn.collectionBuilders.guildInfos(interaction.client);
await interaction.editReply(fn.builders.embeds.treeRoleMenu(guildInfo)).catch(err => console.error(err)); await interaction.editReply(fn.builders.embeds.treeRoleMenu(guildInfo)).catch(err => console.error(err));

0
slash-commands/setup.js Normal file → Executable file
View File

0
slash-commands/setupinfo.js Normal file → Executable file
View File

0
slash-commands/template Normal file → Executable file
View File

0
slash-commands/timetoheight.js Normal file → Executable file
View File

0
slash-commands/watertime.js Normal file → Executable file
View File