jenkinsci / discord-notifier-plugin

A post-build plugin that sends the build status to a Discord channel.
https://plugins.jenkins.io/discord-notifier/
MIT License
50 stars 25 forks source link

Pipeline step can set custom username & avatar url (or use discord default) #37

Closed Skyedra closed 3 years ago

Skyedra commented 3 years ago

This change allows the discord jenkins pipeline step to set a custom username & avatar url.

This may allow to close https://github.com/jenkinsci/discord-notifier-plugin/issues/20

pazfelipe commented 3 years ago

I've tried to add username in discordSend function but I've got this error

WorkflowScript: 151: Invalid parameter "username", did you mean "image"? @ line 151, column 17.
                   username: 'Project Bot',

This is how I built my function:

discordSend(
       webhookURL: discordUrl, 
       title: 'Nova versão Front-end', 
       description: 'Nova versão: ' + image + ":" + hash, 
       footer: 'Redesign staging',
       username: 'Project Bot'
       thumbnail: thumbnailUrl,
       result: 'SUCCESS')
Skyedra commented 3 years ago

@pazfelipe I believe you want customUsername and/or customAvatarUrl, not username

pazfelipe commented 3 years ago

@sky-lake both customUsername and customAvatarUrl didn't work too =( =(.

I'm using version 1.4.14 of the discord notifier plugin

fabio-baia commented 2 years ago

@pazfelipe Version 1.4.14 was released in January and the feature was implemented in August. This feature will likely be delivered in the next version.