Skip to content

Commit

Permalink
Remove deprecated response types (#930)
Browse files Browse the repository at this point in the history
* update deprecated notices

* remove deprecated response types

* remove InteractionResponseChannelMessage usage

* remove deprecated response types from example options

* stop using iota for respone type constants
  • Loading branch information
plally committed May 15, 2021
1 parent 7d7206b commit ec2cf69
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 25 deletions.
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 @@ -227,18 +227,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
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

0 comments on commit ec2cf69

Please sign in to comment.