From 2d66f8480200a4d87c6157303c7796c0aa615210 Mon Sep 17 00:00:00 2001 From: pavlov Date: Mon, 14 Apr 2025 17:32:38 +0300 Subject: [PATCH] set no preview to my groups --- internal/telegram/handlers/text/myGroups.go | 2 +- test/telegram/handlers/myGroups_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/telegram/handlers/text/myGroups.go b/internal/telegram/handlers/text/myGroups.go index ffd47f9..d2c2d5a 100644 --- a/internal/telegram/handlers/text/myGroups.go +++ b/internal/telegram/handlers/text/myGroups.go @@ -60,7 +60,7 @@ func (g *MyGroup) ServeContext(ctx telebot.Context) error { return ctx.Send(fmt.Sprintf("[%s] Ошибка при получении групп!", ctx.Get("trace_id")), telebot.ModeHTML) } - return ctx.Send(g.msgMyGroups(groups, ctx), telebot.ModeMarkdown, keyboards.RefreshGroups()) + return ctx.Send(g.msgMyGroups(groups, ctx), telebot.ModeMarkdown, telebot.NoPreview, keyboards.RefreshGroups()) } func (g *MyGroup) msgMyGroups(groups []models.Group, ctx telebot.Context) string { diff --git a/test/telegram/handlers/myGroups_test.go b/test/telegram/handlers/myGroups_test.go index 66bd619..216dc80 100644 --- a/test/telegram/handlers/myGroups_test.go +++ b/test/telegram/handlers/myGroups_test.go @@ -47,7 +47,7 @@ func TestMyGroups(t *testing.T) { Type: domain.GroupType, Data: []string{strconv.Itoa(mockGroups[2].GroupID)}, }).Return("", errors.New("ser")).Times(1), - mctx.EXPECT().Send(mockStringRet, tele.ModeMarkdown, keyboards.RefreshGroups()).Return(nil).Times(1), + mctx.EXPECT().Send(mockStringRet, tele.ModeMarkdown, tele.NoPreview, keyboards.RefreshGroups()).Return(nil).Times(1), ) err := handler.ServeContext(mctx)