chore: Renamed ButtonUtil to EmbedUtil
Signed-off-by: limited_dev <loginakkisativ@gmail.com>
This commit is contained in:
parent
04ff442d86
commit
fb287b24cf
4 changed files with 11 additions and 11 deletions
|
@ -27,7 +27,7 @@ import dev.kord.core.entity.interaction.ButtonInteraction
|
||||||
import dev.kord.rest.builder.message.modify.embed
|
import dev.kord.rest.builder.message.modify.embed
|
||||||
import net.moonleay.lilJudd.Bot
|
import net.moonleay.lilJudd.Bot
|
||||||
import net.moonleay.lilJudd.buttons.component.EditButton
|
import net.moonleay.lilJudd.buttons.component.EditButton
|
||||||
import net.moonleay.lilJudd.util.ButtonUtil
|
import net.moonleay.lilJudd.util.EmbedUtil
|
||||||
|
|
||||||
class IsAvailableEditButton : EditButton("public.edit.btn.timemanagement.available") {
|
class IsAvailableEditButton : EditButton("public.edit.btn.timemanagement.available") {
|
||||||
override suspend fun onInteraction(
|
override suspend fun onInteraction(
|
||||||
|
@ -40,7 +40,7 @@ class IsAvailableEditButton : EditButton("public.edit.btn.timemanagement.availab
|
||||||
if (m.embeds[0].fields[0].value.contains(user.id.value.toString())) {
|
if (m.embeds[0].fields[0].value.contains(user.id.value.toString())) {
|
||||||
Bot.bot.kordRef.getChannelOf<MessageChannel>(interaction.channelId)!!.getMessage(m.id).edit {
|
Bot.bot.kordRef.getChannelOf<MessageChannel>(interaction.channelId)!!.getMessage(m.id).edit {
|
||||||
this.embed {
|
this.embed {
|
||||||
val temp = ButtonUtil.replaceXWithYinValuesAtTable(user.id.value.toString(), "", m.embeds[0], 1)
|
val temp = EmbedUtil.replaceXWithYinValuesAtTable(user.id.value.toString(), "", m.embeds[0], 1)
|
||||||
this.color = temp.color
|
this.color = temp.color
|
||||||
this.title = temp.title
|
this.title = temp.title
|
||||||
this.description = temp.description
|
this.description = temp.description
|
||||||
|
@ -51,7 +51,7 @@ class IsAvailableEditButton : EditButton("public.edit.btn.timemanagement.availab
|
||||||
} else {
|
} else {
|
||||||
Bot.bot.kordRef.getChannelOf<MessageChannel>(interaction.channelId)!!.getMessage(m.id).edit {
|
Bot.bot.kordRef.getChannelOf<MessageChannel>(interaction.channelId)!!.getMessage(m.id).edit {
|
||||||
this.embed {
|
this.embed {
|
||||||
val temp = ButtonUtil.addXToValuesAtTable(user.id.value.toString(), m.embeds[0], 1)
|
val temp = EmbedUtil.addXToValuesAtTable(user.id.value.toString(), m.embeds[0], 1)
|
||||||
this.color = temp.color
|
this.color = temp.color
|
||||||
this.title = temp.title
|
this.title = temp.title
|
||||||
this.description = temp.description
|
this.description = temp.description
|
||||||
|
|
|
@ -27,7 +27,7 @@ import dev.kord.core.entity.interaction.ButtonInteraction
|
||||||
import dev.kord.rest.builder.message.modify.embed
|
import dev.kord.rest.builder.message.modify.embed
|
||||||
import net.moonleay.lilJudd.Bot
|
import net.moonleay.lilJudd.Bot
|
||||||
import net.moonleay.lilJudd.buttons.component.EditButton
|
import net.moonleay.lilJudd.buttons.component.EditButton
|
||||||
import net.moonleay.lilJudd.util.ButtonUtil
|
import net.moonleay.lilJudd.util.EmbedUtil
|
||||||
|
|
||||||
class MaybeAvailableEditButton : EditButton("public.edit.btn.timemanagement.maybeavailable") {
|
class MaybeAvailableEditButton : EditButton("public.edit.btn.timemanagement.maybeavailable") {
|
||||||
override suspend fun onInteraction(
|
override suspend fun onInteraction(
|
||||||
|
@ -40,7 +40,7 @@ class MaybeAvailableEditButton : EditButton("public.edit.btn.timemanagement.mayb
|
||||||
if (m.embeds[0].fields[1].value.contains(user.id.value.toString())) {
|
if (m.embeds[0].fields[1].value.contains(user.id.value.toString())) {
|
||||||
Bot.bot.kordRef.getChannelOf<MessageChannel>(interaction.channelId)!!.getMessage(m.id).edit {
|
Bot.bot.kordRef.getChannelOf<MessageChannel>(interaction.channelId)!!.getMessage(m.id).edit {
|
||||||
this.embed {
|
this.embed {
|
||||||
val temp = ButtonUtil.replaceXWithYinValuesAtTable(user.id.value.toString(), "", m.embeds[0], 2)
|
val temp = EmbedUtil.replaceXWithYinValuesAtTable(user.id.value.toString(), "", m.embeds[0], 2)
|
||||||
this.color = temp.color
|
this.color = temp.color
|
||||||
this.title = temp.title
|
this.title = temp.title
|
||||||
this.description = temp.description
|
this.description = temp.description
|
||||||
|
@ -51,7 +51,7 @@ class MaybeAvailableEditButton : EditButton("public.edit.btn.timemanagement.mayb
|
||||||
} else {
|
} else {
|
||||||
Bot.bot.kordRef.getChannelOf<MessageChannel>(interaction.channelId)!!.getMessage(m.id).edit {
|
Bot.bot.kordRef.getChannelOf<MessageChannel>(interaction.channelId)!!.getMessage(m.id).edit {
|
||||||
this.embed {
|
this.embed {
|
||||||
val temp = ButtonUtil.addXToValuesAtTable(user.id.value.toString(), m.embeds[0], 2)
|
val temp = EmbedUtil.addXToValuesAtTable(user.id.value.toString(), m.embeds[0], 2)
|
||||||
this.color = temp.color
|
this.color = temp.color
|
||||||
this.title = temp.title
|
this.title = temp.title
|
||||||
this.description = temp.description
|
this.description = temp.description
|
||||||
|
|
|
@ -27,7 +27,7 @@ import dev.kord.core.entity.interaction.ButtonInteraction
|
||||||
import dev.kord.rest.builder.message.modify.embed
|
import dev.kord.rest.builder.message.modify.embed
|
||||||
import net.moonleay.lilJudd.Bot
|
import net.moonleay.lilJudd.Bot
|
||||||
import net.moonleay.lilJudd.buttons.component.EditButton
|
import net.moonleay.lilJudd.buttons.component.EditButton
|
||||||
import net.moonleay.lilJudd.util.ButtonUtil
|
import net.moonleay.lilJudd.util.EmbedUtil
|
||||||
|
|
||||||
class NotAvailableEditButton : EditButton("public.edit.btn.timemanagement.notavailable") {
|
class NotAvailableEditButton : EditButton("public.edit.btn.timemanagement.notavailable") {
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@ class NotAvailableEditButton : EditButton("public.edit.btn.timemanagement.notava
|
||||||
if (m.embeds[0].fields[2].value.contains(user.id.value.toString())) {
|
if (m.embeds[0].fields[2].value.contains(user.id.value.toString())) {
|
||||||
Bot.bot.kordRef.getChannelOf<MessageChannel>(interaction.channelId)!!.getMessage(m.id).edit {
|
Bot.bot.kordRef.getChannelOf<MessageChannel>(interaction.channelId)!!.getMessage(m.id).edit {
|
||||||
this.embed {
|
this.embed {
|
||||||
val temp = ButtonUtil.replaceXWithYinValuesAtTable(user.id.value.toString(), "", m.embeds[0], 3)
|
val temp = EmbedUtil.replaceXWithYinValuesAtTable(user.id.value.toString(), "", m.embeds[0], 3)
|
||||||
this.color = temp.color
|
this.color = temp.color
|
||||||
this.title = temp.title
|
this.title = temp.title
|
||||||
this.description = temp.description
|
this.description = temp.description
|
||||||
|
@ -52,7 +52,7 @@ class NotAvailableEditButton : EditButton("public.edit.btn.timemanagement.notava
|
||||||
} else {
|
} else {
|
||||||
Bot.bot.kordRef.getChannelOf<MessageChannel>(interaction.channelId)!!.getMessage(m.id).edit {
|
Bot.bot.kordRef.getChannelOf<MessageChannel>(interaction.channelId)!!.getMessage(m.id).edit {
|
||||||
this.embed {
|
this.embed {
|
||||||
val temp = ButtonUtil.addXToValuesAtTable(user.id.value.toString(), m.embeds[0], 3)
|
val temp = EmbedUtil.addXToValuesAtTable(user.id.value.toString(), m.embeds[0], 3)
|
||||||
this.color = temp.color
|
this.color = temp.color
|
||||||
this.title = temp.title
|
this.title = temp.title
|
||||||
this.description = temp.description
|
this.description = temp.description
|
||||||
|
|
|
@ -23,7 +23,7 @@ import com.kotlindiscord.kord.extensions.extensions.publicSlashCommand
|
||||||
import com.kotlindiscord.kord.extensions.types.respond
|
import com.kotlindiscord.kord.extensions.types.respond
|
||||||
import dev.kord.common.Color
|
import dev.kord.common.Color
|
||||||
import dev.kord.rest.builder.message.create.actionRow
|
import dev.kord.rest.builder.message.create.actionRow
|
||||||
import net.moonleay.lilJudd.util.ButtonUtil
|
import net.moonleay.lilJudd.util.EmbedUtil
|
||||||
import net.moonleay.lilJudd.util.MessageUtil
|
import net.moonleay.lilJudd.util.MessageUtil
|
||||||
|
|
||||||
/* This extension has no proper use.
|
/* This extension has no proper use.
|
||||||
|
@ -53,7 +53,7 @@ class TestExtension : Extension() {
|
||||||
)
|
)
|
||||||
|
|
||||||
this.actionRow {
|
this.actionRow {
|
||||||
this.components.addAll(ButtonUtil.getTimePlannerButtons().components)
|
this.components.addAll(EmbedUtil.getTimePlannerButtons().components)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue