From 6a789f52c32d2816f71e302faafcc8d00a09fa87 Mon Sep 17 00:00:00 2001 From: zekro Date: Sun, 10 Jul 2022 17:53:31 +0000 Subject: [PATCH] upgrade to discordgo v0.25.0 --- context.go | 12 ++---------- followupmessage.go | 9 ++++----- go.mod | 2 +- go.sum | 2 ++ 4 files changed, 9 insertions(+), 16 deletions(-) diff --git a/context.go b/context.go index 734c8c8..297c45e 100644 --- a/context.go +++ b/context.go @@ -87,11 +87,7 @@ func (c *Ctx) Respond(r *discordgo.InteractionResponse) (err error) { if r == nil || r.Data == nil { return } - var self *discordgo.User - if self, err = c.Ken.opt.State.SelfUser(c.Session); err != nil { - return - } - _, err = c.Session.InteractionResponseEdit(self.ID, c.Event.Interaction, &discordgo.WebhookEdit{ + _, err = c.Session.InteractionResponseEdit(c.Event.Interaction, &discordgo.WebhookEdit{ Content: r.Data.Content, Embeds: r.Data.Embeds, Components: r.Data.Components, @@ -148,11 +144,7 @@ func (c *Ctx) FollowUp(wait bool, data *discordgo.WebhookParams) (fum *FollowUpM s: c.Session, i: c.Event.Interaction, } - fum.self, fum.Error = c.Ken.opt.State.SelfUser(c.Session) - if fum.Error != nil { - return - } - fum.Message, fum.Error = c.Session.FollowupMessageCreate(fum.self.ID, c.Event.Interaction, wait, data) + fum.Message, fum.Error = c.Session.FollowupMessageCreate(c.Event.Interaction, wait, data) return } diff --git a/followupmessage.go b/followupmessage.go index 147dc5a..dd1bdb6 100644 --- a/followupmessage.go +++ b/followupmessage.go @@ -15,9 +15,8 @@ type FollowUpMessage struct { // error occurrences during method execution. Error error - self *discordgo.User - s *discordgo.Session - i *discordgo.Interaction + s *discordgo.Session + i *discordgo.Interaction } // Edit overwrites the given follow up message with the @@ -28,7 +27,7 @@ func (m *FollowUpMessage) Edit(data *discordgo.WebhookEdit) (err error) { return } - inter, err := m.s.FollowupMessageEdit(m.self.ID, m.i, m.ID, data) + inter, err := m.s.FollowupMessageEdit(m.i, m.ID, data) if err != nil { return } @@ -53,7 +52,7 @@ func (m *FollowUpMessage) Delete() (err error) { return } - err = m.s.FollowupMessageDelete(m.self.ID, m.i, m.ID) + err = m.s.FollowupMessageDelete(m.i, m.ID) return } diff --git a/go.mod b/go.mod index ae9e6ea..95f7632 100644 --- a/go.mod +++ b/go.mod @@ -2,7 +2,7 @@ module github.com/zekrotja/ken go 1.17 -require github.com/bwmarrin/discordgo v0.23.3-0.20220216202327-6015eed9333e +require github.com/bwmarrin/discordgo v0.25.0 require ( github.com/gorilla/websocket v1.4.2 // indirect diff --git a/go.sum b/go.sum index d6e39a1..c4288a7 100644 --- a/go.sum +++ b/go.sum @@ -4,6 +4,8 @@ github.com/bwmarrin/discordgo v0.23.3-0.20210821175000-0fad116c6c2a h1:L7EuIzka8 github.com/bwmarrin/discordgo v0.23.3-0.20210821175000-0fad116c6c2a/go.mod h1:NJZpH+1AfhIcyQsPeuBKsUtYrRnjkyu0kIVMCHkZtRY= github.com/bwmarrin/discordgo v0.23.3-0.20220216202327-6015eed9333e h1:P7ba3v4TFTuN7eSJiegQBTWJVB560/nz5VkLUOLRuhI= github.com/bwmarrin/discordgo v0.23.3-0.20220216202327-6015eed9333e/go.mod h1:NJZpH+1AfhIcyQsPeuBKsUtYrRnjkyu0kIVMCHkZtRY= +github.com/bwmarrin/discordgo v0.25.0 h1:NXhdfHRNxtwso6FPdzW2i3uBvvU7UIQTghmV2T4nqAs= +github.com/bwmarrin/discordgo v0.25.0/go.mod h1:NJZpH+1AfhIcyQsPeuBKsUtYrRnjkyu0kIVMCHkZtRY= github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+qY= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=