From ad99e2767ea6ffbff28361cfea38aad46b69827e Mon Sep 17 00:00:00 2001 From: limited_dev Date: Wed, 12 Jul 2023 13:23:03 +0200 Subject: [PATCH] feat: updated buttons and ButtonManager Signed-off-by: limited_dev --- .../moonleay/lilJudd/buttons/component/EditButtonManager.kt | 6 +++++- .../lilJudd/buttons/timeplanner/IsAvailableEditButton.kt | 6 ++++-- .../lilJudd/buttons/timeplanner/MaybeAvailableEditButton.kt | 6 ++++-- .../lilJudd/buttons/timeplanner/NotAvailableEditButton.kt | 5 +++-- 4 files changed, 16 insertions(+), 7 deletions(-) diff --git a/src/main/kotlin/net/moonleay/lilJudd/buttons/component/EditButtonManager.kt b/src/main/kotlin/net/moonleay/lilJudd/buttons/component/EditButtonManager.kt index 7f253f7..070f25a 100644 --- a/src/main/kotlin/net/moonleay/lilJudd/buttons/component/EditButtonManager.kt +++ b/src/main/kotlin/net/moonleay/lilJudd/buttons/component/EditButtonManager.kt @@ -18,6 +18,8 @@ package net.moonleay.lilJudd.buttons.component +import net.moonleay.lilJudd.buttons.matchplanner.CancelEditButton +import net.moonleay.lilJudd.buttons.matchplanner.SignMeUpEditButton import net.moonleay.lilJudd.buttons.timeplanner.IsAvailableEditButton import net.moonleay.lilJudd.buttons.timeplanner.MaybeAvailableEditButton import net.moonleay.lilJudd.buttons.timeplanner.NotAvailableEditButton @@ -26,6 +28,8 @@ object EditButtonManager { val buttons = listOf( IsAvailableEditButton(), MaybeAvailableEditButton(), - NotAvailableEditButton() + NotAvailableEditButton(), + SignMeUpEditButton(), + CancelEditButton() ) } diff --git a/src/main/kotlin/net/moonleay/lilJudd/buttons/timeplanner/IsAvailableEditButton.kt b/src/main/kotlin/net/moonleay/lilJudd/buttons/timeplanner/IsAvailableEditButton.kt index 5d9802c..2acfe55 100644 --- a/src/main/kotlin/net/moonleay/lilJudd/buttons/timeplanner/IsAvailableEditButton.kt +++ b/src/main/kotlin/net/moonleay/lilJudd/buttons/timeplanner/IsAvailableEditButton.kt @@ -26,10 +26,12 @@ import dev.kord.core.entity.channel.MessageChannel import dev.kord.core.entity.interaction.ButtonInteraction import dev.kord.rest.builder.message.modify.embed import net.moonleay.lilJudd.Bot -import net.moonleay.lilJudd.buttons.component.EditButton +import net.moonleay.lilJudd.buttons.component.IEditButton import net.moonleay.lilJudd.util.EmbedUtil -class IsAvailableEditButton : EditButton("public.edit.btn.timemanagement.available") { +class IsAvailableEditButton : IEditButton { + override val id: String = "public.edit.btn.timemanagement.available" + override suspend fun onInteraction( interaction: ButtonInteraction, response: PublicMessageInteractionResponseBehavior, diff --git a/src/main/kotlin/net/moonleay/lilJudd/buttons/timeplanner/MaybeAvailableEditButton.kt b/src/main/kotlin/net/moonleay/lilJudd/buttons/timeplanner/MaybeAvailableEditButton.kt index bac99ac..3696a54 100644 --- a/src/main/kotlin/net/moonleay/lilJudd/buttons/timeplanner/MaybeAvailableEditButton.kt +++ b/src/main/kotlin/net/moonleay/lilJudd/buttons/timeplanner/MaybeAvailableEditButton.kt @@ -26,10 +26,12 @@ import dev.kord.core.entity.channel.MessageChannel import dev.kord.core.entity.interaction.ButtonInteraction import dev.kord.rest.builder.message.modify.embed import net.moonleay.lilJudd.Bot -import net.moonleay.lilJudd.buttons.component.EditButton +import net.moonleay.lilJudd.buttons.component.IEditButton import net.moonleay.lilJudd.util.EmbedUtil -class MaybeAvailableEditButton : EditButton("public.edit.btn.timemanagement.maybeavailable") { +class MaybeAvailableEditButton : IEditButton { + override val id: String = "public.edit.btn.timemanagement.maybeavailable" + override suspend fun onInteraction( interaction: ButtonInteraction, response: PublicMessageInteractionResponseBehavior, diff --git a/src/main/kotlin/net/moonleay/lilJudd/buttons/timeplanner/NotAvailableEditButton.kt b/src/main/kotlin/net/moonleay/lilJudd/buttons/timeplanner/NotAvailableEditButton.kt index 4c691e4..698993f 100644 --- a/src/main/kotlin/net/moonleay/lilJudd/buttons/timeplanner/NotAvailableEditButton.kt +++ b/src/main/kotlin/net/moonleay/lilJudd/buttons/timeplanner/NotAvailableEditButton.kt @@ -26,10 +26,11 @@ import dev.kord.core.entity.channel.MessageChannel import dev.kord.core.entity.interaction.ButtonInteraction import dev.kord.rest.builder.message.modify.embed import net.moonleay.lilJudd.Bot -import net.moonleay.lilJudd.buttons.component.EditButton +import net.moonleay.lilJudd.buttons.component.IEditButton import net.moonleay.lilJudd.util.EmbedUtil -class NotAvailableEditButton : EditButton("public.edit.btn.timemanagement.notavailable") { +class NotAvailableEditButton : IEditButton { + override val id: String = "public.edit.btn.timemanagement.notavailable" override suspend fun onInteraction( interaction: ButtonInteraction,