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(MultipartBodyWithJSON): form file field name format #1256

Merged
merged 2 commits into from
Oct 7, 2022

Conversation

FedorLap2006
Copy link
Collaborator

@FedorLap2006 FedorLap2006 commented Oct 3, 2022

Currently MultipartBodyWithJSON uses file<index> format for the name of the form field for files. However this format is not correct, according to the documentation. The correct format is files[<index>].

The implementation was working all that time, because all the endpoints with support of attachments append them automatically and you do not need to reference them, however when you would try to, you would just get an "Unknown attachment" error.
This PR should fix this problem.

Initially I discovered this when I was performing manual tests on #1253.

Fix the format of form field name for a file.
@FedorLap2006 FedorLap2006 self-assigned this Oct 3, 2022
@FedorLap2006 FedorLap2006 added the fix Pull requests and issues related to bug fixes and structural inconsistencies label Oct 3, 2022
@FedorLap2006 FedorLap2006 linked an issue Oct 3, 2022 that may be closed by this pull request
@FedorLap2006
Copy link
Collaborator Author

Whoops, forgot to push the local changes. It's files, not file 😅

Use files[n] instead of file[n] in the form field name
@FedorLap2006 FedorLap2006 merged commit 1ff58d4 into master Oct 7, 2022
@FedorLap2006 FedorLap2006 deleted the fix-multipart branch October 7, 2022 11:43
LWCoder pushed a commit to AtTheTavern/discordgo that referenced this pull request Apr 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Pull requests and issues related to bug fixes and structural inconsistencies
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support attatchments in message edits
1 participant