Skip to content

Commit 38d6e32

Browse files
committed
try disgo gateway cleanup
1 parent 177c186 commit 38d6e32

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

dbot/commands/play.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ func playAndQueue(b *dbot.Bot, i discord.BaseInteraction, tracks ...lavalink.Aud
277277
}
278278

279279
func giveSearchSelection(b *dbot.Bot, e *events.ApplicationCommandInteractionCreate, tracks []lavalink.AudioTrack) {
280-
var options []discord.SelectMenuOption
280+
var options []discord.StringSelectMenuOption
281281
for i, track := range tracks {
282282
if len(options) >= 25 {
283283
break
@@ -291,7 +291,7 @@ func giveSearchSelection(b *dbot.Bot, e *events.ApplicationCommandInteractionCre
291291
description = description[:99] + "…"
292292
}
293293

294-
options = append(options, discord.SelectMenuOption{
294+
options = append(options, discord.StringSelectMenuOption{
295295
Label: label,
296296
Description: description,
297297
Value: strconv.Itoa(i),
@@ -303,7 +303,7 @@ func giveSearchSelection(b *dbot.Bot, e *events.ApplicationCommandInteractionCre
303303

304304
if _, err := e.Client().Rest().UpdateInteractionResponse(e.ApplicationID(), e.Token(),
305305
responses.UpdateSuccessComponentsf("Select tracks to play.", nil, discord.NewActionRow(
306-
discord.NewSelectMenu("search:"+e.ID().String(), "Select tracks to play.", options...).WithMaxValues(len(options)),
306+
discord.NewStringSelectMenu("search:"+e.ID().String(), "Select tracks to play.", options...).WithMaxValues(len(options)),
307307
)),
308308
); err != nil {
309309
b.Logger.Error("Error while updating interaction message: ", err)
@@ -331,7 +331,7 @@ func giveSearchSelection(b *dbot.Bot, e *events.ApplicationCommandInteractionCre
331331
return
332332
}
333333
var playTracks []lavalink.AudioTrack
334-
for _, value := range ne.SelectMenuInteractionData().Values {
334+
for _, value := range ne.StringSelectMenuInteractionData().Values {
335335
index, _ := strconv.Atoi(value)
336336
playTracks = append(playTracks, tracks[index])
337337
}

dbot/commands/report_components.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,10 @@ func reportConfirmHandler(b *dbot.Bot) handler.ComponentHandler {
7474
})
7575
}
7676

77-
var selectMenuOptions []discord.SelectMenuOption
77+
var selectMenuOptions []discord.StringSelectMenuOption
7878

7979
if reportCount > 0 {
80-
selectMenuOptions = append(selectMenuOptions, discord.SelectMenuOption{
80+
selectMenuOptions = append(selectMenuOptions, discord.StringSelectMenuOption{
8181
Label: "Show Previous Reports",
8282
Value: "show-reports",
8383
Emoji: &discord.ComponentEmoji{
@@ -87,7 +87,7 @@ func reportConfirmHandler(b *dbot.Bot) handler.ComponentHandler {
8787
}
8888

8989
if report.MessageID != "0" && report.ChannelID != "0" {
90-
selectMenuOptions = append(selectMenuOptions, discord.SelectMenuOption{
90+
selectMenuOptions = append(selectMenuOptions, discord.StringSelectMenuOption{
9191
Label: "Delete Message",
9292
Value: "delete-message",
9393
Emoji: &discord.ComponentEmoji{
@@ -96,7 +96,7 @@ func reportConfirmHandler(b *dbot.Bot) handler.ComponentHandler {
9696
})
9797
}
9898

99-
selectMenuOptions = append(selectMenuOptions, []discord.SelectMenuOption{
99+
selectMenuOptions = append(selectMenuOptions, []discord.StringSelectMenuOption{
100100
{
101101
Label: "Delete Report",
102102
Value: "delete-report",
@@ -130,7 +130,7 @@ func reportConfirmHandler(b *dbot.Bot) handler.ComponentHandler {
130130
return e.UpdateMessage(discord.MessageUpdate{
131131
Components: &[]discord.ContainerComponent{
132132
discord.ActionRowComponent{
133-
discord.SelectMenuComponent{
133+
discord.StringSelectMenuComponent{
134134
CustomID: fmt.Sprintf("handler:report-action:%d", reportID),
135135
Placeholder: "Select an action",
136136
MinValues: json.Ptr(1),
@@ -198,7 +198,7 @@ func reportActionHandler(b *dbot.Bot) handler.ComponentHandler {
198198
reason := fmt.Sprintf("AutoMod action by: %s\nCaused by report #%d", e.User().Tag(), reportID)
199199

200200
var content string
201-
value := e.SelectMenuInteractionData().Values[0]
201+
value := e.StringSelectMenuInteractionData().Values[0]
202202
switch value {
203203
case "delete-message":
204204
if err = b.Client.Rest().DeleteMessage(snowflake.MustParse(report.ChannelID), snowflake.MustParse(report.MessageID), rest.WithReason(reason)); err != nil {

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module github.com/KittyBot-Org/KittyBotGo
33
go 1.18
44

55
require (
6-
github.com/disgoorg/disgo v0.13.22
6+
github.com/disgoorg/disgo v0.14.1-0.20221217000909-728480f0d5fc
77
github.com/disgoorg/disgolink/disgolink v1.7.4
88
github.com/disgoorg/disgolink/lavalink v1.7.3
99
github.com/disgoorg/handler v0.3.0

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7Do
5959
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
6060
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
6161
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
62-
github.com/disgoorg/disgo v0.13.22 h1:Vf49TkfC5djuMTbS9qdg/pr/pCNUxHQtx8/dMPu3aWI=
63-
github.com/disgoorg/disgo v0.13.22/go.mod h1:YiVpXSmyXLRalYQHTHUFWEQvolCNzw0zh6nfug07b/M=
62+
github.com/disgoorg/disgo v0.14.1-0.20221217000909-728480f0d5fc h1:h+Hmx0gCVltfaYMibybuobJ1nW/lEnDQy/dLnJOhmx8=
63+
github.com/disgoorg/disgo v0.14.1-0.20221217000909-728480f0d5fc/go.mod h1:YiVpXSmyXLRalYQHTHUFWEQvolCNzw0zh6nfug07b/M=
6464
github.com/disgoorg/disgolink/disgolink v1.7.4 h1:JqiB9fOMxEZHktfHc0LZVOCiNLVmkmtlIic8qDTd5W0=
6565
github.com/disgoorg/disgolink/disgolink v1.7.4/go.mod h1:qbYYCPJvmoBSxDnk+UznKRYa86QMsIZKQxfv9joBVr4=
6666
github.com/disgoorg/disgolink/lavalink v1.7.3 h1:i3wThR0CWWvabhR/HSYM8b6Ln7Ex3ZgX6Hs4VZ+ZSV0=

0 commit comments

Comments
 (0)