53 lines
1.6 KiB
Python
53 lines
1.6 KiB
Python
import platform
|
||
import sys
|
||
from datetime import datetime
|
||
import os
|
||
import pytz
|
||
import aiogram
|
||
|
||
def get_debug_info():
|
||
try:
|
||
# Системная информация
|
||
system_name = platform.system()
|
||
system_version = platform.version()
|
||
system_release = platform.release()
|
||
|
||
# Версия Python
|
||
python_version = sys.version
|
||
|
||
# Версия aiogram
|
||
aiogram_version = aiogram.__version__
|
||
|
||
# Локация сервера
|
||
server_location = os.getenv('SERVER_LOCATION', 'Неизвестно')
|
||
|
||
# Время сервера
|
||
server_time = datetime.now(pytz.utc).strftime('%Y-%m-%d %H:%M:%S UTC')
|
||
|
||
# Информация о процессоре
|
||
processor_info = platform.processor()
|
||
|
||
# Информация о машине
|
||
machine_info = platform.machine()
|
||
|
||
# Возвращаем массив с данными
|
||
return {
|
||
"System Name": system_name,
|
||
"System Version": system_version,
|
||
"System Release": system_release,
|
||
"Python Version": python_version,
|
||
"Aiogram Version": aiogram_version,
|
||
"Server Location": server_location,
|
||
"Server Time": server_time,
|
||
"Processor Info": processor_info,
|
||
"Machine Info": machine_info,
|
||
}
|
||
except Exception as e:
|
||
return {"Error": str(e)}
|
||
|
||
if __name__ == "__main__":
|
||
# Для отладки: вывод информации
|
||
debug_info = get_debug_info()
|
||
for key, value in debug_info.items():
|
||
print(f"{key}: {value}")
|