mirror of
https://github.com/krau/SaveAny-Bot.git
synced 2026-09-05 15:46:37 +08:00
feat: truncate item description to 233 characters in parsed text
This commit is contained in:
@@ -3,6 +3,7 @@ package msgelem
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
|
"github.com/duke-git/lancet/v2/strutil"
|
||||||
"github.com/gotd/td/telegram/message/entity"
|
"github.com/gotd/td/telegram/message/entity"
|
||||||
"github.com/gotd/td/telegram/message/styling"
|
"github.com/gotd/td/telegram/message/styling"
|
||||||
"github.com/gotd/td/tg"
|
"github.com/gotd/td/tg"
|
||||||
@@ -18,7 +19,7 @@ func BuildParsedTextEntity(item parser.Item) (string, []tg.MessageEntityClass, e
|
|||||||
styling.Plain("\n作者: "),
|
styling.Plain("\n作者: "),
|
||||||
styling.Code(item.Author),
|
styling.Code(item.Author),
|
||||||
styling.Plain("\n描述: "),
|
styling.Plain("\n描述: "),
|
||||||
styling.Code(item.Description),
|
styling.Code(strutil.Ellipsis(item.Description, 233)),
|
||||||
styling.Plain("\n文件数量: "),
|
styling.Plain("\n文件数量: "),
|
||||||
styling.Code(fmt.Sprintf("%d", len(item.Resources))),
|
styling.Code(fmt.Sprintf("%d", len(item.Resources))),
|
||||||
styling.Plain("\n预计总大小: "),
|
styling.Plain("\n预计总大小: "),
|
||||||
|
|||||||
Reference in New Issue
Block a user