Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add **fields** #66

Open
kimdwkimdw opened this issue Mar 24, 2022 · 1 comment
Open

Add **fields** #66

kimdwkimdw opened this issue Mar 24, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@kimdwkimdw
Copy link

What feature do you want to see added?

Add additional fields arguments. Check below

https://birdie0.github.io/discord-webhooks-guide/structure/embed/fields.html
https://leovoel.github.io/embed-visualizer/

Upstream changes

No response

@kimdwkimdw kimdwkimdw added the enhancement New feature or request label Mar 24, 2022
@bestknighter
Copy link

bestknighter commented Jun 12, 2023

Can this also be exposed to Jenkins Scripting Pipeline?

EDIT: After reading the changelog of PR #92, I realized that there probably is an undocumented way.
You can probably use like so:

discordSend([
  webhookURL: 'Your URL',
  fields: ["Key1:Value1", "Key2:Value2"]
])

Later this week I'll try and come back with my results.

EDIT: There is! I managed to get it working. All private fields of DiscordPipelineStep.java can be used as fields. And looking at the code, I realized that you just need to do the following:

discordSend([
  webhookURL: 'Your URL',
  fields: "Key1:Value1, Key2:Value2, Key 3:Value 3a; Value 3b"
])

To get it looking like:

Key1
Value1

Key2
Value2

Key3
Value3a; Value 3b

Sadly, there's no way to make them inline. At least not with how this was set up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants