Browse Source

Remove deprecated response types (#930)

* update deprecated notices

* remove deprecated response types

* remove InteractionResponseChannelMessage usage

* remove deprecated response types from example options

* stop using iota for respone type constants
Pierce 3 years ago
parent
commit
ec2cf69202
2 changed files with 4 additions and 25 deletions
  1. 1 15
      examples/slash_commands/main.go
  2. 3 10
      interactions.go

+ 1 - 15
examples/slash_commands/main.go

@@ -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,
 						},
 					},
@@ -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. " +

+ 3 - 10
interactions.go

@@ -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.