[SIS-xxx] changing ban message

modifying meetup to add the location on the meetup message itself
updating abstracto version
This commit is contained in:
Sheldan
2026-04-24 20:03:10 +02:00
parent 796c66ff33
commit d5d6bbbcb5
9 changed files with 26 additions and 25 deletions

View File

@@ -35,6 +35,8 @@ import net.dv8tion.jda.api.events.interaction.command.SlashCommandInteractionEve
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.time.Instant;
import java.util.Arrays;
import java.util.List;
@@ -76,7 +78,7 @@ public class CreateMeetup extends AbstractConditionableCommand {
private static final String DESCRIPTION_PARAMETER = "description";
private static final String LOCATION_PARAMETER = "location";
private static final String CONFIRMATION_TEMPLATE = "createMeetup_confirmation";
private static final String DEFAULT_LOCATION_STRING = "\"\"";
private static final String DEFAULT_LOCATION_STRING = "";
@Override
public CompletableFuture<CommandResult> executeAsync(CommandContext commandContext) {
@@ -94,13 +96,14 @@ public class CreateMeetup extends AbstractConditionableCommand {
Meetup meetup = meetupManagementServiceBean.createMeetup(meetupTime, meetupTopic, description, organizer, meetupChannel, DEFAULT_LOCATION_STRING);
String confirmationId = componentService.generateComponentId();
String cancelId = componentService.generateComponentId();
String locationEncoded = URLEncoder.encode(meetup.getLocation(), StandardCharsets.UTF_8);
MeetupConfirmationModel model = MeetupConfirmationModel
.builder()
.meetupTime(meetupTime)
.guildId(commandContext.getGuild().getIdLong())
.description(description)
.topic(meetupTopic)
.location(meetup.getLocation())
.location(locationEncoded)
.confirmationId(confirmationId)
.cancelId(cancelId)
.meetupId(meetup.getId().getId())
@@ -136,13 +139,14 @@ public class CreateMeetup extends AbstractConditionableCommand {
Meetup meetup = meetupManagementServiceBean.createMeetup(meetupTime, topic, description, organizer, meetupChannel, location);
String confirmationId = componentService.generateComponentId();
String cancelId = componentService.generateComponentId();
String locationEncoded = URLEncoder.encode(meetup.getLocation(), StandardCharsets.UTF_8);
MeetupConfirmationModel model = MeetupConfirmationModel
.builder()
.meetupTime(meetupTime)
.guildId(event.getGuild().getIdLong())
.description(description)
.topic(topic)
.location(meetup.getLocation())
.location(locationEncoded)
.confirmationId(confirmationId)
.cancelId(cancelId)
.meetupId(meetup.getId().getId())

View File

@@ -16,7 +16,7 @@ public class MeetupMessageModel {
private String description;
private Instant meetupTime;
private String location;
private String decodedLocation;
private String locationEncoded;
private MemberDisplay organizer;
private Long meetupId;
private String yesId;

View File

@@ -195,17 +195,17 @@ public class MeetupServiceBean {
.filter(meetupParticipator -> meetupParticipator.getDecision().equals(MeetupDecision.NO_TIME))
.map(mapToUserId)
.toList();
String rawLocation = java.net.URLDecoder.decode(meetup.getLocation(), StandardCharsets.UTF_8);
List<Long> participantIds = allParticipants
.stream()
.map(mapToUserId)
.collect(Collectors.toList());
String locationEncoded = URLEncoder.encode(meetup.getLocation(), StandardCharsets.UTF_8);
MeetupMessageModel.MeetupMessageModelBuilder builder = MeetupMessageModel
.builder()
.description(meetup.getDescription())
.topic(meetup.getTopic())
.location(meetup.getLocation())
.decodedLocation(rawLocation)
.locationEncoded(locationEncoded)
.noTimeId(meetup.getNoTimeButtonId())
.yesId(meetup.getYesButtonId())
.maybeId(meetup.getMaybeButtonId())
@@ -525,11 +525,7 @@ public class MeetupServiceBean {
}
public CompletableFuture<Void> changeMeetupLocation(Meetup meetup, String newLocation) {
try {
meetup.setLocation(URLEncoder.encode(newLocation, StandardCharsets.UTF_8.toString()));
} catch (UnsupportedEncodingException e) {
throw new AbstractoRunTimeException(e);
}
meetup.setLocation(newLocation);
return updateMeetupMessage(meetup);
}

View File

@@ -35,23 +35,18 @@ public class MeetupManagementServiceBean {
throw new MeetupPastTimeException();
}
Long meetupId = counterService.getNextCounterValue(organizer.getServerReference(), MEETUP_COUNTER_KEY);
Meetup meetup = null;
try {
meetup = Meetup
Meetup meetup = Meetup
.builder()
.meetupTime(timeStamp)
.description(description)
.topic(topic)
.location(URLEncoder.encode(location, StandardCharsets.UTF_8.toString()))
.location(location)
.organizer(organizer)
.server(organizer.getServerReference())
.meetupChannel(meetupChannel)
.state(MeetupState.NEW)
.id(new ServerSpecificId(organizer.getServerReference().getId(), meetupId))
.build();
} catch (UnsupportedEncodingException e) {
throw new AbstractoRunTimeException(e);
}
return meetupRepository.save(meetup);
}

View File

@@ -18,8 +18,8 @@
<properties>
<maven.compiler.target>17</maven.compiler.target>
<maven.compiler.source>17</maven.compiler.source>
<abstracto.version>1.6.21</abstracto.version>
<abstracto.templates.version>1.4.67</abstracto.templates.version>
<abstracto.version>1.6.22</abstracto.version>
<abstracto.templates.version>1.4.68</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>

View File

@@ -2,7 +2,7 @@
{
"components": [
{
<#assign hasLocation=location?? && location != "%22%22">
<#assign hasLocation=location?has_content>
"type": "textDisplay",
"content": "<#include "createMeetup_meetup_information">"
},

View File

@@ -17,18 +17,22 @@
<#assign time><@format_instant_long_date_time instant=meetupTime/></#assign>
<#assign timeRelative><@format_instant_relative instant=meetupTime/></#assign>
<#if location?? && location != "%22%22">
<#if location?has_content>
"type": "section",
"components": [
{
"type": "textDisplay",
"content": "<@safe_include "meetup_display_time_component"/>"
},
{
"type": "textDisplay",
"content": "<@safe_include "meetup_message_location_button_label"/>: ${location?json_string}"
}
],
"accessory": {
"type": "button",
"label": "<@safe_include "meetup_message_location_button_label"/>",
"url": "https://www.google.com/maps?q=${location?json_string}",
"url": "https://www.google.com/maps?q=${locationEncoded?json_string}",
"buttonStyle": "link"
}
<#else>

View File

@@ -8,6 +8,6 @@ DTSTART:${meetupIcsModel.icsFormattedStartTime}
DTEND:${meetupIcsModel.icsFormattedEndTime}
SUMMARY:${topic}
<#if description?has_content>DESCRIPTION:${description}</#if>
<#if decodedLocation?? && decodedLocation != "">LOCATION:${decodedLocation}</#if>
<#if location?? && location != "">LOCATION:${location}</#if>
END:VEVENT
END:VCALENDAR

View File

@@ -1,9 +1,11 @@
Du wurdest vom Server ${serverName} wegen `${reason}` gebannt.
When du das beeinspruchen willst, folge bitte dieser Einladung: https://discord.gg/qdH3rJDVrv und ANTWORTE AUF DIESE NACHRICHT MIT EINER TEXT NACHRICHT. Die Mods werden dir dann antworten.
When du das beeinspruchen willst, folge bitte dieser Einladung: https://discord.gg/qdH3rJDVrv und ANTWORTE AUF DIESE NACHRICHT MIT EINER TEXT NACHRICHT.
Die Mods werden dir dann antworten. Falls du wegen honeypot gebannt wurdest: Dies ist eine Rolle beim onboarding und da steht daneben, dass man gebannt wird. Melde dich dennoch bei den Mods.
Du musst dich in 'Austria Appeal Server' befinden, damit du dem Bot schreiben kannst.
Wenn der Einspruch abgelehnt wird, wirst du vom Server entfernt.
You were banned from the server ${serverName} for `${reason}`.
If you want to appeal, join the server https://discord.gg/qdH3rJDVrv and then message this bot, this opens up a modmail.
If you were banned for the reason of honeypot: this is related to an option you selected during onboarding that specifically says that you get banned upon selection. Contact the mods anyway if you want.
Joining the server is necessary in order to make communication to the bot possible.
If the appeal is denied, you will be banned from the above-mentioned server.