修复转发跳收藏;修复若干小bug

This commit is contained in:
dela
2026-02-05 21:29:48 +08:00
parent 098fd57c19
commit 270369ae0a
6 changed files with 96 additions and 11 deletions

View File

@@ -2,6 +2,7 @@ package telegram
import (
"fmt"
"html"
"strconv"
"strings"
@@ -94,7 +95,7 @@ func (b *Bot) handleEntryList(c tele.Context) error {
var sb strings.Builder
if category != "" {
sb.WriteString(fmt.Sprintf("📋 分类 [%s] 的条目:\n\n", category))
sb.WriteString(fmt.Sprintf("📋 分类 [%s] 的条目:\n\n", html.EscapeString(category)))
} else {
sb.WriteString("📋 所有条目:\n\n")
}
@@ -103,12 +104,12 @@ func (b *Bot) handleEntryList(c tele.Context) error {
for _, e := range entries {
if category == "" && e.Category != currentCat {
currentCat = e.Category
sb.WriteString(fmt.Sprintf("\n【%s】\n", currentCat))
sb.WriteString(fmt.Sprintf("\n【%s】\n", html.EscapeString(currentCat)))
}
sb.WriteString(fmt.Sprintf("• [%s] %s\n", e.ID, e.Title))
sb.WriteString(fmt.Sprintf("• <code>%s</code> %s\n", e.ID, html.EscapeString(e.Title)))
}
return c.Reply(sb.String())
return c.Reply(sb.String(), tele.ModeHTML)
}
func (b *Bot) handleRefresh(c tele.Context) error {