Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove deprecated response types #930

Merged
merged 5 commits into from May 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 1 addition & 15 deletions examples/slash_commands/main.go
Expand Up @@ -133,20 +133,12 @@ var (
Description: "Response type",
Type: discordgo.ApplicationCommandOptionInteger,
Choices: []*discordgo.ApplicationCommandOptionChoice{
{
Name: "Acknowledge",
Value: 2,
},
{
Name: "Channel message",
Value: 3,
},
{
Name: "Channel message with source",
Value: 4,
},
{
Name: "Acknowledge with source",
Name: "Deferred response With Source",
Value: 5,
},
},
Expand Down Expand Up @@ -247,12 +239,6 @@ var (
// As you can see, the response type names used here are pretty self-explanatory,
// but for those who want more information see the official documentation
switch i.Data.Options[0].IntValue() {
case int64(discordgo.InteractionResponseChannelMessage):
content =
"Well, you just responded to an interaction, and sent a message.\n" +
"That's all what I wanted to say, yeah."
content +=
"\nAlso... you can edit your response, wait 5 seconds and this message will be changed"
case int64(discordgo.InteractionResponseChannelMessageWithSource):
content =
"You just responded to an interaction, sent a message and showed the original one. " +
Expand Down
13 changes: 3 additions & 10 deletions interactions.go
Expand Up @@ -226,18 +226,11 @@ type InteractionResponseType uint8
// Interaction response types.
const (
// InteractionResponsePong is for ACK ping event.
InteractionResponsePong = InteractionResponseType(iota + 1)
// InteractionResponseAcknowledge is for ACK a command without sending a message, eating the user's input.
// NOTE: this type is being imminently deprecated, and **will be removed when this occurs.**
InteractionResponseAcknowledge
// InteractionResponseChannelMessage is for responding with a message, eating the user's input.
// NOTE: this type is being imminently deprecated, and **will be removed when this occurs.**
InteractionResponseChannelMessage
plally marked this conversation as resolved.
Show resolved Hide resolved
InteractionResponsePong InteractionResponseType = 1
// InteractionResponseChannelMessageWithSource is for responding with a message, showing the user's input.
InteractionResponseChannelMessageWithSource
InteractionResponseChannelMessageWithSource InteractionResponseType = 4
// InteractionResponseDeferredChannelMessageWithSource acknowledges that the event was received, and that a follow-up will come later.
// It was previously named InteractionResponseACKWithSource.
InteractionResponseDeferredChannelMessageWithSource
InteractionResponseDeferredChannelMessageWithSource InteractionResponseType = 5
)

// InteractionResponse represents a response for an interaction event.
Expand Down