Commit graph

1457 commits

Author SHA1 Message Date
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
Carson Hoffman
c27ad65527
Sleep for correct duration after 429 2021-02-05 13:06:05 -05:00
AlexPresso
b6deecb67d
Add MessageReactionsRemoveEmoji (#873)
* Add MessageReactionsRemove

* Add MessageReactionsRemove

* Rename MessageReactionsRemove to MessageReactionsRemoveEmoji

Co-authored-by: Qais Patankar <qaisjp@gmail.com>

* Update MessageReactionsRemoveEmoji comments

Co-authored-by: Qais Patankar <qaisjp@gmail.com>
2021-02-03 19:13:48 -05:00
Alex
5f6bb2d120
Set channel and role edit perms to int64 (#867)
* set channel and role edit perms to int64

* add string serialization
2021-01-27 12:55:31 -05:00
Carson Hoffman
e6a8d51c9b
Add JSON tags to Activity struct 2021-01-26 13:24:24 -05:00
Carson Hoffman
d4d47b65ee
Bump library version to v0.23.0 2021-01-23 19:53:47 -05:00
Carson Hoffman
cbfa831b6c
Merge pull request #866 from bwmarrin/v8
Switch library to API version v8
2021-01-23 19:52:04 -05:00
Carson Hoffman
90531dc713
Fix permissions type for UserGuild 2021-01-20 20:19:51 -05:00
Carson Hoffman
0f0aaad011
Correct header in rate limit test 2021-01-20 19:48:09 -05:00
Carson Hoffman
bd34c3c66d
Add comment for UnmarshalJSON 2021-01-20 19:43:00 -05:00
Carson Hoffman
b7a2a4b7fa
Correct rate limit test magnitude 2021-01-20 19:42:53 -05:00
Carson Hoffman
9548146f69
Fix comment on UpdateGameStatus 2021-01-20 19:34:05 -05:00
Carson Hoffman
657ac048fe
Switch example to use UpdateGameStatus 2021-01-20 19:33:43 -05:00
Carson Hoffman
c41dc15a10
Add changes to presences, remove Game type 2021-01-20 18:54:38 -05:00
Carson Hoffman
866ecccb2e
Support millisecond precision in rate limits 2021-01-20 18:39:43 -05:00
Carson Hoffman
daaafb5a7f
Rename fields for v8 2021-01-20 18:22:39 -05:00
Carson Hoffman
167b649902
Remove support for optional intents 2021-01-20 18:18:34 -05:00