This topic was automatically generated from Slack. You can find the original thread here.
I am attempting to bring a picture from a Patreon post and automatically post in Discord. I have been able to post a message, text only, but don’t understand the coding in the embed section.
From the data below, how do I construct the embed area to pull the picture through? I have tried the following, but I don’t understand where the data should be pulled from.
I understand the following code, but can’t get it to work for me.
{
“embeds”: [{
“image”: {
“url”: “Imgur: The magic of the Internet”
}
}]
}
{{ [{ “image”: { “url”: “Imgur: The magic of the Internet” } }] }} - I am able to get this to pull thru, but i’m trying to create a dynamic code that takes the pic that is posted in Patreon. Note: I am able to pass the text thru, but not the picture.
Below is a copy and paste of the data pulling thru from Patreon, I don’t understand what data to link from the info below:
process
{1}
env
{0}
steps
{1}
trigger
{2}
event
{4}
attributes
{11}
app_id:
null
app_status:
null
content
pI thought I would share the YTD progress against last years numbers. /p
embed_data:
null
embed_url:
null
is_paid:
false
is_public:
true
published_at:
2024-02-18T21:06:59.849+00:00
tiers
[0]
title:
2023 vs 2024 YTD
url:
/posts/2023-vs-2024-ytd-98722713
id:
98722713
relationships
{2}
campaign
{2}
data
{2}
To dynamically post a picture from a Patreon post to Discord using the embed section, you need to extract the image URL from the Patreon post data and use it in the Discord message payload. Based on the data structure you provided from Patreon, it seems like the image URL might not be directly available in the attributes you’ve shown. However, if the image URL were available, it would likely be part of the embed_data or within a similar field that contains media information. Since the embed_data field is null in the data you’ve provided, and there’s no direct mention of an image URL, you might need to adjust your approach. If Patreon posts containing images have URLs or identifiers for those images in a different part of the data, you would use that. Assuming an image URL is available somewhere in the Patreon post data, here’s how you could dynamically construct the embed section for Discord: on { "embeds": [{ "image": { "url": "DYNAMIC_IMAGE_URL_FROM_PATREON" } }] } In the place of DYNAMIC_IMAGE_URL_FROM_PATREON, you would programmatically insert the image URL extracted from the Patreon post data. Since the provided data does not clearly show where the image URL is located, you might need to explore the Patreon API response further or check if images are referenced differently in the post data. If you’re able to identify the field where the image URL is stored or if there’s a specific way Patreon handles image attachments in posts, you can replace DYNAMIC_IMAGE_URL_FROM_PATREON with the actual path to the image URL in your workflow’s code. For instance, if the image URL is stored under steps.trigger.event.attributes.image_url, you would use that path. Remember, the key to solving this is identifying where in the Patreon post data the image URLs are provided. If the image URLs are not directly available, you might need to use additional API calls to Patreon to retrieve media associated with a post. If you’re still having trouble finding where the image data is located or how to properly extract it for use in Discord, I recommend consulting the Patreon API documentation or reaching out to Patreon support for more details on how images are referenced in post data.
Hi there. Thank you for confirming that the URL is not available from the data I provided. That is what I suspected. I will try to get more data on the API from Patreon to figure out where to grab that image data/url. THANK YOU! this is a great start.