Fix usage of an outdated request in RequestWithLockedBucket after applying WithContext option
---------
Co-authored-by: Fedor Lapshin <fe.lap.prog@gmail.com>
* feat: add options for request methods
Add functional options to request, RequestWithBucketID, RequestWithLockedBucket.
These options allow for request modification and overriding REST related Session fields,
such as Client, MaxRestRetries and ShouldRetryOnRateLimit.
* feat: add context and retries options
Implement WithContext and WithMaxRestRetries options.
* feat: add documentation
Add documentation to the options
* feat(rest): add options to methods
Add option arguments to all Session methods.
* feat: add missed forwarded options
* feat: reword documentation
* refactor(requestConfig): rename to newRequestConfig
Rename requestConfig to newRequestConfig to match other
constructor functions naming.
* style: manually revert documentation formatting
Manually revert the formatting of documentation in certain functions.
* feat(UserChannelPermissions): add description of fetchOptions
Add description for fetchOptions parameter of Session.UserChannelPermissions.
* feat(ChannelMessageSendEmbedReply): pass options
Pass options to ChannelMessageSendEmbedsReply call in ChannelMessageSendEmbedReply
* docs(InviteComplex): revert parameter descriptions removal
* feat: role connection metadata
* feat: add role connection endpoints
Add User Application Role Connection endpoints:
* Get User Application Role Connection
* Update User Application Role Connection
* feat: add example
Add basic example to showcase linked roles flow.
* refactor(endpoints): move role connection metadata
Move Application Role Connection Metadata endpoint to other Application
endpoints.
* feat: forums
Initial implementation of forum channels REST API
* fix: linter
* feat: cosmetic changes
Added periods in the end of all documentation comments
* fix(ChannelFlagRequireTag): incorrect value
Fix incorrect value of ChannelFlagRequireTag.
* refactor(DefaultReaction): rename to ForumDefaultReaction
Rename DefaultReaction to ForumDefaultReaction.
* fix(Channel): use ForumDefaultReaction
Use ForumDefaultReaction instead of DefaultReaction in DefaultReactionEmoji field.
* fix: gofmt
* feat: cosmetic changes
* Change "GUILD_FORUM" to "forum" in comment to ForumTag
* Fix spacing for documentation of embeds parameter in ForumThreadStartEmbeds
* docs(ForumThreadStartComplex): align parameters
Align documentation for parameters of ForumThreadStartComplex.
* refactor(GuildRoleEdit)!: use struct params
Refactor GuildRoleEdit to accept parameters using a Params struct.
Therefore also allow partial edits.
* feat(GuildRoleCreate): initial parameters
Make GuildRoleCreate accept a struct with initial parameters for a role
* refactor(ChannelEdit)!: replace ChannelEditComplex
Move funcitonality of ChannelEditComplex to ChannelEdit
* chore: deprecate ChannelEditComplex
* feat(GuildEmbed)!: allow partial edits
* Make fields omitempty
* Make `Enabled` field a pointer
* refactor(GuildEmbedEdit)!: use params struct
Refactor GuildEmbedEdit to accept parameters through GuildEmbed struct
* refactor(GuildMemberEdit)!: replace GuildMemberEditComplex
Move functionality fo GuildMemberEditComplex to GuildMemberEdit
* chore: deprecate GuildMemberEditComplex
* refactor(GuildEmojiCreate)!: use struct params
Refactor GuildEmojiCreate to take parameters using EmojiParams struct.
* refactor(GuildEmojiEdit)!: use struct params
Refactor GuildEmojiEdit to take parameters using EmojiParams struct.
* refactor(GuildMemberAdd)!: use struct params
Refactor GuildMemberAdd to take parameters using GuildMemberAddParams struct.
* refactor(GuildTemplateEdit)!: use struct params
Refactor GuildTemplateEdit to take parameters using GuildTemplateParams struct.
* refactor(GuildTemplateCreate)!: use struct params
Refactor GuildTemplateCreate to take parameters using GuildTemplateParams struct.
* chore(rest)!: use pointers for Params structs
Refactor methods with Params struct to use pointers
* chore: grammar and style fixes in comments
* feat: auto moderation
* feat(examples/automod): add message content intent
* style(examples/automod): newline between sections
* feat(AutoModerationActionExecution): add user id
Add user_id field to AutoModerationActionExecution event.
* refactor(events): remove todos
Remove TODO comments for AutoModerationRuleUpdate and AutoModerationRuleDelete.
* feat(AutoModerationEventMessageSend): doc comment
Add documentation comment to AutoModerationEventMessageSend constant.
* add GET prefix for ApplicationCommands bucketID
* dont use local variable for bucketID
Co-authored-by: Fedor Lapshin <fe.lap.prog@gmail.com>
* format code
* remove newline
Co-authored-by: Fedor Lapshin <fe.lap.prog@gmail.com>
* Modify GuildEmojiEdit function of restapi.go
Changes function to not omit empty role information. This allows for properly resetting the roles of an emoji, otherwise it appears to be presently impossible to reset the roles (without including a role ID in the edit request).
* feat: code review changes
* feat: fix typo and rephrase
Co-authored-by: nitroflap <fe.lap.prog@gmail.com>
* feat: Add support of StageInstance RESTAPI and Events
* chore: Make the changes for following the current convention of package
* doc: Add missing docs and example for stage-instance
* doc: Add final log for deleted stage instance
* refactor: Prevent trailing slash on stage instance endpoint
* chore: Harmonize params structure
* Update structs.go
Co-authored-by: Fedor Lapshin <fe.lap.prog@gmail.com>
* docs: Remove deprecated doc
* docs: Add new documentation for restapi function
* 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>
* Update restapi.go
Co-authored-by: Fedor Lapshin <fe.lap.prog@gmail.com>
* 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>
* doc: Add sleep in example to let user see by themselves
Co-authored-by: Fedor Lapshin <fe.lap.prog@gmail.com>
* Create payload for Guild Member Edit
* Update rest API usage with new payload
* Update comment with ref to discord API
* Change data to pointer instead
* Change struct to just nick and roles
* Review comments
* feat(rest#GuildMemberEditComplex): return updated member and cosmetic changes
* feat(structs): renamed GuildMemberEditData to GuildMemberParams
* style(structs#GuildMemberParams): fix spacing
* fix(rest#GuildMemberEditComplex): use GuildMemberParams instead of GuildMemberEditData
Co-authored-by: nitroflap <fe.lap.prog@gmail.com>
* Added Guild Members Search Function
* Updated method name to be consistent with other endpoints
* Refactored and moved GuildMembersSearch method for consistency
* 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>
* 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>
* 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
* Create edit application command permissions endpoint
* Add remaining command permissions endpoints
* Clean up naming a bit
* Add docs for application command permissions endpoints
* Update comments
* More comments
* :^)
* Put the verb in API method names at the end
* Review feedback
* Add default permissions
* feat(restapi): rewording of comments to application command permissions endpoints
* fix(rest): errors for application commands permissions endpoints
* style(interactions): changed order of fields in ApplicationCommand
Co-authored-by: NotUnlikeTheWaves <hleistra@gmail.com>
Co-authored-by: nitroflap <fe.lap.prog@gmail.com>