psyche
DIAdiscord.js - Imagine an app
•Created by psyche on 3/25/2024 in #djs-questions
[14.14.1] Check if awaitMessageComponent hit timeout or some other code failed
Would it be possible to detect whether awaitMessageComponent failed because of the timeout, or some other error occurred in the code?
For example:
I'm not sure how to detect/where to get the error class from tho.
I already tried:
DiscordjsErrorCodes.InteractionCollectorError
(as it's rejected with new DiscordjsError(ErrorCodes.InteractionCollectorError, reason)
), however, I got the following error:
"The right-hand side of an 'instanceof' expression must be either of type 'any', a class, function, or other type assignable to the 'Function' interface type, or an object type with a 'Symbol.hasInstance' method."
I guess this is this case since ErrorCodes.InteractionCollectorError
isn't a class, but rather just an error code? Not sure about this tho.
Thanks in advance7 replies