Skip to content

Commit

Permalink
update acknowledgment method documentation with linked references
Browse files Browse the repository at this point in the history
  • Loading branch information
BowsiePup committed Jan 18, 2025
1 parent fdd94b9 commit d964193
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions events/interaction_events.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,19 @@ func (e *ApplicationCommandInteractionCreate) Guild() (discord.Guild, bool) {
//
// This is used strictly for acknowledging the HTTP interaction request from discord. This responds with 202 Accepted.
//
// When using this, your first http request must be <event>.Client().Rest().CreateInteractionResponse()
// When using this, your first http request must be [rest.Interactions.CreateInteractionResponse] or [rest.Interactions.CreateInteractionResponseWithCallback]
//
// This does not produce a visible loading state to the user.
// You are expected to send a new http request within 3 seconds to respond to the interaction.
// This allows you to gracefully handle errors with your sent response & access the resulting message.
//
// If you want to create a visible loading state, use DeferCreateMessage.
//
// Source docs: https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-callback
// Source docs: [Discord Source docs]
//
// [rest.Interactions.CreateInteractionResponse]: https://pkg.go.dev/github.com/disgoorg/disgo/rest#Interactions.CreateInteractionResponse
// [rest.Interactions.CreateInteractionResponseWithCallback]: https://pkg.go.dev/github.com/disgoorg/disgo/rest#Interactions.CreateInteractionResponseWithCallback
// [Discord Source docs]: https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-callback
func (e *ApplicationCommandInteractionCreate) Acknowledge(opts ...rest.RequestOpt) error {
return e.Respond(discord.InteractionResponseTypeAcknowledge, nil, opts...)
}
Expand Down Expand Up @@ -110,15 +114,19 @@ func (e *ComponentInteractionCreate) Guild() (discord.Guild, bool) {
//
// This is used strictly for acknowledging the HTTP interaction request from discord. This responds with 202 Accepted.
//
// When using this, your first http request must be <event>.Client().Rest().CreateInteractionResponse()
// When using this, your first http request must be [rest.Interactions.CreateInteractionResponse] or [rest.Interactions.CreateInteractionResponseWithCallback]
//
// This does not produce a visible loading state to the user.
// You are expected to send a new http request within 3 seconds to respond to the interaction.
// This allows you to gracefully handle errors with your sent response & access the resulting message.
//
// If you want to create a visible loading state, use DeferCreateMessage.
//
// Source docs: https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-callback
// Source docs: [Discord Source docs]
//
// [rest.Interactions.CreateInteractionResponse]: https://pkg.go.dev/github.com/disgoorg/disgo/rest#Interactions.CreateInteractionResponse
// [rest.Interactions.CreateInteractionResponseWithCallback]: https://pkg.go.dev/github.com/disgoorg/disgo/rest#Interactions.CreateInteractionResponseWithCallback
// [Discord Source docs]: https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-callback
func (e *ComponentInteractionCreate) Acknowledge(opts ...rest.RequestOpt) error {
return e.Respond(discord.InteractionResponseTypeAcknowledge, nil, opts...)
}
Expand Down Expand Up @@ -206,15 +214,19 @@ func (e *ModalSubmitInteractionCreate) Guild() (discord.Guild, bool) {
//
// This is used strictly for acknowledging the HTTP interaction request from discord. This responds with 202 Accepted.
//
// When using this, your first http request must be <event>.Client().Rest().CreateInteractionResponse()
// When using this, your first http request must be [rest.Interactions.CreateInteractionResponse] or [rest.Interactions.CreateInteractionResponseWithCallback]
//
// This does not produce a visible loading state to the user.
// You are expected to send a new http request within 3 seconds to respond to the interaction.
// This allows you to gracefully handle errors with your sent response & access the resulting message.
//
// If you want to create a visible loading state, use DeferCreateMessage.
//
// Source docs: https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-callback
// Source docs: [Discord Source docs]
//
// [rest.Interactions.CreateInteractionResponse]: https://pkg.go.dev/github.com/disgoorg/disgo/rest#Interactions.CreateInteractionResponse
// [rest.Interactions.CreateInteractionResponseWithCallback]: https://pkg.go.dev/github.com/disgoorg/disgo/rest#Interactions.CreateInteractionResponseWithCallback
// [Discord Source docs]: https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-callback
func (e *ModalSubmitInteractionCreate) Acknowledge(opts ...rest.RequestOpt) error {
return e.Respond(discord.InteractionResponseTypeAcknowledge, nil, opts...)
}
Expand Down

0 comments on commit d964193

Please sign in to comment.