Question - handling interactions
How do you guys handle for example temporary interactions but if the user presses on it again a few hours later it should time out?
Solution:Jump to solution
Discord.js
Discord.js is a powerful node.js module that allows you to interact with the Discord API very easily. It takes a much more object-oriented approach than most other JS Discord libraries, making your bot's code significantly tidier and easier to comprehend.
6 Replies
Solution
Discord.js
Discord.js is a powerful node.js module that allows you to interact with the Discord API very easily. It takes a much more object-oriented approach than most other JS Discord libraries, making your bot's code significantly tidier and easier to comprehend.
Ah okay, yeah I meant I have a button that you can click, I assume that button is there indefinitely unless it's edited
Is there a way I could catch interactions that aren't in-use?
Or should I avoid interaction handlers if I have temporarily interactions?
Is there a way I could catch interactions that aren't in-use?No, people will just get "application did not respond" so yeah you have to edit them out just before the handler expires for example PaginatedMessage from sapphire expires in 15 minutes and the components are edited away after (from the top of my head) 14 minutes and 55 seconds. or it was on
onEnd
... I don't recall. I think it was onEnd
Ah okay I see, so yeah only edge-cases I guess would be if bot crashes
If I ctrl + c the bot would that run the handlers?
no they would stop
@Mikkel Have you done it ? I would love to see an example of an expiration of a button