Skip to content
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(CommandInteraction): update typings and docs for #editReply #5630

Merged
merged 1 commit into from May 22, 2021

Conversation

iShibi
Copy link
Contributor

@iShibi iShibi commented May 14, 2021

Please describe the changes this PR makes and why it should be merged:

Closes: #5629
⚠️This PR is not a direct fix for that issue, see this

CommandInteraction#editReply can take MessageAttachment too. This PR updates the typings and docs for it.

Status and versioning classification:

  • Code changes have been tested against the Discord API, or there are no code changes
  • I know how to update typings and have done so, or typings don't need updating
  • This PR includes breaking changes (methods removed or renamed, parameters moved or removed)

@vaporoxx
Copy link
Contributor

Since CommandInteraction#editReply is really just Webhook#editMessage/WebhookClient#editMessage under the hood, shouldn't the types be updated there too? (As well as WebhookEditMessageOptions#files if it works, otherwise support for that should be added)

@iShibi
Copy link
Contributor Author

iShibi commented May 14, 2021

Since CommandInteraction#editReply is really just Webhook#editMessage/WebhookClient#editMessage under the hood, shouldn't the types be updated there too? (As well as WebhookEditMessageOptions#files if it works, otherwise support for that should be added)

Yup, the type for options param in Webhook#editMessage should be WebhookEditMessageOptions | MessageAdditions instead of what it currently is. I don't get what you meant by WebhookEditMessageOptions#files tho

@iShibi
Copy link
Contributor Author

iShibi commented May 16, 2021

Oh, It took me some time but I got it. Yeah, the WebhookEditMessageOptions#files should also show that it can take Array<MessageAttachment> or Array<BufferResolvable>. I also noticed that the files field in all types of message options only show array of fileoptions or BufferResolvable as a valid type, it's missing the MessageAttachment. I can fix that in #5632 but the question is should I add the other two changes (Webhook#editMessage & WebhookEditMessageOptions#files) here or it's out of the scope of this PR?

@iCrawl iCrawl merged commit 56d44fb into discordjs:master May 22, 2021
@iShibi iShibi deleted the fix-5629 branch May 30, 2021 10:23
@iCrawl iCrawl added this to the Version 13 milestone Jun 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Interactions] Able to directly send MessageAttachment without content
6 participants