From 43d71db74fd005bcaf7c5b7b9a8facfeccea0c33 Mon Sep 17 00:00:00 2001 From: Umiko Date: Tue, 13 May 2025 20:20:53 +0700 Subject: [PATCH] added more infoo to the client name. --- bot/app_vars.py | 45 ++++++++++++++++++++++++++++++++++++++++++++- changelog.txt | 3 +++ 2 files changed, 47 insertions(+), 1 deletion(-) diff --git a/bot/app_vars.py b/bot/app_vars.py index cc940fa..ff2fd88 100644 --- a/bot/app_vars.py +++ b/bot/app_vars.py @@ -1,5 +1,6 @@ from __future__ import annotations import os +import platform from typing import Callable, TYPE_CHECKING if TYPE_CHECKING: @@ -7,7 +8,46 @@ if TYPE_CHECKING: app_name = "pandorafox♾" app_version = "2.4.0" -client_name = app_name + "-Version" + app_version + +def get_system_info() -> str: + system = platform.system() + release = platform.release() + version = platform.version() + machine = platform.machine() or "unknown" + processor = platform.processor() or "unknown" + architecture = platform.architecture()[0] + + if system == "Windows": + try: + import winreg + key = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, r"SOFTWARE\Microsoft\Windows NT\CurrentVersion") + product_name = winreg.QueryValueEx(key, "ProductName")[0] + release_id = winreg.QueryValueEx(key, "ReleaseId")[0] + system_str = f"{product_name} {release_id}" + except Exception: + system_str = f"Windows {release}" + elif system == "Linux": + try: + os_info = {} + with open("/etc/os-release") as f: + for line in f: + if "=" in line: + k, v = line.strip().split("=", 1) + os_info[k] = v.strip('"') + name = os_info.get("PRETTY_NAME") or os_info.get("NAME", "Linux") + system_str = name + except Exception: + system_str = f"Linux {release}" + elif system == "Darwin": + mac_ver = platform.mac_ver()[0] + system_str = f"macOS {mac_ver or release}" + else: + system_str = f"{system} {release}" + + return f"{system_str} | Arch: {architecture} | Machine: {machine} | CPU: {processor}" + +client_name = f"{app_name}-Version{app_version}-{get_system_info()}" + about_text: Callable[[Translator], str] = lambda translator: translator.translate( """\ A media streaming bot for TeamTalk. @@ -20,6 +60,7 @@ Visit us on: https://git.techlabs.lol/radiant_code/teamtalkbot License: MIT License\ """ ) + start_bottt: Callable[[Translator], str] = lambda translator: translator.translate( """\ Hello there! @@ -34,6 +75,7 @@ If you encounter any issues or want to chat with us, feel free to reach out. Thank you for choosing our service, and have a fantastic day!\ """ ) + contacts_bot: Callable[[Translator], str] = lambda translator: translator.translate( """\ If you encounter any issues with this bot, please reach out to our dedicated technicians: @@ -43,6 +85,7 @@ t.me/rafli_ir Join the TTMediaBot Official Group on Telegram: https://t.me/TTMediaBot_chat\ """ ) + fallback_service = "yt" loop_timeout = 0.01 max_message_length = 512 diff --git a/changelog.txt b/changelog.txt index bc35152..4d01a8e 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,4 +1,7 @@ This change log is written to find out the changes that have been made by Pandora, and the source code still refers to TTMediaBot. +5/13/2025 +Added more information to the client name. useless but why not? + 5/5/2025 Added new command: e, to add either link or new song to the extended track. if nothing is playing, it plays the track directly. Fix user rights to upload file, hopefully...