[SIS-xxx] upgrading to abstracto version supporting components v2

changing meetup and quote command responses to use components v2
changing column name of quote attachment
This commit is contained in:
Sheldan
2025-07-13 20:09:45 +02:00
parent 5f6df14c24
commit be35a84dcf
33 changed files with 248 additions and 171 deletions

View File

@@ -1,33 +1,30 @@
<#include "format_instant">
{
"embeds": [
"components": [
{
<#include "abstracto_color">,
"title": {
"title": "${topic?json_string}"
},
"description": "<@format_instant_long_date_time instant=meetupTime/>
${description?json_string}"
<#if location?? && location != "%22%22">,
"fields": [
{
"name": "<@safe_include "createMeetup_confirmation_location_field_title"/>",
"value": "https://www.google.com/maps?q=${location?json_string}"
}
]
</#if>
}
],
"buttons": [
{
"label": "<@safe_include "createMeetup_confirm_button_label"/>",
"id": "${confirmationId}",
"buttonStyle": "success"
<#assign hasLocation=location?? && location != "%22%22">
"type": "textDisplay",
"content": "<#include "createMeetup_meetup_information">"
},
{
"label": "<@safe_include "createMeetup_cancel_button_label"/>",
"id": "${cancelId}",
"buttonStyle": "danger"
"type": "actionRow",
"actionRowItems": [
{
"label": "<@safe_include "createMeetup_confirm_button_label"/>",
"id": "${confirmationId}",
"buttonStyle": "success",
"type": "button"
},
{
"label": "<@safe_include "createMeetup_cancel_button_label"/>",
"id": "${cancelId}",
"buttonStyle": "danger",
"type": "button"
}
]
}
]
],
"messageConfig": {
"useComponentsV2": true
}
}

View File

@@ -1,10 +1,36 @@
<#include "format_instant">
{
"embeds": [
"components": [
<#list meetups as meetup>
<#assign meetup=meetup>
<#assign topic=meetup.topic>
<#assign time><@format_instant_long_date_time instant=meetup.meetupTime/>
</#assign><#assign timeRelative><@format_instant_relative instant=meetup.meetupTime/></#assign>
<#assign link=meetup.meetupMessage.jumpUrl>
{
<#include "abstracto_color">,
"description": "<#list meetups as meetup><#assign meetup=meetup><#assign topic=meetup.topic><#assign time><@format_instant_long_date_time instant=meetup.meetupTime/></#assign><#assign timeRelative><@format_instant_relative instant=meetup.meetupTime/></#assign><#assign link=meetup.meetupMessage.jumpUrl><#include "meetup_list_meetup_display">
<#else><#include "meetup_list_no_meetups"></#list>"
"type": "section",
"components": [
{
"type": "textDisplay",
"content": "<#include "meetup_list_meetup_display">"
}
]
,"accessory": {
"type": "button",
"label": "<#include "meetup_list_jump_button_label"/>",
"url": "${link}",
"buttonStyle": "link"
}
}
]
<#sep>,</#sep>
<#else>
{
"type": "textDisplay",
"content": "<#include "meetup_list_no_meetups">"
}
</#list>
],
"messageConfig": {
"useComponentsV2": true
}
}

View File

