Skip to content

Conversation

@jiusheng6
Copy link

如图
tg机器人如图
image
image
image
image

@AkimioJR
Copy link
Owner

  1. Strm2Alist清理本地文件修改部分不予通过
  2. 某些函数缺少type hint,并且需要补充完整参数说明
  3. 参照PEP8,应该使用ruff或者black的默认配置对文件进行格式化

@wanggh8
Copy link

wanggh8 commented Apr 5, 2025

期待这个功能

Copy link
Owner

@AkimioJR AkimioJR left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

修改意见(之前忘记提交了)


# 菜单导航
if callback_data.startswith("menu_") :
menu_type = callback_data[5 :] # 去掉 "menu_" 前缀
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

应该使用.replace()函数

@@ -0,0 +1,1271 @@
from typing import Dict, List, Callable, Awaitable, Any, Optional, Union, Tuple, Set
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dict、List、Optional、Union、Tuple应该使用dict、list、| None、|、tuple替代

pydantic == 2.9.2
pypinyin == 0.53.0
pypinyin == 0.53.0
python-telegram-bot
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

需提供准确的版本信息

rss_domain: api.ani.rip # AniOpen 项目 RSS 订阅域名(可选,默认为 api.ani.rip)

TelegramBot:
token: "" # 你的 Telegram 机器人令牌(从 BotFather 获取)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

注释需要对齐

Comment on lines 819 to 860
async def _handle_admin_system_status(self, query) -> None:
"""Handle admin system status action"""
import platform
import psutil # 确保已安装 psutil 库

# 系统信息
system_info = f"系统: {platform.system()} {platform.release()}\n"
system_info += f"Python: {platform.python_version()}\n"

# CPU 使用率
cpu_percent = psutil.cpu_percent(interval=1)
system_info += f"CPU 使用率: {cpu_percent}%\n"

# 内存使用率
memory = psutil.virtual_memory()
memory_percent = memory.percent
memory_used = memory.used / (1024 * 1024 * 1024) # 转换为 GB
memory_total = memory.total / (1024 * 1024 * 1024) # 转换为 GB
system_info += f"内存使用率: {memory_percent}% ({memory_used:.2f}GB / {memory_total:.2f}GB)\n"

# 磁盘使用率
disk = psutil.disk_usage('/')
disk_percent = disk.percent
disk_used = disk.used / (1024 * 1024 * 1024) # 转换为 GB
disk_total = disk.total / (1024 * 1024 * 1024) # 转换为 GB
system_info += f"磁盘使用率: {disk_percent}% ({disk_used:.2f}GB / {disk_total:.2f}GB)\n"

# 进程信息
process = psutil.Process()
process_cpu = process.cpu_percent(interval=1)
process_memory = process.memory_info().rss / (1024 * 1024) # 转换为 MB
system_info += f"进程 CPU 使用率: {process_cpu}%\n"
system_info += f"进程内存使用: {process_memory:.2f}MB\n"

# 运行时间
boot_time = psutil.boot_time()
uptime = time.time() - boot_time
uptime_text = self._format_duration(uptime)
system_info += f"系统运行时间: {uptime_text}\n"

# AutoFilm 信息
system_info += f"\nAutoFilm 版本: {settings.APP_VERSION}\n"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这段读取系统配置信息不应放在这个类里面

Comment on lines 26 to 28
allowed_users: List[int] = None,
proxy_url: str = None,
admin_users: List[int] = None,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

类型不正确,cython编译后运行会报错

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants