url in discord message

This commit is contained in:
2026-01-20 01:12:17 +01:00
parent b22e72c28f
commit 8f51e6d981
6 changed files with 34 additions and 16 deletions

View File

@@ -22,8 +22,8 @@ type GiteaFetcher struct {
Cache *Cache
}
func (f GiteaFetcher) Fetch() []string {
var messages []string
func (f GiteaFetcher) Fetch() []Entry {
var messages []Entry
for _, repo := range f.Repos {
if repo == "" {
@@ -48,7 +48,10 @@ func (f GiteaFetcher) Fetch() []string {
commit := r[0]
if f.Cache.TryUpdate("gitea_"+url.QueryEscape(giteaURL), commit.Sha) {
messages = append(messages, fmt.Sprintf("📝 [Gitea] - (%s) %s - %s", repo, commit.Commit.Message, commit.HTMLURL))
messages = append(messages, Entry{
Title: fmt.Sprintf("📝 [Gitea] - (%s) %s", repo, commit.Commit.Message),
URL: commit.HTMLURL,
})
}
}
return messages