From 7eb1c1ae9819b19614b4acdf971b7e0d4105fe1c Mon Sep 17 00:00:00 2001 From: Timonso Date: Tue, 9 Jun 2026 17:20:57 +0200 Subject: [PATCH 1/6] =?UTF-8?q?=E2=9C=A8=20feat(deadline):=20add=20ticket?= =?UTF-8?q?=20validation=20before=20deleting=20reply=20deadlines?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../surf/discord/ticket/deadline/ReplyDeadlineService.kt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/kotlin/dev/slne/surf/discord/ticket/deadline/ReplyDeadlineService.kt b/src/main/kotlin/dev/slne/surf/discord/ticket/deadline/ReplyDeadlineService.kt index 3e33b611..ae7699fb 100644 --- a/src/main/kotlin/dev/slne/surf/discord/ticket/deadline/ReplyDeadlineService.kt +++ b/src/main/kotlin/dev/slne/surf/discord/ticket/deadline/ReplyDeadlineService.kt @@ -8,6 +8,7 @@ import dev.slne.surf.discord.ticket.Ticket import dev.slne.surf.discord.ticket.database.deadline.DeadlineNotifyRepository import dev.slne.surf.discord.ticket.database.deadline.ReplyDeadline import dev.slne.surf.discord.ticket.database.deadline.ReplyDeadlineRepository +import dev.slne.surf.discord.ticket.database.ticket.TicketRepository import dev.slne.surf.discord.util.Colors import kotlinx.coroutines.CancellationException import kotlinx.coroutines.launch @@ -26,6 +27,7 @@ class ReplyDeadlineService( private val jda: JDA, private val replyDeadlineRepository: ReplyDeadlineRepository, private val deadlineNotifyRepository: DeadlineNotifyRepository, + private val ticketRepository: TicketRepository, ) { suspend fun createDeadline(ticket: Ticket, target: User, setBy: User, deadline: OffsetDateTime) { @@ -68,6 +70,9 @@ class ReplyDeadlineService( val deleted = replyDeadlineRepository.delete(deadline.id) if (!deleted) return + val ticket = ticketRepository.getTicketById(deadline.ticketId) + if (ticket == null || ticket.isClosed()) return + try { if (deadlineNotifyRepository.isEnabled(deadline.setById)) { notifyDeadlineCreator(deadline) From a2e8b40bdbad9a5763ce6112a206c5c61e9e5437 Mon Sep 17 00:00:00 2001 From: Timonso <181272711+Timonso-1@users.noreply.github.com> Date: Tue, 9 Jun 2026 16:52:49 +0000 Subject: [PATCH 2/6] =?UTF-8?q?=E2=9C=A8=20feat(messages):=20add=20time=20?= =?UTF-8?q?range=20specification=20to=20ticket=20information?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/messages.properties | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/resources/messages.properties b/src/main/resources/messages.properties index f3db192f..c060b03b 100644 --- a/src/main/resources/messages.properties +++ b/src/main/resources/messages.properties @@ -284,5 +284,6 @@ Bitte überprüfe noch einmal, ob du uns alle wichtigen Informationen mitgeteilt • **Koordinaten** (z. B. `110 64 60`)\n\ • **Dimension** (z. B. `Overworld`)\n\ • **Eine genaue Beschreibung des Problems** +• **Zeitraumangabe** (z. B. `Gestern 12:30 Uhr bis 13:30 Uhr`) faq.command.questions.how-to-whitelist.question=Wie werde ich gewhitelisted? faq.command.questions.how-to-whitelist.answer=Um auf dem Survival-Server gewhitelisted zu werden, gehe in <#1124438644523012234> und klicke dort auf **„Whitelist erstellen“**.\n\nAnschließend öffnet sich ein Formular, in das du deinen **Minecraft-Namen** eintragen musst. Achte darauf, dass dein Name korrekt geschrieben ist.\n\nSobald du das Formular absendest, wirst du automatisch gewhitelisted und kannst dem Server beitreten. From 69008b39415feaa69120138fd653fdd207ca5524 Mon Sep 17 00:00:00 2001 From: Timonso Date: Wed, 24 Jun 2026 13:16:37 +0200 Subject: [PATCH 3/6] =?UTF-8?q?=E2=9C=A8=20feat(faq):=20add=20option=20to?= =?UTF-8?q?=20display=20FAQ=20answers=20privately?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gradle.properties | 2 +- .../surf/discord/faq/command/FaqCommand.kt | 27 +++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 28df0cf2..abff4f7a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1 +1 @@ -version=6.0.30 +version=6.0.31 diff --git a/src/main/kotlin/dev/slne/surf/discord/faq/command/FaqCommand.kt b/src/main/kotlin/dev/slne/surf/discord/faq/command/FaqCommand.kt index b8b89950..957f3d7f 100644 --- a/src/main/kotlin/dev/slne/surf/discord/faq/command/FaqCommand.kt +++ b/src/main/kotlin/dev/slne/surf/discord/faq/command/FaqCommand.kt @@ -49,6 +49,12 @@ import kotlin.time.toJavaDuration "Der Benutzer, für den die Frage angezeigt wird", CommandOptionType.USER, false + ), + CommandOption( + "info", + "Zeigt das FAQ nur dir selbst an", + CommandOptionType.BOOLEAN, + false ) ] ) @@ -61,6 +67,7 @@ class FaqCommand : SlashCommand { val interaction = event.interaction val question = interaction.getOption("question")?.asString ?: return val user = interaction.getOption("user")?.asUser + val info = interaction.getOption("info")?.asBoolean ?: false val faq = Faq.entries.find { it.id == question } if (!event.member.hasPermission(DiscordPermission.COMMAND_FAQ)) { @@ -76,6 +83,26 @@ class FaqCommand : SlashCommand { return } + if (info) { + val file = faq.attachmentPath?.let(::File) + + event.replyEmbeds(embed { + title = faq.question + description = faq.answer + color = Colors.INFO + + if (file != null) { + image = "attachment://${file.name}" + } + }).setEphemeral(true).apply { + if (file != null) { + addFiles(FileUpload.fromData(file)) + } + }.queue() + + return + } + if (faqCache.asMap() .any { it.value.first == faq && it.value.second == event.messageChannel.idLong } ) { From de0109a21e06b2f48e2a5b00e105f3d98f84b22f Mon Sep 17 00:00:00 2001 From: Timonso Date: Wed, 1 Jul 2026 20:46:04 +0200 Subject: [PATCH 4/6] =?UTF-8?q?=E2=9C=A8=20feat(faq):=20add=20ping-pong=20?= =?UTF-8?q?question=20and=20answer=20to=20FAQ?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/kotlin/dev/slne/surf/discord/faq/Faq.kt | 7 ++++++- .../dev/slne/surf/discord/faq/command/FaqCommand.kt | 3 ++- src/main/resources/messages.properties | 8 ++++++++ 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/dev/slne/surf/discord/faq/Faq.kt b/src/main/kotlin/dev/slne/surf/discord/faq/Faq.kt index 857d74bb..b82b8f51 100644 --- a/src/main/kotlin/dev/slne/surf/discord/faq/Faq.kt +++ b/src/main/kotlin/dev/slne/surf/discord/faq/Faq.kt @@ -98,5 +98,10 @@ enum class Faq( translatable("faq.command.questions.how-to-whitelist.question"), translatable("faq.command.questions.how-to-whitelist.answer"), "gifs/wl-gif.gif" - ) + ), + PING_PONG( + "ping-pong", + translatable("faq.command.questions.ping-pong.question"), + translatable("faq.command.questions.ping-pong.answer") + ), } \ No newline at end of file diff --git a/src/main/kotlin/dev/slne/surf/discord/faq/command/FaqCommand.kt b/src/main/kotlin/dev/slne/surf/discord/faq/command/FaqCommand.kt index 957f3d7f..60d2dd07 100644 --- a/src/main/kotlin/dev/slne/surf/discord/faq/command/FaqCommand.kt +++ b/src/main/kotlin/dev/slne/surf/discord/faq/command/FaqCommand.kt @@ -41,7 +41,8 @@ import kotlin.time.toJavaDuration CommandChoice("how-to-join", "how-to-join"), CommandChoice("ask", "ask"), CommandChoice("missing-information", "missing-information"), - CommandChoice("how-to-whitelist", "how-to-whitelist") + CommandChoice("how-to-whitelist", "how-to-whitelist"), + CommandChoice("ping-pong", "ping-pong") ] ), CommandOption( diff --git a/src/main/resources/messages.properties b/src/main/resources/messages.properties index c060b03b..28015c65 100644 --- a/src/main/resources/messages.properties +++ b/src/main/resources/messages.properties @@ -287,3 +287,11 @@ Bitte überprüfe noch einmal, ob du uns alle wichtigen Informationen mitgeteilt • **Zeitraumangabe** (z. B. `Gestern 12:30 Uhr bis 13:30 Uhr`) faq.command.questions.how-to-whitelist.question=Wie werde ich gewhitelisted? faq.command.questions.how-to-whitelist.answer=Um auf dem Survival-Server gewhitelisted zu werden, gehe in <#1124438644523012234> und klicke dort auf **„Whitelist erstellen“**.\n\nAnschließend öffnet sich ein Formular, in das du deinen **Minecraft-Namen** eintragen musst. Achte darauf, dass dein Name korrekt geschrieben ist.\n\nSobald du das Formular absendest, wirst du automatisch gewhitelisted und kannst dem Server beitreten. +faq.command.questions.ping-pong.question=Antwortzeiten & Pings – das solltet ihr wissen! +faq.command.questions.ping-pong.answer=Warum antwortet das Serverteam nicht sofort?\n\ + - Das Serverteam arbeitet ehrenamtlich in seiner Freizeit.\n\ + - Wir bemühen uns, bei Problemen und Anliegen so schnell wie möglich zu helfen.\n\ + - Pings sind nicht notwendig – das Team sieht alle Nachrichten und Tickets.\n\ + - Pings beschleunigen nichts, sie können die Bearbeitung sogar verzögern.\n\ + - Bitte habt etwas Geduld und wartet auf eine Antwort.\n\n\ + Vielen Dank für euer Verständnis und eure Rücksichtnahme. \ No newline at end of file From 6040d5ff06091aad866f7fab083d5b51adf05374 Mon Sep 17 00:00:00 2001 From: Timonso Date: Wed, 1 Jul 2026 20:48:35 +0200 Subject: [PATCH 5/6] =?UTF-8?q?=E2=9C=A8=20feat(faq):=20refactor=20FAQ=20r?= =?UTF-8?q?esponse=20to=20use=20interactive=20components?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../surf/discord/faq/command/FaqCommand.kt | 82 +++++++++---------- 1 file changed, 37 insertions(+), 45 deletions(-) diff --git a/src/main/kotlin/dev/slne/surf/discord/faq/command/FaqCommand.kt b/src/main/kotlin/dev/slne/surf/discord/faq/command/FaqCommand.kt index 60d2dd07..0d51ebea 100644 --- a/src/main/kotlin/dev/slne/surf/discord/faq/command/FaqCommand.kt +++ b/src/main/kotlin/dev/slne/surf/discord/faq/command/FaqCommand.kt @@ -2,12 +2,17 @@ package dev.slne.surf.discord.faq.command import com.github.benmanes.caffeine.cache.Caffeine import dev.slne.surf.discord.command.* -import dev.slne.surf.discord.dsl.embed import dev.slne.surf.discord.faq.Faq import dev.slne.surf.discord.messages.translatable import dev.slne.surf.discord.permission.DiscordPermission import dev.slne.surf.discord.permission.hasPermission import dev.slne.surf.discord.util.Colors +import net.dv8tion.jda.api.components.container.Container +import net.dv8tion.jda.api.components.container.ContainerChildComponent +import net.dv8tion.jda.api.components.mediagallery.MediaGallery +import net.dv8tion.jda.api.components.mediagallery.MediaGalleryItem +import net.dv8tion.jda.api.components.separator.Separator +import net.dv8tion.jda.api.components.textdisplay.TextDisplay import net.dv8tion.jda.api.events.interaction.command.SlashCommandInteractionEvent import net.dv8tion.jda.api.utils.FileUpload import org.springframework.stereotype.Component @@ -64,6 +69,25 @@ class FaqCommand : SlashCommand { .expireAfterWrite(30.seconds.toJavaDuration()) .build>() + private fun faqComponent(faq: Faq, userMention: String? = null): Container { + val components = mutableListOf() + + if (userMention != null) { + components += TextDisplay.of(userMention) + components += Separator.createDivider(Separator.Spacing.SMALL) + } + + components += TextDisplay.of("## ${faq.question}") + components += TextDisplay.of(faq.answer) + + faq.attachmentPath?.let(::File)?.let { file -> + components += Separator.createDivider(Separator.Spacing.LARGE) + components += MediaGallery.of(MediaGalleryItem.fromFile(FileUpload.fromData(file))) + } + + return Container.of(components).withAccentColor(Colors.INFO) + } + override suspend fun execute(event: SlashCommandInteractionEvent) { val interaction = event.interaction val question = interaction.getOption("question")?.asString ?: return @@ -85,21 +109,10 @@ class FaqCommand : SlashCommand { } if (info) { - val file = faq.attachmentPath?.let(::File) - - event.replyEmbeds(embed { - title = faq.question - description = faq.answer - color = Colors.INFO - - if (file != null) { - image = "attachment://${file.name}" - } - }).setEphemeral(true).apply { - if (file != null) { - addFiles(FileUpload.fromData(file)) - } - }.queue() + event.replyComponents(faqComponent(faq)) + .useComponentsV2() + .setEphemeral(true) + .queue() return } @@ -113,38 +126,17 @@ class FaqCommand : SlashCommand { faqCache.put(System.currentTimeMillis(), faq to event.messageChannel.idLong) - val file = faq.attachmentPath?.let(::File) - if (user != null) { - event.reply(user.asMention).setEmbeds(embed { - title = faq.question - description = faq.answer - color = Colors.INFO - - if (file != null) { - image = "attachment://${file.name}" - } - }).apply { - if (file != null) { - addFiles(FileUpload.fromData(file)) - } - }.queue() + event.replyComponents(faqComponent(faq, user.asMention)) + .useComponentsV2() + .mention(user) + .queue() return } - event.replyEmbeds(embed { - title = faq.question - description = faq.answer - color = Colors.INFO - - if (file != null) { - image = "attachment://${file.name}" - } - }).apply { - if (file != null) { - addFiles(FileUpload.fromData(file)) - } - }.queue() + event.replyComponents(faqComponent(faq)) + .useComponentsV2() + .queue() } -} \ No newline at end of file +} From 6ae80a2d1587ec1a08972f5df63dab76def137b4 Mon Sep 17 00:00:00 2001 From: Timonso <181272711+Timonso-1@users.noreply.github.com> Date: Wed, 1 Jul 2026 20:54:58 +0200 Subject: [PATCH 6/6] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- src/main/resources/messages.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/messages.properties b/src/main/resources/messages.properties index 28015c65..dc83574d 100644 --- a/src/main/resources/messages.properties +++ b/src/main/resources/messages.properties @@ -283,7 +283,7 @@ Bitte überprüfe noch einmal, ob du uns alle wichtigen Informationen mitgeteilt • **Server**, auf dem es aufgetreten ist\n\ • **Koordinaten** (z. B. `110 64 60`)\n\ • **Dimension** (z. B. `Overworld`)\n\ -• **Eine genaue Beschreibung des Problems** +• **Eine genaue Beschreibung des Problems**\n\ • **Zeitraumangabe** (z. B. `Gestern 12:30 Uhr bis 13:30 Uhr`) faq.command.questions.how-to-whitelist.question=Wie werde ich gewhitelisted? faq.command.questions.how-to-whitelist.answer=Um auf dem Survival-Server gewhitelisted zu werden, gehe in <#1124438644523012234> und klicke dort auf **„Whitelist erstellen“**.\n\nAnschließend öffnet sich ein Formular, in das du deinen **Minecraft-Namen** eintragen musst. Achte darauf, dass dein Name korrekt geschrieben ist.\n\nSobald du das Formular absendest, wirst du automatisch gewhitelisted und kannst dem Server beitreten.