Skip to content

Commit

Permalink
try disgo gateway cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
topi314 committed Dec 17, 2022
1 parent 177c186 commit 38d6e32
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
8 changes: 4 additions & 4 deletions dbot/commands/play.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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),
Expand All @@ -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)
Expand Down Expand Up @@ -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])
}
Expand Down
12 changes: 6 additions & 6 deletions dbot/commands/report_components.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand All @@ -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{
Expand All @@ -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",
Expand Down Expand Up @@ -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),
Expand Down Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down

0 comments on commit 38d6e32

Please sign in to comment.