Skip to content

Commit

Permalink
multiple filters
Browse files Browse the repository at this point in the history
  • Loading branch information
evandeters committed Sep 24, 2024
1 parent b05773e commit 3c98cd2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion command.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ var (
{
Type: discordgo.ApplicationCommandOptionString,
Name: "filter",
Description: "Filter for a bulk delete operation.",
Description: "Filter for a bulk delete operation. Takes a comma separated list of filters.",
Required: true,
},
},
Expand Down
5 changes: 4 additions & 1 deletion kamino.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"io"
"net/http"
"net/http/cookiejar"
"strings"
"time"

"github.com/Clinet/discordgo-embed"
Expand Down Expand Up @@ -130,7 +131,9 @@ func deletePod(s *discordgo.Session, i *discordgo.InteractionCreate) {

func bulkDeletePods(s *discordgo.Session, i *discordgo.InteractionCreate) {
data := make(map[string]any)
data["filters"] = i.ApplicationCommandData().Options[0].Options[0].StringValue()
filters := strings.ReplaceAll(i.ApplicationCommandData().Options[0].Options[0].StringValue(), " ", "")
filtersList := strings.Split(filters, ",")
data["filters"] = filtersList

resp, err := doAPIRequest("POST", config.KaminoBulkDeleteEndpoint, data)
if err != nil {
Expand Down

0 comments on commit 3c98cd2

Please sign in to comment.