-
-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: use throw instead of Promise.reject #10712
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 2 Skipped Deployments
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
InteractionResponses#awaitModalSubmit()
has a similar issue to Shard#spawn()
:
discord.js/packages/discord.js/src/structures/interfaces/InteractionResponses.js
Lines 308 to 309 in 338c962
awaitModalSubmit(options) { | |
if (typeof options.time !== 'number') throw new DiscordjsError(ErrorCodes.InvalidType, 'time', 'number'); |
Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com> Co-authored-by: Renegade334 <Renegade334@users.noreply.github.com>
338c962
to
1842f85
Compare
Refactored functions previously using
Promise.{reject, resolve}()
to use the more concisethrow
syntax, converting them toasync
functions.Also fixed a rejection from #6210 by making the
Shard#spawn
methodasync
.