[SIS-13] changing debra links to new version

adding a second post target for debra donation notifications
This commit is contained in:
Sheldan
2022-12-01 07:55:53 +01:00
parent 55d25697ce
commit 015ff303b7
7 changed files with 13 additions and 7 deletions

View File

@@ -17,6 +17,6 @@ public class DebraFeatureConfig implements FeatureConfig {
@Override
public List<PostTargetEnum> getRequiredPostTargets() {
return Arrays.asList(DebraPostTarget.DEBRA_DONATION_NOTIFICATION);
return Arrays.asList(DebraPostTarget.DEBRA_DONATION_NOTIFICATION, DebraPostTarget.DEBRA_DONATION_NOTIFICATION2);
}
}

View File

@@ -5,7 +5,7 @@ import lombok.Getter;
@Getter
public enum DebraPostTarget implements PostTargetEnum {
DEBRA_DONATION_NOTIFICATION("debraDonationNotification");
DEBRA_DONATION_NOTIFICATION("debraDonationNotification"), DEBRA_DONATION_NOTIFICATION2("debraDonationNotification2");
private String key;

View File

@@ -10,6 +10,7 @@ import dev.sheldan.sissi.module.debra.config.DebraProperties;
import dev.sheldan.sissi.module.debra.model.Donation;
import dev.sheldan.sissi.module.debra.model.listener.DonationNotificationModel;
import lombok.extern.slf4j.Slf4j;
import net.dv8tion.jda.api.entities.Message;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@@ -19,6 +20,7 @@ import java.io.InputStream;
import java.io.InputStreamReader;
import java.math.BigDecimal;
import java.net.URL;
import java.util.List;
import java.util.Optional;
import java.util.concurrent.CompletableFuture;
import java.util.regex.Matcher;
@@ -86,6 +88,9 @@ public class DonationService {
.build();
MessageToSend messageToSend = templateService.renderEmbedTemplate(DONATION_NOTIFICATION_TEMPLATE_KEY, model);
Long targetServerId = Long.parseLong(System.getenv("DEBRA_DONATION_NOTIFICATION_SERVER_ID"));
return FutureUtils.toSingleFutureGeneric(postTargetService.sendEmbedInPostTarget(messageToSend, DebraPostTarget.DEBRA_DONATION_NOTIFICATION, 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);
}
}

View File

@@ -2,6 +2,7 @@ abstracto.featureFlags.debra.featureName=debra
abstracto.featureFlags.debra.enabled=false
abstracto.postTargets.debraDonationNotification.name=debraDonationNotification
abstracto.postTargets.debraDonationNotification2.name=debraDonationNotification2
sissi.debra.websocketURL=ws://spenden.baba.fm:8765/
sissi.debra.donationsPageURL=https://em.altruja.de/discord-und-r-austria-2021
sissi.debra.donationsPageURL=https://em.altruja.de/discord-fuer-debra-2022

View File

@@ -1 +1 @@
Aktuell wurden **${donationAmount} Euro** für Debra Austria gespendet. Spende auch du unter https://tiny.cc/schmetterling2021.
Aktuell wurden **${donationAmount} Euro** für Debra Austria gespendet. Spende auch du unter https://tiny.cc/schmetterling2022.

View File

@@ -1 +1 @@
Spende auch du für Debra Austria unter http://tiny.cc/schmetterling2021.
Spende auch du für Debra Austria unter http://tiny.cc/schmetterling2022.

View File

@@ -1 +1 @@
Also donate for Debra austria via http://tiny.cc/schmetterling2021.
Also donate for Debra austria via http://tiny.cc/schmetterling2022.