JuanDelPueblo
DIAdiscord.js - Imagine an app
•Created by JuanDelPueblo on 6/26/2023 in #djs-questions
Proper error handling with awaitMessages
I'm trying to optimize my code as best as possible, and this includes error handling.
I understand how to catch an error with promises, but I am confused as how to pass it into .catch, because the catch arguments in the discord.js collectors guide only includes collected, so am I supposed to add a second argument for the error, or check if collected is an error? Also, in the errors parameter of awaitMessages, is 'time' the only one I can put, or are there others?
Here is my current code for the bit I'm trying to optimize just in case (collecting role ID to create an action for a forms bot)
12 replies