From f3ac0bf903334fb9c8e93ceb023e6d2afec4eb28 Mon Sep 17 00:00:00 2001 From: indes Date: Tue, 15 Jan 2019 10:18:48 +0800 Subject: [PATCH] feat(list): format message and hide log --- bot/bot.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bot/bot.go b/bot/bot.go index 96cfbfcb..d39be1ba 100644 --- a/bot/bot.go +++ b/bot/bot.go @@ -87,20 +87,20 @@ func makeHandle() { B.Handle("/list", func(m *tb.Message) { sources, _ := model.GetSourcesByUserID(m.Sender.ID) - log.Println(sources) + message := "目前的订阅源:\n" for index, source := range sources { - message = message + fmt.Sprintf("%d - [%s](%s)\n", index+1, source.Title, source.Link) + message = message + fmt.Sprintf("[[%d]] [%s](%s)\n", index+1, source.Title, source.Link) } _, _ = B.Send(m.Sender, message, &tb.SendOptions{ - ParseMode: tb.ModeMarkdown, + DisableWebPagePreview: true, + ParseMode: tb.ModeMarkdown, }) }) B.Handle("/unsub", func(m *tb.Message) { msg := strings.Split(m.Text, " ") - B.Send(m.Sender, m.Text) if len(msg) != 2 { SendError(m.Chat)