Skip to content

Commit

Permalink
upgrade to discordgo v0.25.0
Browse files Browse the repository at this point in the history
  • Loading branch information
zekro committed Jul 10, 2022
1 parent 5acec66 commit 6a789f5
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 16 deletions.
12 changes: 2 additions & 10 deletions context.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
}

Expand Down
9 changes: 4 additions & 5 deletions followupmessage.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
}
Expand All @@ -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
}

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down

0 comments on commit 6a789f5

Please sign in to comment.