Merge branch 'dev' into 'main'

Bug fix

See merge request illegitimate/illegitimate-bot!30
This commit is contained in:
2023-10-01 15:10:03 +00:00

View File

@@ -23,7 +23,11 @@ module.exports = {
const embed = message.embeds[0]; const embed = message.embeds[0];
const applicantId = embed.footer.text.split(" ")[1]; const applicantId = embed.footer.text.split(" ")[1];
const applicant = await guild.members.fetch(applicantId); try {
var applicant = await guild.members.fetch(applicantId);
} catch (error) {
var applicant = null;
}
const reason = interaction.fields.fields.get('denyreason').value || "No reason provided"; const reason = interaction.fields.fields.get('denyreason').value || "No reason provided";
const embedColor = Number(color.replace("#", "0x")); const embedColor = Number(color.replace("#", "0x"));
@@ -71,11 +75,11 @@ module.exports = {
text: "ID: " + applicant.id text: "ID: " + applicant.id
}) })
if (applicant) { if (applicant !== null) {
await applicant.send({ embeds: [dmMessage] }); await applicant.send({ embeds: [dmMessage] });
} }
if (!applicant) { if (applicant === null) {
var responseEmbeds = [responseEmbed, missingUser]; var responseEmbeds = [responseEmbed, missingUser];
} else { } else {
var responseEmbeds = [responseEmbed]; var responseEmbeds = [responseEmbed];