ngate: fix formatting for all platforms

This commit is contained in:
Chris Sexton 2021-09-18 10:24:39 -04:00 committed by Chris Sexton
parent 6cacff4513
commit 2cfca47d7d
2 changed files with 3 additions and 3 deletions

View File

@ -78,7 +78,7 @@ func (p *NewsBid) bidsCmd(r bot.Request) bool {
out := "Bids:\n" out := "Bids:\n"
for _, b := range bids { for _, b := range bids {
hnURL := fmt.Sprintf("https://news.ycombinator.com/item?id=%d", b.HNID) hnURL := fmt.Sprintf("https://news.ycombinator.com/item?id=%d", b.HNID)
out += fmt.Sprintf("• %s bid %s <%s|%s> (<%s|Comments>)\n", b.User, b.BidStr, b.URL, b.Title, hnURL) out += fmt.Sprintf("• %s bid %s on %s (%s)\n", b.User, b.BidStr, b.Title, hnURL)
} }
p.bot.Send(r.Conn, bot.Message, ch, out) p.bot.Send(r.Conn, bot.Message, ch, out)
return true return true

View File

@ -36,9 +36,9 @@ func (is Items) Titles() string {
for _, v := range is { for _, v := range is {
hnURL := fmt.Sprintf("https://news.ycombinator.com/item?id=%d", v.ID) hnURL := fmt.Sprintf("https://news.ycombinator.com/item?id=%d", v.ID)
if v.URL == "" { if v.URL == "" {
out += fmt.Sprintf("• %s %s (<%s|Comments>)\n", v.Bid, v.Title, hnURL) out += fmt.Sprintf("• %s %s (%s)\n", v.Bid, v.Title, hnURL)
} else { } else {
out += fmt.Sprintf("• %s <%s|%s> (<%s|Comments>)\n", v.Bid, v.URL, v.Title, hnURL) out += fmt.Sprintf("• %s %s (%s)\n", v.Bid, v.Title, hnURL)
} }
} }
return out return out