From 5ac25ade51d782af2886fca5bc5cc55b4fbce78a Mon Sep 17 00:00:00 2001 From: NovaFox161 Date: Fri, 15 Oct 2021 16:48:20 -0500 Subject: [PATCH] Event view will now no longer be ephemeral --- .../discal/client/commands/EventCommand.kt | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/client/src/main/kotlin/org/dreamexposure/discal/client/commands/EventCommand.kt b/client/src/main/kotlin/org/dreamexposure/discal/client/commands/EventCommand.kt index fc28433f..e51fe074 100644 --- a/client/src/main/kotlin/org/dreamexposure/discal/client/commands/EventCommand.kt +++ b/client/src/main/kotlin/org/dreamexposure/discal/client/commands/EventCommand.kt @@ -14,7 +14,6 @@ import org.dreamexposure.discal.core.entities.Event import org.dreamexposure.discal.core.entities.response.UpdateEventResponse import org.dreamexposure.discal.core.enums.event.EventColor import org.dreamexposure.discal.core.enums.event.EventFrequency -import org.dreamexposure.discal.core.extensions.discord4j.followup import org.dreamexposure.discal.core.extensions.discord4j.followupEphemeral import org.dreamexposure.discal.core.extensions.discord4j.getCalendar import org.dreamexposure.discal.core.extensions.discord4j.hasControlRole @@ -195,7 +194,7 @@ class EventCommand(private val wizard: Wizard) : SlashCommand { // Event end cannot be before event start event.interaction.guild .map { EventEmbed.pre(it, settings, pre) } - .flatMap { event.followupEphemeral(getMessage("start.failure.afterEnd", settings), it)} + .flatMap { event.followupEphemeral(getMessage("start.failure.afterEnd", settings), it) } } } } else { @@ -275,7 +274,7 @@ class EventCommand(private val wizard: Wizard) : SlashCommand { // Event start cannot be after event end event.interaction.guild .map { EventEmbed.pre(it, settings, pre) } - .flatMap { event.followupEphemeral(getMessage("end.failure.beforeStart", settings), it)} + .flatMap { event.followupEphemeral(getMessage("end.failure.beforeStart", settings), it) } } } } else { @@ -529,7 +528,12 @@ class EventCommand(private val wizard: Wizard) : SlashCommand { return event.interaction.guild.flatMap { guild -> guild.getCalendar(calendarNumber).flatMap { calendar -> calendar.getEvent(eventId).flatMap { calEvent -> - event.followup(EventEmbed.getFull(guild, settings, calEvent)) + event.interaction.channel.flatMap { + // Create message instead of followup + event.interactionResponse.deleteInitialResponse().then( + it.createMessage(EventEmbed.getFull(guild, settings, calEvent)) + ) + } }.switchIfEmpty(event.followupEphemeral(getCommonMsg("error.notFound.calendar", settings))) }.switchIfEmpty(event.followupEphemeral(getCommonMsg("error.notFound.calendar", settings))) }