Notify error
This commit is contained in:
parent
fd5ff3331d
commit
bc63d5b938
@ -64,14 +64,18 @@ func GetGuilds(ctx *gin.Context) {
|
||||
if g.Owner {
|
||||
permLevel = permission.Admin
|
||||
} else {
|
||||
permLevel, err = utils.GetPermissionLevel(context.Background(), g.GuildId, userId)
|
||||
tmp, err := utils.GetPermissionLevel(context.Background(), g.GuildId, userId)
|
||||
if err != nil {
|
||||
// If a Discord error occurs, just skip the server
|
||||
var restError request.RestError
|
||||
if !errors.As(err, &restError) {
|
||||
if errors.As(err, &restError) {
|
||||
return nil
|
||||
} else {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
permLevel = tmp
|
||||
}
|
||||
|
||||
if permLevel >= permission.Support {
|
||||
|
@ -42,6 +42,11 @@
|
||||
|
||||
async function loadData() {
|
||||
const res = await axios.get(`${API_URL}/user/guilds`);
|
||||
if (res.status !== 200) {
|
||||
notifyError(res.data.error);
|
||||
return;
|
||||
}
|
||||
|
||||
guilds = res.data;
|
||||
|
||||
permissionLevelCache.update(cache => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user