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