Skip to content
This repository has been archived by the owner on Sep 17, 2024. It is now read-only.

Commit

Permalink
feat(list): format message and hide log
Browse files Browse the repository at this point in the history
  • Loading branch information
indes committed Jan 15, 2019
1 parent ac86744 commit f3ac0bf
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions bot/bot.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit f3ac0bf

Please sign in to comment.