diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2023-10-31 12:43:38 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-31 04:43:38 +0000 |
commit | 16d15ce087cd4b9ddf91f6acff7eacac24e6aac5 (patch) | |
tree | a71425c3ab1c5ee0c3ca6a8b8eaefd1367ecbfc8 /services/webhook/discord.go | |
parent | 9106514e516f1e75ae539f3cd2f3a794c7d2c50a (diff) | |
download | gitea-16d15ce087cd4b9ddf91f6acff7eacac24e6aac5.tar.gz gitea-16d15ce087cd4b9ddf91f6acff7eacac24e6aac5.zip |
Fix package webhook (#27839)
Fix #23742
---------
Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
Diffstat (limited to 'services/webhook/discord.go')
-rw-r--r-- | services/webhook/discord.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/services/webhook/discord.go b/services/webhook/discord.go index b22bb4f912..e2ac1410b8 100644 --- a/services/webhook/discord.go +++ b/services/webhook/discord.go @@ -256,6 +256,12 @@ func (d *DiscordPayload) Release(p *api.ReleasePayload) (api.Payloader, error) { return d.createPayload(p.Sender, text, p.Release.Note, p.Release.HTMLURL, color), nil } +func (d *DiscordPayload) Package(p *api.PackagePayload) (api.Payloader, error) { + text, color := getPackagePayloadInfo(p, noneLinkFormatter, false) + + return d.createPayload(p.Sender, text, "", p.Package.HTMLURL, color), nil +} + // GetDiscordPayload converts a discord webhook into a DiscordPayload func GetDiscordPayload(p api.Payloader, event webhook_module.HookEventType, meta string) (api.Payloader, error) { s := new(DiscordPayload) |