From 6e62ccf00da304a9d51e02b169b16cbb34752746 Mon Sep 17 00:00:00 2001 From: Chris Sexton Date: Sat, 2 Nov 2019 18:18:36 -0400 Subject: [PATCH] webshit: add links to articles --- plugins/newsbid/newsbid.go | 9 +++++---- plugins/newsbid/webshit/webshit.go | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/plugins/newsbid/newsbid.go b/plugins/newsbid/newsbid.go index b22548d..accc59c 100644 --- a/plugins/newsbid/newsbid.go +++ b/plugins/newsbid/newsbid.go @@ -2,13 +2,14 @@ package newsbid import ( "fmt" + "sort" + "strconv" + "strings" + "github.com/jmoiron/sqlx" "github.com/velour/catbase/bot" "github.com/velour/catbase/bot/msg" "github.com/velour/catbase/plugins/newsbid/webshit" - "sort" - "strconv" - "strings" ) type NewsBid struct { @@ -50,7 +51,7 @@ func (p *NewsBid) message(conn bot.Connector, k bot.Kind, message msg.Message, a sort.Slice(bids, func(i, j int) bool { return bids[i].User < bids[j].User }) out := "Bids:\n" for _, b := range bids { - out += fmt.Sprintf("%s bid %d on %s\n", b.User, b.Bid, b.Title) + out += fmt.Sprintf("%s bid %d on <%s|%s> \n", b.User, b.Bid, b.URL, b.Title) } p.bot.Send(conn, bot.Message, ch, out) return true diff --git a/plugins/newsbid/webshit/webshit.go b/plugins/newsbid/webshit/webshit.go index 40c28a2..3bb3d42 100644 --- a/plugins/newsbid/webshit/webshit.go +++ b/plugins/newsbid/webshit/webshit.go @@ -45,7 +45,7 @@ func (s Stories) Titles() string { if i > 0 { out += ", " } - out += v.Title + out += fmt.Sprintf("<%s|%s>", v.URL, v.Title) } return out }