Skip server on rest errorg

This commit is contained in:
rxdn 2021-01-10 18:45:25 +00:00
parent 09484e370d
commit 84fa811a4a

View File

@ -8,6 +8,7 @@ import (
"github.com/TicketsBot/common/permission"
"github.com/gin-gonic/gin"
"github.com/rxdn/gdl/objects/guild"
"github.com/rxdn/gdl/rest/request"
"golang.org/x/sync/errgroup"
"sort"
"sync"
@ -58,8 +59,11 @@ func GetGuilds(ctx *gin.Context) {
permLevel, err := utils.GetPermissionLevel(g.GuildId, userId)
if err != nil {
// If a Discord error occurs, just skip the server
if _, ok := err.(*request.RestError); !ok {
return err
}
}
if permLevel >= permission.Support {
lock.Lock()