diff --git a/gotelegram-bot/bot.py b/gotelegram-bot/bot.py
index f18cfde..1a3ed06 100644
--- a/gotelegram-bot/bot.py
+++ b/gotelegram-bot/bot.py
@@ -389,7 +389,7 @@ async def check_service_status(service: str) -> bool:
async def get_telemt_version() -> str:
"""Get telemt version."""
- code, stdout, _ = await sh("telemt", "-v")
+ code, stdout, _ = await sh("telemt", "--version")
if code == 0:
return stdout.strip().split()[-1] if stdout else "unknown"
return "unknown"
@@ -699,18 +699,21 @@ async def get_traffic_stats(user_id: Optional[int] = None) -> str:
except Exception:
return f"📊 {_t(user_id, 'stats_title', 'Statistics')}\n\n{_t(user_id, 'stats_unavailable', 'Data unavailable. Make sure stats module is enabled.')}"
- # Read history
+ # Read history (skip header and non-numeric rows)
history = []
try:
with open(history_file, "r") as f:
reader = csv.reader(f)
for row in reader:
if len(row) >= 3:
- history.append({
- "ts": int(row[0]),
- "proxy": int(row[1]),
- "site": int(row[2]),
- })
+ try:
+ history.append({
+ "ts": int(row[0]),
+ "proxy": int(row[1]),
+ "site": int(row[2]),
+ })
+ except (ValueError, TypeError):
+ continue # skip header or malformed rows
except Exception:
pass