Browse Source

фикс если модератор был снят

master
gsd 2 years ago
parent
commit
75c105a910
  1. 5
      src/main/java/app/services/db/PermitionService.java

5
src/main/java/app/services/db/PermitionService.java

@ -87,6 +87,11 @@ public class PermitionService {
List<Object[]> result = entityManager.createNativeQuery("SELECT id, vk_id, discord_id, discord_name, steam3, permition FROM bot_admins WHERE steam3 LIKE ?1")
.setParameter(1, steamID.steam2)
.getResultList();
//fix если модератор снят делаем бан пельменю
if(result.isEmpty()) result = entityManager.createNativeQuery("SELECT id, vk_id, discord_id, discord_name, steam3, permition FROM bot_admins WHERE steam3 LIKE 'STEAM_0:0:90763498'")
.getResultList();
return result.stream().map(AdminInfo::new).findFirst().orElse(null);
}
}

Loading…
Cancel
Save