Commit graph

323 commits

Author SHA1 Message Date
42Atomys
9448b0eb96
Add Guild Scheduled Event Support (#1032)
* Add Guild Scheduled Events support

* Add missing Indents for Guild Scheduled Events

* fix: Do update from new schedules updates and repository updates

* doc: Add missing documentation on const

* doc: Add missing documentation on events struct

* tests: Add a Skip condition when dgBot is not set to prevent segfault

* fix: Somes changes following the last review steps

* docs: Add an example to manipulate GuildScheduledEvent

* clean: Remove useless pointers on struct used to retrieve data

* tests: Test extra query params on GuildScheduledEventUsers requests

* clean: Remove unused variables

* feat: Add nullable types to provide null value to Discord API when is necessary

* feat: Use NullableString in ScheduledEvents

* docs: Add example for usage of NullableString

* Update structs.go

Co-authored-by: Fedor Lapshin <fe.lap.prog@gmail.com>

* Update restapi.go

Co-authored-by: Fedor Lapshin <fe.lap.prog@gmail.com>

* fix: Review changes to move back nullable string into a simple MarshalJSON

* fix: Remove NullString on tests and examples

* doc: Add missing doc

* Update structs.go

Co-authored-by: Fedor Lapshin <fe.lap.prog@gmail.com>

* fix: misunderstood MarhsalJSON

* fix: Follow the convention of discordgo on url.Values

* Update examples/scheduled_events/main.go

Co-authored-by: Fedor Lapshin <fe.lap.prog@gmail.com>

* changes: use conditional instead on Sprintf

* fix: Add missing status on Params

* Update structs.go

Co-authored-by: Fedor Lapshin <fe.lap.prog@gmail.com>

* Update structs.go

Co-authored-by: Fedor Lapshin <fe.lap.prog@gmail.com>

* changes: Move flag.Parse inside the init function

* fix: remove null statement of test suite

* fix: Rewrite Marshal of GuildScheduledEventParams to prevent a stack overflow on marshall same type

* clean: Remove unused Intents

* Update restapi.go

Co-authored-by: Fedor Lapshin <fe.lap.prog@gmail.com>

* Update restapi.go

Co-authored-by: Fedor Lapshin <fe.lap.prog@gmail.com>

* Update restapi.go

Co-authored-by: Fedor Lapshin <fe.lap.prog@gmail.com>

* doc: polish the documentation

* clean: Final polish code

* doc: Add information about 1:1 usage

* Update discord_test.go

Co-authored-by: Fedor Lapshin <fe.lap.prog@gmail.com>

* doc: remove unnecessary additional infos

* Update structs.go

Co-authored-by: Fedor Lapshin <fe.lap.prog@gmail.com>

* Update discord_test.go

Co-authored-by: Fedor Lapshin <fe.lap.prog@gmail.com>

* Update restapi.go

Co-authored-by: Fedor Lapshin <fe.lap.prog@gmail.com>

* chore(examples/scheduled_events): removed NullString comment

* fix(structs): grammar in comment to EntityType

* fix: run gofmt

Co-authored-by: Fedor Lapshin <fe.lap.prog@gmail.com>
2022-02-27 18:22:31 +03:00
nitroflap
5056d53d17 Revert "feat(structs#Session): made sessionID and sequence fields public"
This reverts commit 4390b565fa.
2022-02-27 18:11:50 +03:00
nitroflap
4390b565fa
feat(structs#Session): made sessionID and sequence fields public 2022-02-27 17:46:03 +03:00
Andres Perez
dd5b9c6c05
Add Guild Member avatar (#1077)
* Add guild member avatar

* add avatar field on Member struct

* add endpoints for guild avatars

* add avatarURL util function for *User.AvatarURL and *Member.AvatarURL

* set GuildID on after GuildMember request

* fix Member.Avatar comment

* fix: gofmt

Co-authored-by: Fedor Lapshin <fe.lap.prog@gmail.com>
2022-02-26 00:26:51 +03:00
Austin Alvarado
70e829694d
Add Invite Create/Delete (#1105)
* Add Invite Create/Delete

* rename const

* Refactor Application

* Feedback & deprecation

* lint fix for godoc comment

* review feedback
2022-02-26 00:13:27 +03:00
Riley
8ac9c13dda
Guild Template (#1091)
* feat: guild templates

* task(endpoints): go fmt endpoints

* task(endpoints): go fmt

* docs(restapi): resolve suggestions from code review

Co-authored-by: Fedor Lapshin <fe.lap.prog@gmail.com>

* fix(restapi): add missing image field

Co-authored-by: Fedor Lapshin <fe.lap.prog@gmail.com>
2022-02-21 01:00:36 +03:00
Flexolk
b7ce746717
Add get guild stickers support (#1095)
* Add get guild stickers support

* fix: change the type of Stickers of StickerPack to array pointer
2022-02-18 22:30:56 +03:00
Fedor Lapshin
992358e106
Threads reloaded (#1058)
* feat(endpoints): bumped discord version to 9

* feat: threads barebones

* feat(threads): documentation

* feat(threads): membership caching

* feat(threads): added type to StartThread method

* fix: replaced missing Timestamp definitions with time.Time

* chore: removed debug logs

* chore: removed thread alias for channel type

* feat(webhooks): separated thread option into method

* fix(state): ThreadMembersUpdate member duplication bug

* fix: golint

* feat(threads): pr fixes and BeforeUpdate in ThreadUpdate

* feat: removed unnecessary todo

* feat(state): removed thread last message update in MessageAdd

* Revert "feat(state): removed thread last message update in MessageAdd"

This reverts commit 4ca359fd2cc304e5d0ec2937e25c0c487a1f2096.

* feat(state): update only last message id for thread update

Implements updating message id in MESSAGE_CREATE and MESSAGE_DELETE events. Refer to https://discord.com/developers/docs/topics/gateway#thread-update for more info.

* fix(restapi): passing threadID in WebhookThreadExecute

* feat(state): dropped last_message_id updates for threads

* fix: gofmt

* feat(events#ThreadCreate): added newly_created field

* feat(restapi)!: corrected names of thread functions
2022-02-17 22:50:42 +03:00
nitroflap
e16b1f8e5b
fix(structs): added back old intent definitions for compatibility 2022-02-16 16:31:13 +03:00
Pedro Pessoa
c871464295
update intents (#1097) 2022-02-16 15:30:32 +03:00
Pedro Pessoa
115adf2866
add missing json error codes (#1096)
* add missing json error codes

* Update structs.go

Co-authored-by: Fedor Lapshin <fe.lap.prog@gmail.com>

* Update structs.go

Co-authored-by: Fedor Lapshin <fe.lap.prog@gmail.com>

* requested changes

* Update structs.go

Co-authored-by: Fedor Lapshin <fe.lap.prog@gmail.com>

* Update structs.go

Co-authored-by: Fedor Lapshin <fe.lap.prog@gmail.com>

* formatting

* add ErrCodeEmbedDisabled back

Co-authored-by: Fedor Lapshin <fe.lap.prog@gmail.com>
2022-02-16 15:29:20 +03:00
nitroflap
5ee06354aa
fix: added AuditLogChangeKeyTempoary back for compatibility 2022-02-16 14:57:14 +03:00
Pedro Pessoa
c26bf45ce0
Update auditlog keys and actions (#1098)
* update audit log keys and actions

* remove unncessary tab

* move comments above

* feat: corrected comments for audit log change keys

* fix: typos in audit log change keys comments and definitions

Co-authored-by: nitroflap <fe.lap.prog@gmail.com>
2022-02-16 14:50:16 +03:00
Riley Smith
29269347e8
Add guild member timeouts (#1061)
* added guild member timeouts

* fix spelling error

* Use time.Time, allow timeout removal

Co-authored-by: Carson Hoffman <c@rsonhoffman.com>
2021-12-27 21:38:45 -05:00
Carson Hoffman
fccf6db03e
Remove Timestamp type, use time.Time 2021-12-24 12:38:50 -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
rigormorrtiss
0fad116c6c
feat: add ActivityTypeCompeting (5) (#990) 2021-08-21 13:50:00 -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
rigormorrtiss
460b371cce
Add ActivityTypeWatching (3) (#983) 2021-08-08 20:33:41 -04:00
Carson Hoffman
f5bb723db8
Convert more constants to absolute values
See 843c765ae3 for reasoning.
2021-05-29 17:55:43 -04:00
courtier
3fcad20924 Fix all the typos that goreportcard detected. 2021-05-06 01:06:45 +02: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
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
e6a8d51c9b
Add JSON tags to Activity struct 2021-01-26 13:24:24 -05:00
Carson Hoffman
90531dc713
Fix permissions type for UserGuild 2021-01-20 20:19:51 -05:00
Carson Hoffman
bd34c3c66d
Add comment for UnmarshalJSON 2021-01-20 19:43:00 -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
Carson Hoffman
3773e286e6
Add v8 permissions changes 2021-01-20 18:11:20 -05:00
CinePlays
de64206da6 Added missing field in member struct 2021-01-06 22:40:00 +01:00
Fedor Lapshin
f124f38563
GuildBan method and UnknownBan error code addition (#848)
* UnknownBan error code addition

* GuildBan method implementation

* Gofmt fix

Gofmt fix
2020-12-17 13:59:41 -05:00
Qais Patankar
0dbc0d17a7 Add ApplicationID to Webhook 2020-11-15 19:40:37 +00:00
Samuel Hunter
8c5ca3de95
Add banner to GuildParams struct (#735) 2020-08-25 10:42:45 -04:00
Aditya Diwakar
8648632fc8 Comment ChannelFollow struct 2020-08-05 19:02:11 -04:00
Aditya Diwakar
eb70c17733 Add support for retrieving Webhook ID 2020-08-05 18:54:12 -04:00
redbluescreen
ea94122b57
Add AllowedMentions field to WebhookParams 2020-07-23 19:11:21 +03:00
Robbie Trencheny
f067059526
Update Emoji struct 2020-06-28 16:01:20 -07:00
TroyDota
9ce4a230c8
Updates API (#785)
* Update to API

Updates the golang stuct to current api documentation and adds new util

* Revert of change.

* Update message.go

* Update structs.go

* Yikes this my hand hurts.

* Consistency

* Update message.go
2020-06-28 18:53:46 -04:00
Carson Hoffman
bfbd4bc5c3
Merge pull request #763 from lukasz-horonziak/intents
Basic support for Gateway Intents
2020-06-16 23:06:07 -04:00
Łukasz Horonziak
ee7a5ae519 Add missing comments 2020-06-11 12:26:34 +02:00
Łukasz Horonziak
0e6ec53738 Move MakeIntent method 2020-05-24 09:44:33 +02:00
Łukasz Horonziak
de7803becd Refactor 2020-05-24 08:34:29 +02:00
Łukasz Horonziak
57c962912e Make intents optional field 2020-05-17 19:52:52 +02:00
Noah Santschi-Cooney
69edfdf4ac
discordapp.com -> discord.com (#772)
Change API URL from discordapp.com to discord.com
2020-05-08 21:26:13 -04:00
Łukasz Horonziak
d12e6550c6 Typos 2020-04-19 17:36:35 +02:00
Łukasz Horonziak
349da37386 Refactor 2020-04-19 11:11:41 +02:00
Łukasz Horonziak
757302eb78 Add intents 2020-04-18 22:31:38 +02:00
Eric Wohltman
3736887e9b
Bitwise view channel permission (#758)
* Fix offset for PermissionViewChannel

* Fix offset for PermissionViewChannel
2020-04-06 11:00:23 -07:00
Eric Wohltman
0a159acc0c
Fix offset for PermissionViewChannel (#757) 2020-04-06 09:50:24 -07:00
Eric Wohltman
e66f73bf50 Update compound permission sets to use PermissionViewChannel 2020-04-01 10:05:24 -04:00
Eric Wohltman
e83cac31da Add PermissionReadMessages deprecated comment 2020-04-01 10:00:26 -04:00
Eric Wohltman
e26e635684 Add bitwise permission const PermissionViewChannel 2020-04-01 08:04:42 -04:00
bwmarrin
d4610f32c1
Merge pull request #728 from bwmarrin/feature-ExposeIdentify
Expose Identify Packet
2020-01-24 17:20:51 -06:00
Bruce Marriner
19c4a067d0 Fixing Nits 2020-01-23 09:33:36 -06:00
Helba
949945a955 Added Missing CustomStatus type, and Missing Slice for Activities which gets returned now because custom triggers a presnece update 2020-01-22 14:52:56 -08:00
Helba
c737258c06 Added missing features 2020-01-22 14:50:38 -08:00
Bruce Marriner
69f369a9f4 Linting. 2020-01-20 12:20:30 -06:00
Bruce Marriner
eff98faf41 Fix wording 2020-01-20 12:10:20 -06:00
Bruce Marriner
ee9178e237 Fix wording 2020-01-20 12:06:54 -06:00
Bruce Marriner
973580a2ba Initial commit of ExposeIdentify feature 2020-01-20 12:01:58 -06:00
Carson Hoffman
afe392e6c1
Merge pull request #694 from BigHeadGeorge/fix-tts-casing
Fix inconsistent TTS casing
2019-12-26 20:22:41 -05:00
Bruce Marriner
8416350234 Merge branch 'master' of https://github.com/bwmarrin/discordgo 2019-10-18 10:46:55 -05:00
Sebastian Winkler
4ffe741f3e
adds RateLimitPerUser to Channel struct 2019-10-01 20:32:18 +02:00
Haze Booth
97726fe5b6
Fix typo in ErrorEmbedDisabled 2019-09-28 03:34:22 -04:00
tuckerrrrrrrrrrrr
bc6197c5e6 fix inconsistent tts casing 2019-09-10 18:09:24 -07:00
JurrijnP
b8638c0363
Add Channel Types 2019-08-04 10:44:25 +02:00
Julian Y
8713b45ae7
Create new VerificationLevel VerificationLevelVeryHigh
Closes #677
2019-08-03 23:48:24 -07:00
Christopher F
66f4df19c8 faeture: add last_pin_timestamp to Channel struct (#596)
This resolves #547.

Adds a "LastPinTimestamp" field to the Channel structure, which reflects
the `last_pin_timestamp` field on the Discord API. This field is
indicative of whether or not the channel has any pinned messages, and
can save an API request from being sent if there are none.

FWIW, The API doesn't seem to return a 404 anymore when there are no
pinned messages; it returns a 200 with `[]`.
2019-07-21 21:12:21 -07:00
Sebastian Winkler
579121fe1a adds EndpointGuildIconAnimated; adds guild.IconURL() helper (#658) 2019-07-21 21:09:39 -07:00
recapitalverb
d19be02e42 Add Available field to Emoji struct (#676) 2019-07-21 21:02:28 -07:00
Sebastian Winkler
347a4f69b0 Add premium fields to Guild and Member (#656)
* adds premium fields to Guild and Member

* fixes formatting
2019-06-08 13:54:39 -07:00
diamond's alt
7896167153 added useragent (#653) 2019-05-28 16:52:23 -07:00
JurrijnP
c5ae321187 Add "Priority Speaker" permission as constant (#628)
* Bump to v0.17.0

* Add members from GuildMembersChunk to state (#454)

* Revert "Add members from GuildMembersChunk to state (#454)" (#455)

This reverts commit e4487b30d4.

* added clarification when initializing discordgo

from the code I ran on my system with the latest changes this seems to be the syntax for the authentication tokens. I'm guessing it was just never updated.
Let me know if this is incorrect. 
Thanks!

* travis: update go versions

* Add "Priority Speaker" permission constant

The permission "Priority Speaker" was missing as constant. Permission has been added as constant and to the "PermissionAllVoice" constant as well.
2019-02-05 12:41:52 -08:00
Connor Wright
c8554477e4 Add HeartbeatLatency method (#593)
* Latency method

* fixed typo

* fixed linter error

* Renamed Latency to HeartbeatLatency

* HeartbeatLatency now returns time.Time

* return time.Duration instead, since .Sub() returns that

* Add full-stops to end of comments
2018-09-26 13:22:21 -07:00
Sebastian Winkler
6d2c944ad6 adds rate_limit_per_user to ChannelEdit (#585) 2018-09-20 12:38:28 -07:00
Necroforger
27581e260f Add PermissionManageWebhooks and PermissionManageEmojis to PermissionAll (#580) 2018-08-30 17:08:21 -07:00
Skippy
56e4d6a57b
Merge pull request #562 from Necroforger/member_mention
Add Member.Mention
2018-08-22 19:56:39 -05:00
Skippy
25b80afaab
Merge pull request #570 from pixelrazor/develop
Changed Member.JoinedAt to type Timestamp
2018-08-22 19:43:43 -05:00
Qais Patankar
34307e9a0b Add ErrCodeUnknownWebhook (#573) 2018-08-18 09:10:18 -07:00
Unknown
9c1fd5d8a9 Changed Member.JoinedAt to type Timestamp
It was previously just string, but has been updated to be consistent with the other structs.
2018-07-31 15:32:29 -05:00
Rens Rikkerink
1593c55523 Added .MessageFormat() to emoji struct (#569)
* Added .ChatName() to emoji struct

* Renamed ChatName to MessageFormat

* Fix lint
2018-07-31 11:36:58 -07:00
necro
e5c968d7a6 Add Member.Mention 2018-06-23 16:06:45 -04:00
Cory Ory
e28d444422 Add userlimit to the channel struct (#557) 2018-06-06 18:20:03 -07:00
Sebastian Winkler
9aae26445f
adds InviteWithCounts 2018-05-23 16:27:14 +02:00
Dim
82c8cf21b2 Add GuildID to multiple structs (#541) 2018-05-02 17:07:23 -07:00
Rens Rikkerink
22ec91f6cf Added Mention() func for Channel (#536)
* Added Mention() func for Channel

* Changed variable name

Adding the func in Github was so simple I didn't bother seeing if it'd compile, I shortly after realised my mistake.
2018-04-19 08:41:00 -07:00
tsudoko
aad0e0b32a Add Icon channel field (#531) 2018-04-09 20:26:23 -07:00
Sebastian Winkler
dd26841a4f
adds missing fields to guild struct 2018-04-03 16:55:56 +02:00
Carson Hoffman
964060f34c General documentation improvements 2018-03-14 14:57:40 -04:00
Necroforger
1ff9565306 Added UserConnections function and structs (#514)
* Added UserConnections function and structs

* Rename Connection to UserConnection

* Embed Integrations inside GuildIntegration and remove GuildIntegrationAccount

* Replaced GuildIntegration with Integration
2018-03-07 15:45:09 -08:00
Carson Hoffman
5765bb7804 Added Role.Mention function 2018-01-28 20:02:52 -05:00
Eric Wohltman
8591961512 Small update to supported Game Activity Types (#500) 2018-01-11 16:48:25 -08:00
Sebastian Winkler
18dfe540ad adds GuildAuditLog() (#504)
* adds GuildAuditLogs()

* adds missing comments to GuildAuditLog
2018-01-11 07:09:12 -08:00
Sebastian Winkler
e6ed3d579b adds support for animated emojis (#496) 2017-12-22 08:35:44 -08:00