mirror of
https://github.com/Sheldan/abstracto-templates.git
synced 2026-03-02 23:17:34 +00:00
[AB-xxx] fixing message embed and starboard post failing for embeds and component v2
This commit is contained in:
@@ -37,8 +37,14 @@
|
|||||||
</#if>
|
</#if>
|
||||||
<#list embeddedMessage.embeds as embed>
|
<#list embeddedMessage.embeds as embed>
|
||||||
<#if embed.description?has_content>
|
<#if embed.description?has_content>
|
||||||
,{
|
<#if embeddedMessage.content?has_content>,</#if>
|
||||||
|
<#if (embed.cachedImageInfo?has_content && embed.cachedImageInfo.proxyUrl?has_content) || (embed.cachedThumbnail?has_content && embed.cachedThumbnail.proxyUrl?has_content)>
|
||||||
|
{
|
||||||
<#assign hasContent=true>
|
<#assign hasContent=true>
|
||||||
|
"accessory": {
|
||||||
|
"type": "thumbnail",
|
||||||
|
"url": "${(embed.cachedImageInfo.proxyUrl)!embed.cachedThumbnail.proxyUrl}"
|
||||||
|
},
|
||||||
"type": "section",
|
"type": "section",
|
||||||
"components": [
|
"components": [
|
||||||
{
|
{
|
||||||
@@ -46,13 +52,14 @@
|
|||||||
"content": "${embed.description?json_string}"
|
"content": "${embed.description?json_string}"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
<#if (embed.cachedImageInfo?has_content && embed.cachedImageInfo.proxyUrl?has_content) || (embed.cachedThumbnail?has_content && embed.cachedThumbnail.proxyUrl?has_content)>
|
}
|
||||||
,"accessory": {
|
<#else>
|
||||||
"type": "thumbnail",
|
{
|
||||||
"url": "${(embed.cachedImageInfo.proxyUrl)!embed.cachedThumbnail.proxyUrl}"
|
"type": "textDisplay",
|
||||||
|
"content": "${embed.description?json_string}"
|
||||||
}
|
}
|
||||||
</#if>
|
</#if>
|
||||||
}
|
<#assign hasContent=true>
|
||||||
<#elseif (embed.cachedImageInfo?has_content && embed.cachedImageInfo.proxyUrl?has_content && embed.cachedImageInfo.width gt 0)
|
<#elseif (embed.cachedImageInfo?has_content && embed.cachedImageInfo.proxyUrl?has_content && embed.cachedImageInfo.width gt 0)
|
||||||
|| (embed.cachedThumbnail?has_content && embed.cachedThumbnail.proxyUrl?has_content && embed.cachedThumbnail.width gt 0)>
|
|| (embed.cachedThumbnail?has_content && embed.cachedThumbnail.proxyUrl?has_content && embed.cachedThumbnail.width gt 0)>
|
||||||
<#assign hasContent=true>
|
<#assign hasContent=true>
|
||||||
@@ -68,7 +75,7 @@
|
|||||||
</#list>
|
</#list>
|
||||||
<#if embeddedMessage.attachments?size gt 0>
|
<#if embeddedMessage.attachments?size gt 0>
|
||||||
<#list embeddedMessage.attachments?filter(x -> x.width gt 0)>
|
<#list embeddedMessage.attachments?filter(x -> x.width gt 0)>
|
||||||
,{
|
<#if hasContent>,</#if>{
|
||||||
<#assign hasContent=true>
|
<#assign hasContent=true>
|
||||||
"type": "mediaGallery",
|
"type": "mediaGallery",
|
||||||
"images": [
|
"images": [
|
||||||
|
|||||||
@@ -47,7 +47,7 @@
|
|||||||
<#list message.embeds as embed>
|
<#list message.embeds as embed>
|
||||||
<#if embed.description?has_content && !((embed.cachedImageInfo?has_content && embed.cachedImageInfo.proxyUrl?has_content) || (embed.cachedThumbnail?has_content && embed.cachedThumbnail.proxyUrl?has_content))>
|
<#if embed.description?has_content && !((embed.cachedImageInfo?has_content && embed.cachedImageInfo.proxyUrl?has_content) || (embed.cachedThumbnail?has_content && embed.cachedThumbnail.proxyUrl?has_content))>
|
||||||
<#assign hasContent=true>
|
<#assign hasContent=true>
|
||||||
{
|
<#if message.content?has_content>,</#if>{
|
||||||
"type": "textDisplay",
|
"type": "textDisplay",
|
||||||
"content": "${embed.description?json_string}"
|
"content": "${embed.description?json_string}"
|
||||||
}
|
}
|
||||||
@@ -82,8 +82,8 @@
|
|||||||
</#list>
|
</#list>
|
||||||
<#if message.attachments?size gt 0>
|
<#if message.attachments?size gt 0>
|
||||||
<#list message.attachments?filter(x -> x.width gt 0)>
|
<#list message.attachments?filter(x -> x.width gt 0)>
|
||||||
<#assign hasContent=true>
|
<#if hasContent>,</#if><#assign hasContent=true>
|
||||||
,{
|
{
|
||||||
"type": "mediaGallery",
|
"type": "mediaGallery",
|
||||||
"images": [
|
"images": [
|
||||||
<#items as attachment>
|
<#items as attachment>
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
No content.
|
||||||
Reference in New Issue
Block a user