diff --git a/internal/service/bot_features_test.go b/internal/service/bot_features_test.go
index cb6a97f..bf6d9a1 100644
--- a/internal/service/bot_features_test.go
+++ b/internal/service/bot_features_test.go
@@ -340,6 +340,27 @@ func TestBotAdminCommandsManageDevicePolicy(t *testing.T) {
t.Fatalf("cleanup rule update should not create duplicates, got %d rules=%+v", matches, cfg.AccountCleanupRules)
}
+ reply, err = bot.executeCommand(ctx, channel, msg, "/cleanup_rule 修改 recent_login login_7d 二十一天内登录 21")
+ if err != nil {
+ t.Fatal(err)
+ }
+ if !strings.Contains(reply.Text, "已更新规则") {
+ t.Fatalf("expected Chinese cleanup rule update reply, got %q", reply.Text)
+ }
+ cfg = loadBotConfig(ctx, repos)
+ matches = 0
+ for _, rule := range cfg.AccountCleanupRules {
+ if rule.ID == "login_7d" {
+ matches++
+ if rule.WindowDaysMax != 21 || rule.Name != "二十一天内登录" {
+ t.Fatalf("Chinese cleanup rule update should update values, got %+v", rule)
+ }
+ }
+ }
+ if matches != 1 {
+ t.Fatalf("Chinese cleanup rule update should not create duplicates, got %d rules=%+v", matches, cfg.AccountCleanupRules)
+ }
+
reply, err = bot.executeCommand(ctx, channel, msg, "/cleanup_rule add account_age_grace new_7d 7")
if err != nil {
t.Fatal(err)
diff --git a/internal/service/telegram_bot.go b/internal/service/telegram_bot.go
index 20a29bd..4c43787 100644
--- a/internal/service/telegram_bot.go
+++ b/internal/service/telegram_bot.go
@@ -525,7 +525,7 @@ func (s *TelegramBotService) cmdHelp(ctx context.Context, msg *TelegramMessage)
"/antishare on play=3 login=3 warn=2 — 防共享策略(管理员)\n" +
"/cleanup on|off|run — 保号规则开关/巡检(管理员)\n" +
"/cleanup_mode any|all|count 2 — 保号模式(管理员)\n" +
- "/cleanup_rule list|add|edit|del|enable|disable — Sakura 保号规则(管理员)\n" +
+ "/cleanup_rule list|add|edit|修改|del|enable|disable — Sakura 保号规则(管理员)\n" +
"/ban 用户名 / /unban 用户名 — 禁用/解禁用户(管理员)\n" +
"/hideadult on|off — 隐藏/显示当前绑定账号的成人目录\n" +
"/status — 系统运行状态\n" +
diff --git a/internal/service/telegram_menu.go b/internal/service/telegram_menu.go
index 502041e..18f5907 100644
--- a/internal/service/telegram_menu.go
+++ b/internal/service/telegram_menu.go
@@ -1125,7 +1125,7 @@ func (s *TelegramBotService) protectReason(ctx context.Context, userID string) s
func (s *TelegramBotService) replyDevicePolicy(ctx context.Context) telegramCommandReply {
cfg := loadBotConfig(ctx, s.repo)
text := fmt.Sprintf(
- "设备策略\n\n① 防共享:%s\n 并发播放上限 %d / 登录客户端上限 %d;超限会禁用账号,管理员可解禁。\n 设备指纹异常警告 %d 次后禁用账号。\n\n② Sakura 保号规则:%s\n 保号模式:%s;需要满足 %d 条;启用规则 %d 条。\n\n命令:\n/antishare on play=3 login=3 warn=2\n/cleanup on|off|run\n/cleanup_mode any|all|count 2\n/cleanup_rule list|add|edit|del|enable|disable\n\n策略默认关闭;清理前会先通过 Bot 通知用户;管理员/受保护账号永不自动处理。",
+ "设备策略\n\n① 防共享:%s\n 并发播放上限 %d / 登录客户端上限 %d;超限会禁用账号,管理员可解禁。\n 设备指纹异常警告 %d 次后禁用账号。\n\n② Sakura 保号规则:%s\n 保号模式:%s;需要满足 %d 条;启用规则 %d 条。\n\n命令:\n/antishare on play=3 login=3 warn=2\n/cleanup on|off|run\n/cleanup_mode any|all|count 2\n/cleanup_rule list|add|edit|修改|del|enable|disable\n\n策略默认关闭;清理前会先通过 Bot 通知用户;管理员/受保护账号永不自动处理。",
onOff(cfg.AntiShareEnabled), cfg.MaxConcurrentPlay, cfg.MaxLoggedClients, cfg.WarnThreshold,
onOff(cfg.AccountCleanupEnabled), cleanupModeLabel(cfg.AccountCleanupKeepMode), cfg.AccountCleanupRequiredCount, countEnabledCleanupRules(cfg.AccountCleanupRules))
return telegramCommandReply{
@@ -1280,7 +1280,7 @@ func (s *TelegramBotService) cmdCleanupRule(ctx context.Context, args []string)
return telegramCommandReply{Text: "保存失败:" + err.Error()}
}
return telegramCommandReply{Text: "已更新规则状态。\n\n" + formatCleanupRules(rules)}
- case "add", "set", "edit", "update":
+ case "add", "set", "edit", "update", "修改", "更新", "改":
rule, err := parseCleanupRuleCommand(args[1:])
if err != nil {
return telegramCommandReply{Text: err.Error() + "\n\n" + cleanupRuleHelp()}
@@ -1518,6 +1518,7 @@ func cleanupRuleHelp() string {
"/cleanup_rule add signin_streak sign_3 连续签到3天 3\n" +
"/cleanup_rule add account_age_grace new_7d 新号宽限7天 7\n" +
"/cleanup_rule edit 规则类型 规则ID 名称 参数... — 修改同 ID 规则\n" +
+ "/cleanup_rule 修改 规则类型 规则ID 名称 参数... — 中文修改入口\n" +
"/cleanup_rule enable 规则ID / disable 规则ID\n" +
"/cleanup_rule del 规则ID\n\n" +
"保号模式:/cleanup_mode any|all|count 2"