feat: Support transparent/dynamic embed color #547
Replies: 12 comments
-
Wow, I didn't even know Let me fix this. Thank you for reporting! |
Beta Was this translation helpful? Give feedback.
-
This is released as https://github.com/sarisia/actions-status-discord/releases/tag/v1.14.7, thanks! |
Beta Was this translation helpful? Give feedback.
-
Thank you! Uhh, I am having trouble using it: I tried From the log it seems that it was sent correctly as So is the default color mentioned in the docs not the transparent one? I am really sorry. |
Beta Was this translation helpful? Give feedback.
-
Update: I asked in the Discohook Discord server, and this is what an admin said I'm really sorry. I thought it had to be zero. When trying to specify the color as This is what is seen in the json data editor that the admin mentions:
|
Beta Was this translation helpful? Give feedback.
-
Oh, got your point. I'm not sure what Discohook is but atm we do not have ways to set Maybe it's good to have GitHub Actions outputs to expose webhook payload json to latter steps |
Beta Was this translation helpful? Give feedback.
-
Uhh, tbh I don't really understand what this would mean. Is this like being able to fully customize the payload json? If yes, it sounds cool, but only do what makes sense. I do not want you do to anything unreasonable. |
Beta Was this translation helpful? Give feedback.
-
Let's say we add the output - uses: actions-status-discord@v1
id: webhook
- run: npm install axios
- uses: actions/github-script@v7
env:
WEBHOOK_PAYLOAD: ${{ steps.webhook.outputs.payload }}
WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK }}
with:
script: |
const axios = require("axios")
const { WEBHOOK_PAYLOAD, WEBHOOK_URL } = process.env
const payload = JSON.parse(WEBHOOK_PAYLOAD)
payload.embeds[0].color = null
axios.post(WEBHOOK_URL, payload) |
Beta Was this translation helpful? Give feedback.
-
I can't code but ChaptGPT helped me understand this 🙈 (this is my first time using a Gh action) This is clever, but tbh, I imagine very few users would be interested or be able to utilize this capability so idk if it's worth implementing. Edit: The dev of Dischook said this, if it makes any difference: |
Beta Was this translation helpful? Give feedback.
-
I've made an pre-release as https://github.com/sarisia/actions-status-discord/releases/tag/v1.15.0-pre.0 . Also see https://github.com/sarisia/actions-status-discord/tree/output-payload?tab=readme-ov-file#full-payload-control for usages. I'll make it official once other implementations are done. |
Beta Was this translation helpful? Give feedback.
-
Thank you! Do you accept donations? (I couldn't find anything on any of your profiles) |
Beta Was this translation helpful? Give feedback.
-
No worries at all but if this doesn't bother you, I have sponsor button on top of repository, thanks! |
Beta Was this translation helpful? Give feedback.
-
This is now released as v1.15.0! |
Beta Was this translation helpful? Give feedback.
-
Discord embeds can have a semi-transparent color that appears different based on the user's theme:
The webhook messages in the images above were generated on discohook.org, which uses this transparent color by default.
According to this guide, an embed's color is transparent by default (set to
0
).Similarly, this doc, says that to use the "default" embed color in Discord, the hex code should be
0x000000
or an integer value should be0
.But currently, when using this GitHub action, if the color is set to
0x000000
,0
,0x0
,0x00000000
, or000000
the color will end up being green:Feature
Add support to specify this transparent embed color.
Beta Was this translation helpful? Give feedback.
All reactions