Update profile.js

This commit is contained in:
2025-05-07 17:56:50 +05:00
committed by GitHub
parent 80290213c4
commit 6c77b10e33

View File

@@ -8,7 +8,10 @@ async function getProfileFromAnixart(profileId, token = '') {
const response = await axios.get(url);
const profileData = response.data;
let isVerified = false;
// Убедимся, что profile существует
if (!profileData.profile) {
profileData.profile = {};
}
// Проверка верификации
try {
@@ -16,11 +19,13 @@ async function getProfileFromAnixart(profileId, token = '') {
const verifiedList = verifiedResponse.data;
if (Array.isArray(verifiedList) && verifiedList.includes(profileId.toString())) {
isVerified = true;
profileData.profile.is_verified = true;
} else {
profileData.profile.is_verified = false;
}
} catch {
// Ошибку верификации игнорируем
profileData.profile.is_verified = false;
}
// Подгружаем кастомные роли
@@ -36,14 +41,7 @@ async function getProfileFromAnixart(profileId, token = '') {
// Ошибку загрузки ролей игнорируем
}
// // Тестовое поле privilege_level (можно отключить)
// profileData.profile.privilege_level = 0;
// profileData.profile.status = "Я Falkor!";
return {
...profileData,
is_verified: isVerified,
};
return profileData;
} catch {
return {
code: 2,