@@ -1,63 +1,74 @@
<#include "format_instant">
{
<#assign roleMention="<@&371419588619141121>"/>
"additionalMessage": "${roleMention?json_string}",
"embeds": [
"components": [
{
"type": "textDisplay",
<#assign roleMention="<@&371419588619141121>"/>
"content": "<#if cancelled>~~</#if>${roleMention?json_string} ${topic?json_string} - <@safe_include "meetup_message_id_display"/><#if cancelled>~~</#if>"
},
<#if description?has_content>
{
<#assign descriptionText>${description?json_string}</#assign>
<#assign organizerText>${organizer.memberMention}</#assign>
"type": "textDisplay",
"content": "<#if cancelled>~~</#if><@safe_include "meetup_description_component"/><#if cancelled>~~</#if>"
},
</#if>
{
<#include "abstracto_color">,
"title": {
"title": "${topic?json_string} - <@safe_include "meetup_message_id_display"/>"
},
<#assign time><@format_instant_long_date_time instant=meetupTime/></#assign>
<#assign timeRelative><@format_instant_relative instant=meetupTime/></#assign>
<#assign organizerText>${organizer.memberMention}</#assign>
<#assign meetupId=meetupId/>
<#assign descriptionText>${description?json_string}</#assign>
<#assign participantsText> (${participants?size}) <#list participants as member>${member.memberMention}<#sep>, </#sep><#else><#include "meetup_message_no_member"></#list></#assign>
<#assign maybeParticipantsText> (${maybeParticipants?size}) <#list maybeParticipants as member>${member.memberMention}<#sep>, </#sep><#else><#include "meetup_message_no_member"></#list></#assign>
<#assign noTimeParticipantsText> (${noTimeParticipants?size}) <#list noTimeParticipants as member>${member.memberMention}<#sep>, </#sep><#else><#include "meetup_message_no_member"></#list></#assign>
<#assign declinedParticipantsText> (${declinedParticipants?size}) <#list declinedParticipants as member>${member.memberMention}<#sep>, </#sep><#else><#include "meetup_message_no_member"></#list></#assign>
"description": "<#if cancelled>~~</#if><@safe_include "meetup_display_description"/><#if cancelled>~~</#if>"
}
],
"buttons": [
{
"label": "<@safe_include "meetup_message_yes_button_label"/>",
"id": "${yesId}",
"buttonStyle": "success"
},
{
"label": "<@safe_include "meetup_message_maybe_button_label"/>",
"id": "${maybeId}",
"buttonStyle": "secondary"
},
{
"label": "<@safe_include "meetup_message_no_time_button_label"/>",
"id": "${noTimeId}",
"buttonStyle": "danger"
},
{
"label": "<@safe_include "meetup_message_no_button_label"/>",
"id": "${noId}",
"buttonStyle": "danger"
}
<#if location?? && location != "%22%22">,
{
"label": "<@safe_include "meetup_message_location_button_label"/>",
"url": "https://www.google.com/maps?q=${location?json_string}",
"buttonStyle": "link"
"type": "section",
"components": [
{
"type": "textDisplay",
"content": "<@safe_include "meetup_display_time_component"/>"
}
]
<#if location?? && location != "%22%22">
,"accessory": {
"type": "button",
"label": "<@safe_include "meetup_message_location_button_label"/>",
"url": "https://www.google.com/maps?q=${location?json_string}",
"buttonStyle": "link"
}
</#if>
}
<#macro decision_component button_id button_style label_template content_template user>
{
"type": "section",
"components": [
{
"type": "textDisplay",
"content": "<@safe_include content_template/>"
}
]
,"accessory": {
"type": "button",
"id": "${button_id}",
"label": "<@safe_include label_template/>",
"buttonStyle": "${button_style}"
}
}
</#macro>
<#assign participantsText> (${participants?size}) <#list participants as member>${member.memberMention}<#sep>, </#sep><#else><#include "meetup_message_no_member"></#list></#assign>
<#assign maybeParticipantsText> (${maybeParticipants?size}) <#list maybeParticipants as member>${member.memberMention}<#sep>, </#sep><#else><#include "meetup_message_no_member"></#list></#assign>
<#assign noTimeParticipantsText> (${noTimeParticipants?size}) <#list noTimeParticipants as member>${member.memberMention}<#sep>, </#sep><#else><#include "meetup_message_no_member"></#list></#assign>
<#assign declinedParticipantsText> (${declinedParticipants?size}) <#list declinedParticipants as member>${member.memberMention}<#sep>, </#sep><#else><#include "meetup_message_no_member"></#list></#assign>
,<@decision_component yesId "success" "meetup_message_yes_button_label" "meetup_user_display_participants" participantsText/>
,<@decision_component maybeId "secondary" "meetup_message_maybe_button_label" "meetup_user_display_maybe_participants" maybeParticipantsText/>
,<@decision_component noId "danger" "meetup_message_no_button_label" "meetup_user_display_declined_participants" declinedParticipantsText/>
,<@decision_component noTimeId "danger" "meetup_message_no_time_button_label" "meetup_user_display_no_time_participants" noTimeParticipantsText/>
<#if meetupIcsModel.attachIcsFile>
,{
"type": "fileDisplay",
"fileName": "<@safe_include "meetup_ics_file_name"/>.ics",
"fileContent": "<@safe_include "meetup_ice_file_download"/>"
}
</#if>
],
<#if meetupIcsModel.attachIcsFile>
"files": [
{
"fileName": "<@safe_include "meetup_ics_file_name"/>.ics",
"fileContent": "<@safe_include "meetup_ice_file_download"/>"
}
],
</#if>
"messageConfig": {
"allowsRoleMention": true
"allowsRoleMention": true,
"allowsUserMention": false,
"useComponentsV2": true
}
}

View File

@@ -1,26 +1,66 @@
<#include "format_instant">
{
"embeds": [
"components": [
{
<#include "abstracto_color">,
"author": {
<#assign authorName><@default_template_if_null authorName "quote_response_default_author_name"/></#assign>
<#assign channelName><@default_template_if_null sourceChannelName "quote_response_default_channel_name"/></#assign>
"name": "<@safe_include "quote_response_header_author_name"/>"
<#if authorAvatarURL??>,"avatar": "${authorAvatarURL}"</#if>
},
<#assign quoteId=quoteId>
<#assign quoteDescription=quoteContent>
<#assign authorName><#if authorMemberDisplay?has_content>${authorMemberDisplay.name}<#elseif authorUserDisplay?has_content>${authorUserDisplay.name}<#else><@safe_include "quote_response_default_author_name"/></#if></#assign>
<#assign adderUserName><#if adderMemberDisplay?has_content>${adderMemberDisplay.name}<#elseif adderUserDisplay?has_content>${adderMemberDisplay.name}<#else><@safe_include "quote_response_default_adder_name"/></#if></#assign>
<#assign channelName><@default_template_if_null sourceChannelName "quote_response_default_channel_name"/></#assign>
<#assign creationDate><@format_instant_date_time instant=creationDate/></#assign>
"type": "textDisplay",
"content": "<@safe_include "quote_response_header_author_name"/>"
},
{
"type": "section",
"components": [
{
<#assign quoteId=quoteId>
"type": "textDisplay",
"content": "<@safe_include "quote_response_title"/>"
}
],
<#assign quoteJumpUrl=quotedMessage.jumpUrl>
"description": "<@safe_include "quote_response_description"/>",
"footer": {
<#assign adderUserName><@default_template_if_null adderName "quote_response_default_adder_name"/></#assign>
"text": "<@safe_include "quote_response_footer_adder_name" />"
<#if adderAvatarURL??>,"icon": "${adderAvatarURL}"</#if>
},
<#if imageAttachmentURLs?size = 1>
"imageUrl": "${imageAttachmentURLs[0]}",
"accessory": {
"type": "button",
"label": "<@safe_include "quote_response_jump_label"/>",
"url": "${quoteJumpUrl}",
"buttonStyle": "link"
}
},
{
"type": "container",
"components": [
<#assign hasContent=false>
<#if quoteContent?has_content>
<#assign hasContent=true>
{
"type": "textDisplay",
<#assign quoteDescription=quoteContent>
"content": "${quoteDescription}"
}
</#if>
"timeStamp": "${creationDate}"
<#if mediaAttachmentURLs?size gt 0>
<#assign hasContent=true>
,{
"type": "mediaGallery",
"images": [
<#list mediaAttachmentURLs as image>
{
"url": "${image}"
}<#sep>,</#list>
]
}
</#if>
<#if hasContent==false>
{
"type": "textDisplay",
"content": "<@safe_include "quote_response_no_content"/>"
}
</#if>
]
}
]
],
"messageConfig": {
"allowsUserMention": false,
"useComponentsV2": true
}
}