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

View File

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

View File

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

View File

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

View File

@@ -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.21</abstracto.version> <abstracto.version>1.6.22</abstracto.version>
<abstracto.templates.version>1.4.67</abstracto.templates.version> <abstracto.templates.version>1.4.68</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>
<jsoup.version>1.21.2</jsoup.version> <jsoup.version>1.21.2</jsoup.version>

View File

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

View File

@@ -17,18 +17,22 @@
<#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>
<#if location?? && location != "%22%22"> <#if location?has_content>
"type": "section", "type": "section",
"components": [ "components": [
{ {
"type": "textDisplay", "type": "textDisplay",
"content": "<@safe_include "meetup_display_time_component"/>" "content": "<@safe_include "meetup_display_time_component"/>"
},
{
"type": "textDisplay",
"content": "<@safe_include "meetup_message_location_button_label"/>: ${location?json_string}"
} }
], ],
"accessory": { "accessory": {
"type": "button", "type": "button",
"label": "<@safe_include "meetup_message_location_button_label"/>", "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" "buttonStyle": "link"
} }
<#else> <#else>

View File

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

View File

@@ -1,9 +1,11 @@
Du wurdest vom Server ${serverName} wegen `${reason}` gebannt. 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. Du musst dich in 'Austria Appeal Server' befinden, damit du dem Bot schreiben kannst.
Wenn der Einspruch abgelehnt wird, wirst du vom Server entfernt. Wenn der Einspruch abgelehnt wird, wirst du vom Server entfernt.
You were banned from the server ${serverName} for `${reason}`. 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 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. 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. If the appeal is denied, you will be banned from the above-mentioned server.