Added new tryCatch wrapper
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user