Update app.py
Browse files
app.py
CHANGED
@@ -13,10 +13,10 @@ import logging
|
|
13 |
import threading
|
14 |
from huggingface_hub import HfApi, hf_hub_download
|
15 |
from huggingface_hub.utils import RepositoryNotFoundError
|
16 |
-
from pytonapi import Tonapi
|
17 |
from pytonapi.exceptions import AccountNotFoundError
|
18 |
|
19 |
-
BOT_TOKEN = os.getenv("BOT_TOKEN", "7566834146:
|
20 |
HOST = '0.0.0.0'
|
21 |
PORT = 7860
|
22 |
DATA_FILE = 'data.json'
|
@@ -622,8 +622,8 @@ TEMPLATE = """
|
|
622 |
root.style.setProperty('--tg-theme-bg-color-rgb', `18, 18, 18`);
|
623 |
}
|
624 |
try {
|
625 |
-
const greenColor = themeParams.button_color || '#34c759';
|
626 |
-
const greenGradientEnd = '#' + (parseInt(greenColor.slice(1), 16) + 0x101010).toString(16).padStart(6, '0');
|
627 |
root.style.setProperty('--accent-gradient-green', `linear-gradient(95deg, #34c759, ${themeParams.button_color || '#30d158'})`);
|
628 |
root.style.setProperty('--accent-gradient-green-end', themeParams.button_color || '#30d158');
|
629 |
} catch (e) {
|
@@ -661,6 +661,7 @@ TEMPLATE = """
|
|
661 |
if (response.ok && data.status === 'ok') {
|
662 |
tonBalanceDisplay.textContent = `${data.balance} TON`;
|
663 |
tonBalanceDisplay.style.color = 'var(--accent-gradient-green-end, #30d158)';
|
|
|
664 |
} else {
|
665 |
tonBalanceDisplay.textContent = '';
|
666 |
tonErrorDisplay.textContent = data.message || 'Неизвестная ошибка';
|
|
|
13 |
import threading
|
14 |
from huggingface_hub import HfApi, hf_hub_download
|
15 |
from huggingface_hub.utils import RepositoryNotFoundError
|
16 |
+
from pytonapi.client import Tonapi # Corrected import
|
17 |
from pytonapi.exceptions import AccountNotFoundError
|
18 |
|
19 |
+
BOT_TOKEN = os.getenv("BOT_TOKEN", "7566834146:AAGiG4MaTZZvvvTVsqEJVG5SYK5hUlc_Ewo")
|
20 |
HOST = '0.0.0.0'
|
21 |
PORT = 7860
|
22 |
DATA_FILE = 'data.json'
|
|
|
622 |
root.style.setProperty('--tg-theme-bg-color-rgb', `18, 18, 18`);
|
623 |
}
|
624 |
try {
|
625 |
+
const greenColor = themeParams.button_color || '#34c759';
|
626 |
+
const greenGradientEnd = '#' + (parseInt(greenColor.slice(1), 16) + 0x101010).toString(16).padStart(6, '0');
|
627 |
root.style.setProperty('--accent-gradient-green', `linear-gradient(95deg, #34c759, ${themeParams.button_color || '#30d158'})`);
|
628 |
root.style.setProperty('--accent-gradient-green-end', themeParams.button_color || '#30d158');
|
629 |
} catch (e) {
|
|
|
661 |
if (response.ok && data.status === 'ok') {
|
662 |
tonBalanceDisplay.textContent = `${data.balance} TON`;
|
663 |
tonBalanceDisplay.style.color = 'var(--accent-gradient-green-end, #30d158)';
|
664 |
+
if (tg.HapticFeedback) tg.HapticFeedback.notificationOccurred('success');
|
665 |
} else {
|
666 |
tonBalanceDisplay.textContent = '';
|
667 |
tonErrorDisplay.textContent = data.message || 'Неизвестная ошибка';
|