Notify error

This commit is contained in:
rxdn 2024-06-18 23:29:26 +01:00
parent fd5ff3331d
commit bc63d5b938
2 changed files with 11 additions and 2 deletions

View File

@ -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 {

View File

@ -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 => {