Commit graph

1573 commits

Author SHA1 Message Date
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
AKU
007bf76790
fix: add missing (*Guild).BannerURL() method (#1023)
Signed-off-by: AKP <tom@tdpain.net>
2021-10-27 19:56:26 -04:00
Fedor Lapshin
f0b7e81468
feat: ephemeral attachments (#1008) 2021-10-10 11:09:59 -04: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
xIceArcher
842ddb357a
Support for multiple embeds in message routes (#1000) 2021-10-10 10:56:47 -04:00
rigormorrtiss
0fad116c6c
feat: add ActivityTypeCompeting (5) (#990) 2021-08-21 13:50:00 -04:00
vertex-admin
d655d6df7b
Add BeforeDelete to GuildDelete struct (#962) 2021-08-20 18:48:45 -04:00
vertex-admin
be90532eda
Add SessionStartLimit to GatewayBotResponse struct (#949)
Current GatewayBotResponse struct is missing the information required for max concurrency sharding.
2021-08-20 18:46: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
Carson Hoffman
f7454d039f
Add more safety around message reference misuse 2021-08-10 21:40:36 -04:00
rigormorrtiss
460b371cce
Add ActivityTypeWatching (3) (#983) 2021-08-08 20:33:41 -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
Xpl0itR
e72c457cb4
Get webhook message endpoint (#948)
* Get interaction response message by interaction token

* Rename methods
2021-06-17 17:19:10 -04:00
Carson Hoffman
f5bb723db8
Convert more constants to absolute values
See 843c765ae3 for reasoning.
2021-05-29 17:55:43 -04:00
Branden J Brown
f36553e31f
fix UserFlags constant types (#937)
Only UserFlagDiscordEmployee had type UserFlags. All other constants
defined in the same block were untyped integer constants.

This change makes all UserFlags constants have type UserFlags. The
primary impact is that godoc and pkg.go.dev should render these
constants under the documentation for UserFlags, rather than under
package-level constants.
2021-05-25 22:09:34 -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
John Olheiser
df74d8bbe6
README updates (#935)
* go fmt

Signed-off-by: jolheiser <john.olheiser@gmail.com>

* Update README

Signed-off-by: jolheiser <john.olheiser@gmail.com>

Co-authored-by: Carson Hoffman <c@rsonhoffman.com>
2021-05-20 00:13:20 -04:00
Carson Hoffman
9e4f05730f
Revert "Update user.go (#934)" (#936)
This reverts commit 1998af926e.
2021-05-20 00:03:07 -04:00
Aditya Jha
1998af926e
Update user.go (#934) 2021-05-19 22:49:11 -04:00
chanbakjsd
8dc42757be
Add ping pong example for direct messages (#882)
This commit adds an example on sending direct messages as it's a
frequently asked question.
The example sends a "Pong" response through DM when a user sends "ping"
in any channel the bot has the permission to see.

The example is simply adopted from the ping pong example.
2021-05-14 22:34:46 -04:00
Eric Wohltman
9c33bfbada
Update unmarshal function to wrap ErrJSONUnmarshal and return specific error message. Requires at least Go 1.13. (#924) 2021-05-14 22:30:27 -04:00
person-with-a-username
a7c15e1bab
Misc changes to docs (#907)
* Misc changes

* Update index.md

Fix GettingStarted link + misc changes

* Update index.md

Fix DiscordGo image

* Update README.md

Fix image

* Fix image
2021-05-14 22:19:57 -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
bwmarrin
0f05488fa0
Merge pull request #925 from courtier/typo-fixes
Fix all the typos that goreportcard detected.
2021-05-06 10:17:29 -05:00
courtier
3fcad20924 Fix all the typos that goreportcard detected. 2021-05-06 01:06:45 +02:00
Maful Prayoga Arnandi
577e7dd4f6
Update badge (#868)
Co-authored-by: Carson Hoffman <c@rsonhoffman.com>
2021-04-10 16:29:08 -04:00
KeepSOBP
24f61442ac
travis-ci.org -> travis-ci.com (#875) 2021-04-10 16:26:12 -04:00
chris
590e92e1c6
slash_commands example spelling & grammar (#905)
Co-authored-by: chris <christophpryer@gmail.com>
2021-04-10 16:24:33 -04:00
Damian Gerow
faf06855cf
Update gorilla to 1.4.2 (#896) 2021-04-10 16:23:09 -04:00
Pierce
f7db9886fc
add Permissions to Member struct (#902)
* add Permissions to Member struct

* add period to Member.Permissions comment

* change Permissions type from string to int64
2021-04-10 16:21:21 -04:00
post
4f55d76981
update Activity struct and add emoji functions (#895)
* update Activity struct and add emoji functions

* fix the emoji regex

* Remove inline type definitions

* Change function name

* fix message_test function name

* make custom unmarshaljson and change `CreatedAt` to `time.Time`

* fix

Co-authored-by: post <61803796+postrequest69@users.noreply.github.com>
2021-04-10 16:17:16 -04:00
EvieDelta
a5f1f303a9
Add in some missing permission constants (#906)
PermissionUseSlashCommands
PermissionVoiceStreamVideo
PermissionRequestToSpeak
PermissionViewGuildInsights

Co-authored-by: EvieDelta <no public email>
2021-04-10 16:10:09 -04:00
Carson Hoffman
843c765ae3
Use absolute values for permission constants
We define our permissions constants based on Discord's values,
and thus the use of `iota` is fragile, makes docs harder to read,
and makes changes touching these constants harder to review.
Here, we now use the full 64-bit representation of each constant,
which both removes the implicit ordering dependencies and makes
the values easier to immediately see.
2021-04-09 15:34:05 -04:00
courtier
30251cf325
Fix EndpointInvite (#892) 2021-04-09 15:04:37 -04:00
Carson Hoffman
f637c37ba2
Merge pull request #886 from Nv7-GitHub/master
Fix slash commands example bug
2021-03-26 23:30:43 -04:00
Carson Hoffman
182d9b48f3
Add more robust file support for webhooks 2021-03-14 12:27:22 -04:00
Carson Hoffman
ba10a00fbc
Add User to Interaction 2021-03-12 09:45:35 -05:00
Carson Hoffman
37088aefec
Send [] rather than null on empty activities slice 2021-03-06 12:06:38 -05:00
Nv7
71d8e959ca Fix slash commands example bug 2021-03-03 09:12:01 -08:00
Carson Hoffman
abe5ba6f0f
Update slash command example to pass application ID 2021-02-28 23:32:34 -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
Jim Eagle
4617d8e379
Add guild preview endpoint (#818) 2021-02-24 12:10:18 -05:00
Carson Hoffman
2021f608f6
Merge pull request #880 from galberti/fix_rtp_ext_header
Fix RTP extended header parsing
2021-02-23 13:40:16 -05:00
Gabriele Alberti
b18e1d7276 Fix RTP extended header parsing
As ext header length isn't always 1, the shift to find the beginning of
the Opus packet must be adjusted dynamically.
2021-02-22 13:20:15 +01:00