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
This commit is contained in:
Pierce 2021-05-14 22:18:50 -04:00 committed by GitHub
parent 7d7206b01b
commit ec2cf69202
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 25 deletions

View file

@ -133,20 +133,12 @@ var (
Description: "Response type", Description: "Response type",
Type: discordgo.ApplicationCommandOptionInteger, Type: discordgo.ApplicationCommandOptionInteger,
Choices: []*discordgo.ApplicationCommandOptionChoice{ Choices: []*discordgo.ApplicationCommandOptionChoice{
{
Name: "Acknowledge",
Value: 2,
},
{
Name: "Channel message",
Value: 3,
},
{ {
Name: "Channel message with source", Name: "Channel message with source",
Value: 4, Value: 4,
}, },
{ {
Name: "Acknowledge with source", Name: "Deferred response With Source",
Value: 5, Value: 5,
}, },
}, },
@ -247,12 +239,6 @@ var (
// As you can see, the response type names used here are pretty self-explanatory, // 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 // but for those who want more information see the official documentation
switch i.Data.Options[0].IntValue() { 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): case int64(discordgo.InteractionResponseChannelMessageWithSource):
content = content =
"You just responded to an interaction, sent a message and showed the original one. " + "You just responded to an interaction, sent a message and showed the original one. " +

View file

@ -227,18 +227,11 @@ type InteractionResponseType uint8
// Interaction response types. // Interaction response types.
const ( const (
// InteractionResponsePong is for ACK ping event. // InteractionResponsePong is for ACK ping event.
InteractionResponsePong = InteractionResponseType(iota + 1) InteractionResponsePong InteractionResponseType = 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
// InteractionResponseChannelMessageWithSource is for responding with a message, showing the user's input. // 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. // InteractionResponseDeferredChannelMessageWithSource acknowledges that the event was received, and that a follow-up will come later.
// It was previously named InteractionResponseACKWithSource. InteractionResponseDeferredChannelMessageWithSource InteractionResponseType = 5
InteractionResponseDeferredChannelMessageWithSource
) )
// InteractionResponse represents a response for an interaction event. // InteractionResponse represents a response for an interaction event.