mirror of
https://github.com/Sheldan/Sissi.git
synced 2026-01-02 15:56:31 +00:00
Compare commits
13 Commits
release-20
...
release-20
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ee0a49b00e | ||
|
|
ff4756e0ff | ||
|
|
68e4dc4235 | ||
|
|
7d827c6e1e | ||
|
|
8e292f76e4 | ||
|
|
a2db56853b | ||
|
|
abcd8e5c67 | ||
|
|
a05b9a8811 | ||
|
|
ec5a07cffb | ||
|
|
111a88b091 | ||
|
|
663d88475a | ||
|
|
8336d7fd9e | ||
|
|
a5d3b970df |
4
.env
4
.env
@@ -1,4 +1,4 @@
|
||||
REGISTRY_PREFIX=harbor.sheldan.dev/sissi/
|
||||
ABSTRACTO_PREFIX=harbor.sheldan.dev/abstracto/
|
||||
VERSION=1.5.16
|
||||
ABSTRACTO_VERSION=1.6.17
|
||||
VERSION=1.5.19
|
||||
ABSTRACTO_VERSION=1.6.19
|
||||
3
README
3
README
@@ -1,4 +1 @@
|
||||
|
||||
|
||||
Attributions:
|
||||
Code for debra module has been inspired with approval of zinnsoldat91 by: https://github.com/zinnsoldat91/spendenbot. The code has been adapted to fit into the structure.
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.sissi.application</groupId>
|
||||
<artifactId>application</artifactId>
|
||||
<version>1.5.17-SNAPSHOT</version>
|
||||
<version>1.5.20-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>executable</artifactId>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.sissi</groupId>
|
||||
<artifactId>sissi</artifactId>
|
||||
<version>1.5.17-SNAPSHOT</version>
|
||||
<version>1.5.20-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.sissi.application.module.custom</groupId>
|
||||
<artifactId>sissi-customizations</artifactId>
|
||||
<version>1.5.17-SNAPSHOT</version>
|
||||
<version>1.5.20-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>image-generation-custom</artifactId>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.sissi.application.module.custom</groupId>
|
||||
<artifactId>sissi-customizations</artifactId>
|
||||
<version>1.5.17-SNAPSHOT</version>
|
||||
<version>1.5.20-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<artifactId>application</artifactId>
|
||||
<groupId>dev.sheldan.sissi.application</groupId>
|
||||
<version>1.5.17-SNAPSHOT</version>
|
||||
<version>1.5.20-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.sissi.application</groupId>
|
||||
<artifactId>sissi-modules</artifactId>
|
||||
<version>1.5.17-SNAPSHOT</version>
|
||||
<version>1.5.20-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ public class DebraFeatureConfig implements FeatureConfig {
|
||||
|
||||
@Override
|
||||
public List<PostTargetEnum> getRequiredPostTargets() {
|
||||
return Arrays.asList(DebraPostTarget.DEBRA_DONATION_NOTIFICATION, DebraPostTarget.DEBRA_DONATION_NOTIFICATION2);
|
||||
return Arrays.asList(DebraPostTarget.DEBRA_DONATION_NOTIFICATION);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -5,7 +5,7 @@ import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
public enum DebraPostTarget implements PostTargetEnum {
|
||||
DEBRA_DONATION_NOTIFICATION("debraDonationNotification"), DEBRA_DONATION_NOTIFICATION2("debraDonationNotification2");
|
||||
DEBRA_DONATION_NOTIFICATION("debraDonationNotification");
|
||||
|
||||
private String key;
|
||||
|
||||
|
||||
@@ -87,6 +87,7 @@ public class DonationService {
|
||||
private DonationService self;
|
||||
|
||||
private static final String DEBRA_DONATION_NOTIFICATION_TEMPLATE_KEY = "debra_donation_notification";
|
||||
private static final String DEBRA_DONATION_PING_NOTIFICATION_TEMPLATE_KEY = "debra_donation_notification_ping_notification";
|
||||
|
||||
private static final String DEBRA_INFO_BUTTON_MESSAGE_TEMPLATE_KEY = "debraInfoButton";
|
||||
public static final String DEBRA_INFO_BUTTON_ORIGIN = "DEBRA_INFO_BUTTON";
|
||||
@@ -286,10 +287,9 @@ public class DonationService {
|
||||
.totalDonationAmount(donationInfoModel.getTotalAmount())
|
||||
.build();
|
||||
MessageToSend messageToSend = templateService.renderEmbedTemplate(DEBRA_DONATION_NOTIFICATION_TEMPLATE_KEY, model, targetServerId);
|
||||
List<CompletableFuture<Message>> firstMessage = postTargetService.sendEmbedInPostTarget(messageToSend, DebraPostTarget.DEBRA_DONATION_NOTIFICATION, targetServerId);
|
||||
List<CompletableFuture<Message>> secondMessage = postTargetService.sendEmbedInPostTarget(messageToSend, DebraPostTarget.DEBRA_DONATION_NOTIFICATION2, targetServerId);
|
||||
firstMessage.addAll(secondMessage);
|
||||
return FutureUtils.toSingleFutureGeneric(firstMessage);
|
||||
MessageToSend pingMessageToSend = templateService.renderEmbedTemplate(DEBRA_DONATION_PING_NOTIFICATION_TEMPLATE_KEY, model, targetServerId);
|
||||
return FutureUtils.toSingleFutureGenericList(postTargetService.sendEmbedInPostTarget(List.of(pingMessageToSend, messageToSend),
|
||||
DebraPostTarget.DEBRA_DONATION_NOTIFICATION, targetServerId));
|
||||
}
|
||||
|
||||
public CompletableFuture<Void> sendDebraInfoButtonMessage(GuildMessageChannel guildMessageChannel) {
|
||||
|
||||
@@ -2,7 +2,6 @@ abstracto.featureFlags.debra.featureName=debra
|
||||
abstracto.featureFlags.debra.enabled=false
|
||||
|
||||
abstracto.postTargets.debraDonationNotification.name=debraDonationNotification
|
||||
abstracto.postTargets.debraDonationNotification2.name=debraDonationNotification2
|
||||
|
||||
sissi.debra.donationPageUrl=https://secure.sicherhelfen.org/campaigns/07a3baf6-5cdc-4300-854b-ea2b36b0b218/show
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.sissi.application</groupId>
|
||||
<artifactId>sissi-modules</artifactId>
|
||||
<version>1.5.17-SNAPSHOT</version>
|
||||
<version>1.5.20-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -42,7 +42,14 @@ public class MeetupChangeTimeConfirmationListener implements ButtonClickedListen
|
||||
}
|
||||
if(model.getEvent().getComponentId().equals(payload.getConfirmationId())) {
|
||||
Meetup meetup = meetupManagementServiceBean.getMeetup(payload.getMeetupId(), payload.getGuildId());
|
||||
meetupServiceBean.changeMeetupTimeAndNotifyParticipants(meetup, Instant.ofEpochSecond(payload.getNewTime()));
|
||||
Long meetupId = meetup.getId().getId();
|
||||
Long serverId = meetup.getId().getServerId();
|
||||
meetupServiceBean.changeMeetupTimeAndNotifyParticipants(meetup, Instant.ofEpochSecond(payload.getNewTime())).thenAccept(unused -> {
|
||||
log.info("Successfully changed time of meetup {} in server {}.", meetupId, serverId);
|
||||
}).exceptionally(throwable -> {
|
||||
log.error("Failed to update time of meetup {} in server {}.", meetupId, serverId);
|
||||
return null;
|
||||
});
|
||||
messageService.deleteMessage(model.getEvent().getMessage());
|
||||
cleanupConfirmationMessagePayloads(payload);
|
||||
} else if(model.getEvent().getComponentId().equals(payload.getCancelId())) {
|
||||
|
||||
@@ -103,18 +103,26 @@ public class MeetupConfirmationListener implements ButtonClickedListener {
|
||||
String noButtonId = componentService.generateComponentId();
|
||||
String maybeButtonId = componentService.generateComponentId();
|
||||
String noTimeButtonId = componentService.generateComponentId();
|
||||
MeetupMessageModel messageModel = meetupServiceBean.getMeetupMessageModel(meetup);
|
||||
messageModel.setYesId(yesButtonId);
|
||||
messageModel.setNoId(noButtonId);
|
||||
messageModel.setMaybeId(maybeButtonId);
|
||||
messageModel.setNoTimeId(noTimeButtonId);
|
||||
Long meetupId = payload.getMeetupId();
|
||||
Long serverId = payload.getGuildId();
|
||||
meetup.setYesButtonId(yesButtonId);
|
||||
meetup.setMaybeButtonId(maybeButtonId);
|
||||
meetup.setNoTimeButtonId(noTimeButtonId);
|
||||
meetup.setNotInterestedButtonId(noButtonId);
|
||||
meetupServiceBean.getMeetupMessageModel(meetup).thenAccept(messageModel -> {
|
||||
self.postMeetupMessage(model, messageModel, yesButtonId, noButtonId, maybeButtonId, noTimeButtonId, meetupId, serverId);
|
||||
});
|
||||
return ButtonClickedListenerResult.ACKNOWLEDGED;
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public void postMeetupMessage(ButtonClickedListenerModel model, MeetupMessageModel messageModel, String yesButtonId, String noButtonId,
|
||||
String maybeButtonId, String noTimeButtonId, Long meetupId, Long serverId) {
|
||||
messageModel.setYesId(yesButtonId);
|
||||
messageModel.setNoId(noButtonId);
|
||||
messageModel.setMaybeId(maybeButtonId);
|
||||
messageModel.setNoTimeId(noTimeButtonId);
|
||||
messageModel.setCancelled(false);
|
||||
Long meetupId = payload.getMeetupId();
|
||||
Long serverId = payload.getGuildId();
|
||||
MessageToSend messageToSend = meetupServiceBean.getMeetupMessage(messageModel, model.getServerId());
|
||||
List<CompletableFuture<Message>> messageFutures = channelService.sendMessageToSendToChannel(messageToSend, model.getEvent().getMessageChannel());
|
||||
FutureUtils.toSingleFutureGeneric(messageFutures).thenAccept(unused -> {
|
||||
@@ -129,7 +137,6 @@ public class MeetupConfirmationListener implements ButtonClickedListener {
|
||||
log.error("Failed to send meetup message for meetup {}.", meetupId, throwable);
|
||||
return null;
|
||||
});
|
||||
return ButtonClickedListenerResult.ACKNOWLEDGED;
|
||||
}
|
||||
|
||||
private void cleanupConfirmationMessagePayloads(MeetupConfirmationPayload payload) {
|
||||
|
||||
@@ -20,8 +20,10 @@ import dev.sheldan.sissi.module.meetup.service.MeetupServiceBean;
|
||||
import dev.sheldan.sissi.module.meetup.service.management.MeetupManagementServiceBean;
|
||||
import dev.sheldan.sissi.module.meetup.service.management.MeetupParticipatorManagementServiceBean;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.dv8tion.jda.api.entities.Member;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
@@ -45,11 +47,15 @@ public class MeetupDecisionListener implements ButtonClickedListener {
|
||||
@Autowired
|
||||
private ChannelService channelService;
|
||||
|
||||
@Autowired
|
||||
private MeetupDecisionListener self;
|
||||
|
||||
@Override
|
||||
public ButtonClickedListenerResult execute(ButtonClickedListenerModel model) {
|
||||
MeetupDecisionPayload payload = (MeetupDecisionPayload) model.getDeserializedPayload();
|
||||
Meetup meetup = meetupManagementServiceBean.getMeetup(payload.getMeetupId(), payload.getGuildId());
|
||||
AUserInAServer userInAServer = userInServerManagementService.loadOrCreateUser(model.getEvent().getMember());
|
||||
Member member = model.getEvent().getMember();
|
||||
AUserInAServer userInAServer = userInServerManagementService.loadOrCreateUser(member);
|
||||
|
||||
Optional<MeetupParticipant> participationOptional = meetupParticipatorManagementServiceBean.getParticipation(meetup, userInAServer);
|
||||
if(participationOptional.isPresent()) {
|
||||
@@ -57,19 +63,28 @@ public class MeetupDecisionListener implements ButtonClickedListener {
|
||||
} else {
|
||||
meetupParticipatorManagementServiceBean.createParticipation(meetup, userInAServer, payload.getMeetupDecision());
|
||||
}
|
||||
MeetupMessageModel meetupMessageModel = meetupServiceBean.getMeetupMessageModel(meetup);
|
||||
addParticipationToModel(meetupMessageModel, userInAServer, payload.getMeetupDecision());
|
||||
MessageToSend messageToSend = meetupServiceBean.getMeetupMessage(meetupMessageModel, model.getServerId());
|
||||
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()))
|
||||
.exceptionally(throwable -> {
|
||||
log.info("Failed to update message of meetup {} in channel {} in server {}.", meetup.getId().getId(), meetup.getMeetupChannel().getId(), meetup.getServer().getId(), throwable);
|
||||
return null;
|
||||
});
|
||||
Long meetupMessageId = meetup.getMessageId();
|
||||
Long meetupId = meetup.getId().getId();
|
||||
Long meetupServerId = meetup.getServer().getId();
|
||||
meetupServiceBean.getMeetupMessageModel(meetup).thenAccept(meetupMessageModel -> {
|
||||
self.updateMeetupMessage(model, meetupMessageModel, member, payload, meetupMessageId, meetupId, meetupServerId);
|
||||
});
|
||||
return ButtonClickedListenerResult.ACKNOWLEDGED;
|
||||
}
|
||||
|
||||
private void addParticipationToModel(MeetupMessageModel model, AUserInAServer aUserInAServer, MeetupDecision decision) {
|
||||
@Transactional
|
||||
public void updateMeetupMessage(ButtonClickedListenerModel model, MeetupMessageModel meetupMessageModel, Member member, MeetupDecisionPayload payload, Long meetupMessageId, Long meetupId, Long meetupServerId) {
|
||||
addParticipationToModel(meetupMessageModel, member, payload.getMeetupDecision());
|
||||
MessageToSend messageToSend = meetupServiceBean.getMeetupMessage(meetupMessageModel, model.getServerId());
|
||||
channelService.editMessageInAChannelFuture(messageToSend, model.getEvent().getChannel(), meetupMessageId)
|
||||
.thenAccept(message -> log.info("Updated message of meetup {} in channel {} in server {}.", meetupId, meetupMessageId, meetupServerId))
|
||||
.exceptionally(throwable -> {
|
||||
log.info("Failed to update message of meetup {} in channel {} in server {}.", meetupId, meetupMessageId, meetupServerId, throwable);
|
||||
return null;
|
||||
});
|
||||
}
|
||||
|
||||
private void addParticipationToModel(MeetupMessageModel model, Member aUserInAServer, MeetupDecision decision) {
|
||||
if(decision.equals(MeetupDecision.NO)) {
|
||||
addIfMissing(model.getDeclinedParticipants(), aUserInAServer);
|
||||
} else if(decision.equals(MeetupDecision.YES)) {
|
||||
@@ -80,9 +95,9 @@ public class MeetupDecisionListener implements ButtonClickedListener {
|
||||
addIfMissing(model.getNoTimeParticipants(), aUserInAServer);
|
||||
}
|
||||
|
||||
private void addIfMissing(List<MemberDisplay> list, AUserInAServer aUserInAServer) {
|
||||
if(list.stream().noneMatch(memberDisplay -> memberDisplay.getUserId().equals(aUserInAServer.getUserReference().getId()))) {
|
||||
list.add(MemberDisplay.fromAUserInAServer(aUserInAServer));
|
||||
private void addIfMissing(List<MemberDisplay> list, Member aUserInAServer) {
|
||||
if(list.stream().noneMatch(memberDisplay -> memberDisplay.getUserId().equals(aUserInAServer.getIdLong()))) {
|
||||
list.add(MemberDisplay.fromMember(aUserInAServer));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ import dev.sheldan.abstracto.core.service.*;
|
||||
import dev.sheldan.abstracto.core.service.management.ServerManagementService;
|
||||
import dev.sheldan.abstracto.core.templating.model.MessageToSend;
|
||||
import dev.sheldan.abstracto.core.templating.service.TemplateService;
|
||||
import dev.sheldan.abstracto.core.utils.CompletableFutureList;
|
||||
import dev.sheldan.abstracto.core.utils.FileService;
|
||||
import dev.sheldan.abstracto.core.utils.FutureUtils;
|
||||
import dev.sheldan.abstracto.scheduling.model.JobParameters;
|
||||
@@ -32,6 +33,8 @@ import dev.sheldan.sissi.module.meetup.service.management.MeetupComponentManagem
|
||||
import dev.sheldan.sissi.module.meetup.service.management.MeetupManagementServiceBean;
|
||||
import dev.sheldan.sissi.module.meetup.service.management.MeetupParticipatorManagementServiceBean;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.dv8tion.jda.api.entities.Member;
|
||||
import net.dv8tion.jda.api.entities.User;
|
||||
import net.dv8tion.jda.api.entities.channel.middleman.GuildMessageChannel;
|
||||
import net.dv8tion.jda.api.entities.channel.middleman.MessageChannel;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -48,6 +51,8 @@ import java.time.format.DateTimeFormatter;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.function.Function;
|
||||
import java.util.function.Predicate;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Component
|
||||
@@ -109,8 +114,16 @@ public class MeetupServiceBean {
|
||||
|
||||
@Autowired
|
||||
private MeetupComponentManagementServiceBean meetupComponentManagementServiceBean;
|
||||
|
||||
@Autowired
|
||||
private MemberService memberService;
|
||||
|
||||
private static final String ICS_TIME_STAMP_FORMAT = "yMMdd'T'kkmmss'Z'";
|
||||
private static final ZoneId UTC = ZoneId.of("UTC");
|
||||
private static final DateTimeFormatter ICS_DATE_TIME_FORMATTER = DateTimeFormatter.ofPattern(ICS_TIME_STAMP_FORMAT);
|
||||
private static final Predicate<MeetupParticipant> MAYBE_OR_YES_PARTICIPATOR = meetupParticipator ->
|
||||
meetupParticipator.getDecision().equals(MeetupDecision.MAYBE) ||
|
||||
meetupParticipator.getDecision().equals(MeetupDecision.YES);
|
||||
|
||||
public void storeMeetupConfirmation(MeetupConfirmationModel model) {
|
||||
AServer server = serverManagementService.loadServer(model.getGuildId());
|
||||
@@ -142,11 +155,11 @@ public class MeetupServiceBean {
|
||||
}
|
||||
|
||||
private MeetupIcsModel getMeetupICSModel(Meetup meetup) {
|
||||
ZonedDateTime startTime = meetup.getMeetupTime().atZone(ZoneId.of("UTC"));
|
||||
ZonedDateTime endTime = meetup.getMeetupTime().plus(1, ChronoUnit.HOURS).atZone(ZoneId.of("UTC"));
|
||||
ZonedDateTime startTime = meetup.getMeetupTime().atZone(UTC);
|
||||
ZonedDateTime endTime = meetup.getMeetupTime().plus(1, ChronoUnit.HOURS).atZone(UTC);
|
||||
String icsFormattedStartTime = startTime.format(ICS_DATE_TIME_FORMATTER);
|
||||
String icsFormattedEndTime = endTime.format(ICS_DATE_TIME_FORMATTER);
|
||||
String icsFormattedMeetupCreationTime = Instant.now().atZone(ZoneId.of("UTC"))
|
||||
String icsFormattedMeetupCreationTime = Instant.now().atZone(UTC)
|
||||
.format(ICS_DATE_TIME_FORMATTER);
|
||||
boolean attachIcsFile = featureModeService.featureModeActive(MeetupFeatureDefinition.MEETUP, meetup.getServer().getId(), MeetupFeatureMode.ATTACH_ICS_FILE);
|
||||
return MeetupIcsModel
|
||||
@@ -158,26 +171,36 @@ public class MeetupServiceBean {
|
||||
.build();
|
||||
}
|
||||
|
||||
public MeetupMessageModel getMeetupMessageModel(Meetup meetup) {
|
||||
public CompletableFuture<MeetupMessageModel> getMeetupMessageModel(Meetup meetup) {
|
||||
List<MeetupParticipant> allParticipants = meetup.getParticipants();
|
||||
List<MeetupParticipant> participating = allParticipants
|
||||
Long serverId = meetup.getServer().getId();
|
||||
Function<MeetupParticipant, Long> mapToUserId = (p) -> p.getParticipator().getUserReference().getId();
|
||||
List<Long> participating = allParticipants
|
||||
.stream()
|
||||
.filter(meetupParticipator -> meetupParticipator.getDecision().equals(MeetupDecision.YES))
|
||||
.collect(Collectors.toList());
|
||||
List<MeetupParticipant> maybe = allParticipants
|
||||
.map(mapToUserId)
|
||||
.toList();
|
||||
List<Long> maybe = allParticipants
|
||||
.stream()
|
||||
.filter(meetupParticipator -> meetupParticipator.getDecision().equals(MeetupDecision.MAYBE))
|
||||
.collect(Collectors.toList());
|
||||
List<MeetupParticipant> notParticipating = allParticipants
|
||||
.map(mapToUserId)
|
||||
.toList();
|
||||
List<Long> notParticipating = allParticipants
|
||||
.stream()
|
||||
.filter(meetupParticipator -> meetupParticipator.getDecision().equals(MeetupDecision.NO))
|
||||
.collect(Collectors.toList());
|
||||
List<MeetupParticipant> notTimeParticipating = allParticipants
|
||||
.map(mapToUserId)
|
||||
.toList();
|
||||
List<Long> notTimeParticipating = allParticipants
|
||||
.stream()
|
||||
.filter(meetupParticipator -> meetupParticipator.getDecision().equals(MeetupDecision.NO_TIME))
|
||||
.collect(Collectors.toList());
|
||||
.map(mapToUserId)
|
||||
.toList();
|
||||
String rawLocation = java.net.URLDecoder.decode(meetup.getLocation(), StandardCharsets.UTF_8);
|
||||
return MeetupMessageModel
|
||||
List<Long> participantIds = allParticipants
|
||||
.stream()
|
||||
.map(mapToUserId)
|
||||
.collect(Collectors.toList());
|
||||
MeetupMessageModel.MeetupMessageModelBuilder builder = MeetupMessageModel
|
||||
.builder()
|
||||
.description(meetup.getDescription())
|
||||
.topic(meetup.getTopic())
|
||||
@@ -189,20 +212,63 @@ public class MeetupServiceBean {
|
||||
.noId(meetup.getNotInterestedButtonId())
|
||||
.meetupTime(meetup.getMeetupTime())
|
||||
.meetupId(meetup.getId().getId())
|
||||
.participants(getMemberDisplays(participating))
|
||||
.declinedParticipants(getMemberDisplays(notParticipating))
|
||||
.noTimeParticipants(getMemberDisplays(notTimeParticipating))
|
||||
.maybeParticipants(getMemberDisplays(maybe))
|
||||
.cancelled(meetup.getState().equals(MeetupState.CANCELLED))
|
||||
.organizer(MemberDisplay.fromAUserInAServer(meetup.getOrganizer()))
|
||||
.meetupIcsModel(getMeetupICSModel(meetup))
|
||||
.build();
|
||||
.meetupIcsModel(getMeetupICSModel(meetup));
|
||||
Long organizerId = meetup.getOrganizer().getUserReference().getId();
|
||||
participantIds.add(organizerId);
|
||||
// only supports 100 members at once, should be enough
|
||||
CompletableFuture<List<Member>> membersInServerAsync = memberService.getMembersInServerAsync(serverId, participantIds);
|
||||
return membersInServerAsync.thenCompose(members -> {
|
||||
Set<Long> foundMembers = members
|
||||
.stream()
|
||||
.map(Member::getIdLong)
|
||||
.collect(Collectors.toSet());
|
||||
Set<Long> participatingMembers = new HashSet<>(participantIds);
|
||||
participatingMembers.removeAll(foundMembers);
|
||||
CompletableFuture<List<User>> userLoading = new CompletableFuture<>();
|
||||
if(!participatingMembers.isEmpty()) {
|
||||
CompletableFutureList<User> userFutureList = userService.retrieveUsers(new ArrayList<>(participatingMembers));
|
||||
userFutureList.getMainFuture().thenAccept(unused -> {
|
||||
userLoading.complete(userFutureList.getObjects());
|
||||
});
|
||||
} else {
|
||||
userLoading.complete(new ArrayList<>());
|
||||
}
|
||||
|
||||
return userLoading.thenApply(users ->
|
||||
builder
|
||||
.participants(getMemberDisplays(members, users, participating, serverId))
|
||||
.declinedParticipants(getMemberDisplays(members, users, notParticipating, serverId))
|
||||
.noTimeParticipants(getMemberDisplays(members, users, notTimeParticipating, serverId))
|
||||
.maybeParticipants(getMemberDisplays(members, users, maybe, serverId))
|
||||
.organizer(getMemberDisplays(members, users, Arrays.asList(organizerId), serverId).get(0))
|
||||
.build());
|
||||
});
|
||||
}
|
||||
|
||||
private List<MemberDisplay> getMemberDisplays(List<MeetupParticipant> participants) {
|
||||
private List<MemberDisplay> getMemberDisplays(List<Member> members, List<User> users, List<Long> participants, Long serverId) {
|
||||
Map<Long, Member> memberMap = members.stream()
|
||||
.collect(Collectors.toMap(Member::getIdLong, Function.identity()));
|
||||
Map<Long, User> userMap = users.stream()
|
||||
.collect(Collectors.toMap(User::getIdLong, Function.identity()));
|
||||
return participants
|
||||
.stream()
|
||||
.map(meetupParticipator -> MemberDisplay.fromAUserInAServer(meetupParticipator.getParticipator()))
|
||||
.map(meetupParticipator -> {
|
||||
if(memberMap.containsKey(meetupParticipator)) {
|
||||
return MemberDisplay.fromMember(memberMap.get(meetupParticipator));
|
||||
} else if(userMap.containsKey(meetupParticipator)) {
|
||||
User user = userMap.get(meetupParticipator);
|
||||
// a user display would be more appropriate, but I dont want to deal with the implications
|
||||
return MemberDisplay
|
||||
.builder()
|
||||
.serverId(serverId)
|
||||
.userId(user.getIdLong())
|
||||
.name(user.getEffectiveName())
|
||||
.avatarUrl(user.getEffectiveAvatarUrl())
|
||||
.build();
|
||||
}
|
||||
return MemberDisplay.fromIds(serverId, meetupParticipator);
|
||||
})
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@@ -214,40 +280,43 @@ public class MeetupServiceBean {
|
||||
Long serverId = meetup.getServer().getId();
|
||||
Long meetupId = meetup.getId().getId();
|
||||
GuildMessageChannel channel = channelService.getMessageChannelFromServer(serverId, meetup.getMeetupChannel().getId());
|
||||
MeetupMessageModel model = getMeetupMessageModel(meetup);
|
||||
List<String> componentPayloads = meetup
|
||||
.getMeetupComponents()
|
||||
.stream()
|
||||
.map(meetupComponent -> meetupComponent.getId().getComponentId())
|
||||
.collect(Collectors.toList());
|
||||
model.setCancelled(true);
|
||||
MessageToSend meetupMessage = getMeetupMessage(model, serverId);
|
||||
return messageService.editMessageInChannel(channel, meetupMessage, meetup.getMessageId())
|
||||
.thenAccept(unused -> self.notifyParticipants(meetupId, serverId))
|
||||
.thenAccept(unused -> self.cleanupMeetup(meetupId, serverId, componentPayloads));
|
||||
Long meetupMessageId = meetup.getMessageId();
|
||||
return getMeetupMessageModel(meetup).thenCompose(model -> {
|
||||
model.setCancelled(true);
|
||||
MessageToSend meetupMessage = getMeetupMessage(model, serverId);
|
||||
return messageService.editMessageInChannel(channel, meetupMessage, meetupMessageId)
|
||||
.thenAccept(unused -> self.notifyParticipants(meetupId, serverId))
|
||||
.thenAccept(unused -> self.cleanupMeetup(meetupId, serverId, componentPayloads));
|
||||
});
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public void notifyParticipants(Long meetupId, Long serverId) {
|
||||
Meetup meetup = meetupManagementServiceBean.getMeetup(meetupId, serverId);
|
||||
MeetupMessageModel model = getMeetupMessageModel(meetup);
|
||||
List<Long> participatorIds = getYesOrMaybeParticipants(meetup);
|
||||
getMeetupMessageModel(meetup).thenAccept(model -> {
|
||||
self.sendNotifications(meetupId, serverId, model, participatorIds);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public void sendNotifications(Long meetupId, Long serverId, MeetupMessageModel model, List<Long> participatorIds) {
|
||||
MessageToSend messageToSend = templateService.renderEmbedTemplate(MEETUP_CANCELLATION_TEMPLATE, model, serverId);
|
||||
meetup
|
||||
.getParticipants()
|
||||
.stream()
|
||||
.filter(meetupParticipator ->
|
||||
meetupParticipator.getDecision().equals(MeetupDecision.MAYBE) ||
|
||||
meetupParticipator.getDecision().equals(MeetupDecision.YES))
|
||||
.forEach(meetupParticipator -> {
|
||||
Long userId = meetupParticipator.getParticipator().getUserReference().getId();
|
||||
userService.retrieveUserForId(userId)
|
||||
.thenCompose(user -> messageService.sendMessageToSendToUser(user, messageToSend))
|
||||
.thenAccept(message -> log.info("Notified user {} about cancellation of meetup {} in server {}.", userId, meetupId, serverId))
|
||||
.exceptionally(throwable -> {
|
||||
log.warn("Failed to notify user {} about cancellation of meetup {} in server {}.", userId, meetupId, serverId);
|
||||
return null;
|
||||
});
|
||||
});
|
||||
participatorIds.forEach(userId -> {
|
||||
userService.retrieveUserForId(userId)
|
||||
.thenCompose(user -> messageService.sendMessageToSendToUser(user, messageToSend))
|
||||
.thenAccept(message -> log.info("Notified user {} about cancellation of meetup {} in server {}.", userId, meetupId, serverId))
|
||||
.exceptionally(throwable -> {
|
||||
log.warn("Failed to notify user {} about cancellation of meetup {} in server {}.", userId, meetupId, serverId);
|
||||
return null;
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@@ -318,20 +387,29 @@ public class MeetupServiceBean {
|
||||
@Transactional
|
||||
public void remindParticipants(Long meetupId, Long serverId) {
|
||||
Meetup meetup = meetupManagementServiceBean.getMeetup(meetupId, serverId);
|
||||
MeetupMessageModel model = getMeetupMessageModel(meetup);
|
||||
List<Long> participatorIds = getYesOrMaybeParticipants(meetup);
|
||||
getMeetupMessageModel(meetup).thenAccept(model -> {
|
||||
self.sendMeetupReminderMessages(meetupId, serverId, model, participatorIds);
|
||||
});
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public void sendMeetupReminderMessages(Long meetupId, Long serverId, MeetupMessageModel model, List<Long> participatorIds) {
|
||||
MessageToSend messageToSend = templateService.renderEmbedTemplate(MEETUP_REMINDER_TEMPLATE, model, serverId);
|
||||
meetup
|
||||
participatorIds.forEach(userId -> {
|
||||
userService.retrieveUserForId(userId)
|
||||
.thenCompose(user -> messageService.sendMessageToSendToUser(user, messageToSend))
|
||||
.thenAccept(message -> log.info("Notified user {} about incoming meetup {} in server {}.", userId, meetupId, serverId));
|
||||
});
|
||||
}
|
||||
|
||||
private List<Long> getYesOrMaybeParticipants(Meetup meetup) {
|
||||
return meetup
|
||||
.getParticipants()
|
||||
.stream()
|
||||
.filter(meetupParticipator ->
|
||||
meetupParticipator.getDecision().equals(MeetupDecision.MAYBE) ||
|
||||
meetupParticipator.getDecision().equals(MeetupDecision.YES))
|
||||
.forEach(meetupParticipator -> {
|
||||
Long userId = meetupParticipator.getParticipator().getUserReference().getId();
|
||||
userService.retrieveUserForId(userId)
|
||||
.thenCompose(user -> messageService.sendMessageToSendToUser(user, messageToSend))
|
||||
.thenAccept(message -> log.info("Notified user {} about incoming meetup {} in server {}.", userId, meetupId, serverId));
|
||||
});
|
||||
.filter(MAYBE_OR_YES_PARTICIPATOR)
|
||||
.map(meetupParticipant -> meetupParticipant.getParticipator().getUserReference().getId())
|
||||
.toList();
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@@ -376,11 +454,12 @@ public class MeetupServiceBean {
|
||||
|
||||
Long serverId = meetup.getServer().getId();
|
||||
|
||||
Long meetupMessageId = meetup.getMessageId();
|
||||
ServerChannelMessage meetupMessage = ServerChannelMessage
|
||||
.builder()
|
||||
.serverId(serverId)
|
||||
.channelId(meetup.getMeetupChannel().getId())
|
||||
.messageId(meetup.getMessageId())
|
||||
.messageId(meetupMessageId)
|
||||
.build();
|
||||
MeetupTimeChangedNotificationModel notificationModel = MeetupTimeChangedNotificationModel
|
||||
.builder()
|
||||
@@ -418,18 +497,24 @@ public class MeetupServiceBean {
|
||||
.toList();
|
||||
meetup
|
||||
.getParticipants().removeIf(meetupParticipant -> userInServerIds.contains(meetupParticipant.getParticipator().getUserInServerId()));
|
||||
MeetupMessageModel meetupMessageModel = getMeetupMessageModel(meetup);
|
||||
Long meetupChannelId = meetup.getMeetupChannel().getId();
|
||||
return getMeetupMessageModel(meetup).thenCompose(meetupMessageModel ->
|
||||
self.changeMeetupTimeInternal(meetupMessageModel, serverId, meetupChannelId, meetupMessageId, meetupId));
|
||||
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public CompletableFuture<Void> changeMeetupTimeInternal(MeetupMessageModel meetupMessageModel, Long serverId, Long meetupChannelId, Long meetupMessageId, Long meetupId) {
|
||||
meetupMessageModel.setParticipants(new ArrayList<>());
|
||||
meetupMessageModel.setMaybeParticipants(new ArrayList<>());
|
||||
meetupMessageModel.setNoTimeParticipants(new ArrayList<>());
|
||||
|
||||
MessageToSend updatedMeetupMessage = getMeetupMessage(meetupMessageModel, serverId);
|
||||
GuildMessageChannel meetupChannel = channelService.getMessageChannelFromServer(serverId, meetup.getMeetupChannel().getId());
|
||||
return channelService.editMessageInAChannelFuture(updatedMeetupMessage, meetupChannel, meetup.getMessageId())
|
||||
.thenAccept(message -> log.info("Updated message of meetup {} in channel {} in server {}.", meetupId, meetup.getMeetupChannel().getId(), serverId))
|
||||
GuildMessageChannel meetupChannel = channelService.getMessageChannelFromServer(serverId, meetupChannelId);
|
||||
return channelService.editMessageInAChannelFuture(updatedMeetupMessage, meetupChannel, meetupMessageId)
|
||||
.thenAccept(message -> log.info("Updated message of meetup {} in channel {} in server {}.", meetupId, meetupChannelId, serverId))
|
||||
.thenAccept(unused -> fileService.safeDeleteIgnoreException(updatedMeetupMessage.getAttachedFiles().get(0).getFile()))
|
||||
.exceptionally(throwable -> {
|
||||
log.info("Failed to update message of meetup {} in channel {} in server {}.", meetupId, meetup.getMeetupChannel().getId(), serverId, throwable);
|
||||
log.info("Failed to update message of meetup {} in channel {} in server {}.", meetupId, meetupChannelId, serverId, throwable);
|
||||
return null;
|
||||
});
|
||||
}
|
||||
@@ -456,14 +541,21 @@ public class MeetupServiceBean {
|
||||
private CompletableFuture<Void> updateMeetupMessage(Meetup meetup) {
|
||||
Long meetupId = meetup.getId().getId();
|
||||
Long serverId = meetup.getId().getServerId();
|
||||
MeetupMessageModel meetupMessageModel = getMeetupMessageModel(meetup);
|
||||
Long meetupChannelId = meetup.getMeetupChannel().getId();
|
||||
Long meetupMessageId = meetup.getMessageId();
|
||||
return getMeetupMessageModel(meetup).thenCompose(meetupMessageModel ->
|
||||
self.updateMessageInternal(meetupMessageModel, serverId, meetupChannelId, meetupMessageId, meetupId));
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public CompletableFuture<Void> updateMessageInternal(MeetupMessageModel meetupMessageModel, Long serverId, Long meetupChannelId, Long meetupMessageId, Long meetupId) {
|
||||
MessageToSend updatedMeetupMessage = getMeetupMessage(meetupMessageModel, serverId);
|
||||
GuildMessageChannel meetupChannel = channelService.getMessageChannelFromServer(serverId, meetup.getMeetupChannel().getId());
|
||||
return channelService.editMessageInAChannelFuture(updatedMeetupMessage, meetupChannel, meetup.getMessageId())
|
||||
.thenAccept(message -> log.info("Updated message of meetup {} in channel {} in server {}.", meetupId, meetup.getMeetupChannel().getId(), serverId))
|
||||
GuildMessageChannel meetupChannel = channelService.getMessageChannelFromServer(serverId, meetupChannelId);
|
||||
return channelService.editMessageInAChannelFuture(updatedMeetupMessage, meetupChannel, meetupMessageId)
|
||||
.thenAccept(message -> log.info("Updated message of meetup {} in channel {} in server {}.", meetupId, meetupChannelId, serverId))
|
||||
.thenAccept(unused -> fileService.safeDeleteIgnoreException(updatedMeetupMessage.getAttachedFiles().get(0).getFile()))
|
||||
.exceptionally(throwable -> {
|
||||
log.info("Failed to update message of meetup {} in channel {} in server {}.", meetupId, meetup.getMeetupChannel().getId(), serverId, throwable);
|
||||
log.info("Failed to update message of meetup {} in channel {} in server {}.", meetupId, meetupChannelId, serverId, throwable);
|
||||
return null;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<artifactId>sissi-modules</artifactId>
|
||||
<groupId>dev.sheldan.sissi.application</groupId>
|
||||
<version>1.5.17-SNAPSHOT</version>
|
||||
<version>1.5.20-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -5,19 +5,17 @@ import dev.sheldan.abstracto.core.service.PostTargetService;
|
||||
import dev.sheldan.abstracto.core.service.management.UserInServerManagementService;
|
||||
import dev.sheldan.abstracto.core.templating.model.MessageToSend;
|
||||
import dev.sheldan.abstracto.core.templating.service.TemplateService;
|
||||
import dev.sheldan.abstracto.core.utils.CompletableFutureList;
|
||||
import dev.sheldan.abstracto.core.utils.FutureUtils;
|
||||
import dev.sheldan.sissi.module.miepscord.weeklytext.config.WeeklyTextPostTarget;
|
||||
import dev.sheldan.sissi.module.miepscord.weeklytext.model.database.TextItem;
|
||||
import dev.sheldan.sissi.module.miepscord.weeklytext.model.template.TextItemPostModel;
|
||||
import dev.sheldan.sissi.module.miepscord.weeklytext.service.management.TextItemServiceManagementBean;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.dv8tion.jda.api.entities.Member;
|
||||
import net.dv8tion.jda.api.entities.Message;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
@@ -66,9 +64,7 @@ public class TextItemServiceBean {
|
||||
.text(textItem.getText())
|
||||
.build();
|
||||
MessageToSend messageToSend = templateService.renderEmbedTemplate(WEEKLY_TEXT_ITEM_POST_TEMPLATE, model, serverId);
|
||||
List<CompletableFuture<Message>> futures = postTargetService.sendEmbedInPostTarget(messageToSend, WeeklyTextPostTarget.TEXT_ITEM_TARGET, serverId);
|
||||
CompletableFutureList<Message> futureList = new CompletableFutureList<>(futures);
|
||||
return futureList.getMainFuture().thenAccept(unused -> {
|
||||
return FutureUtils.toSingleFutureGenericList(postTargetService.sendEmbedInPostTarget(messageToSend, WeeklyTextPostTarget.TEXT_ITEM_TARGET, serverId)).thenAccept(unused -> {
|
||||
self.setTexItemToDone(textItemId);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.sissi.application</groupId>
|
||||
<artifactId>application</artifactId>
|
||||
<version>1.5.17-SNAPSHOT</version>
|
||||
<version>1.5.20-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.sissi.application</groupId>
|
||||
<artifactId>sissi-modules</artifactId>
|
||||
<version>1.5.17-SNAPSHOT</version>
|
||||
<version>1.5.20-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<artifactId>sissi-modules</artifactId>
|
||||
<groupId>dev.sheldan.sissi.application</groupId>
|
||||
<version>1.5.17-SNAPSHOT</version>
|
||||
<version>1.5.20-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -2,4 +2,4 @@ apiVersion: v2
|
||||
name: sissi
|
||||
description: A Helm chart for Kubernetes
|
||||
type: application
|
||||
version: 1.5.16
|
||||
version: 1.5.19
|
||||
|
||||
@@ -3,7 +3,7 @@ bot:
|
||||
repository: harbor.sheldan.dev/sissi
|
||||
pullPolicy: Always
|
||||
image: sissi-bot
|
||||
tag: 1.5.16
|
||||
tag: 1.5.19
|
||||
livenessProbe:
|
||||
initialDelaySeconds: 60
|
||||
periodSeconds: 5
|
||||
@@ -23,7 +23,7 @@ restApi:
|
||||
repository: harbor.sheldan.dev/sissi
|
||||
pullPolicy: Always
|
||||
image: sissi-rest-api
|
||||
tag: 1.5.16
|
||||
tag: 1.5.19
|
||||
podAnnotations: {}
|
||||
podSecurityContext: {}
|
||||
securityContext: {}
|
||||
@@ -63,7 +63,7 @@ privateRestApi:
|
||||
repository: harbor.sheldan.dev/sissi
|
||||
pullPolicy: Always
|
||||
image: sissi-private-rest-api
|
||||
tag: 1.5.16
|
||||
tag: 1.5.19
|
||||
podAnnotations: {}
|
||||
podSecurityContext: {}
|
||||
securityContext: {}
|
||||
@@ -94,23 +94,23 @@ templateDeployment:
|
||||
repository: harbor.sheldan.dev/abstracto
|
||||
pullPolicy: Always
|
||||
image: abstracto-template-deployment
|
||||
tag: 1.6.17
|
||||
tag: 1.6.19
|
||||
templateDeploymentData:
|
||||
repository: harbor.sheldan.dev/sissi
|
||||
pullPolicy: Always
|
||||
image: sissi-template-data
|
||||
tag: 1.5.16
|
||||
tag: 1.5.19
|
||||
dbConfigDeployment:
|
||||
enabled: true
|
||||
repository: harbor.sheldan.dev/abstracto
|
||||
pullPolicy: Always
|
||||
image: abstracto-db-deployment
|
||||
tag: 1.6.17
|
||||
tag: 1.6.19
|
||||
dbConfigDeploymentData:
|
||||
repository: harbor.sheldan.dev/sissi
|
||||
pullPolicy: Always
|
||||
image: sissi-db-data
|
||||
tag: 1.5.16
|
||||
tag: 1.5.19
|
||||
dbCredentials:
|
||||
host: null
|
||||
port: null
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.sissi</groupId>
|
||||
<artifactId>deployment</artifactId>
|
||||
<version>1.5.17-SNAPSHOT</version>
|
||||
<version>1.5.20-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.sissi</groupId>
|
||||
<artifactId>sissi</artifactId>
|
||||
<version>1.5.17-SNAPSHOT</version>
|
||||
<version>1.5.20-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
6
pom.xml
6
pom.xml
@@ -13,13 +13,13 @@
|
||||
<groupId>dev.sheldan.sissi</groupId>
|
||||
<artifactId>sissi</artifactId>
|
||||
<name>Sissi</name>
|
||||
<version>1.5.17-SNAPSHOT</version>
|
||||
<version>1.5.20-SNAPSHOT</version>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.target>17</maven.compiler.target>
|
||||
<maven.compiler.source>17</maven.compiler.source>
|
||||
<abstracto.version>1.6.17</abstracto.version>
|
||||
<abstracto.templates.version>1.4.63</abstracto.templates.version>
|
||||
<abstracto.version>1.6.19</abstracto.version>
|
||||
<abstracto.templates.version>1.4.65</abstracto.templates.version>
|
||||
<apache-jena.version>4.9.0</apache-jena.version>
|
||||
<rssreader.version>3.5.0</rssreader.version>
|
||||
<jsoup.version>1.21.2</jsoup.version>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.sissi</groupId>
|
||||
<artifactId>sissi</artifactId>
|
||||
<version>1.5.17-SNAPSHOT</version>
|
||||
<version>1.5.20-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>customization-templates</artifactId>
|
||||
<groupId>dev.sheldan.sissi.templates</groupId>
|
||||
<version>1.5.17-SNAPSHOT</version>
|
||||
<version>1.5.20-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>image-generation-customization-templates</artifactId>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.sissi.templates</groupId>
|
||||
<artifactId>customization-templates</artifactId>
|
||||
<version>1.5.17-SNAPSHOT</version>
|
||||
<version>1.5.20-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<artifactId>sissi-templates</artifactId>
|
||||
<groupId>dev.sheldan.sissi.templates</groupId>
|
||||
<version>1.5.17-SNAPSHOT</version>
|
||||
<version>1.5.20-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<artifactId>module-templates</artifactId>
|
||||
<groupId>dev.sheldan.sissi.templates</groupId>
|
||||
<version>1.5.17-SNAPSHOT</version>
|
||||
<version>1.5.20-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
{
|
||||
<#assign userPing="<@186558865851154435>">
|
||||
"additionalMessage": "${userPing}",
|
||||
"embeds": [
|
||||
{
|
||||
"title": {
|
||||
<#assign donatorName><#if donation.anonymous><#include "donations_response_anonymous"><#else>${donation.donatorName}</#if></#assign>
|
||||
<#assign donationAmount=donation.amount>
|
||||
"title": "<@safe_include "debra_donation_notification_embed_title"/>"
|
||||
},
|
||||
<#if donation.message != 'gespendet'>
|
||||
<#assign donationMessage=donation.message>
|
||||
"description": "${donationMessage?json_string}",
|
||||
</#if>
|
||||
"fields": [
|
||||
{
|
||||
<#assign totalDonationAmount=totalDonationAmount>
|
||||
"name": "<@safe_include "debra_donation_notification_embed_field_amount_title"/>",
|
||||
"value": "<@safe_include "debra_donation_notification_embed_field_amount_value"/>"
|
||||
}
|
||||
],
|
||||
"imageUrl": "https://cdn.discordapp.com/attachments/299115929206390784/1047306670319079474/dotpict-1.png",
|
||||
"footer": {
|
||||
"text": "<@safe_include "debra_donation_notification_embed_footer"/>"
|
||||
}
|
||||
}
|
||||
],
|
||||
"buttons": [
|
||||
{
|
||||
"label": "<@safe_include "debra_donation_notification_link_button_label"/>",
|
||||
"url": "https://tinyurl.com/debra25",
|
||||
"buttonStyle": "link",
|
||||
"metaConfig": {
|
||||
"persistCallback": false
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<artifactId>module-templates</artifactId>
|
||||
<groupId>dev.sheldan.sissi.templates</groupId>
|
||||
<version>1.5.17-SNAPSHOT</version>
|
||||
<version>1.5.20-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -1,19 +1,18 @@
|
||||
<#include "format_instant">
|
||||
{
|
||||
<#macro display_user member_to_display><#if member_to_display.name??>${member_to_display.name}<#else>${member_to_display.memberMention}</#if></#macro>
|
||||
"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>
|
||||
<#assign descriptionText><#if description?has_content>${description?json_string}<#else><@safe_include "meetup_description_no_description"/></#if></#assign>
|
||||
<#assign organizerText><@display_user member_to_display=organizer/></#assign>
|
||||
"type": "textDisplay",
|
||||
"content": "<#if cancelled>~~</#if><@safe_include "meetup_description_component"/><#if cancelled>~~</#if>"
|
||||
},
|
||||
</#if>
|
||||
{
|
||||
<#assign time><@format_instant_long_date_time instant=meetupTime/></#assign>
|
||||
<#assign timeRelative><@format_instant_relative instant=meetupTime/></#assign>
|
||||
@@ -54,10 +53,10 @@
|
||||
}
|
||||
}
|
||||
</#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>
|
||||
<#assign participantsText> (${participants?size}) <#list participants as member><@display_user member_to_display=member/><#sep>, </#sep><#else><#include "meetup_message_no_member"></#list></#assign>
|
||||
<#assign maybeParticipantsText> (${maybeParticipants?size}) <#list maybeParticipants as member><@display_user member_to_display=member/><#sep>, </#sep><#else><#include "meetup_message_no_member"></#list></#assign>
|
||||
<#assign noTimeParticipantsText> (${noTimeParticipants?size}) <#list noTimeParticipants as member><@display_user member_to_display=member/><#sep>, </#sep><#else><#include "meetup_message_no_member"></#list></#assign>
|
||||
<#assign declinedParticipantsText> (${declinedParticipants?size}) <#list declinedParticipants as member><@display_user member_to_display=member/><#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/>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.sissi.templates</groupId>
|
||||
<artifactId>module-templates</artifactId>
|
||||
<version>1.5.17-SNAPSHOT</version>
|
||||
<version>1.5.20-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>miepscord-templates</artifactId>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.sissi.templates</groupId>
|
||||
<artifactId>sissi-templates</artifactId>
|
||||
<version>1.5.17-SNAPSHOT</version>
|
||||
<version>1.5.20-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.sissi.templates</groupId>
|
||||
<artifactId>module-templates</artifactId>
|
||||
<version>1.5.17-SNAPSHOT</version>
|
||||
<version>1.5.20-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<artifactId>module-templates</artifactId>
|
||||
<groupId>dev.sheldan.sissi.templates</groupId>
|
||||
<version>1.5.17-SNAPSHOT</version>
|
||||
<version>1.5.20-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.sissi.templates</groupId>
|
||||
<artifactId>templates</artifactId>
|
||||
<version>1.5.17-SNAPSHOT</version>
|
||||
<version>1.5.20-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.sissi.templates</groupId>
|
||||
<artifactId>template-overrides</artifactId>
|
||||
<version>1.5.17-SNAPSHOT</version>
|
||||
<version>1.5.20-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.sissi.templates</groupId>
|
||||
<artifactId>template-overrides</artifactId>
|
||||
<version>1.5.17-SNAPSHOT</version>
|
||||
<version>1.5.20-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.sissi.templates</groupId>
|
||||
<artifactId>template-overrides</artifactId>
|
||||
<version>1.5.17-SNAPSHOT</version>
|
||||
<version>1.5.20-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<artifactId>sissi-templates</artifactId>
|
||||
<groupId>dev.sheldan.sissi.templates</groupId>
|
||||
<version>1.5.17-SNAPSHOT</version>
|
||||
<version>1.5.20-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.sissi.templates</groupId>
|
||||
<artifactId>template-overrides</artifactId>
|
||||
<version>1.5.17-SNAPSHOT</version>
|
||||
<version>1.5.20-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.sissi.templates.translations</groupId>
|
||||
<artifactId>customization-translations</artifactId>
|
||||
<version>1.5.17-SNAPSHOT</version>
|
||||
<version>1.5.20-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<artifactId>sissi-translations</artifactId>
|
||||
<groupId>dev.sheldan.sissi.templates.translations</groupId>
|
||||
<version>1.5.17-SNAPSHOT</version>
|
||||
<version>1.5.20-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<artifactId>module-translations</artifactId>
|
||||
<groupId>dev.sheldan.sissi.templates.translations</groupId>
|
||||
<version>1.5.17-SNAPSHOT</version>
|
||||
<version>1.5.20-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.sissi.templates.translations</groupId>
|
||||
<artifactId>module-translations</artifactId>
|
||||
<version>1.5.17-SNAPSHOT</version>
|
||||
<version>1.5.20-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
No description
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.sissi.templates.translations</groupId>
|
||||
<artifactId>module-translations</artifactId>
|
||||
<version>1.5.17-SNAPSHOT</version>
|
||||
<version>1.5.20-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>miepscord-translations</artifactId>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.sissi.templates.translations</groupId>
|
||||
<artifactId>sissi-translations</artifactId>
|
||||
<version>1.5.17-SNAPSHOT</version>
|
||||
<version>1.5.20-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.sissi.templates.translations</groupId>
|
||||
<artifactId>module-translations</artifactId>
|
||||
<version>1.5.17-SNAPSHOT</version>
|
||||
<version>1.5.20-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<artifactId>module-translations</artifactId>
|
||||
<groupId>dev.sheldan.sissi.templates.translations</groupId>
|
||||
<version>1.5.17-SNAPSHOT</version>
|
||||
<version>1.5.20-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.sissi.templates</groupId>
|
||||
<artifactId>templates</artifactId>
|
||||
<version>1.5.17-SNAPSHOT</version>
|
||||
<version>1.5.20-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.sissi.templates.translations.overrides</groupId>
|
||||
<artifactId>translation-overrides</artifactId>
|
||||
<version>1.5.17-SNAPSHOT</version>
|
||||
<version>1.5.20-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.sissi.templates.translations.overrides</groupId>
|
||||
<artifactId>translation-overrides</artifactId>
|
||||
<version>1.5.17-SNAPSHOT</version>
|
||||
<version>1.5.20-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.sissi.templates.translations.overrides</groupId>
|
||||
<artifactId>translation-overrides</artifactId>
|
||||
<version>1.5.17-SNAPSHOT</version>
|
||||
<version>1.5.20-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.sissi.templates.translations.overrides</groupId>
|
||||
<artifactId>translation-overrides</artifactId>
|
||||
<version>1.5.17-SNAPSHOT</version>
|
||||
<version>1.5.20-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>dev.sheldan.sissi.templates.translations</groupId>
|
||||
<artifactId>sissi-translations</artifactId>
|
||||
<version>1.5.17-SNAPSHOT</version>
|
||||
<version>1.5.20-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user