mirror of
https://github.com/Sheldan/Sissi.git
synced 2026-01-01 23:35:21 +00:00
[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:
2
.env
2
.env
@@ -1,4 +1,4 @@
|
|||||||
REGISTRY_PREFIX=harbor.sheldan.dev/sissi/
|
REGISTRY_PREFIX=harbor.sheldan.dev/sissi/
|
||||||
ABSTRACTO_PREFIX=harbor.sheldan.dev/abstracto/
|
ABSTRACTO_PREFIX=harbor.sheldan.dev/abstracto/
|
||||||
VERSION=1.5.5
|
VERSION=1.5.5
|
||||||
ABSTRACTO_VERSION=1.6.8
|
ABSTRACTO_VERSION=1.6.9
|
||||||
@@ -60,7 +60,7 @@ public class MeetupDecisionListener implements ButtonClickedListener {
|
|||||||
MeetupMessageModel meetupMessageModel = meetupServiceBean.getMeetupMessageModel(meetup);
|
MeetupMessageModel meetupMessageModel = meetupServiceBean.getMeetupMessageModel(meetup);
|
||||||
addParticipationToModel(meetupMessageModel, userInAServer, payload.getMeetupDecision());
|
addParticipationToModel(meetupMessageModel, userInAServer, payload.getMeetupDecision());
|
||||||
MessageToSend messageToSend = meetupServiceBean.getMeetupMessage(meetupMessageModel, model.getServerId());
|
MessageToSend messageToSend = meetupServiceBean.getMeetupMessage(meetupMessageModel, model.getServerId());
|
||||||
channelService.editEmbedMessageInAChannel(messageToSend.getEmbeds().get(0), model.getEvent().getChannel(), meetup.getMessageId())
|
channelService.editMessageInAChannelFuture(messageToSend, model.getEvent().getChannel(), meetup.getMessageId())
|
||||||
.thenAccept(message -> log.info("Updated message of meetup {} in channel {} in server {}.", meetup.getId().getId(), meetup.getMeetupChannel().getId(), meetup.getServer().getId()))
|
.thenAccept(message -> log.info("Updated message of meetup {} in channel {} in server {}.", meetup.getId().getId(), meetup.getMeetupChannel().getId(), meetup.getServer().getId()))
|
||||||
.exceptionally(throwable -> {
|
.exceptionally(throwable -> {
|
||||||
log.info("Failed to update message of meetup {} in channel {} in server {}.", meetup.getId().getId(), meetup.getMeetupChannel().getId(), meetup.getServer().getId(), throwable);
|
log.info("Failed to update message of meetup {} in channel {} in server {}.", meetup.getId().getId(), meetup.getMeetupChannel().getId(), meetup.getServer().getId(), throwable);
|
||||||
|
|||||||
@@ -372,7 +372,7 @@ public class MeetupServiceBean {
|
|||||||
List<Long> userIdsToNotify = participants
|
List<Long> userIdsToNotify = participants
|
||||||
.stream()
|
.stream()
|
||||||
.map(meetupParticipator -> meetupParticipator.getParticipator().getUserReference().getId())
|
.map(meetupParticipator -> meetupParticipator.getParticipator().getUserReference().getId())
|
||||||
.collect(Collectors.toList());
|
.toList();
|
||||||
|
|
||||||
Long serverId = meetup.getServer().getId();
|
Long serverId = meetup.getServer().getId();
|
||||||
|
|
||||||
@@ -415,7 +415,7 @@ public class MeetupServiceBean {
|
|||||||
List<Long> userInServerIds = participants
|
List<Long> userInServerIds = participants
|
||||||
.stream()
|
.stream()
|
||||||
.map(meetupParticipant -> meetupParticipant.getParticipator().getUserInServerId())
|
.map(meetupParticipant -> meetupParticipant.getParticipator().getUserInServerId())
|
||||||
.collect(Collectors.toList());
|
.toList();
|
||||||
meetup
|
meetup
|
||||||
.getParticipants().removeIf(meetupParticipant -> userInServerIds.contains(meetupParticipant.getParticipator().getUserInServerId()));
|
.getParticipants().removeIf(meetupParticipant -> userInServerIds.contains(meetupParticipant.getParticipator().getUserInServerId()));
|
||||||
MeetupMessageModel meetupMessageModel = getMeetupMessageModel(meetup);
|
MeetupMessageModel meetupMessageModel = getMeetupMessageModel(meetup);
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
package dev.sheldan.sissi.module.quotes.model.command;
|
package dev.sheldan.sissi.module.quotes.model.command;
|
||||||
|
|
||||||
import dev.sheldan.abstracto.core.models.ServerChannelMessage;
|
import dev.sheldan.abstracto.core.models.ServerChannelMessage;
|
||||||
|
import dev.sheldan.abstracto.core.models.template.display.MemberDisplay;
|
||||||
|
import dev.sheldan.abstracto.core.models.template.display.UserDisplay;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
|
||||||
@@ -11,14 +13,14 @@ import java.util.List;
|
|||||||
@Builder
|
@Builder
|
||||||
public class QuoteResponseModel {
|
public class QuoteResponseModel {
|
||||||
private Long quoteId;
|
private Long quoteId;
|
||||||
private String authorAvatarURL;
|
private UserDisplay authorUserDisplay;
|
||||||
private String authorName;
|
private MemberDisplay authorMemberDisplay;
|
||||||
private ServerChannelMessage quotedMessage;
|
private ServerChannelMessage quotedMessage;
|
||||||
private String quoteContent;
|
private String quoteContent;
|
||||||
private List<String> imageAttachmentURLs;
|
private List<String> mediaAttachmentURLs;
|
||||||
private List<String> fileAttachmentURLs;
|
private List<String> fileAttachmentURLs;
|
||||||
private String adderAvatarURL;
|
private UserDisplay adderUserDisplay;
|
||||||
private String adderName;
|
private MemberDisplay adderMemberDisplay;
|
||||||
private Instant creationDate;
|
private Instant creationDate;
|
||||||
private String sourceChannelName;
|
private String sourceChannelName;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,8 +41,8 @@ public class QuoteAttachment {
|
|||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
@Column(name = "is_image", nullable = false)
|
@Column(name = "is_media", nullable = false)
|
||||||
@Builder.Default
|
@Builder.Default
|
||||||
private Boolean isImage = false;
|
private Boolean isMedia = false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ import dev.sheldan.abstracto.core.models.ServerChannelMessage;
|
|||||||
import dev.sheldan.abstracto.core.models.ServerUser;
|
import dev.sheldan.abstracto.core.models.ServerUser;
|
||||||
import dev.sheldan.abstracto.core.models.database.AServer;
|
import dev.sheldan.abstracto.core.models.database.AServer;
|
||||||
import dev.sheldan.abstracto.core.models.database.AUserInAServer;
|
import dev.sheldan.abstracto.core.models.database.AUserInAServer;
|
||||||
|
import dev.sheldan.abstracto.core.models.template.display.MemberDisplay;
|
||||||
|
import dev.sheldan.abstracto.core.models.template.display.UserDisplay;
|
||||||
import dev.sheldan.abstracto.core.service.ChannelService;
|
import dev.sheldan.abstracto.core.service.ChannelService;
|
||||||
import dev.sheldan.abstracto.core.service.MemberService;
|
import dev.sheldan.abstracto.core.service.MemberService;
|
||||||
import dev.sheldan.abstracto.core.service.UserService;
|
import dev.sheldan.abstracto.core.service.UserService;
|
||||||
@@ -103,21 +105,21 @@ public class QuoteServiceBean {
|
|||||||
List<String> imageAttachments = quote
|
List<String> imageAttachments = quote
|
||||||
.getAttachments()
|
.getAttachments()
|
||||||
.stream()
|
.stream()
|
||||||
.filter(QuoteAttachment::getIsImage)
|
.filter(QuoteAttachment::getIsMedia)
|
||||||
.map(QuoteAttachment::getUrl)
|
.map(QuoteAttachment::getUrl)
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
List<String> fileAttachments = quote
|
List<String> fileAttachments = quote
|
||||||
.getAttachments()
|
.getAttachments()
|
||||||
.stream()
|
.stream()
|
||||||
.filter(quoteAttachment -> !quoteAttachment.getIsImage())
|
.filter(quoteAttachment -> !quoteAttachment.getIsMedia())
|
||||||
.map(QuoteAttachment::getUrl)
|
.map(QuoteAttachment::getUrl)
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
QuoteResponseModel.QuoteResponseModelBuilder modelBuilder = QuoteResponseModel
|
QuoteResponseModel.QuoteResponseModelBuilder modelBuilder = QuoteResponseModel
|
||||||
.builder()
|
.builder()
|
||||||
.quoteContent(quote.getText())
|
.quoteContent(quote.getText())
|
||||||
.imageAttachmentURLs(imageAttachments)
|
.mediaAttachmentURLs(imageAttachments)
|
||||||
.quoteId(quote.getId())
|
.quoteId(quote.getId())
|
||||||
.fileAttachmentURLs(fileAttachments)
|
.fileAttachmentURLs(fileAttachments)
|
||||||
.creationDate(quote.getCreated())
|
.creationDate(quote.getCreated())
|
||||||
@@ -166,42 +168,14 @@ public class QuoteServiceBean {
|
|||||||
.filter(user -> user.getIdLong() == quoteAdderUserId)
|
.filter(user -> user.getIdLong() == quoteAdderUserId)
|
||||||
.findFirst()
|
.findFirst()
|
||||||
.orElse(null);
|
.orElse(null);
|
||||||
String adderAvatar = Optional
|
|
||||||
.ofNullable(adderMember)
|
|
||||||
.map(member -> member.getUser().getAvatarUrl())
|
|
||||||
.orElse(Optional
|
|
||||||
.ofNullable(adderUser)
|
|
||||||
.map(User::getAvatarUrl)
|
|
||||||
.orElse(null));
|
|
||||||
String authorAvatar = Optional
|
|
||||||
.ofNullable(authorMember)
|
|
||||||
.map(member -> member.getUser().getAvatarUrl())
|
|
||||||
.orElse(Optional
|
|
||||||
.ofNullable(authorUser)
|
|
||||||
.map(User::getAvatarUrl)
|
|
||||||
.orElse(null));
|
|
||||||
String adderName = Optional
|
|
||||||
.ofNullable(adderMember)
|
|
||||||
.map(Member::getEffectiveName)
|
|
||||||
.orElse(Optional
|
|
||||||
.ofNullable(adderUser)
|
|
||||||
.map(User::getName)
|
|
||||||
.orElse(null));
|
|
||||||
String authorName = Optional
|
|
||||||
.ofNullable(authorMember)
|
|
||||||
.map(Member::getEffectiveName)
|
|
||||||
.orElse(Optional
|
|
||||||
.ofNullable(authorUser)
|
|
||||||
.map(User::getName)
|
|
||||||
.orElse(null));
|
|
||||||
String channelName = sourceChannel
|
String channelName = sourceChannel
|
||||||
.map(Channel::getName)
|
.map(Channel::getName)
|
||||||
.orElse(null);
|
.orElse(null);
|
||||||
QuoteResponseModel model = modelBuilder
|
QuoteResponseModel model = modelBuilder
|
||||||
.adderAvatarURL(adderAvatar)
|
.authorMemberDisplay(authorMember != null ? MemberDisplay.fromMember(authorMember) : null)
|
||||||
.authorAvatarURL(authorAvatar)
|
.authorUserDisplay(authorUser != null ? UserDisplay.fromUser(authorUser) : UserDisplay.fromServerUser(ServerUser.fromId(serverId, quotedUserId)))
|
||||||
.adderName(adderName)
|
.adderMemberDisplay(adderMember != null ? MemberDisplay.fromMember(adderMember) : null)
|
||||||
.authorName(authorName)
|
.adderUserDisplay(adderUser != null ? UserDisplay.fromUser(adderUser) : UserDisplay.fromServerUser(ServerUser.fromId(serverId, quoteAdderUserId)))
|
||||||
.sourceChannelName(channelName)
|
.sourceChannelName(channelName)
|
||||||
.build();
|
.build();
|
||||||
return templateService.renderEmbedTemplate(QUOTE_RESPONSE_TEMPLATE_KEY, model, serverId);
|
return templateService.renderEmbedTemplate(QUOTE_RESPONSE_TEMPLATE_KEY, model, serverId);
|
||||||
@@ -260,7 +234,7 @@ public class QuoteServiceBean {
|
|||||||
List<Pair<String, Boolean>> attachments = quoteMessage
|
List<Pair<String, Boolean>> attachments = quoteMessage
|
||||||
.getAttachments()
|
.getAttachments()
|
||||||
.stream()
|
.stream()
|
||||||
.map(attachment -> Pair.of(attachment.getProxyUrl(), attachment.isImage()))
|
.map(attachment -> Pair.of(attachment.getProxyUrl(), attachment.isImage() || attachment.isVideo()))
|
||||||
.toList();
|
.toList();
|
||||||
return quoteManagementService.createQuote(author, adder, quoteMessage.getContentDisplay(), ServerChannelMessage.fromMessage(quoteMessage), attachments);
|
return quoteManagementService.createQuote(author, adder, quoteMessage.getContentDisplay(), ServerChannelMessage.fromMessage(quoteMessage), attachments);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ public class QuoteManagementService {
|
|||||||
.url(stringBooleanPair.getLeft())
|
.url(stringBooleanPair.getLeft())
|
||||||
.quote(quote)
|
.quote(quote)
|
||||||
.server(adder.getServerReference())
|
.server(adder.getServerReference())
|
||||||
.isImage(stringBooleanPair.getRight())
|
.isMedia(stringBooleanPair.getRight())
|
||||||
.build())
|
.build())
|
||||||
.toList();
|
.toList();
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
|
||||||
|
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog https://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.26.xsd" >
|
||||||
|
<include file="tables/tables.xml" relativeToChangelogFile="true"/>
|
||||||
|
</databaseChangeLog>
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
|
||||||
|
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog https://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.26.xsd" >
|
||||||
|
<changeSet author="Sheldan" id="quote_attachment-rename-media-column">
|
||||||
|
<renameColumn
|
||||||
|
tableName="quote_attachment"
|
||||||
|
newColumnName="is_media"
|
||||||
|
oldColumnName="is_image" />
|
||||||
|
</changeSet>
|
||||||
|
|
||||||
|
</databaseChangeLog>
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
|
||||||
|
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog https://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.26.xsd" >
|
||||||
|
<include file="quote_attachment.xml" relativeToChangelogFile="true"/>
|
||||||
|
</databaseChangeLog>
|
||||||
@@ -5,4 +5,5 @@
|
|||||||
<include file="1.0.2/collection.xml" relativeToChangelogFile="true"/>
|
<include file="1.0.2/collection.xml" relativeToChangelogFile="true"/>
|
||||||
<include file="1.4.56/collection.xml" relativeToChangelogFile="true"/>
|
<include file="1.4.56/collection.xml" relativeToChangelogFile="true"/>
|
||||||
<include file="1.4.57/collection.xml" relativeToChangelogFile="true"/>
|
<include file="1.4.57/collection.xml" relativeToChangelogFile="true"/>
|
||||||
|
<include file="1.5.6/collection.xml" relativeToChangelogFile="true"/>
|
||||||
</databaseChangeLog>
|
</databaseChangeLog>
|
||||||
@@ -93,7 +93,7 @@ templateDeployment:
|
|||||||
repository: harbor.sheldan.dev/abstracto
|
repository: harbor.sheldan.dev/abstracto
|
||||||
pullPolicy: Always
|
pullPolicy: Always
|
||||||
image: abstracto-template-deployment
|
image: abstracto-template-deployment
|
||||||
tag: 1.6.8
|
tag: 1.6.9
|
||||||
templateDeploymentData:
|
templateDeploymentData:
|
||||||
repository: harbor.sheldan.dev/sissi
|
repository: harbor.sheldan.dev/sissi
|
||||||
pullPolicy: Always
|
pullPolicy: Always
|
||||||
@@ -104,7 +104,7 @@ dbConfigDeployment:
|
|||||||
repository: harbor.sheldan.dev/abstracto
|
repository: harbor.sheldan.dev/abstracto
|
||||||
pullPolicy: Always
|
pullPolicy: Always
|
||||||
image: abstracto-db-deployment
|
image: abstracto-db-deployment
|
||||||
tag: 1.6.8
|
tag: 1.6.9
|
||||||
dbConfigDeploymentData:
|
dbConfigDeploymentData:
|
||||||
repository: harbor.sheldan.dev/sissi
|
repository: harbor.sheldan.dev/sissi
|
||||||
pullPolicy: Always
|
pullPolicy: Always
|
||||||
|
|||||||
4
pom.xml
4
pom.xml
@@ -18,8 +18,8 @@
|
|||||||
<properties>
|
<properties>
|
||||||
<maven.compiler.target>17</maven.compiler.target>
|
<maven.compiler.target>17</maven.compiler.target>
|
||||||
<maven.compiler.source>17</maven.compiler.source>
|
<maven.compiler.source>17</maven.compiler.source>
|
||||||
<abstracto.version>1.6.8</abstracto.version>
|
<abstracto.version>1.6.9</abstracto.version>
|
||||||
<abstracto.templates.version>1.4.56</abstracto.templates.version>
|
<abstracto.templates.version>1.4.57</abstracto.templates.version>
|
||||||
<apache-jena.version>4.9.0</apache-jena.version>
|
<apache-jena.version>4.9.0</apache-jena.version>
|
||||||
<rssreader.version>3.5.0</rssreader.version>
|
<rssreader.version>3.5.0</rssreader.version>
|
||||||
</properties>
|
</properties>
|
||||||
|
|||||||
@@ -1,33 +1,30 @@
|
|||||||
<#include "format_instant">
|
<#include "format_instant">
|
||||||
{
|
{
|
||||||
"embeds": [
|
"components": [
|
||||||
{
|
{
|
||||||
<#include "abstracto_color">,
|
<#assign hasLocation=location?? && location != "%22%22">
|
||||||
"title": {
|
"type": "textDisplay",
|
||||||
"title": "${topic?json_string}"
|
"content": "<#include "createMeetup_meetup_information">"
|
||||||
},
|
|
||||||
"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"
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": "<@safe_include "createMeetup_cancel_button_label"/>",
|
"type": "actionRow",
|
||||||
"id": "${cancelId}",
|
"actionRowItems": [
|
||||||
"buttonStyle": "danger"
|
{
|
||||||
|
"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
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,10 +1,36 @@
|
|||||||
<#include "format_instant">
|
<#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">,
|
"type": "section",
|
||||||
"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">
|
"components": [
|
||||||
<#else><#include "meetup_list_no_meetups"></#list>"
|
{
|
||||||
|
"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
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,63 +1,74 @@
|
|||||||
<#include "format_instant">
|
<#include "format_instant">
|
||||||
{
|
{
|
||||||
<#assign roleMention="<@&371419588619141121>"/>
|
"components": [
|
||||||
"additionalMessage": "${roleMention?json_string}",
|
{
|
||||||
"embeds": [
|
"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 time><@format_instant_long_date_time instant=meetupTime/></#assign>
|
||||||
<#assign timeRelative><@format_instant_relative instant=meetupTime/></#assign>
|
<#assign timeRelative><@format_instant_relative instant=meetupTime/></#assign>
|
||||||
<#assign organizerText>${organizer.memberMention}</#assign>
|
"type": "section",
|
||||||
<#assign meetupId=meetupId/>
|
"components": [
|
||||||
<#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>
|
"type": "textDisplay",
|
||||||
<#assign maybeParticipantsText> (${maybeParticipants?size}) <#list maybeParticipants as member>${member.memberMention}<#sep>, </#sep><#else><#include "meetup_message_no_member"></#list></#assign>
|
"content": "<@safe_include "meetup_display_time_component"/>"
|
||||||
<#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>"
|
<#if location?? && location != "%22%22">
|
||||||
}
|
,"accessory": {
|
||||||
],
|
"type": "button",
|
||||||
"buttons": [
|
"label": "<@safe_include "meetup_message_location_button_label"/>",
|
||||||
{
|
"url": "https://www.google.com/maps?q=${location?json_string}",
|
||||||
"label": "<@safe_include "meetup_message_yes_button_label"/>",
|
"buttonStyle": "link"
|
||||||
"id": "${yesId}",
|
}
|
||||||
"buttonStyle": "success"
|
</#if>
|
||||||
},
|
|
||||||
{
|
|
||||||
"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"
|
|
||||||
}
|
}
|
||||||
|
<#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>
|
||||||
],
|
],
|
||||||
<#if meetupIcsModel.attachIcsFile>
|
|
||||||
"files": [
|
|
||||||
{
|
|
||||||
"fileName": "<@safe_include "meetup_ics_file_name"/>.ics",
|
|
||||||
"fileContent": "<@safe_include "meetup_ice_file_download"/>"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
</#if>
|
|
||||||
"messageConfig": {
|
"messageConfig": {
|
||||||
"allowsRoleMention": true
|
"allowsRoleMention": true,
|
||||||
|
"allowsUserMention": false,
|
||||||
|
"useComponentsV2": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,26 +1,66 @@
|
|||||||
|
<#include "format_instant">
|
||||||
{
|
{
|
||||||
"embeds": [
|
"components": [
|
||||||
{
|
{
|
||||||
<#include "abstracto_color">,
|
<#assign authorName><#if authorMemberDisplay?has_content>${authorMemberDisplay.name}<#elseif authorUserDisplay?has_content>${authorUserDisplay.name}<#else><@safe_include "quote_response_default_author_name"/></#if></#assign>
|
||||||
"author": {
|
<#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 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>
|
||||||
<#assign channelName><@default_template_if_null sourceChannelName "quote_response_default_channel_name"/></#assign>
|
<#assign creationDate><@format_instant_date_time instant=creationDate/></#assign>
|
||||||
"name": "<@safe_include "quote_response_header_author_name"/>"
|
"type": "textDisplay",
|
||||||
<#if authorAvatarURL??>,"avatar": "${authorAvatarURL}"</#if>
|
"content": "<@safe_include "quote_response_header_author_name"/>"
|
||||||
},
|
},
|
||||||
<#assign quoteId=quoteId>
|
{
|
||||||
<#assign quoteDescription=quoteContent>
|
"type": "section",
|
||||||
|
"components": [
|
||||||
|
{
|
||||||
|
<#assign quoteId=quoteId>
|
||||||
|
"type": "textDisplay",
|
||||||
|
"content": "<@safe_include "quote_response_title"/>"
|
||||||
|
}
|
||||||
|
],
|
||||||
<#assign quoteJumpUrl=quotedMessage.jumpUrl>
|
<#assign quoteJumpUrl=quotedMessage.jumpUrl>
|
||||||
"description": "<@safe_include "quote_response_description"/>",
|
"accessory": {
|
||||||
"footer": {
|
"type": "button",
|
||||||
<#assign adderUserName><@default_template_if_null adderName "quote_response_default_adder_name"/></#assign>
|
"label": "<@safe_include "quote_response_jump_label"/>",
|
||||||
"text": "<@safe_include "quote_response_footer_adder_name" />"
|
"url": "${quoteJumpUrl}",
|
||||||
<#if adderAvatarURL??>,"icon": "${adderAvatarURL}"</#if>
|
"buttonStyle": "link"
|
||||||
},
|
}
|
||||||
<#if imageAttachmentURLs?size = 1>
|
},
|
||||||
"imageUrl": "${imageAttachmentURLs[0]}",
|
{
|
||||||
|
"type": "container",
|
||||||
|
"components": [
|
||||||
|
<#assign hasContent=false>
|
||||||
|
<#if quoteContent?has_content>
|
||||||
|
<#assign hasContent=true>
|
||||||
|
{
|
||||||
|
"type": "textDisplay",
|
||||||
|
<#assign quoteDescription=quoteContent>
|
||||||
|
"content": "${quoteDescription}"
|
||||||
|
}
|
||||||
</#if>
|
</#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
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
${topic?json_string} - <@format_instant_long_date_time instant=meetupTime/>
|
||||||
|
|
||||||
|
${description?json_string}
|
||||||
|
|
||||||
|
<#if hasLocation>https://www.google.com/maps?q=${location?json_string}</#if>
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
Go to meetup
|
||||||
@@ -1,3 +1,2 @@
|
|||||||
Time: ${time} ${timeRelative}
|
Time: ${time} ${timeRelative}
|
||||||
Link: [here](${link})
|
|
||||||
Meetup Topic: `${topic?json_string}`
|
Meetup Topic: `${topic?json_string}`
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
Description: ${descriptionText}
|
||||||
|
|
||||||
|
Organized by: ${organizerText}
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
Time: ${time} ${timeRelative}
|
|
||||||
<#if descriptionText?hasContent>Description: ${descriptionText}</#if>
|
|
||||||
Organized by: ${organizerText}
|
|
||||||
|
|
||||||
Participants: ${participantsText}
|
|
||||||
|
|
||||||
Maybe: ${maybeParticipantsText}
|
|
||||||
|
|
||||||
Declined: ${declinedParticipantsText}
|
|
||||||
|
|
||||||
No time: ${noTimeParticipantsText}
|
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
Time: ${time} ${timeRelative}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
Declined: ${declinedParticipantsText}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
Maybe: ${maybeParticipantsText}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
No time: ${noTimeParticipantsText}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
Participants: ${participantsText}
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
[**Quote #${quoteId?c}**](${quoteJumpUrl})
|
|
||||||
${quoteDescription}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
Added by ${adderUserName}
|
|
||||||
@@ -1 +1 @@
|
|||||||
${authorName} in ${channelName}
|
${authorName} in ${channelName} added by ${adderUserName} at ${creationDate}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
Go to quote
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
No content found.
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
## Quote #${quoteId}
|
||||||
Reference in New Issue
Block a user