diff --git a/dbot/commands/play.go b/dbot/commands/play.go index 5851cd4..efe796f 100644 --- a/dbot/commands/play.go +++ b/dbot/commands/play.go @@ -277,7 +277,7 @@ func playAndQueue(b *dbot.Bot, i discord.BaseInteraction, tracks ...lavalink.Aud } func giveSearchSelection(b *dbot.Bot, e *events.ApplicationCommandInteractionCreate, tracks []lavalink.AudioTrack) { - var options []discord.SelectMenuOption + var options []discord.StringSelectMenuOption for i, track := range tracks { if len(options) >= 25 { break @@ -291,7 +291,7 @@ func giveSearchSelection(b *dbot.Bot, e *events.ApplicationCommandInteractionCre description = description[:99] + "…" } - options = append(options, discord.SelectMenuOption{ + options = append(options, discord.StringSelectMenuOption{ Label: label, Description: description, Value: strconv.Itoa(i), @@ -303,7 +303,7 @@ func giveSearchSelection(b *dbot.Bot, e *events.ApplicationCommandInteractionCre if _, err := e.Client().Rest().UpdateInteractionResponse(e.ApplicationID(), e.Token(), responses.UpdateSuccessComponentsf("Select tracks to play.", nil, discord.NewActionRow( - discord.NewSelectMenu("search:"+e.ID().String(), "Select tracks to play.", options...).WithMaxValues(len(options)), + discord.NewStringSelectMenu("search:"+e.ID().String(), "Select tracks to play.", options...).WithMaxValues(len(options)), )), ); err != nil { b.Logger.Error("Error while updating interaction message: ", err) @@ -331,7 +331,7 @@ func giveSearchSelection(b *dbot.Bot, e *events.ApplicationCommandInteractionCre return } var playTracks []lavalink.AudioTrack - for _, value := range ne.SelectMenuInteractionData().Values { + for _, value := range ne.StringSelectMenuInteractionData().Values { index, _ := strconv.Atoi(value) playTracks = append(playTracks, tracks[index]) } diff --git a/dbot/commands/report_components.go b/dbot/commands/report_components.go index da32ee4..3376279 100644 --- a/dbot/commands/report_components.go +++ b/dbot/commands/report_components.go @@ -74,10 +74,10 @@ func reportConfirmHandler(b *dbot.Bot) handler.ComponentHandler { }) } - var selectMenuOptions []discord.SelectMenuOption + var selectMenuOptions []discord.StringSelectMenuOption if reportCount > 0 { - selectMenuOptions = append(selectMenuOptions, discord.SelectMenuOption{ + selectMenuOptions = append(selectMenuOptions, discord.StringSelectMenuOption{ Label: "Show Previous Reports", Value: "show-reports", Emoji: &discord.ComponentEmoji{ @@ -87,7 +87,7 @@ func reportConfirmHandler(b *dbot.Bot) handler.ComponentHandler { } if report.MessageID != "0" && report.ChannelID != "0" { - selectMenuOptions = append(selectMenuOptions, discord.SelectMenuOption{ + selectMenuOptions = append(selectMenuOptions, discord.StringSelectMenuOption{ Label: "Delete Message", Value: "delete-message", Emoji: &discord.ComponentEmoji{ @@ -96,7 +96,7 @@ func reportConfirmHandler(b *dbot.Bot) handler.ComponentHandler { }) } - selectMenuOptions = append(selectMenuOptions, []discord.SelectMenuOption{ + selectMenuOptions = append(selectMenuOptions, []discord.StringSelectMenuOption{ { Label: "Delete Report", Value: "delete-report", @@ -130,7 +130,7 @@ func reportConfirmHandler(b *dbot.Bot) handler.ComponentHandler { return e.UpdateMessage(discord.MessageUpdate{ Components: &[]discord.ContainerComponent{ discord.ActionRowComponent{ - discord.SelectMenuComponent{ + discord.StringSelectMenuComponent{ CustomID: fmt.Sprintf("handler:report-action:%d", reportID), Placeholder: "Select an action", MinValues: json.Ptr(1), @@ -198,7 +198,7 @@ func reportActionHandler(b *dbot.Bot) handler.ComponentHandler { reason := fmt.Sprintf("AutoMod action by: %s\nCaused by report #%d", e.User().Tag(), reportID) var content string - value := e.SelectMenuInteractionData().Values[0] + value := e.StringSelectMenuInteractionData().Values[0] switch value { case "delete-message": if err = b.Client.Rest().DeleteMessage(snowflake.MustParse(report.ChannelID), snowflake.MustParse(report.MessageID), rest.WithReason(reason)); err != nil { diff --git a/go.mod b/go.mod index 45caf2e..83d3579 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/KittyBot-Org/KittyBotGo go 1.18 require ( - github.com/disgoorg/disgo v0.13.22 + github.com/disgoorg/disgo v0.14.1-0.20221217000909-728480f0d5fc github.com/disgoorg/disgolink/disgolink v1.7.4 github.com/disgoorg/disgolink/lavalink v1.7.3 github.com/disgoorg/handler v0.3.0 diff --git a/go.sum b/go.sum index be81bd7..54950a1 100644 --- a/go.sum +++ b/go.sum @@ -59,8 +59,8 @@ github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7Do 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/disgoorg/disgo v0.13.22 h1:Vf49TkfC5djuMTbS9qdg/pr/pCNUxHQtx8/dMPu3aWI= -github.com/disgoorg/disgo v0.13.22/go.mod h1:YiVpXSmyXLRalYQHTHUFWEQvolCNzw0zh6nfug07b/M= +github.com/disgoorg/disgo v0.14.1-0.20221217000909-728480f0d5fc h1:h+Hmx0gCVltfaYMibybuobJ1nW/lEnDQy/dLnJOhmx8= +github.com/disgoorg/disgo v0.14.1-0.20221217000909-728480f0d5fc/go.mod h1:YiVpXSmyXLRalYQHTHUFWEQvolCNzw0zh6nfug07b/M= github.com/disgoorg/disgolink/disgolink v1.7.4 h1:JqiB9fOMxEZHktfHc0LZVOCiNLVmkmtlIic8qDTd5W0= github.com/disgoorg/disgolink/disgolink v1.7.4/go.mod h1:qbYYCPJvmoBSxDnk+UznKRYa86QMsIZKQxfv9joBVr4= github.com/disgoorg/disgolink/lavalink v1.7.3 h1:i3wThR0CWWvabhR/HSYM8b6Ln7Ex3ZgX6Hs4VZ+ZSV0=