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
Selects component #954
Selects component #954
Conversation
By the way, if you see a comment and commits related to buttons, don't be confused. Since I'm waiting for Carson's review, this changes isn't merged (but this PR is based on them). So, anyways, just don't mind this comment and commits. |
@FedorLap2006 Great work! Thanks, I'm gonna try to test it |
Thanks. Now probably you're gonna be a little confused when you will be testing this. Because I forgot to document some moments. Probably in 30 minutes the docs will come. |
@fletcherist So, now all docs should be in the place and you can test it if you have the beta access. |
@FedorLap2006 I got this when I press button [DG0] wsapi.go:585:onEvent() error unmarshalling INTERACTION_CREATE event, json: cannot unmarshal object into Go struct field Message.message.components of type discordgo.MessageComponent |
I just created a message with button, and then clicked on it |
The fixes is ready, try them out. |
thanks for quick response. trying! |
Now I've got an unmarshalling error, but event type is different
|
516644f
to
0640e7f
Compare
I think API is final and we can start reviewing :) |
I tested that latest commit and got error I mentioned above 23a197a |
Oh, yeah, forgot to push the commits. |
I think that the example here is getting a bit unwieldy, especially as Discord continues to add component types. It'd probably be best to have a more focused example dedicated to each type of component. |
Huh. Sorry everyone for such long delay. Just was working on personal things. So, well, here it goes. Hope everything is done in scope of select menus, so I can move forward to other features. |
918dca2
to
eb8edf7
Compare
* Interactions: buttons * Doc fix * Gofmt fix * Fix typo * Remaking interaction data into interface * Godoc fix * Gofmt fix * Godoc fix * InteractionData helper functions and some fixes in slash commands example * Fix components example * Yet another fix of components example * Fix interaction unmarshaling * Gofmt fix * Godoc fix * Gofmt fix * Corrected naming and docs * Rolled back API version * Requested fixes * Added support of components to webhook and regular messages * Fix components unmarshaling * Godoc fix * Requested fixes * Fixed unmarshaling issues * Components example: cleanup * Added components tracking to state * Requested fixes * Renaming fix * Remove more named returns * Minor English fixes Co-authored-by: Carson Hoffman <c@rsonhoffman.com>
…ions with files (bwmarrin#931) * allow files in webhook message edits * add Files to WebhookEdit struct * move the construction of the multipart body for files into a shared function * allow interaction responses to have files * go fmt * fix err shadowing * document MakeFilesBody * rename MakeFilesBody -> EncodeWithFiles. fix InteractionRespond responding twice * use resp in InteractionRespond files, add basic-command-with-files example command * import strings and go fmt * EncodeWithFiles -> MultiPartBodyWithJSON * go fmt * fix example for slash_commands * move files to responsedata
eb8edf7
to
c6f37ad
Compare
Well, after some discussion with @CarsonHoffman we decided that I shouldn't let the branch be in the state it is and rebase it on the master branch of the repository. So, well, hope everything works. Enjoy! |
* Interactions: the Buttons (bwmarrin#933) * Interactions: buttons * Doc fix * Gofmt fix * Fix typo * Remaking interaction data into interface * Godoc fix * Gofmt fix * Godoc fix * InteractionData helper functions and some fixes in slash commands example * Fix components example * Yet another fix of components example * Fix interaction unmarshaling * Gofmt fix * Godoc fix * Gofmt fix * Corrected naming and docs * Rolled back API version * Requested fixes * Added support of components to webhook and regular messages * Fix components unmarshaling * Godoc fix * Requested fixes * Fixed unmarshaling issues * Components example: cleanup * Added components tracking to state * Requested fixes * Renaming fix * Remove more named returns * Minor English fixes Co-authored-by: Carson Hoffman <c@rsonhoffman.com> * Doc fix * Gofmt fix * Fix typo * Remaking interaction data into interface * Godoc fix * Gofmt fix * Godoc fix * InteractionData helper functions and some fixes in slash commands example * Fix components example * Yet another fix of components example * Fix interaction unmarshaling * Godoc fix * Gofmt fix * Corrected naming and docs * Rolled back API version * Requested fixes * Added support of components to webhook and regular messages * Interactions: select menus * Example fix * Merge fix * Some fixes * Added missing documentation * Fix components unmarshaling * Godoc fix * Requested fixes * Fixed unmarshaling issues * Components example: cleanup * Gofmt fix * Godoc fix * URL field renaming fix * Added flags to followups * Updated components example * Fixed typo in components example * Merge fix * Improve handling of invalid interaction situations * support allowing webhook edits with files, and responding to interactions with files (bwmarrin#931) * allow files in webhook message edits * add Files to WebhookEdit struct * move the construction of the multipart body for files into a shared function * allow interaction responses to have files * go fmt * fix err shadowing * document MakeFilesBody * rename MakeFilesBody -> EncodeWithFiles. fix InteractionRespond responding twice * use resp in InteractionRespond files, add basic-command-with-files example command * import strings and go fmt * EncodeWithFiles -> MultiPartBodyWithJSON * go fmt * fix example for slash_commands * move files to responsedata * Merge fixes * Fixed rebase consequences Co-authored-by: Carson Hoffman <c@rsonhoffman.com> Co-authored-by: plally <pierce@vulpes.dev>
Well, during the development of the #933 I was also busy working on Selects component implementation. Now, since all API is experimental this request will be marked as draft one. Also this PR includes some fixes and improvements: like adding WebhookMessage endpoint and files support to webhooks API ( #951). Anyways, here it is: selects component. Feel free to give a feedback on this PR.