Commit graph

19 commits

Author SHA1 Message Date
nitroflap
e44c83a1fc
feat(interactions): added note about modals to InteractionResponse 2022-02-16 02:13:29 +03:00
nitroflap
09e3d894b7
feat: modal interactions and text input component 2021-12-09 04:03:43 +03:00
Fedor Lapshin
fd6228c0d5
Slash commands options auto completion (#1014)
* feat(interactions): options autocompletion

* fix(examples/autocomplete): typo in comment

Replaced "returining" with "returning"
2021-11-16 22:56:33 -05:00
Han Seung Min - 한승민
9f89234f3f
Update invalid link to docs (#1010) 2021-10-10 11:02:24 -04:00
Fedor Lapshin
4249df2359
Channel type restriction (#1015) 2021-10-10 10:59:59 -04:00
Fedor Lapshin
9d9602318a
Context menus (#978)
* Interactions: context menus

* Example for message context menus

* Added flags to followups

* Example for user context menus

* Godoc fix

* Rebase fix

* Update message types to reflect new separations

Co-authored-by: Carson Hoffman <c@rsonhoffman.com>
2021-08-18 16:16:46 -04:00
Fedor Lapshin
4ebe5a08ee
Selects component (#954)
* Interactions: the Buttons (#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 (#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>
2021-08-08 20:16:07 -04:00
plally
ab47f123ba
support allowing webhook edits with files, and responding to interactions with files (#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
2021-07-30 11:22:08 -04:00
Carson Hoffman
083bf5c1d9
Improve handling of invalid interaction situations 2021-07-25 13:39:31 -04:00
Fedor Lapshin
421e149650
Interactions: the Buttons (#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>
2021-06-27 12:16:52 -04:00
Carson Hoffman
f5bb723db8
Convert more constants to absolute values
See 843c765ae3 for reasoning.
2021-05-29 17:55:43 -04:00
Pierce
ccf3b3738e
add ApplicationCommandInteractionDataResolved struct (#919)
* add ApplicationCommandInteractionDataResolved struct

* add comment to ApplicationCommandInteractionDataResolved

* change wording of comment for ApplicationCommandInteractionDataResolved
2021-05-25 22:06:38 -04:00
Pierce
ec2cf69202
Remove deprecated response types (#930)
* update deprecated notices

* remove deprecated response types

* remove InteractionResponseChannelMessage usage

* remove deprecated response types from example options

* stop using iota for respone type constants
2021-05-14 22:18:50 -04:00
Pierce
7d7206b01b
Bulk command overwrite (#926)
* add session.ApplicationCommandBulkOverwrite

* change ApplicationCommandBulkOverwrite to take a guildID

* formatting

* add omitempty to ID of ApplicationCommand
2021-05-11 23:51:33 -04:00
Pierce
cbae312c9d
add ApplicationCommandOptionMentionable (#918) 2021-05-10 17:01:10 -04:00
courtier
3fcad20924 Fix all the typos that goreportcard detected. 2021-05-06 01:06:45 +02:00
Carson Hoffman
ba10a00fbc
Add User to Interaction 2021-03-12 09:45:35 -05:00
Fedor Lapshin
b0fa920925
Slash commands (#856)
* UnknownBan error code addition

* GuildBan method implementation

* Gofmt fix

Gofmt fix

* Interactions: application commands basic API and gateway integration

* Some gitignore update

* Application commands and interactions API implementation

* Some fixes

* Some improvements of slash-commands example and slash-commands API

* OAuth2 endpoints backward compatibility

* Gofmt fix

* Requested fixes and documentation improvement for application commands

* Some fixes

* New and more interesting example of slash-commands usage, merging "interaction.go" and "interactions.go" into a single file. And some fixes.

* Gofmt and documentation fixes

* More fixes

* Gofmt fixes

* More fixes!

* Doc and endpoint fixes

* Gofmt fix

* Remove dependence on open gateway connection

* Remove redundant command ID checks

* Fix typo in ApplicationCommandCreate comment

* Tidy up function calls returning body

* Add upcoming API changes

* Correct return value name, swap parameter order

* Add Version field to ApplicationCommand

* Fix up language in comments

* Remove redundant conversion to float64

Co-authored-by: Carson Hoffman <c@rsonhoffman.com>
2021-02-28 21:54:02 -05:00
Jon Chen
dc3c2d5533 implement interaction request signing verification 2021-01-13 17:43:43 +00:00