Skip server on rest errorg
This commit is contained in:
parent
09484e370d
commit
84fa811a4a
@ -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()
|
||||
|
Loading…
x
Reference in New Issue
Block a user