feat: added get Users in the first X fields
fix: fixed typo in May be available button chore: renamed ButtonUtil to EmbedUtil Signed-off-by: limited_dev <loginakkisativ@gmail.com>
This commit is contained in:
parent
8bca3838bc
commit
4bc2fe6930
1 changed files with 17 additions and 2 deletions
|
@ -23,7 +23,7 @@ import dev.kord.core.entity.Embed
|
||||||
import dev.kord.rest.builder.component.ActionRowBuilder
|
import dev.kord.rest.builder.component.ActionRowBuilder
|
||||||
import dev.kord.rest.builder.message.EmbedBuilder
|
import dev.kord.rest.builder.message.EmbedBuilder
|
||||||
|
|
||||||
object ButtonUtil {
|
object EmbedUtil {
|
||||||
fun getTimePlannerButtons(): ActionRowBuilder {
|
fun getTimePlannerButtons(): ActionRowBuilder {
|
||||||
val ar = ActionRowBuilder()
|
val ar = ActionRowBuilder()
|
||||||
ar.interactionButton(ButtonStyle.Success, "public.edit.btn.timemanagement.available") {
|
ar.interactionButton(ButtonStyle.Success, "public.edit.btn.timemanagement.available") {
|
||||||
|
@ -60,6 +60,21 @@ object ButtonUtil {
|
||||||
return ebb
|
return ebb
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun getAllUsersInTheFirstXTables(amountOfTables: Int, e: Embed): List<String> {
|
||||||
|
val users = mutableListOf<String>()
|
||||||
|
for (i in 0 until amountOfTables - 1) {
|
||||||
|
val f = e.fields[i]
|
||||||
|
if (!f.value.contains("@"))
|
||||||
|
continue // check next one. this one does not have any entries
|
||||||
|
val v = f.value.split("\n").toMutableList()
|
||||||
|
for (l in v) {
|
||||||
|
Logger.out(l)
|
||||||
|
users.add(l.subSequence(2, l.indexOf(">")).toString())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return users
|
||||||
|
}
|
||||||
|
|
||||||
fun addXToValuesAtTable(x: String, e: Embed, table: Int): EmbedBuilder {
|
fun addXToValuesAtTable(x: String, e: Embed, table: Int): EmbedBuilder {
|
||||||
val ebb = MessageUtil.getAClonedEmbedd(e)
|
val ebb = MessageUtil.getAClonedEmbedd(e)
|
||||||
for ((i, f) in e.fields.withIndex()) {
|
for ((i, f) in e.fields.withIndex()) {
|
Loading…
Reference in a new issue