Default `time` value for `awaitMessageComponent` ?

Hi, the time value in awaitMessageComponent is optional, but I cannot find any indication of what the default value is ? Thanks
10 Replies
d.js toolkit
d.js toolkit•7mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button!
duck
duck•7mo ago
There isn't one, it's a required option
treble/luna
treble/luna•7mo ago
afaik its only required in modal collectors. this one just runs until the process exits
KaKi87
KaKi87OP•7mo ago
No description
KaKi87
KaKi87OP•7mo ago
Nice, thanks !
d.js docs
d.js docs•7mo ago
:interface: AwaitMessageComponentOptions discord.js@14.19.3 An object containing the same properties as CollectorOptions, but a few more:
duck
duck•7mo ago
It's at least typed as non nullable But if you are looking for something more persistent, you should really consider just listening to the interactionCreate event All collectors are designed to be temporary
KaKi87
KaKi87OP•7mo ago
Yeah but that's more complicated to code I mean no I don't want it to be persistent, I just want the user to be able to take their time, so removing expiration works for me.
duck
duck•7mo ago
Maybe it's just personal preference but something still irks me about an indefinitely hanging promise that I'd still personally use the event based collector 😅
Amgelo
Amgelo•7mo ago
yeah I'd say it would even classify as a memory leak one user could even intentionally create a bunch of unresolved promises if they manage to know you're waiting without a timeout and it could slow down and/or drain resources if done enough times, wouldn't even need to be just one user, could be multiple unintentionally over a period of time

Did you find this page helpful?