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 ./
RUN npm install
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

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

@ -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":
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:

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;
},
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()

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));
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));

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