mirror of
https://github.com/Sheldan/abstracto-templates.git
synced 2026-04-15 20:16:36 +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": {
|
"messageConfig": {
|
||||||
"allowsRoleMention": true
|
"allowsRoleMention": true
|
||||||
},
|
}
|
||||||
<#if roles?size gt 0>
|
<#if roles?size gt 0>
|
||||||
,"additionalMessage": "<#list roles as role>${role.role.asMention?json_string}<#sep>,</#list>"
|
,"additionalMessage": "<#list roles as role>${role.role.asMention?json_string}<#sep>,</#list>"
|
||||||
</#if>
|
</#if>
|
||||||
|
|||||||
@@ -12,10 +12,31 @@
|
|||||||
<#else>
|
<#else>
|
||||||
"description": "<@safe_include "modmail_no_message_provided"/>"
|
"description": "<@safe_include "modmail_no_message_provided"/>"
|
||||||
</#if>
|
</#if>
|
||||||
<#if postedMessage.attachments?size gt 0>
|
<#if attachedImageUrls?size gt 0>
|
||||||
,"imageUrl": "${postedMessage.attachments[0].proxyUrl}"
|
,"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>
|
||||||
}
|
}
|
||||||
|
<#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>
|
<#if subscribers?size gt 0>
|
||||||
,"additionalMessage": "<#list subscribers as subscriber>${subscriber.asMention?json_string}<#sep>, </#list>"
|
,"additionalMessage": "<#list subscribers as subscriber>${subscriber.asMention?json_string}<#sep>, </#list>"
|
||||||
|
|||||||
@@ -7,11 +7,33 @@
|
|||||||
<#if message.embeds[0].description?has_content>
|
<#if message.embeds[0].description?has_content>
|
||||||
,"description": "${message.embeds[0].description?json_string}"
|
,"description": "${message.embeds[0].description?json_string}"
|
||||||
</#if>
|
</#if>
|
||||||
<#if message.embeds[0].image?has_content>
|
<#if message.embeds?size gt 0 && message.embeds[0].image??>
|
||||||
,"imageUrl": "${message.embeds[0].image.proxyUrl}"
|
,"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>
|
</#if>
|
||||||
,"timeStamp": "${message.timeCreated}"
|
,"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>
|
<#if modMailMessage.anonymous>
|
||||||
,"additionalMessage": "<@safe_include "modmail_anonymous_message_note"/>"
|
,"additionalMessage": "<@safe_include "modmail_anonymous_message_note"/>"
|
||||||
|
|||||||
@@ -10,9 +10,30 @@
|
|||||||
<#if text?has_content>
|
<#if text?has_content>
|
||||||
,"description": "${text?json_string}"
|
,"description": "${text?json_string}"
|
||||||
</#if>
|
</#if>
|
||||||
<#if postedMessage.attachments?size gt 0>
|
<#if attachedImageUrls?size gt 0>
|
||||||
,"imageUrl": "${postedMessage.attachments[0].proxyUrl}"
|
,"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>
|
||||||
}
|
}
|
||||||
|
<#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>
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
Attachment ${currentIndex}/${attachmentCount}
|
||||||
Reference in New Issue
Block a user