Throwing on unhandled interaction

Hey, I just wanted to quickly check this idea - If I assign a listener to interaction create and then set a 4 second timeout, if the interaction hasn't been deferred or replied to I can log an error right?
8 Replies
24
242y ago
Log the error where exactly? Consol? Console
Rhys
RhysOP2y ago
I'll be logging it via sentry to track it
24
242y ago
Yeah I don't see why you couldn't do this in an error listener for example Seems fine by me
Rhys
RhysOP2y ago
Is there a specific event thats emitted for this / all errors that I could just listen to? The other thing is getting information about what is failing, an error listener would need to let me know for example the id & name of what interaction didn't complete
24
242y ago
I think you'd have to listen to xCommandError and make one for each of the different types of commands you have E.g. message, interaction and context Not sure what info you can get. I know you can parse the url but not sure of the context you get specifically. I'd try out and see what you can get
Rhys
RhysOP2y ago
GitHub
AnswerOverflow/command-failure.ts at bot-pre-release-polish · Answe...
Indexing Discord Help Channel Questions into Google - AnswerOverflow/command-failure.ts at bot-pre-release-polish · AnswerOverflow/AnswerOverflow
Rhys
RhysOP2y ago
Responds to failed interactions, logs to the console, and emits a message to sentry with command info
24
242y ago
Nice!
Want results from more Discord servers?
Add your server