#Default `time` value for `awaitMessageComponent` ?

14 messages · Page 1 of 1 (latest)

thorny reef
#

Hi, the time value in awaitMessageComponent is optional, but I cannot find any indication of what the default value is ? Thanks

proven stratusBOT
#
  • What's your exact discord.js npm list discord.js and node node -v version?
  • Not a discord.js issue? Check out #1081585952654360687.
  • 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!
hidden robin
#

There isn't one, it's a required option

blissful tangle
#

afaik its only required in modal collectors. this one just runs until the process exits

thorny reef
old hingeBOT
hidden robin
#

It's at least typed as non nullable

hidden robin
# thorny reef Nice, thanks !

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

thorny reef
#

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.

hidden robin
#

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 😅

quaint sierra
#

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