Compare commits

...

2 Commits

Author SHA1 Message Date
Chris Sexton 6e62ccf00d webshit: add links to articles 2019-11-02 18:21:40 -04:00
Chris Sexton 8d74baddba git: fix gitea formatting 2019-11-02 18:21:40 -04:00
3 changed files with 7 additions and 6 deletions

View File

@ -101,7 +101,7 @@ func (p *GitPlugin) giteaEvent(w http.ResponseWriter, r *http.Request) {
msg := ""
for _, c := range evt.Commits {
m := strings.Split(c.Message, "\n")[0]
msg += fmt.Sprintf("%s pushed to %s (<%s|%s>) %s",
msg += fmt.Sprintf("%s pushed to %s (<%s|%s>) %s\n",
c.Author.Name,
repo,
c.URL,

View File

@ -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

View File

@ -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
}