Updated guild application accept
This commit is contained in:
@@ -10,6 +10,7 @@ import {
|
|||||||
waitingListMessage,
|
waitingListMessage,
|
||||||
hypixelGuildID,
|
hypixelGuildID,
|
||||||
} from "../../../config/options.json"
|
} from "../../../config/options.json"
|
||||||
|
import colorLog from "../../utils/functions/colors"
|
||||||
import mongoose from "mongoose"
|
import mongoose from "mongoose"
|
||||||
import guildapp from "../../schemas/guildAppSchema"
|
import guildapp from "../../schemas/guildAppSchema"
|
||||||
import waitingList from "../../schemas/waitinglistSchema"
|
import waitingList from "../../schemas/waitinglistSchema"
|
||||||
@@ -88,7 +89,26 @@ export = {
|
|||||||
await applicant.roles.add(waitingListRole)
|
await applicant.roles.add(waitingListRole)
|
||||||
await guildapp.findOneAndDelete({ userID: applicantId })
|
await guildapp.findOneAndDelete({ userID: applicantId })
|
||||||
|
|
||||||
// update waiting list
|
await interaction.editReply({
|
||||||
|
embeds: [
|
||||||
|
{
|
||||||
|
title: applicantUsername + " - Guild Application",
|
||||||
|
description:
|
||||||
|
"Application has been accepted by <@" + user.id + ">.",
|
||||||
|
color: embedColor,
|
||||||
|
thumbnail: {
|
||||||
|
url: applicant.avatarURL() || "",
|
||||||
|
},
|
||||||
|
footer: {
|
||||||
|
icon_url: guild.iconURL() || undefined,
|
||||||
|
text: "ID: " + applicant.id,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
})
|
||||||
|
|
||||||
|
if (process.env.NODE_ENV === "dev") return
|
||||||
|
try {
|
||||||
const channel = guild.channels.cache.get(
|
const channel = guild.channels.cache.get(
|
||||||
waitingListChannel,
|
waitingListChannel,
|
||||||
) as TextChannel
|
) as TextChannel
|
||||||
@@ -134,23 +154,8 @@ export = {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
|
} catch (err) {
|
||||||
await interaction.editReply({
|
console.log(colorLog("Error while trying to update waiting list.", "red"))
|
||||||
embeds: [
|
}
|
||||||
{
|
|
||||||
title: applicantUsername + " - Guild Application",
|
|
||||||
description:
|
|
||||||
"Application has been accepted by <@" + user.id + ">.",
|
|
||||||
color: embedColor,
|
|
||||||
thumbnail: {
|
|
||||||
url: applicant.avatarURL() || "",
|
|
||||||
},
|
|
||||||
footer: {
|
|
||||||
icon_url: guild.iconURL() || undefined,
|
|
||||||
text: "ID: " + applicant.id,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
} as Button
|
} as Button
|
||||||
|
|||||||
Reference in New Issue
Block a user