Client Actions Dispatch

What is the part of the Client that dispatches gateway events?
7 Replies
d.js docs
d.js docs3y ago
• What's your exact discord.js npm list discord.js and node node -v version? • Post the full error stack trace, not just the top part! • Show your code! • Explain what exactly your issue is. • Not a discord.js issue? Check out #useful-servers.
Kinect3000
Kinect30003y ago
The websocket does that Or ig, more specifically the shard
noby
nobyOP3y ago
Is there a way to asynchronously wait for an event to be fired in a command?
Kinect3000
Kinect30003y ago
You can wrap events in a Promise constructor, like how collectors do
d.js docs
d.js docs3y ago
mdn How to use promises Promises are the foundation of asynchronous programming in modern JavaScript. A promise is an object returned by an asynchronous function, which represents the current state of the operation. At the time the promise is returned to the caller, the operation often isn't finished, but the promise object provides methods to handle the eventual success or failure of the operation.
noby
nobyOP3y ago
so new Promise(client.actions…)? How would I define the event ?
Want results from more Discord servers?
Add your server