added more infoo to the client name.
Some checks are pending
Build-nightly / docker (push) Waiting to run

This commit is contained in:
Umiko 2025-05-13 20:20:53 +07:00
parent a033883373
commit 43d71db74f
2 changed files with 47 additions and 1 deletions

View File

@ -1,5 +1,6 @@
from __future__ import annotations from __future__ import annotations
import os import os
import platform
from typing import Callable, TYPE_CHECKING from typing import Callable, TYPE_CHECKING
if TYPE_CHECKING: if TYPE_CHECKING:
@ -7,7 +8,46 @@ if TYPE_CHECKING:
app_name = "pandorafox♾" app_name = "pandorafox♾"
app_version = "2.4.0" 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( about_text: Callable[[Translator], str] = lambda translator: translator.translate(
"""\ """\
A media streaming bot for TeamTalk. A media streaming bot for TeamTalk.
@ -20,6 +60,7 @@ Visit us on: https://git.techlabs.lol/radiant_code/teamtalkbot
License: MIT License\ License: MIT License\
""" """
) )
start_bottt: Callable[[Translator], str] = lambda translator: translator.translate( start_bottt: Callable[[Translator], str] = lambda translator: translator.translate(
"""\ """\
Hello there! 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!\ Thank you for choosing our service, and have a fantastic day!\
""" """
) )
contacts_bot: Callable[[Translator], str] = lambda translator: translator.translate( contacts_bot: Callable[[Translator], str] = lambda translator: translator.translate(
"""\ """\
If you encounter any issues with this bot, please reach out to our dedicated technicians: 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\ Join the TTMediaBot Official Group on Telegram: https://t.me/TTMediaBot_chat\
""" """
) )
fallback_service = "yt" fallback_service = "yt"
loop_timeout = 0.01 loop_timeout = 0.01
max_message_length = 512 max_message_length = 512

View File

@ -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. 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 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. 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... Fix user rights to upload file, hopefully...