From f14112d93d0a94236501a30f6251a2999f1496f5 Mon Sep 17 00:00:00 2001 From: TopiSenpai Date: Mon, 7 Mar 2022 13:49:51 +0100 Subject: [PATCH 1/2] add application_id to interaction struct and remove appID param from rest routes --- examples/components/main.go | 4 ++-- examples/context_menus/main.go | 2 +- examples/slash_commands/main.go | 20 ++++++++++---------- examples/voice_receive/go.mod | 9 +++++++++ examples/voice_receive/go.sum | 5 +++++ examples/voice_receive/main.go | 2 +- interactions.go | 1 + restapi.go | 30 ++++++++++++------------------ 8 files changed, 41 insertions(+), 32 deletions(-) diff --git a/examples/components/main.go b/examples/components/main.go index d3c20f7f9..45b580333 100644 --- a/examples/components/main.go +++ b/examples/components/main.go @@ -139,7 +139,7 @@ var ( panic(err) } time.Sleep(time.Second) // Doing that so user won't see instant response. - _, err = s.FollowupMessageCreate(*AppID, i.Interaction, true, &discordgo.WebhookParams{ + _, err = s.FollowupMessageCreate(i.Interaction, true, &discordgo.WebhookParams{ Content: "Anyways, now when you know how to use single select menus, let's see how multi select menus work. " + "Try calling `/selects multi` command.", Flags: 1 << 6, @@ -164,7 +164,7 @@ var ( panic(err) } time.Sleep(time.Second) // Doing that so user won't see instant response. - _, err = s.FollowupMessageCreate(*AppID, i.Interaction, true, &discordgo.WebhookParams{ + _, err = s.FollowupMessageCreate(i.Interaction, true, &discordgo.WebhookParams{ Content: "Now you know everything about select component. If you want to know more or ask a question - feel free to.", Components: []discordgo.MessageComponent{ discordgo.ActionsRow{ diff --git a/examples/context_menus/main.go b/examples/context_menus/main.go index 1d82a22d0..f5d4b92ef 100644 --- a/examples/context_menus/main.go +++ b/examples/context_menus/main.go @@ -85,7 +85,7 @@ var ( i.ApplicationCommandData().TargetID, ) if err != nil { - _, err = s.FollowupMessageCreate(*AppID, i.Interaction, true, &discordgo.WebhookParams{ + _, err = s.FollowupMessageCreate(i.Interaction, true, &discordgo.WebhookParams{ Content: fmt.Sprintf("Mission failed. Cannot send a message to this user: %q", err.Error()), Flags: 1 << 6, }) diff --git a/examples/slash_commands/main.go b/examples/slash_commands/main.go index 5ac892635..2ad5e2e3d 100644 --- a/examples/slash_commands/main.go +++ b/examples/slash_commands/main.go @@ -288,7 +288,7 @@ var ( Type: discordgo.InteractionResponseType(i.ApplicationCommandData().Options[0].IntValue()), }) if err != nil { - s.FollowupMessageCreate(s.State.User.ID, i.Interaction, true, &discordgo.WebhookParams{ + s.FollowupMessageCreate(i.Interaction, true, &discordgo.WebhookParams{ Content: "Something went wrong", }) } @@ -302,25 +302,25 @@ var ( }, }) if err != nil { - s.FollowupMessageCreate(s.State.User.ID, i.Interaction, true, &discordgo.WebhookParams{ + s.FollowupMessageCreate(i.Interaction, true, &discordgo.WebhookParams{ Content: "Something went wrong", }) return } time.AfterFunc(time.Second*5, func() { - _, err = s.InteractionResponseEdit(s.State.User.ID, i.Interaction, &discordgo.WebhookEdit{ + _, err = s.InteractionResponseEdit(i.Interaction, &discordgo.WebhookEdit{ Content: content + "\n\nWell, now you know how to create and edit responses. " + "But you still don't know how to delete them... so... wait 10 seconds and this " + "message will be deleted.", }) if err != nil { - s.FollowupMessageCreate(s.State.User.ID, i.Interaction, true, &discordgo.WebhookParams{ + s.FollowupMessageCreate(i.Interaction, true, &discordgo.WebhookParams{ Content: "Something went wrong", }) return } time.Sleep(time.Second * 10) - s.InteractionResponseDelete(s.State.User.ID, i.Interaction) + s.InteractionResponseDelete(i.Interaction) }) }, "followups": func(s *discordgo.Session, i *discordgo.InteractionCreate) { @@ -338,26 +338,26 @@ var ( Content: "Surprise!", }, }) - msg, err := s.FollowupMessageCreate(s.State.User.ID, i.Interaction, true, &discordgo.WebhookParams{ + msg, err := s.FollowupMessageCreate(i.Interaction, true, &discordgo.WebhookParams{ Content: "Followup message has been created, after 5 seconds it will be edited", }) if err != nil { - s.FollowupMessageCreate(s.State.User.ID, i.Interaction, true, &discordgo.WebhookParams{ + s.FollowupMessageCreate(i.Interaction, true, &discordgo.WebhookParams{ Content: "Something went wrong", }) return } time.Sleep(time.Second * 5) - s.FollowupMessageEdit(s.State.User.ID, i.Interaction, msg.ID, &discordgo.WebhookEdit{ + s.FollowupMessageEdit(i.Interaction, msg.ID, &discordgo.WebhookEdit{ Content: "Now the original message is gone and after 10 seconds this message will ~~self-destruct~~ be deleted.", }) time.Sleep(time.Second * 10) - s.FollowupMessageDelete(s.State.User.ID, i.Interaction, msg.ID) + s.FollowupMessageDelete(i.Interaction, msg.ID) - s.FollowupMessageCreate(s.State.User.ID, i.Interaction, true, &discordgo.WebhookParams{ + s.FollowupMessageCreate(i.Interaction, true, &discordgo.WebhookParams{ Content: "For those, who didn't skip anything and followed tutorial along fairly, " + "take a unicorn :unicorn: as reward!\n" + "Also, as bonus... look at the original interaction response :D", diff --git a/examples/voice_receive/go.mod b/examples/voice_receive/go.mod index f6bbdeb80..0c3232c58 100644 --- a/examples/voice_receive/go.mod +++ b/examples/voice_receive/go.mod @@ -1,7 +1,16 @@ module github.com/bwmarrin/discordgo/examples/voice_receive +go 1.17 + require ( github.com/bwmarrin/discordgo v0.21.1 github.com/pion/rtp v1.6.0 github.com/pion/webrtc/v3 v3.0.0-20200721060053-ca3cc9d940bc ) + +require ( + github.com/gorilla/websocket v1.4.0 // indirect + github.com/pion/randutil v0.1.0 // indirect + golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 // indirect + golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd // indirect +) diff --git a/examples/voice_receive/go.sum b/examples/voice_receive/go.sum index 51c101e56..0fb8771b8 100644 --- a/examples/voice_receive/go.sum +++ b/examples/voice_receive/go.sum @@ -2,6 +2,7 @@ github.com/bwmarrin/discordgo v0.21.1 h1:UI2PWwzvn5IFuscYcDc6QB/duhs9MUIjQ4HclcI github.com/bwmarrin/discordgo v0.21.1/go.mod h1:c1WtWUGN6nREDmzIpyTp/iD3VYt4Fpx+bVyfBG7JE+M= github.com/cheekybits/genny v1.0.0/go.mod h1:+tQajlRqAUrPI7DOSpB0XAqZYtQakVtB7wXkRAgjxjQ= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= @@ -43,12 +44,14 @@ github.com/pion/udp v0.1.0/go.mod h1:BPELIjbwE9PRbd/zxI/KYBnbo7B6+oA6YuEaNE8lths github.com/pion/webrtc/v3 v3.0.0-20200721060053-ca3cc9d940bc h1:MEXLzhmwidVyYVKJ+Z+b+eumAc3Pz8yrms26RPHF4J4= github.com/pion/webrtc/v3 v3.0.0-20200721060053-ca3cc9d940bc/go.mod h1:g1cyQ0CajooTxiCtJOcH+P5S2uC5cVwUhV3Rj4v0uUg= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/sclevine/agouti v3.0.0+incompatible/go.mod h1:b4WX9W9L1sfQKXeJf1mUTLZKJ48R1S7H23Ji7oFO5Bw= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= golang.org/x/crypto v0.0.0-20181030102418-4d3f4d9ffa16/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190228161510-8dd112bcdc25/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= @@ -65,6 +68,7 @@ golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190228124157-a34e9553db1e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd h1:xhmwyvizuTgC2qz7ZlMluP20uW+C3Rm0FD/WLDX8884= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -74,4 +78,5 @@ gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMy gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/examples/voice_receive/main.go b/examples/voice_receive/main.go index c480b9e2e..90b4a5113 100644 --- a/examples/voice_receive/main.go +++ b/examples/voice_receive/main.go @@ -75,7 +75,7 @@ func main() { defer s.Close() // We only really care about receiving voice state updates. - s.Identify.Intents = discordgo.IntentsGuildVoiceStates + *s.Identify.Intents = discordgo.IntentsGuildVoiceStates err = s.Open() if err != nil { diff --git a/interactions.go b/interactions.go index 0e5ae3c4a..2d76eea63 100644 --- a/interactions.go +++ b/interactions.go @@ -175,6 +175,7 @@ func (t InteractionType) String() string { // Interaction represents data of an interaction. type Interaction struct { ID string `json:"id"` + AppID string `json:"application_id"` Type InteractionType `json:"type"` Data InteractionData `json:"data"` GuildID string `json:"guild_id"` diff --git a/restapi.go b/restapi.go index d81946466..e1f2de069 100644 --- a/restapi.go +++ b/restapi.go @@ -2706,25 +2706,22 @@ func (s *Session) InteractionRespond(interaction *Interaction, resp *Interaction } // InteractionResponse gets the response to an interaction. -// appID : The application ID. // interaction : Interaction instance. -func (s *Session) InteractionResponse(appID string, interaction *Interaction) (*Message, error) { - return s.WebhookMessage(appID, interaction.Token, "@original") +func (s *Session) InteractionResponse(interaction *Interaction) (*Message, error) { + return s.WebhookMessage(interaction.AppID, interaction.Token, "@original") } // InteractionResponseEdit edits the response to an interaction. -// appID : The application ID. // interaction : Interaction instance. // newresp : Updated response message data. -func (s *Session) InteractionResponseEdit(appID string, interaction *Interaction, newresp *WebhookEdit) (*Message, error) { - return s.WebhookMessageEdit(appID, interaction.Token, "@original", newresp) +func (s *Session) InteractionResponseEdit(interaction *Interaction, newresp *WebhookEdit) (*Message, error) { + return s.WebhookMessageEdit(interaction.AppID, interaction.Token, "@original", newresp) } // InteractionResponseDelete deletes the response to an interaction. -// appID : The application ID. // interaction : Interaction instance. -func (s *Session) InteractionResponseDelete(appID string, interaction *Interaction) error { - endpoint := EndpointInteractionResponseActions(appID, interaction.Token) +func (s *Session) InteractionResponseDelete(interaction *Interaction) error { + endpoint := EndpointInteractionResponseActions(interaction.AppID, interaction.Token) _, err := s.RequestWithBucketID("DELETE", endpoint, nil, endpoint) @@ -2732,29 +2729,26 @@ func (s *Session) InteractionResponseDelete(appID string, interaction *Interacti } // FollowupMessageCreate creates the followup message for an interaction. -// appID : The application ID. // interaction : Interaction instance. // wait : Waits for server confirmation of message send and ensures that the return struct is populated (it is nil otherwise) // data : Data of the message to send. -func (s *Session) FollowupMessageCreate(appID string, interaction *Interaction, wait bool, data *WebhookParams) (*Message, error) { - return s.WebhookExecute(appID, interaction.Token, wait, data) +func (s *Session) FollowupMessageCreate(interaction *Interaction, wait bool, data *WebhookParams) (*Message, error) { + return s.WebhookExecute(interaction.AppID, interaction.Token, wait, data) } // FollowupMessageEdit edits a followup message of an interaction. -// appID : The application ID. // interaction : Interaction instance. // messageID : The followup message ID. // data : Data to update the message -func (s *Session) FollowupMessageEdit(appID string, interaction *Interaction, messageID string, data *WebhookEdit) (*Message, error) { - return s.WebhookMessageEdit(appID, interaction.Token, messageID, data) +func (s *Session) FollowupMessageEdit(interaction *Interaction, messageID string, data *WebhookEdit) (*Message, error) { + return s.WebhookMessageEdit(interaction.AppID, interaction.Token, messageID, data) } // FollowupMessageDelete deletes a followup message of an interaction. -// appID : The application ID. // interaction : Interaction instance. // messageID : The followup message ID. -func (s *Session) FollowupMessageDelete(appID string, interaction *Interaction, messageID string) error { - return s.WebhookMessageDelete(appID, interaction.Token, messageID) +func (s *Session) FollowupMessageDelete(interaction *Interaction, messageID string) error { + return s.WebhookMessageDelete(interaction.AppID, interaction.Token, messageID) } // ------------------------------------------------------------------------------------------------ From 662034c85194851b0f80df02c5e1e0b933bc4c2e Mon Sep 17 00:00:00 2001 From: TopiSenpai Date: Thu, 14 Apr 2022 20:39:10 +0200 Subject: [PATCH 2/2] revert voice receive go mod & sum --- examples/voice_receive/go.mod | 9 --------- examples/voice_receive/go.sum | 5 ----- examples/voice_receive/main.go | 2 +- 3 files changed, 1 insertion(+), 15 deletions(-) diff --git a/examples/voice_receive/go.mod b/examples/voice_receive/go.mod index 0c3232c58..f6bbdeb80 100644 --- a/examples/voice_receive/go.mod +++ b/examples/voice_receive/go.mod @@ -1,16 +1,7 @@ module github.com/bwmarrin/discordgo/examples/voice_receive -go 1.17 - require ( github.com/bwmarrin/discordgo v0.21.1 github.com/pion/rtp v1.6.0 github.com/pion/webrtc/v3 v3.0.0-20200721060053-ca3cc9d940bc ) - -require ( - github.com/gorilla/websocket v1.4.0 // indirect - github.com/pion/randutil v0.1.0 // indirect - golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 // indirect - golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd // indirect -) diff --git a/examples/voice_receive/go.sum b/examples/voice_receive/go.sum index 0fb8771b8..51c101e56 100644 --- a/examples/voice_receive/go.sum +++ b/examples/voice_receive/go.sum @@ -2,7 +2,6 @@ github.com/bwmarrin/discordgo v0.21.1 h1:UI2PWwzvn5IFuscYcDc6QB/duhs9MUIjQ4HclcI github.com/bwmarrin/discordgo v0.21.1/go.mod h1:c1WtWUGN6nREDmzIpyTp/iD3VYt4Fpx+bVyfBG7JE+M= github.com/cheekybits/genny v1.0.0/go.mod h1:+tQajlRqAUrPI7DOSpB0XAqZYtQakVtB7wXkRAgjxjQ= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= @@ -44,14 +43,12 @@ github.com/pion/udp v0.1.0/go.mod h1:BPELIjbwE9PRbd/zxI/KYBnbo7B6+oA6YuEaNE8lths github.com/pion/webrtc/v3 v3.0.0-20200721060053-ca3cc9d940bc h1:MEXLzhmwidVyYVKJ+Z+b+eumAc3Pz8yrms26RPHF4J4= github.com/pion/webrtc/v3 v3.0.0-20200721060053-ca3cc9d940bc/go.mod h1:g1cyQ0CajooTxiCtJOcH+P5S2uC5cVwUhV3Rj4v0uUg= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/sclevine/agouti v3.0.0+incompatible/go.mod h1:b4WX9W9L1sfQKXeJf1mUTLZKJ48R1S7H23Ji7oFO5Bw= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= -github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= golang.org/x/crypto v0.0.0-20181030102418-4d3f4d9ffa16/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190228161510-8dd112bcdc25/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= @@ -68,7 +65,6 @@ golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190228124157-a34e9553db1e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd h1:xhmwyvizuTgC2qz7ZlMluP20uW+C3Rm0FD/WLDX8884= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -78,5 +74,4 @@ gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMy gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/examples/voice_receive/main.go b/examples/voice_receive/main.go index 90b4a5113..c480b9e2e 100644 --- a/examples/voice_receive/main.go +++ b/examples/voice_receive/main.go @@ -75,7 +75,7 @@ func main() { defer s.Close() // We only really care about receiving voice state updates. - *s.Identify.Intents = discordgo.IntentsGuildVoiceStates + s.Identify.Intents = discordgo.IntentsGuildVoiceStates err = s.Open() if err != nil {