From 3fd33b2dc930d4fc95b8d8af46286a156b3ab86a Mon Sep 17 00:00:00 2001 From: vKxni Date: Sun, 27 Feb 2022 10:57:04 +0100 Subject: [PATCH] fixed welcome not adding role --- package-lock.json | 4 ++-- src/commands/Setup/Welcome/managewelcome.js | 6 ++++-- src/models/Welcome/welcome.js | 4 ---- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6919a1f3..3b37d41b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "bottodir", - "version": "2.2.5", + "version": "6.0.5", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "bottodir", - "version": "2.2.5", + "version": "6.0.5", "license": "ISC", "dependencies": { "@discordjs/builders": "^0.12.0", diff --git a/src/commands/Setup/Welcome/managewelcome.js b/src/commands/Setup/Welcome/managewelcome.js index 93b124db..cc3288ff 100644 --- a/src/commands/Setup/Welcome/managewelcome.js +++ b/src/commands/Setup/Welcome/managewelcome.js @@ -24,8 +24,8 @@ module.exports.run = async (interaction) => { if (sub === "setup") { const isSetup = await Guild.findOne({ id: interaction.guild.id }); - const channel = - interaction.options.getChannel("channel") || interaction.channel; + const channel = interaction.options.getChannel("channel") || interaction.channel; + const role = interaction.options.getRole("role"); if (!isSetup) { if (channel.type != "GUILD_TEXT") { @@ -38,6 +38,7 @@ module.exports.run = async (interaction) => { const newAuctions = new Guild({ id: interaction.guild.id, + role: role.id, channel: channel.id, }); newAuctions.save(); @@ -48,6 +49,7 @@ module.exports.run = async (interaction) => { } else { await Guild.findOneAndUpdate({ id: interaction.guild.id, + role: role.id, channel: channel.id, }); interaction.followUp({ diff --git a/src/models/Welcome/welcome.js b/src/models/Welcome/welcome.js index 04b459da..75ea49c1 100644 --- a/src/models/Welcome/welcome.js +++ b/src/models/Welcome/welcome.js @@ -4,18 +4,14 @@ const welcomeSchema = new Schema({ id: { type: String, - unique: true, - required: true }, role: { type: String, - required: false }, channel: { type: String, - required: true }, }, { timestamps: true });