Skip to content

Commit

Permalink
fix: add compatibility for go version without native slices package
Browse files Browse the repository at this point in the history
  • Loading branch information
Jisin0 committed Jul 4, 2024
1 parent 7407bc5 commit 447f077
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions api/bot.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import (
"net/http"
"os"
"path"
"slices"
"strings"

"github.com/Jisin0/Go-Filter-Bot/plugins"
"github.com/Jisin0/Go-Filter-Bot/utils"
"github.com/PaulSonOfLars/gotgbot/v2"
)

Expand All @@ -32,7 +32,7 @@ func Bot(w http.ResponseWriter, r *http.Request) {
bot, _ := gotgbot.NewBot(botToken, &gotgbot.BotOpts{DisableTokenCheck: true})

// Delete the webhook incase token is unauthorized.
if lenAllowedTokens > 0 && allowedTokens[0] != "" && !slices.Contains(allowedTokens, botToken) {
if lenAllowedTokens > 0 && allowedTokens[0] != "" && !utils.Contains(allowedTokens, botToken) {
bot.DeleteWebhook(&gotgbot.DeleteWebhookOpts{}) //nolint:errcheck // It doesn't matter if it errors
w.WriteHeader(statusCodeSuccess)

Expand Down

0 comments on commit 447f077

Please sign in to comment.