mirror of https://github.com/velour/catbase.git
Compare commits
No commits in common. "6e62ccf00da304a9d51e02b169b16cbb34752746" and "f1f5fb3c12f9afdb9f1e2abd287cd1186ea91545" have entirely different histories.
6e62ccf00d
...
f1f5fb3c12
|
@ -101,7 +101,7 @@ func (p *GitPlugin) giteaEvent(w http.ResponseWriter, r *http.Request) {
|
||||||
msg := ""
|
msg := ""
|
||||||
for _, c := range evt.Commits {
|
for _, c := range evt.Commits {
|
||||||
m := strings.Split(c.Message, "\n")[0]
|
m := strings.Split(c.Message, "\n")[0]
|
||||||
msg += fmt.Sprintf("%s pushed to %s (<%s|%s>) %s\n",
|
msg += fmt.Sprintf("%s pushed to %s (<%s|%s>) %s",
|
||||||
c.Author.Name,
|
c.Author.Name,
|
||||||
repo,
|
repo,
|
||||||
c.URL,
|
c.URL,
|
||||||
|
|
|
@ -2,14 +2,13 @@ package newsbid
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"sort"
|
|
||||||
"strconv"
|
|
||||||
"strings"
|
|
||||||
|
|
||||||
"github.com/jmoiron/sqlx"
|
"github.com/jmoiron/sqlx"
|
||||||
"github.com/velour/catbase/bot"
|
"github.com/velour/catbase/bot"
|
||||||
"github.com/velour/catbase/bot/msg"
|
"github.com/velour/catbase/bot/msg"
|
||||||
"github.com/velour/catbase/plugins/newsbid/webshit"
|
"github.com/velour/catbase/plugins/newsbid/webshit"
|
||||||
|
"sort"
|
||||||
|
"strconv"
|
||||||
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
type NewsBid struct {
|
type NewsBid struct {
|
||||||
|
@ -51,7 +50,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 })
|
sort.Slice(bids, func(i, j int) bool { return bids[i].User < bids[j].User })
|
||||||
out := "Bids:\n"
|
out := "Bids:\n"
|
||||||
for _, b := range bids {
|
for _, b := range bids {
|
||||||
out += fmt.Sprintf("%s bid %d on <%s|%s> \n", b.User, b.Bid, b.URL, b.Title)
|
out += fmt.Sprintf("%s bid %d on %s\n", b.User, b.Bid, b.Title)
|
||||||
}
|
}
|
||||||
p.bot.Send(conn, bot.Message, ch, out)
|
p.bot.Send(conn, bot.Message, ch, out)
|
||||||
return true
|
return true
|
||||||
|
|
|
@ -45,7 +45,7 @@ func (s Stories) Titles() string {
|
||||||
if i > 0 {
|
if i > 0 {
|
||||||
out += ", "
|
out += ", "
|
||||||
}
|
}
|
||||||
out += fmt.Sprintf("<%s|%s>", v.URL, v.Title)
|
out += v.Title
|
||||||
}
|
}
|
||||||
return out
|
return out
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue