-
-
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
fix(typings): return types for 'Webhook(Client)#send()' #4876
Conversation
I don't see how adding a dependency on |
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.
these overloads should be applied to WebhookClient
directly, as the Webhook
class is instantiated by internal methods and always has a client, thus always returns a full message
@vladfrangu I was assuming that they had to go under
@NotSugden If the channel isn't within the |
Since we're releasing this for discord.js v13, I personally don't see a reason to not include |
For what its worth: I would like to keep this as is and move forward like this until we have a clear path for modularization. |
As shown below,
Webhook(Client)#send()
would either return a Message (if the client was initiated and the channel was cached) or it would return the raw message response from the API (which has been added as aAPIRawMessage
interface in this PR).discord.js/src/structures/Webhook.js
Lines 162 to 164 in d234165
Cuurently the typings do not reflect this behaviour, this PR fixes that.
I did consider making use of the
APIMessage
over ondiscord-api-types
but that would mean introducing another dependency which be a breaking change for all Typescript developers.Webhook(Client)#send()
.Here's a snippet of how I tested these changes
Status
Semantic versioning classification: