qwen-api-proxy 1.0.11 → 1.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -5
- package/bin/qwen-api-proxy.js +64 -53
- package/index.js +106 -20
- package/package.json +8 -2
- package/src/api/chat.js +71 -71
- package/src/api/chatHistory.js +19 -19
- package/src/api/fileUpload.js +23 -23
- package/src/api/imageGeneration.js +23 -23
- package/src/api/modelMapping.js +145 -153
- package/src/api/routes.js +148 -148
- package/src/api/tokenManager.js +93 -93
- package/src/browser/auth.js +13 -13
- package/src/browser/browser.js +9 -9
- package/src/browser/session.js +3 -3
- package/src/config.js +4 -4
- package/src/utils/accountSetup.js +14 -14
- package/src/utils/botSettings.js +14 -14
- package/src/utils/permissionChecker.js +157 -157
- package/src/utils/prompt.js +1 -1
- package/src/utils/proxy.js +11 -11
- package/src/utils/telegramBot.js +656 -654
- package/src/utils/telegramNotifier.js +7 -7
|
@@ -44,13 +44,13 @@ export async function sendTelegramNotification(message) {
|
|
|
44
44
|
});
|
|
45
45
|
|
|
46
46
|
const results = await Promise.all(notifications);
|
|
47
|
-
const successCount = results.filter(r => r).length;
|
|
48
|
-
|
|
47
|
+
const successCount = results.filter((r) => r).length;
|
|
48
|
+
|
|
49
49
|
if (successCount > 0) {
|
|
50
50
|
logInfo(`Telegram уведомления отправлены: ${successCount}/${TELEGRAM_USER_IDS.length} успешно`);
|
|
51
51
|
return true;
|
|
52
52
|
}
|
|
53
|
-
|
|
53
|
+
|
|
54
54
|
logError('Не удалось отправить Telegram уведомления ни одному пользователю');
|
|
55
55
|
return false;
|
|
56
56
|
}
|
|
@@ -62,7 +62,7 @@ export async function sendTelegramNotification(message) {
|
|
|
62
62
|
*/
|
|
63
63
|
export function formatTokenExpiryMessage(tokens) {
|
|
64
64
|
const now = Date.now();
|
|
65
|
-
|
|
65
|
+
|
|
66
66
|
let message = '🚨 <b>FreeQwenApi - Проблема с токенами</b>\n\n';
|
|
67
67
|
message += '❌ <b>Все токены недоступны:</b>\n\n';
|
|
68
68
|
|
|
@@ -70,9 +70,9 @@ export function formatTokenExpiryMessage(tokens) {
|
|
|
70
70
|
const isInvalid = token.invalid === true;
|
|
71
71
|
const resetTime = token.resetAt ? new Date(token.resetAt).getTime() : null;
|
|
72
72
|
const isExpired = resetTime && resetTime > now;
|
|
73
|
-
|
|
73
|
+
|
|
74
74
|
message += `<b>${index + 1}. ${token.id}</b>\n`;
|
|
75
|
-
|
|
75
|
+
|
|
76
76
|
if (isInvalid) {
|
|
77
77
|
message += ' Статус: ❌ Недействителен\n';
|
|
78
78
|
} else if (isExpired) {
|
|
@@ -82,7 +82,7 @@ export function formatTokenExpiryMessage(tokens) {
|
|
|
82
82
|
} else {
|
|
83
83
|
message += ' Статус: ❓ Неизвестно\n';
|
|
84
84
|
}
|
|
85
|
-
|
|
85
|
+
|
|
86
86
|
message += '\n';
|
|
87
87
|
});
|
|
88
88
|
|