Added new tryCatch wrapper

This commit is contained in:
2025-03-20 23:41:18 +01:00
parent e555417e13
commit 95f9bb723f
16 changed files with 255 additions and 269 deletions

View File

@@ -6,6 +6,7 @@ import { guild as guildQuestions } from "~/config/questions"
import { guildRole } from "~/config/roles"
import { IButton } from "~/typings"
import applicationQuestions from "~/utils/Functions/applicationquestions"
import tryCatch from "~/utils/Functions/trycatch"
export default {
name: "guildapply",
@@ -37,18 +38,16 @@ export default {
return
}
try {
await user.send({
embeds: [{
title: "Guild Application",
description: "If you wish to proceed with your application, please type `yes` otherwise type `cancel`.\n\n" +
"**Do not upload images, videos, or GIFS.**\n" +
"You have a minute to respond to this message.",
color: embedColor
}]
})
// eslint-disable-next-line @typescript-eslint/no-unused-vars
} catch (error) {
const [error] = await tryCatch(user.send({
embeds: [{
title: "Guild Application",
description: "If you wish to proceed with your application, please type `yes` otherwise type `cancel`.\n\n" +
"**Do not upload images, videos, or GIFS.**\n" +
"You have a minute to respond to this message.",
color: embedColor
}]
}))
if (error) {
await interaction.editReply("Please enable your DMs.")
return
}