mirror of
https://github.com/Sheldan/abstracto-templates.git
synced 2026-04-14 19:56:30 +00:00
[AB-347] adding multiple and generic attachment support to modmail templates
fixing modmail notification template
This commit is contained in:
@@ -19,7 +19,7 @@
|
||||
],
|
||||
"messageConfig": {
|
||||
"allowsRoleMention": true
|
||||
},
|
||||
}
|
||||
<#if roles?size gt 0>
|
||||
,"additionalMessage": "<#list roles as role>${role.role.asMention?json_string}<#sep>,</#list>"
|
||||
</#if>
|
||||
|
||||
@@ -12,10 +12,31 @@
|
||||
<#else>
|
||||
"description": "<@safe_include "modmail_no_message_provided"/>"
|
||||
</#if>
|
||||
<#if postedMessage.attachments?size gt 0>
|
||||
,"imageUrl": "${postedMessage.attachments[0].proxyUrl}"
|
||||
<#if attachedImageUrls?size gt 0>
|
||||
,"imageUrl": "${attachedImageUrls[0]}"
|
||||
</#if>
|
||||
<#if remainingAttachments?size gt 0>
|
||||
,"fields": [
|
||||
<#list remainingAttachments?keys as attachment><#assign attachment=attachment/>
|
||||
{
|
||||
"name": "${attachment?json_string}",
|
||||
"value": "[${attachment?json_string}](${remainingAttachments[attachment]?json_string})"
|
||||
}
|
||||
<#sep>,</#list>
|
||||
]
|
||||
</#if>
|
||||
}
|
||||
<#if attachedImageUrls?size gt 1>
|
||||
<#assign attachmentCount>${attachedImageUrls?size}</#assign>
|
||||
,<#list attachedImageUrls[1..] as attachment><#assign attachment=attachment/>
|
||||
{
|
||||
<#include "modmail_color">,
|
||||
<#assign currentIndex>${attachment?counter + 1}</#assign>
|
||||
"description": "<@safe_include "modmail_attachment_embed_description"/>",
|
||||
"imageUrl": "${attachment}"
|
||||
}
|
||||
<#sep>,</#list>
|
||||
</#if>
|
||||
]
|
||||
<#if subscribers?size gt 0>
|
||||
,"additionalMessage": "<#list subscribers as subscriber>${subscriber.asMention?json_string}<#sep>, </#list>"
|
||||
|
||||
@@ -7,11 +7,33 @@
|
||||
<#if message.embeds[0].description?has_content>
|
||||
,"description": "${message.embeds[0].description?json_string}"
|
||||
</#if>
|
||||
<#if message.embeds[0].image?has_content>
|
||||
,"imageUrl": "${message.embeds[0].image.proxyUrl}"
|
||||
<#if message.embeds?size gt 0 && message.embeds[0].image??>
|
||||
,"imageUrl": "${message.embeds[0].image.proxyUrl}"
|
||||
</#if>
|
||||
<#if message.embeds?size gt 0 && message.embeds[0].fields?size gt 0>
|
||||
,"fields": [
|
||||
<#list message.embeds[0].fields as field><#assign field=field/>
|
||||
{
|
||||
"name": "${field.name?json_string}",
|
||||
"value": "${field.value?json_string}"
|
||||
}
|
||||
<#sep>,</#list>
|
||||
]
|
||||
</#if>
|
||||
,"timeStamp": "${message.timeCreated}"
|
||||
}
|
||||
<#if message.embeds?size gt 1>
|
||||
<#assign attachmentCount>${message.embeds?size}</#assign>
|
||||
<#list message.embeds[1..] as embed><#assign embed=embed/>
|
||||
<#if embed.image?? && embed.image.proxyUrl??>
|
||||
,{
|
||||
<#include "modmail_color">,
|
||||
<#assign currentIndex>${embed?counter + 1}</#assign>
|
||||
"description": "<@safe_include "modmail_attachment_embed_description"/>",
|
||||
"imageUrl": "${embed.image.proxyUrl}"
|
||||
}
|
||||
</#if></#list>
|
||||
</#if>
|
||||
]
|
||||
<#if modMailMessage.anonymous>
|
||||
,"additionalMessage": "<@safe_include "modmail_anonymous_message_note"/>"
|
||||
|
||||
@@ -10,9 +10,30 @@
|
||||
<#if text?has_content>
|
||||
,"description": "${text?json_string}"
|
||||
</#if>
|
||||
<#if postedMessage.attachments?size gt 0>
|
||||
,"imageUrl": "${postedMessage.attachments[0].proxyUrl}"
|
||||
<#if attachedImageUrls?size gt 0>
|
||||
,"imageUrl": "${attachedImageUrls[0]}"
|
||||
</#if>
|
||||
<#if remainingAttachments?size gt 0>
|
||||
,"fields": [
|
||||
<#list remainingAttachments?keys as attachment><#assign attachment=attachment/>
|
||||
{
|
||||
"name": "${attachment?json_string}",
|
||||
"value": "[${attachment?json_string}](${remainingAttachments[attachment]?json_string})"
|
||||
}
|
||||
<#sep>,</#list>
|
||||
]
|
||||
</#if>
|
||||
}
|
||||
<#if attachedImageUrls?size gt 1>
|
||||
<#assign attachmentCount>${attachedImageUrls?size}</#assign>
|
||||
,<#list attachedImageUrls[1..] as attachment><#assign attachment=attachment/>
|
||||
{
|
||||
<#include "modmail_color">,
|
||||
<#assign currentIndex>${attachment?counter + 1}</#assign>
|
||||
"description": "<@safe_include "modmail_attachment_embed_description"/>",
|
||||
"imageUrl": "${attachment}"
|
||||
}
|
||||
<#sep>,</#list>
|
||||
</#if>
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user